/* ============================================================
   First Aid Plumbing Specialist — Houston Heights
   Composition: warm earth editorial · diagonal split ·
   expandable index · kinetic hero · animated grain field
   ============================================================ */

:root {
  --bg:        #f5efe4;
  --bg-2:      #efe6d6;
  --paper:     #fbf7ef;
  --ink:       #2b1e14;
  --ink-soft:  #5a4636;
  --ink-faint: #8a7563;
  --accent:    #c25a37;
  --accent-dk: #a2452a;
  --secondary: #6a7a4a;
  --line:      rgba(43, 30, 20, 0.16);
  --line-soft: rgba(43, 30, 20, 0.09);
  --shadow:    0 1px 2px rgba(43,30,20,.05), 0 12px 32px -18px rgba(43,30,20,.35);
  --grain-op:  0.055;
  --grain-blend: multiply;
  --radius:    3px;
  --wrap:      1180px;
  --serif: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans:  'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

html[data-theme="dark"] {
  --bg:        #17120d;
  --bg-2:      #1e1811;
  --paper:     #221b14;
  --ink:       #f0e6d8;
  --ink-soft:  #c4b3a0;
  --ink-faint: #8d7c6b;
  --accent:    #e07a52;
  --accent-dk: #f0906c;
  --secondary: #9aab72;
  --line:      rgba(240, 230, 216, 0.18);
  --line-soft: rgba(240, 230, 216, 0.10);
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 14px 36px -20px rgba(0,0,0,.9);
  --grain-op:  0.075;
  --grain-blend: screen;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.7;
  font-weight: 400;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dk); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 6.2vw, 4.1rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1.1em; max-width: 68ch; text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--bg); padding: .7rem 1rem;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- animated grain field ---------- */
.grain-svg { position: absolute; width: 0; height: 0; }
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 1;
  opacity: var(--grain-op);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-drift 8s steps(6) infinite;
}
@keyframes grain-drift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -2%); }
  80%  { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  display: flex; align-items: center; gap: 1.25rem;
  padding-block: .7rem;
}
.brand {
  display: flex; align-items: center; gap: .7rem;
  text-decoration: none; color: var(--ink); flex-shrink: 0;
}
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--accent); color: #fff;
  font-family: var(--serif); font-weight: 700; font-size: .95rem;
  letter-spacing: .02em; border-radius: 2px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--serif); font-size: 1rem; font-weight: 600; }
.brand-text em {
  font-style: normal; font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint);
}
.topnav { display: flex; gap: 1.4rem; margin-left: auto; }
.topnav a {
  color: var(--ink-soft); text-decoration: none;
  font-size: .9rem; padding: .5rem 0;
}
.topnav a:hover { color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: .6rem; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: .5rem .8rem;
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px;
  font: inherit; font-size: .82rem; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-icon { font-size: .95rem; line-height: 1; }

.call-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: .5rem 1rem;
  background: var(--ink); color: var(--bg);
  text-decoration: none; border-radius: 999px;
  font-size: .88rem; font-weight: 500; white-space: nowrap;
  transition: background-color .2s, transform .2s;
}
.call-btn:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.call-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--secondary); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(106,122,74,.6);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(106,122,74,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(106,122,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(106,122,74,0); }
}

/* ---------- shared ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
.section { padding-block: clamp(3.5rem, 9vw, 7rem); position: relative; z-index: 2; }
.section--paper2 { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
.section--ink { background: var(--ink); color: var(--bg); }
.section--ink h2, .section--ink h3 { color: var(--bg); }
.section--ink a { color: var(--accent); }
.section--ink .eyebrow { color: var(--secondary); }

.eyebrow {
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin: 0 0 .9rem;
}
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-lede { color: var(--ink-soft); font-size: 1.02rem; }
.section--ink .section-lede { color: color-mix(in srgb, var(--bg) 78%, transparent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .75rem 1.5rem;
  border-radius: 999px; text-decoration: none;
  font-size: .95rem; font-weight: 500;
  transition: transform .2s, background-color .2s, color .2s, border-color .2s;
}
.btn--solid { background: var(--accent); color: #fff; }
.btn--solid:hover { background: var(--accent-dk); color: #fff; transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--wide { width: 100%; max-width: 22rem; margin-top: .5rem; }

/* ============================================================
   HERO — diagonal split
   ============================================================ */
.hero { position: relative; z-index: 2; }
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: min(88vh, 780px);
}
.hero-panel { position: relative; display: flex; align-items: center; }
.hero-panel--paper {
  background: var(--bg);
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
  padding: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 8vw, 7rem) clamp(2.5rem, 6vw, 5rem) 0;
  margin-right: -8%;
  z-index: 2;
}
.hero-panel--ink {
  background: var(--ink);
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 6vw, 5rem) clamp(3rem, 8vw, 7rem);
  margin-left: -8%;
}
.hero-inner { max-width: 34rem; margin-left: auto; padding-right: 2rem; }

.hero h1 {
  font-variation-settings: 'wght' 200, 'opsz' 100;
  animation: weigh linear both;
  animation-timeline: scroll(root);
  animation-range: 0 30vh;
}
@keyframes weigh {
  from { font-variation-settings: 'wght' 200, 'opsz' 100; }
  to   { font-variation-settings: 'wght' 800, 'opsz' 100; }
}
.hero-lede { color: var(--ink-soft); font-size: 1.06rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.6rem 0 2.2rem; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 2rem;
  list-style: none; margin: 0; padding: 1.4rem 0 0;
  border-top: 1px solid var(--line);
}
.hero-facts li { display: flex; flex-direction: column; }
.hero-facts strong {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: var(--accent); line-height: 1.1;
}
.hero-facts span { font-size: .78rem; color: var(--ink-faint); letter-spacing: .03em; }

.hero-figure { margin: 0; width: 100%; max-width: 30rem; }
.hero-figure img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.7);
}
.hero-figure figcaption {
  margin-top: .9rem; font-size: .8rem; letter-spacing: .02em;
  color: color-mix(in srgb, var(--bg) 62%, transparent);
  max-width: 30ch;
}

/* ============================================================
   SERVICES — expandable index
   ============================================================ */
.index { border-top: 1px solid var(--line); }
.entry { border-bottom: 1px solid var(--line); }
.entry summary {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  align-items: baseline; gap: 1rem;
  padding: 1.35rem .25rem;
  cursor: pointer; list-style: none;
  transition: background-color .25s, padding-left .25s;
}
.entry summary::-webkit-details-marker { display: none; }
.entry summary:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); padding-left: .9rem; }
.entry summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.entry-num {
  font-family: var(--serif); font-size: .85rem; font-weight: 600;
  color: var(--accent); letter-spacing: .04em;
}
.entry-title {
  font-family: var(--serif); font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 500; line-height: 1.25; letter-spacing: -.01em;
}
.entry-meta {
  font-size: .8rem; letter-spacing: .04em; color: var(--ink-faint);
  white-space: nowrap;
}
.entry summary::after {
  content: "+"; grid-column: 3; grid-row: 1;
  justify-self: end; align-self: center;
  font-family: var(--serif); font-size: 1.4rem; color: var(--accent);
  margin-left: 1rem; transition: transform .3s ease;
}
.entry[open] summary::after { transform: rotate(45deg); }
.entry[open] summary { background: color-mix(in srgb, var(--accent) 5%, transparent); }

.entry-body {
  padding: .3rem 0 2rem 4.2rem;
  max-width: 72ch;
  animation: reveal .35s ease both;
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.entry-body p { color: var(--ink-soft); }
.entry-list {
  list-style: none; margin: 0 0 1.2rem; padding: 0;
  display: grid; gap: .5rem;
}
.entry-list li {
  position: relative; padding-left: 1.4rem;
  font-size: .95rem; color: var(--ink);
}
.entry-list li::before {
  content: ""; position: absolute; left: 0; top: .68em;
  width: 8px; height: 1px; background: var(--secondary);
}
.entry-note {
  font-size: .9rem; font-style: italic;
  color: var(--ink-faint);
  border-left: 2px solid var(--secondary);
  padding-left: 1rem;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
.about-copy p { color: color-mix(in srgb, var(--bg) 80%, transparent); }
.about-sign { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid rgba(245,239,228,.2); }
.sign-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin: 0; color: var(--bg); }
.sign-role { font-size: .82rem; letter-spacing: .04em; color: var(--secondary); margin: .2rem 0 0; }
.about-media { display: grid; gap: 1.5rem; }
.about-media figure { margin: 0; }
.about-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 2px; }
.about-media figcaption {
  margin-top: .6rem; font-size: .78rem;
  color: color-mix(in srgb, var(--bg) 58%, transparent);
}

/* ============================================================
   SERVICE AREA
   ============================================================ */
.area-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0; border-top: 1px solid var(--line);
}
.area-grid li {
  padding: 1.3rem 1.2rem 1.3rem 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: .25rem;
}
.area-grid strong { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.area-grid span { font-size: .86rem; color: var(--ink-faint); line-height: 1.5; }
.area-note {
  margin-top: 2rem; font-size: .95rem; color: var(--ink-soft);
  border-left: 2px solid var(--accent); padding-left: 1.1rem;
}

/* ============================================================
   HOURS
   ============================================================ */
.hours-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
.hours-note { font-size: .92rem; color: var(--ink-faint); }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td {
  text-align: left; padding: .85rem .2rem;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 400; font-size: .98rem;
}
.hours-table th { font-family: var(--serif); font-size: 1.02rem; color: var(--ink); }
.hours-table td { text-align: right; color: var(--secondary); font-weight: 500; }
.hours-table tr.closed td { color: var(--ink-faint); font-weight: 400; }
.hours-table tr.closed th { color: var(--ink-faint); }

/* ============================================================
   VISIT
   ============================================================ */
.visit-grid {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
.visit-details { margin: 2rem 0 1.6rem; display: grid; gap: 1.1rem; }
.visit-details div { display: grid; gap: .15rem; }
.visit-details dt {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint);
}
.visit-details dd { margin: 0; font-size: 1rem; }
.phone-link { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; text-decoration: none; }
.phone-link:hover { text-decoration: underline; }
.visit-media figure { margin: 0; }
.visit-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 2px; box-shadow: var(--shadow); }
.visit-media figcaption { margin-top: .7rem; font-size: .8rem; color: var(--ink-faint); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative; z-index: 2;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 5vw, 4rem) 0 2rem;
}
.footer-top {
  display: flex; flex-wrap: wrap; gap: 2rem;
  justify-content: space-between; align-items: flex-start;
  padding-bottom: 1.8rem;
}
.footer-brand { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 0 0 .4rem; }
.footer-line { font-size: .88rem; color: var(--ink-soft); margin: 0 0 .25rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-nav a { font-size: .88rem; color: var(--ink-soft); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }

.claim-banner {
  display: inline-block;
  font-size: .78rem; letter-spacing: .01em;
  color: var(--ink-soft); text-decoration: none;
  background: color-mix(in srgb, var(--secondary) 12%, transparent);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: .45rem .9rem;
  margin-bottom: 1.2rem;
  transition: background-color .2s, color .2s;
}
.claim-banner:hover {
  background: color-mix(in srgb, var(--secondary) 22%, transparent);
  color: var(--ink);
}
.muted { font-size: .72rem; color: var(--ink-faint); margin: 0; }
.muted a { color: inherit; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .topnav { display: none; }
  .hero-split { grid-template-columns: 1fr; min-height: 0; }
  .hero-panel--paper {
    clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
    margin-right: 0; padding: 3rem 0 4.5rem;
  }
  .hero-panel--ink {
    clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 100%);
    margin-left: 0; padding: 4.5rem 0 3rem;
  }
  .hero-inner { margin-left: 0; padding-right: 0; max-width: 100%; }
  .hero-figure { max-width: 100%; }
  .hero-figure img { aspect-ratio: 16/10; }
  .about-grid, .hours-grid, .visit-grid { grid-template-columns: 1fr; }
  .entry-body { padding-left: 0; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .brand-text em { display: none; }
  .theme-label { display: none; }
  .theme-toggle { padding: .5rem .65rem; }
  .call-btn { padding: .5rem .8rem; font-size: .82rem; }
  .hero-facts { gap: 1.4rem; }
  .entry summary { grid-template-columns: 2.2rem 1fr; gap: .6rem; }
  .entry-meta { grid-column: 2; font-size: .74rem; }
  .entry summary::after { grid-column: 2; grid-row: 1; }
  .hours-table td { text-align: right; }
}

/* ============================================================
   MOTION PREFERENCES
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .grain { animation: none; }
  .hero h1 { font-variation-settings: 'wght' 600, 'opsz' 100; animation: none; }
  .call-dot { animation: none; }
  .entry-body { animation: none; }
}

/* Fallback for browsers without scroll-driven animation support */
@supports not (animation-timeline: scroll()) {
  .hero h1 { font-variation-settings: 'wght' 600, 'opsz' 100; animation: none; }
}
