:root {
  --ivory: #f5f1ea;
  --paper: #fcfaf6;
  --obsidian: #0e1816;
  --obsidian-soft: #162522;
  --ink: #141f1d;
  --muted: #52615d;
  --gold: #c9a66b;
  --gold-bright: #e3c489;
  --mint: #5eead4;
  --whatsapp: #168a4d;
  --whatsapp-hover: #11713e;
  --border: rgba(20, 31, 29, 0.11);
  --border-dark: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: clip;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Demo Notice Bar */
.demo-bar {
  background: #0a1210;
  color: #dce7e4;
  font-size: 12.5px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(227, 196, 137, 0.25);
}

.demo-bar-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.demo-bar a {
  color: var(--gold-bright);
  text-decoration: underline;
  font-weight: 600;
}

/* Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(245, 241, 234, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  min-height: 68px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand-monogram {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--obsidian);
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
  white-space: nowrap;
}

.brand-sub {
  display: none;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-header .btn-whatsapp {
  padding: 9px 14px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 28px;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.16s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
  box-shadow: 0 10px 24px rgba(22, 138, 77, 0.24);
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
}

.btn-dark {
  background: var(--obsidian);
  color: var(--paper);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--ink);
  background: transparent;
}

.btn-ghost-light {
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f4f7f6;
  background: rgba(255, 255, 255, 0.05);
}

/* Hero */
.hero {
  padding: 46px 0 64px;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7c5e2c;
  margin-bottom: 16px;
}

.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
}

.hero h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 4.35rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
}

.hero h1 em {
  font-style: italic;
  color: #21574e;
}

.hero-lead {
  color: var(--muted);
  font-size: 1.04rem;
  max-width: 520px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-meta strong {
  color: var(--ink);
  display: block;
  font-size: 0.95rem;
}

.hero-frame {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  background: var(--obsidian);
  box-shadow: 0 24px 60px rgba(14, 24, 22, 0.14);
  aspect-ratio: 16 / 11;
}

.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-caption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  right: 16px;
  background: rgba(14, 24, 22, 0.78);
  backdrop-filter: blur(8px);
  color: #eef4f2;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* =========================================================
   STANDOUT SECTION: SCROLL-CONTROLLED 60-FRAME STUDIO STAGE
   ========================================================= */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 90;
  background: linear-gradient(90deg, #165d52, #b89152);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
  display: none;
}

@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-progress-bar {
      display: block;
      animation: page-scroll-progress auto linear both;
      animation-timeline: scroll(root block);
      animation-range: 0% 100%;
    }
  }
}

@keyframes page-scroll-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* =========================================================
   UNIFIED STICKY SCROLL-SCRUBBED & SORTED STAGES (ALL SECTIONS)
   ========================================================= */
.story-track {
  position: relative;
}

.story-sticky {
  position: sticky;
  top: 68px;
  min-height: calc(100svh - 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 0;
  overflow: hidden;
}

.hero-track {
  height: 155vh;
}

.scroll-story {
  background: linear-gradient(180deg, #ede7dc 0%, #f5f1ea 50%, #ede7dc 100%);
  color: var(--ink);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  height: 290vh;
}

.services-track {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  height: 310vh;
}

.doctor-track {
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
  height: 225vh;
}

.visit-track {
  background: linear-gradient(180deg, var(--ivory) 0%, #eae3d6 100%);
  height: 190vh;
}

/* Treatments Scroll-Sorted Card Deck */
.services-deck-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}

.deck-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.service-pill-tab {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.service-pill-tab.active {
  background: var(--obsidian);
  color: #fff;
  border-color: var(--obsidian);
}

.deck-progress-rail {
  height: 4px;
  border-radius: 999px;
  background: rgba(20, 31, 29, 0.1);
  overflow: hidden;
}

.deck-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #165d52, #b89152);
  transform-origin: left center;
  transform: scaleX(0.08);
  will-change: transform;
}

.services-deck-layout .feature-visual img {
  max-height: 130px;
}

.services-deck-layout .feature-visual-body {
  padding: 14px 16px;
}

.sort-deck-stage {
  position: relative;
  min-height: 295px;
  width: 100%;
  margin-bottom: 36px;
}

.sort-card {
  position: absolute;
  inset: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px 24px;
  box-shadow: 0 18px 46px rgba(20, 31, 29, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  will-change: transform, opacity;
  pointer-events: none;
}

.sort-card.is-front {
  border-color: rgba(22, 93, 82, 0.35);
  box-shadow: 0 24px 56px rgba(20, 31, 29, 0.12);
  pointer-events: auto;
}

.sort-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sort-badge {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #165d52;
  background: #e6f2ef;
  padding: 5px 12px;
  border-radius: 999px;
}

.sort-time {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.sort-card h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.15;
  margin-bottom: 10px;
  color: var(--ink);
}

.sort-card p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 20px;
}

/* Doctor Scroll-Sorted Chapters */
.doctor-steps-col {
  display: grid;
  gap: 14px;
}

.doctor-step-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  will-change: transform, opacity;
}

.doctor-step-card.active {
  background: #ffffff;
  border-color: rgba(22, 93, 82, 0.36);
  box-shadow: 0 14px 32px rgba(20, 31, 29, 0.08);
}

.doctor-quote-sm {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.3rem, 2.3vw, 1.75rem);
  line-height: 1.24;
  color: var(--ink);
  margin-top: 6px;
}

#doctor-portrait-img {
  will-change: transform;
}

/* Visit Panel Step Focus */
.visit-step {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  opacity: 0.62;
  transition: opacity 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.visit-step.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(227, 196, 137, 0.45);
}

.visit-step strong {
  display: block;
  color: var(--gold-bright);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.story-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

.story-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a6835;
  margin-bottom: 4px;
}

.story-header h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.65rem, 3.2vw, 2.55rem);
  font-weight: 600;
  line-height: 1.08;
  color: var(--ink);
}

.story-telemetry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(20, 31, 29, 0.05);
}

.story-telemetry strong {
  color: #165d52;
  font-variant-numeric: tabular-nums;
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: center;
}

.canvas-shell {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(20, 31, 29, 0.12);
  background: #f3efe7;
  box-shadow: 0 24px 60px rgba(34, 28, 18, 0.1);
  aspect-ratio: 16 / 9;
  width: 100%;
}

#sequence-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-hint {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(252, 250, 246, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(20, 31, 29, 0.1);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  pointer-events: none;
}

.chapters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.chapter-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(20, 31, 29, 0.09);
  border-radius: 16px;
  padding: 12px 14px;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
  opacity: 0.58;
}

.chapter-card.active {
  background: #ffffff;
  border-color: rgba(22, 93, 82, 0.35);
  box-shadow: 0 12px 28px rgba(20, 31, 29, 0.07);
  opacity: 1;
}

.chapter-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #8a6835;
  margin-bottom: 4px;
}

.chapter-card h3 {
  font-size: 0.94rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.chapter-card p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.48;
  display: none;
}

/* Reduced-Motion Still Fallback (Hidden by default, shown when reduced motion is preferred) */
.reduced-motion-stage {
  display: none;
  background: #ede7dc;
  color: var(--ink);
  padding: 64px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  .story-track {
    height: auto !important;
  }
  .story-sticky {
    position: static !important;
    min-height: auto !important;
    padding: 48px 0 !important;
  }
  .scroll-story {
    display: none;
  }
  .reduced-motion-stage {
    display: block;
  }
  .sort-deck-stage {
    min-height: auto;
    display: grid;
    gap: 14px;
  }
  .sort-card {
    position: static;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .doctor-step-card,
  .visit-step {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Editorial Services Section */
.section {
  padding: 76px 0;
}

.section-paper {
  background: var(--paper);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 40px;
}

.section-head h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  max-width: 540px;
}

.section-head p {
  color: var(--muted);
  max-width: 400px;
  font-size: 0.96rem;
}

.services-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.feature-visual {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
}

.feature-visual img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.feature-visual-body {
  padding: 24px;
}

.feature-visual-body h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.65rem;
  margin-bottom: 8px;
}

.feature-visual-body p {
  color: var(--muted);
  font-size: 0.93rem;
  margin-bottom: 18px;
}

.services-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.service-row {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.service-row h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.service-row p {
  color: var(--muted);
  font-size: 0.9rem;
}

.service-idx {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

/* Doctor Spread */
.doctor-spread {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

.doctor-portrait-wrap {
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  max-height: 500px;
  box-shadow: 0 22px 48px rgba(14, 24, 22, 0.12);
}

.doctor-portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.doctor-quote {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  line-height: 1.25;
  color: var(--ink);
  margin: 16px 0 18px;
}

.cred-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 26px;
}

.cred-pills span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--obsidian);
  background: #eae4d8;
  padding: 7px 14px;
  border-radius: 999px;
}

/* Visit & Hours */
.visit-panel {
  background: var(--obsidian);
  color: #eef4f2;
  border-radius: 26px;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.visit-panel h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.9rem, 3.5vw, 2.7rem);
  margin-bottom: 10px;
}

.visit-panel p {
  color: #b7c9c4;
  font-size: 0.95rem;
}

.hours-table {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-dark);
  font-size: 0.92rem;
}

.hours-row:last-child {
  border-bottom: none;
}

/* Footer */
.site-footer {
  background: #0a1210;
  color: #bfd0cb;
  padding: 52px 0 92px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-dark);
}

.footer-grid a {
  color: var(--gold-bright);
  text-decoration: none;
  font-weight: 500;
}

.footer-grid a:hover {
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: #879b95;
}

/* Persistent Always-Accessible Floating WhatsApp CTA */
.floating-wa {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--whatsapp);
  color: #fff;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(14, 24, 22, 0.34);
  transition: transform 0.16s ease, background 0.16s ease;
}

.floating-wa:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-2px);
}

/* Unified scroll-scrubbing & card-sorting is driven smoothly by app.js + CSS sticky tracks */

/* Desktop Breakpoint */
@media (min-width: 860px) {
  .brand-title {
    font-size: 1.35rem;
  }
  .brand-sub {
    display: block;
  }
  .site-header .btn-whatsapp {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  .nav-links {
    display: flex;
  }
  .hero {
    padding: 68px 0 84px;
  }
  .hero-layout {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 48px;
  }
  .scroll-story {
    height: 310vh;
  }
  .story-grid {
    grid-template-columns: 1.45fr 0.85fr;
    gap: 28px;
  }
  .chapters {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .chapter-card {
    padding: 18px 20px;
  }
  .chapter-card p {
    display: block;
  }
  .services-deck-layout {
    grid-template-columns: 0.92fr 1.08fr;
    gap: 32px;
  }
  .services-deck-layout .feature-visual img {
    max-height: none;
  }
  .services-deck-layout .feature-visual-body {
    padding: 20px 22px;
  }
  .sort-deck-stage {
    min-height: 360px;
    margin-bottom: 0;
  }
  .sort-card {
    padding: 34px 32px;
  }
  .services-layout {
    grid-template-columns: 0.92fr 1.08fr;
    gap: 28px;
  }
  .doctor-spread {
    grid-template-columns: 400px 1fr;
    gap: 54px;
  }
  .visit-panel {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 48px;
    gap: 42px;
  }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
  .site-footer {
    padding-bottom: 52px;
  }
}
