/* ============================================================
   Valencia Chiropractic — Design System
   Palette: Warm Gold + Charcoal · Fonts: Jost + Figtree
   Light / Dark mode · Theme toggle
   ============================================================ */

/* ===== TOKENS ===== */
:root {
  --bg: #f8f6f2;
  --surface: #ffffff;
  --ink: #2b2a28;
  --muted: #625c53;
  --line: #e6dfd3;
  --teal: #c29a52;
  --teal-ink: #8a6a2e;
  --teal-soft: #f2eadb;
  --slate: #2e2e2f;
  --on-accent: #1f1e1c;
  --chip: #2e2e2f;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --display: "Jost","Avenir Next","Century Gothic",system-ui,sans-serif;
  --body: "Figtree","Segoe UI",system-ui,sans-serif;
  --radius: 14px;
  --transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f1f20; --surface: #2a2a2b; --ink: #ece7de;
    --muted: #b0a796; --line: #3a3936; --teal: #d1ab64;
    --teal-ink: #ddb978; --teal-soft: #3a3328; --slate: #f1ece3;
    --on-accent: #1f1e1c; --chip: #151515;
    --shadow: 0 2px 16px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1f1f20; --surface: #2a2a2b; --ink: #ece7de;
  --muted: #b0a796; --line: #3a3936; --teal: #d1ab64;
  --teal-ink: #ddb978; --teal-soft: #3a3328; --slate: #f1ece3;
  --on-accent: #1f1e1c; --chip: #151515;
  --shadow: 0 2px 16px rgba(0,0,0,.4);
  color-scheme: dark;
}
:root[data-theme="light"] {
  color-scheme: light;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; display: block; }

/* ===== THEME TRANSITION ===== */
body,
header,
footer,
.svc,
form,
.pay div,
details,
.mobile-nav,
input,
select,
textarea,
.brand .chip,
.theme-toggle {
  transition: var(--transition);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

/* ===== SKIP NAV ===== */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--teal);
  color: var(--on-accent);
  padding: .6rem 1rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  z-index: 999;
  text-decoration: none;
  transition: top .15s;
}
.skip-nav:focus { top: 0; }

a { color: var(--teal-ink); }
a:hover { text-decoration: underline; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--slate);
  text-wrap: balance;
  margin: 0;
  line-height: 1.15;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* ===== LAYOUT ===== */
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }

.eyebrow {
  font: 600 .78rem/1 var(--body);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal-ink);
  display: block;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.3rem;
  border-radius: 999px;
  font: 600 .95rem/1 var(--body);
  text-decoration: none;
  border: 1.5px solid var(--teal);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .12s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn.primary {
  background: var(--teal);
  color: var(--on-accent);
}
.btn.ghost {
  background: transparent;
  color: var(--teal-ink);
}
.btn.primary:hover {
  background: var(--teal-ink);
  border-color: var(--teal-ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn.ghost:hover {
  background: var(--teal-soft);
  transform: translateY(-1px);
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand .chip {
  width: 24px;
  height: 44px;
  border-radius: 8px;
  background: var(--chip);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
  overflow: hidden;
}
.brand .chip img { height: 40px; width: auto; }
.brand b {
  display: block;
  font: 500 1.05rem/1 var(--display);
  letter-spacing: .14em;
  color: var(--slate);
}
.brand small {
  display: block;
  font: 500 .62rem/1.4 var(--display);
  letter-spacing: .3em;
  color: var(--teal-ink);
}

.nav-links {
  display: flex;
  gap: clamp(8px, 1.3vw, 20px);
  align-items: center;
}
.nav-links a:not(.btn) {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: clamp(.78rem, .85vw, .9rem);
  transition: color .2s;
  padding-block: 4px;
  border-bottom: 2px solid transparent;
}
.nav-links a:not(.btn):hover {
  color: var(--teal-ink);
  text-decoration: none;
  border-bottom-color: var(--teal);
}
.nav-links a:not(.btn).active {
  color: var(--teal-ink);
  border-bottom-color: var(--teal);
}

/* ===== NAV DROPDOWN ===== */
.dropdown { position: relative; display: flex; align-items: center; }
/* Keep hover alive for 120ms after cursor leaves so slow mouses don't flicker */
.dropdown-menu { transition-delay: 0s, 0s; }
.dropdown:not(:hover):not(.open) .dropdown-menu { transition-delay: 120ms; }
.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.dropdown-trigger .chevron {
  width: 12px; height: 12px;
  transition: transform .22s ease;
  flex-shrink: 0;
  margin-top: 1px;
}
.dropdown:hover .chevron,
.dropdown.open .chevron { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: 100%;           /* flush — no gap to cross */
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.13);
  padding: 10px 6px 6px; /* top padding creates the visual gap inside the hover zone */
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 200;
}
/* invisible bridge fills the top-padding zone so hover never breaks */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
}
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: none !important;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.dropdown-menu a:hover { background: var(--teal-soft); color: var(--teal-ink); }
.dropdown-menu a.active { color: var(--teal-ink); background: var(--teal-soft); }
.dropdown-menu .dm-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

/* Mobile: dropdown items shown inline in mobile-nav */
.mobile-nav .mobile-treatments {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  border-left: 2px solid var(--teal-soft);
  margin: 4px 0 8px;
}
.mobile-nav .mobile-treatments a {
  font-size: .88rem;
  padding-block: 6px;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal-ink);
}

/* Show moon in light mode, sun in dark mode */
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: flex; }

[data-theme="dark"] .theme-toggle .i-sun { display: flex; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: flex; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* ===== MOBILE MENU BUTTON ===== */
.menu-btn {
  display: none;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  padding: 7px;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.menu-btn:hover { background: var(--teal-soft); border-color: var(--teal); }

/* Mid-width: hide lower-priority links, show hamburger so they're still reachable */
@media (max-width: 980px) {
  .nav-links a[href="about.html#pay"],
  .nav-links a[href="contact.html"] { display: none; }
  .menu-btn { display: flex; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
}

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 100;
  padding: 20px;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }

.mobile-nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.mobile-nav .close-btn {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 1.3rem;
  color: var(--ink);
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1.4;
}
.mobile-nav a {
  color: var(--ink);
  text-decoration: none;
  font: 500 1.05rem/1 var(--display);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: block;
}
.mobile-nav a:hover { color: var(--teal-ink); text-decoration: none; }
.mobile-nav a.btn {
  display: inline-flex;
  margin-top: 16px;
  border: 1.5px solid var(--teal);
  justify-content: center;
}

/* ===== SECTIONS ===== */
section { padding-block: 64px; }

.sec-head { display: grid; gap: 12px; max-width: 40em; margin-bottom: 36px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.sec-head p { color: var(--muted); margin: 0; }

.band {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

/* ===== HERO ===== */
.hero {
  padding-block: 72px 56px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  margin-block: 16px 18px;
}
.hero p.lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 34em;
  margin: 0 0 28px;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-img {
  margin: 0;
  justify-self: end;
  width: min(420px, 100%);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}
.hero-img img {
  width: 100%;
  height: auto;
  display: block;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 32px;
  color: var(--muted);
  font-size: .92rem;
}
.facts span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.facts span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-block: 44px 32px; }
  .hero-img { justify-self: center; order: -1; width: min(280px, 60vw); }
}

/* ===== PAGE HEADER (inner pages) ===== */
.page-header {
  background: var(--teal);
  padding-block: 52px;
  text-align: center;
}
.page-header .eyebrow { color: rgba(255,255,255,.75); margin-bottom: 8px; }
.page-header h1 {
  color: #fff;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
}
.page-header p {
  color: rgba(255,255,255,.8);
  margin-top: 10px;
  font-size: 1.1rem;
}

/* ===== SERVICES GRID ===== */
.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.svc {
  background: var(--surface);
  padding: 26px 24px;
  display: grid;
  gap: 10px;
  align-content: start;
  transition: background .2s;
}
.svc:hover { background: color-mix(in srgb, var(--teal-soft) 60%, var(--surface)); }
.svc .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
}
.svc h3, .svc strong { font-size: 1rem; display:block; color:var(--slate); }
.svc p, .svc span { margin: 0; color: var(--muted); font-size: .88rem; display:block; }
.svc .tag { font-size: .78rem; color: var(--teal-ink); font-weight: 600; }

@media (max-width: 900px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .services { grid-template-columns: 1fr; } }

/* ===== CONDITIONS ===== */
.conds {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.conds span {
  padding: .5rem 1rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--ink);
  font-size: .95rem;
  transition: background .18s, transform .12s;
}
.conds span:hover { background: var(--teal); color: var(--on-accent); transform: scale(1.03); }

/* ===== VISIT STEPS ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.step {
  display: grid;
  gap: 8px;
  padding-top: 18px;
  border-top: 2px solid var(--teal);
}
.step .n {
  font: 500 .85rem/1 var(--display);
  letter-spacing: .12em;
  color: var(--teal-ink);
}
.step h3 { font-size: 1.15rem; }
.step p { margin: 0; color: var(--muted); }

@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ===== DOCTOR ===== */
.doc {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.portrait {
  width: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.portrait img {
  width: 100%;
  height: auto;
  display: block;
}
.portrait-placeholder {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--teal-soft);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  padding: 16px;
  border: 1px dashed var(--teal);
}
.doc p { color: var(--muted); max-width: 36em; }

@media (max-width: 760px) {
  .doc { grid-template-columns: 1fr; }
  .portrait { width: min(260px, 100%); }
}

/* ===== FINANCING ===== */
.pay {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.pay div {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: var(--transition), box-shadow .2s, transform .15s;
}
.pay div:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pay h3 { font-size: 1.1rem; margin-bottom: 8px; }
.pay p { margin: 0; color: var(--muted); font-size: .96rem; }

@media (max-width: 760px) { .pay { grid-template-columns: 1fr; } }

/* ===== FAQ ACCORDION ===== */
.faq-list { margin: 0; }
details {
  border-bottom: 1px solid var(--line);
  padding-block: 18px;
}
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  cursor: pointer;
  font: 500 1.05rem/1.4 var(--display);
  color: var(--slate);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
  transition: color .15s;
}
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--teal-ink); }
summary::after {
  content: "+";
  color: var(--teal-ink);
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform .2s;
}
details[open] summary::after { content: "–"; }
details p {
  color: var(--muted);
  margin: 12px 0 0;
  max-width: 42em;
  line-height: 1.7;
}

/* ===== CONTACT GRID ===== */
.contact {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 48px;
}
.info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 20px;
  margin: 0;
}
.info dt { font-weight: 600; color: var(--slate); }
.info dd { margin: 0; color: var(--muted); line-height: 1.5; }
.info a { color: var(--teal-ink); }

.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 4/3;
}
.map-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

@media (max-width: 820px) { .contact { grid-template-columns: 1fr; } }

/* ===== FORM ===== */
form {
  display: grid;
  gap: 14px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
label {
  display: grid;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--slate);
}
input, select, textarea {
  font: inherit;
  font-size: 1rem;
  padding: .7rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  transition: border-color .2s, box-shadow .2s, background .22s;
  appearance: auto;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 20%, transparent);
}
input[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: #c0392b;
}
textarea { resize: vertical; min-height: 80px; }
.note {
  font-size: .84rem;
  color: var(--muted);
  margin: 0;
  padding: 10px 12px;
  background: var(--teal-soft);
  border-radius: 8px;
  border-left: 3px solid var(--teal);
}
.form-confirmation {
  display: none;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--teal-soft);
  color: var(--ink);
  border: 1.5px solid var(--teal);
}
.form-confirmation h3 { margin-bottom: 6px; font-size: 1.1rem; color: var(--slate); }

@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .9rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr 1fr 1.1fr;
  gap: 40px;
  padding-block: 52px 40px;
}

.foot-brand .brand {
  margin-bottom: 14px;
  display: inline-flex;
}
.foot-brand .desc {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
  max-width: 26em;
  margin-bottom: 20px;
}

.foot-col h4 {
  font: 600 .75rem/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-ink);
  margin: 0 0 14px;
}
.foot-col nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foot-col nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .91rem;
  transition: color .15s;
  display: block;
}
.foot-col nav a:hover { color: var(--teal-ink); }

.foot-col address {
  font-style: normal;
  color: var(--muted);
  font-size: .91rem;
  line-height: 1.65;
  margin: 0 0 10px;
}
.foot-col .foot-contact a {
  display: block;
  color: var(--teal-ink);
  text-decoration: none;
  font-size: .91rem;
  margin-bottom: 6px;
}
.foot-col .foot-contact a:hover { text-decoration: underline; }
.foot-col .hours {
  margin-top: 12px;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.65;
}

.foot-bottom {
  border-top: 1px solid var(--line);
  padding-block: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .84rem;
  color: var(--muted);
}
.foot-bottom a { color: var(--teal-ink); text-decoration: none; }
.foot-bottom a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .foot-grid { grid-template-columns: 1fr; padding-block: 36px 28px; gap: 28px; }
  .foot-brand { grid-column: auto; }
}

/* ===== 404 PAGE ===== */
.not-found {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 80px;
}
.not-found .code {
  font: 500 clamp(5rem, 15vw, 9rem)/1 var(--display);
  color: var(--teal-soft);
  display: block;
  margin-bottom: 16px;
}
.not-found h1 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: 12px; }
.not-found p { color: var(--muted); max-width: 32em; margin: 0 auto 28px; }
.not-found .cta-row { justify-content: center; }

/* ===== UTILITY ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ===== PRINT ===== */
@media print {
  header, footer, .menu-btn, .theme-toggle, .mobile-nav { display: none !important; }
  .hero { grid-template-columns: 1fr; }
  section { padding-block: 24px; }
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .55s ease, transform .55s ease; }
.reveal-left { opacity: 0; transform: translateX(-36px); transition: opacity .55s ease, transform .55s ease; }
.reveal-right { opacity: 0; transform: translateX(36px); transition: opacity .55s ease, transform .55s ease; }
.reveal-stagger { opacity: 0; transform: translateY(24px); transition: opacity .55s ease, transform .55s ease; }
.reveal.visible, .reveal-left.visible, .reveal-right.visible, .reveal-stagger.visible { opacity: 1; transform: none; }
.reveal-stagger.visible > *:nth-child(1) { transition-delay:0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay:.08s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay:.16s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay:.24s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay:.32s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay:.40s; }
/* No-JS / IntersectionObserver unsupported fallback */
.no-js .reveal, .no-js .reveal-left, .no-js .reveal-right, .no-js .reveal-stagger { opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce) { .reveal,.reveal-left,.reveal-right,.reveal-stagger { transition: none; opacity:1; transform:none; } }

/* ===== STATS GRID ===== */
.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--line); }
@media(max-width:680px) { .stat-grid { grid-template-columns:repeat(2,1fr); } }
.stat-item { background:var(--surface); padding:36px 20px; text-align:center; transition:var(--transition); }
.stat-num { font:700 2.6rem/1 var(--display); color:var(--teal-ink); display:block; margin-bottom:6px; }
.stat-label { color:var(--muted); font-size:.85rem; }

/* ===== TRUST BAR ===== */
.trust-bar { background:var(--teal-ink); color:var(--on-accent); padding:10px 0; font-size:.85rem; overflow:hidden; }
.trust-bar-inner { display:flex; gap:0; align-items:center; }
.trust-bar span { padding:0 24px; white-space:nowrap; }
.trust-bar span + span { border-left:1px solid rgba(255,255,255,.25); }
/* Mobile marquee */
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media(max-width:680px) {
  .trust-bar { overflow: hidden; }
  .trust-bar-inner {
    display: flex;
    width: max-content;
    animation: marquee-scroll 18s linear infinite;
  }
  .trust-bar-inner:hover { animation-play-state: paused; }
  .trust-bar span { padding: 0 20px; font-size: .82rem; }
  .trust-bar span + span { border-left: 1px solid rgba(255,255,255,.25); }
}

/* ===== REVIEW STARS ===== */
.stars { color:#f4a736; font-size:1.1rem; letter-spacing:.05em; }
.review-row { display:flex; align-items:center; gap:10px; font-size:.9rem; color:var(--muted); margin-top:4px; }

/* ===== FLOATING MOBILE CTA ===== */
.float-cta { display:none; position:fixed; bottom:0; left:0; right:0; z-index:9999; padding:10px 16px; background:var(--bg); border-top:1px solid var(--line); gap:8px; align-items:center; box-shadow:0 -4px 20px rgba(0,0,0,.12); }
@media(max-width:680px) { .float-cta { display:flex; } body { padding-bottom:68px; } }
.float-cta a { flex:1; text-align:center; justify-content:center; font-size:.88rem; padding:.7rem 1rem; }

/* ===== TREATMENT SECTIONS (service.html) ===== */
.treatment-nav { position:sticky; top:68px; z-index:90; background:var(--bg); border-bottom:1px solid var(--line); }
.treatment-nav-inner { display:flex; gap:4px; padding:8px clamp(16px,4vw,40px); max-width:1120px; margin:0 auto; overflow-x:auto; scrollbar-width:none; }
.treatment-nav-inner::-webkit-scrollbar { display:none; }
.treatment-nav a { white-space:nowrap; padding:7px 14px; border-radius:8px; font-size:.82rem; font-weight:500; color:var(--muted); text-decoration:none; transition:var(--transition); }
.treatment-nav a:hover,.treatment-nav a.tn-active { background:var(--teal-soft); color:var(--teal-ink); }

.treatment-section { padding-block:72px 64px; border-bottom:1px solid var(--line); }
.treatment-row { display:grid; grid-template-columns:1fr 1fr; gap:56px; align-items:center; max-width:1120px; margin:0 auto; padding-inline:clamp(16px,4vw,40px); }
.treatment-row.flip { direction:rtl; }
.treatment-row.flip > * { direction:ltr; }
@media(max-width:820px) { .treatment-row,.treatment-row.flip { grid-template-columns:1fr; direction:ltr; gap:32px; } }

.treatment-img { border-radius:16px; overflow:hidden; aspect-ratio:4/3; background:var(--teal-soft); }
.treatment-img img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .5s ease; }
.treatment-img:hover img { transform:scale(1.04); }

.treatment-num { font:600 .72rem/1 var(--display); color:var(--teal-ink); letter-spacing:.16em; text-transform:uppercase; margin-bottom:10px; display:block; }
.treatment-body h2 { font-size:clamp(1.5rem,2.8vw,2.2rem); margin-block:8px 14px; color:var(--slate); }
.treatment-body .lead { color:var(--muted); line-height:1.75; margin-bottom:16px; font-size:1rem; }
.treatment-tags { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:22px; }
.treatment-tags span { padding:4px 13px; border-radius:999px; background:var(--teal-soft); color:var(--teal-ink); font-size:.8rem; font-weight:600; }
.what-expect { border:1px solid var(--line); border-radius:10px; margin-top:16px; overflow:hidden; background:var(--surface); }
.what-expect summary { padding:12px 16px; font-weight:600; font-size:.88rem; cursor:pointer; list-style:none; color:var(--slate); display:flex; justify-content:space-between; }
.what-expect summary::-webkit-details-marker { display:none; }
.what-expect summary::after { content:'+'; color:var(--teal-ink); font-size:1.2rem; font-weight:400; }
.what-expect[open] summary::after { content:'x'; }
.what-expect > p { padding:0 16px 14px; color:var(--muted); font-size:.9rem; line-height:1.7; margin:0; }
.what-expect .we-body { padding:0 18px 16px; color:var(--muted); font-size:.94rem; line-height:1.7; }
.what-expect .we-body p { margin:0 0 .6rem; }
.what-expect .we-body p:last-child { margin:0; }

/* ===== TREATMENT CTA ROW ===== */
.treatment-cta { display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin-top:4px; }

/* ===== CTA BAND (global — used on treatment pages + service.html) ===== */
.cta-band { background:var(--teal); padding-block:60px; text-align:center; }
.cta-band .eyebrow { color:rgba(255,255,255,.75); margin-bottom:10px; }
.cta-band h2 { color:#fff; font-size:clamp(1.7rem,3.5vw,2.4rem); margin-bottom:12px; }
.cta-band p { color:rgba(255,255,255,.8); font-size:1.08rem; max-width:38em; margin:0 auto 28px; }
.cta-band .cta-row { justify-content:center; }
.cta-band .btn.ghost { border-color:rgba(255,255,255,.6); color:#fff; }
.cta-band .btn.ghost:hover { background:rgba(255,255,255,.15); }

/* ===== DOCTOR BIO (team.html) ===== */
.bio-grid { display:grid; grid-template-columns:360px 1fr; gap:60px; align-items:start; }
@media(max-width:900px) { .bio-grid { grid-template-columns:1fr; } }
.bio-photo { border-radius:20px; overflow:hidden; }
.bio-photo img { width:100%; display:block; }
.credential-list { display:flex; flex-direction:column; gap:10px; margin-top:20px; }
.credential-item { display:flex; gap:12px; align-items:flex-start; padding:14px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.credential-item .ci-icon { width:32px; height:32px; border-radius:8px; background:var(--teal-soft); display:grid; place-items:center; color:var(--teal-ink); flex-shrink:0; }
.credential-item h4 { font-size:.9rem; color:var(--slate); margin:0 0 2px; }
.credential-item p { font-size:.82rem; color:var(--muted); margin:0; }

/* ===== ABOUT / NEW PATIENTS ===== */
.checklist { display:flex; flex-direction:column; gap:12px; }
.checklist-item { display:flex; gap:14px; align-items:flex-start; padding:16px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.checklist-item .ci { width:28px; height:28px; border-radius:50%; background:var(--teal-soft); color:var(--teal-ink); display:grid; place-items:center; flex-shrink:0; font-weight:700; font-size:.85rem; }
.checklist-item h4 { font-size:.95rem; color:var(--slate); margin:0 0 3px; }
.checklist-item p { font-size:.85rem; color:var(--muted); margin:0; }

/* ===== CONDITIONS GRID (feature.html) ===== */
.cond-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:20px; }
.cond-card { border:1px solid var(--line); border-radius:var(--radius); padding:24px; background:var(--surface); transition:var(--transition); }
.cond-card:hover { border-color:var(--teal); box-shadow:var(--shadow); transform:translateY(-2px); }
.cond-card h3 { font-size:1.05rem; color:var(--slate); margin:12px 0 8px; }
.cond-card p { color:var(--muted); font-size:.88rem; line-height:1.65; }
.cond-icon { width:40px; height:40px; border-radius:10px; background:var(--teal-soft); display:grid; place-items:center; color:var(--teal-ink); }

/* ===== RESPONSIVE UTILITY ===== */
@media(max-width:480px) {
  .btn { padding:.65rem 1.1rem; font-size:.88rem; }
  .page-header h1 { font-size:clamp(1.8rem,8vw,2.4rem); }
  .cta-row { flex-direction:column; }
  .cta-row .btn { width:100%; justify-content:center; }
}

/* ===== GLOBAL OVERFLOW GUARD ===== */
html { overflow-x: clip; }
body { overflow-x: hidden; }
img, video, svg, iframe { max-width: 100%; }

/* ===== SECTION PADDING — MOBILE ===== */
@media(max-width:540px) {
  section { padding-block: 44px; }
  .page-header { padding-block: 36px; }
  .treatment-section { padding-block: 44px 36px; }
}

@media(prefers-reduced-motion: reduce) {
  .trust-bar-inner { animation: none !important; }
}

/* ===== TABLET (768px) REFINEMENTS ===== */
@media(max-width:768px) {
  .wrap { padding-inline: 16px; }
  .foot-grid { gap: 28px; }
  .hero { gap: 32px; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .sec-head h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
}

/* ===== TOUCH / POINTER TARGETS ===== */
@media(hover:none) and (pointer:coarse) {
  .btn { min-height: 44px; }
  .theme-toggle { width: 44px; height: 44px; }
  .menu-btn { min-height: 44px; min-width: 44px; }
  .nav-links a:not(.btn) { padding-block: 10px; }
}

/* ===== AUTO COLOR-SCHEME SCROLLBAR ===== */
@media(prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
:root:not([data-theme]) { color-scheme: light dark; }
