/* ==========================================================================
   Option B: Flow
   Light and motion-led (template-parts/b/, js/motion.js, css/motion.css):
   soft colour drifting behind the hero, the headline rising in word by
   word, the spine drawing itself with the credentials orbiting it, a ticker
   of conditions, a sticky scroll story, a timeline that fills as you scroll,
   smooth accordions, an animated border round the office card, and a header
   that slims down once you scroll.
   ========================================================================== */

:root { --radius: 16px; --radius-lg: 28px; }

html, body { overflow-x: clip; }
body { background: #f7fbfc; }
.btn { border-radius: 999px; }

/* ---------- Glass header that slims on scroll ---------- */
.site-header { background: rgba(255, 255, 255, .74); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); }
.header-top { max-height: 40px; overflow: hidden; transition: max-height .35s var(--ease-out), opacity .3s ease; }
.site-header.is-scrolled .header-top { max-height: 0; opacity: 0; }
.header-main { border-bottom-color: rgba(15, 33, 64, .08); }
.header-main .container { transition: min-height .35s var(--ease-out); }
.site-header.is-scrolled .header-main .container { min-height: 66px; }

/* ---------- Hero ---------- */
.g-hero { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3.5rem, 7vw, 6rem); }
.g-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; animation: blob-drift 18s ease-in-out infinite alternate; }
.g-blob-1 { width: 520px; height: 520px; top: -160px; left: -140px; background: #8ee8f6; }
.g-blob-2 { width: 460px; height: 460px; bottom: -200px; right: 12%; background: #b9cff0; animation-duration: 22s; }
.g-blob-3 { width: 340px; height: 340px; top: 28%; right: -90px; background: var(--cyan-pale); animation-duration: 26s; }
@keyframes blob-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.12); }
  100% { transform: translate(-40px, 20px) scale(.95); }
}
.g-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3rem; align-items: center; }
.g-hero h1 { font-size: clamp(2.6rem, 5.6vw, 4.6rem); line-height: 1.05; color: var(--ink); letter-spacing: -0.02em; }
.g-lead { font-size: 1.2rem; max-width: 34rem; }

/* The spine in a navy disc, drawing its nerves on load, badges orbiting. */
.g-orbit { position: relative; width: min(100%, 520px); aspect-ratio: 1; justify-self: center; }
.g-orbit-core {
  position: absolute; inset: 14%; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(7, 204, 236, .35), transparent 60%), linear-gradient(160deg, var(--navy), var(--ink));
  box-shadow: 0 40px 80px -30px rgba(15, 33, 64, .6);
}
.g-orbit-core .hero-art { width: 92%; }
.motion-ready .g-orbit-core { animation: core-in 1.2s var(--ease-out) both; }
@keyframes core-in { from { opacity: 0; transform: scale(.85); } }
.motion-ready .g-hero .hero-art-nerve { stroke-dasharray: 500; stroke-dashoffset: 500; animation: nerve-draw 2.4s var(--ease-out) .5s forwards; }
@keyframes nerve-draw { to { stroke-dashoffset: 0; } }
.g-orbit-ring { position: absolute; inset: 0; border: 1.5px dashed rgba(39, 71, 125, .22); border-radius: 50%; animation: orbit 48s linear infinite; }
.g-chip { position: absolute; transform: translate(-50%, -50%); }
.g-chip-1 { left: 50%; top: 0; }
.g-chip-2 { left: 6.7%; top: 75%; }
.g-chip-3 { left: 93.3%; top: 75%; }
.g-chip-inner {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .95rem .55rem .55rem; border-radius: 999px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px -14px rgba(15, 33, 64, .35); white-space: nowrap; font-size: .82rem; color: var(--muted);
  animation: orbit 48s linear infinite reverse;
}
.g-chip-inner strong { display: block; font-family: var(--font-head); font-size: .95rem; line-height: 1.2; color: var(--ink); }
.g-chip-icon { flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--cyan); color: var(--ink); }
@keyframes orbit { to { transform: rotate(360deg); } }

/* ---------- Ticker ---------- */
.g-ticker { display: grid; gap: .7rem; margin: 1.5rem -3%; padding: 1.6rem 0; background: var(--ink); transform: rotate(-1.5deg); overflow: hidden; }
.g-ticker-row { display: flex; width: max-content; animation: marquee 55s linear infinite; }
.g-ticker-reverse { animation-direction: reverse; }
.g-ticker ul { display: flex; list-style: none; }
.g-ticker li { display: flex; align-items: center; gap: 2.5rem; padding-right: 2.5rem; font: 700 1.35rem var(--font-head); color: var(--white); white-space: nowrap; }
.g-ticker li::after { content: '\2726'; font-size: .9rem; color: var(--cyan); }
.g-ticker-reverse li { color: transparent; -webkit-text-stroke: 1px rgba(205, 248, 255, .75); }
.g-ticker:hover .g-ticker-row { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sticky scroll story ---------- */
.g-story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); }
.g-story-visual { position: sticky; top: 16vh; align-self: start; }
.g-story-frame { position: relative; aspect-ratio: 4 / 3.2; overflow: hidden; border-radius: 32px; background: var(--smoke); box-shadow: var(--shadow-lg); }
.g-story-frame figure { position: absolute; inset: 0; margin: 0; opacity: 0; transform: scale(1.06); transition: opacity .7s var(--ease-out), transform 1.2s var(--ease-out); }
.g-story-frame figure.is-active { opacity: 1; transform: none; }
.g-story-frame img { width: 100%; height: 100%; object-fit: cover; }
.g-story-dots { display: flex; justify-content: center; gap: .5rem; margin-top: 1.25rem; list-style: none; }
.g-story-dots li { width: 10px; height: 10px; border-radius: 999px; background: var(--line); transition: width .4s var(--ease-out), background .4s ease; }
.g-story-dots li.is-active { width: 34px; background: var(--cyan); }
.g-story-step { display: flex; flex-direction: column; justify-content: center; min-height: 62vh; transition: opacity .5s ease; }
.motion-ready .g-story-step { opacity: .3; }
.motion-ready .g-story-step.is-active { opacity: 1; }
.g-story-media { display: none; }
.g-story-no { font: 700 .9rem var(--font-head); letter-spacing: .2em; color: var(--cyan-ink); }
.g-story-step h3 { margin-top: .4rem; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.g-story-step > p { font-size: 1.08rem; }
.g-more { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; font-family: var(--font-head); font-weight: 700; }
.g-more span { transition: transform .3s var(--ease-out); }
.g-more:hover span { transform: translateX(5px); }
.g-story-steps > .btn { margin-top: 1rem; }

/* ---------- Doctor ---------- */
.g-doctor-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 4.5rem); align-items: center; }
.g-doctor-photo { overflow: hidden; border-radius: 24px; box-shadow: var(--shadow-lg); }
.g-doctor-photo img { width: 100%; aspect-ratio: 1 / 1.08; object-fit: cover; object-position: 50% 22%; }
.g-doctor-role { color: var(--cyan-ink); font-weight: 700; }

/* ---------- Timeline that fills as you scroll ---------- */
.g-track { --p: 1; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; padding-top: 3.75rem; list-style: none; counter-reset: step; }
.motion-ready .g-track { --p: 0; }
.g-track::before, .g-track::after { content: ''; position: absolute; top: 18px; left: 0; height: 4px; border-radius: 4px; }
.g-track::before { right: 0; background: var(--line); }
.g-track::after { width: calc(var(--p) * 100%); background: linear-gradient(90deg, var(--cyan), var(--navy)); }
.g-track li { position: relative; counter-increment: step; }
.g-track li::before {
  content: counter(step); position: absolute; z-index: 1; top: -3.75rem; left: 0; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 3px solid var(--cyan); background: var(--white); font: 700 1rem var(--font-head); color: var(--navy);
}
.g-track h3 { font-size: 1.2rem; }
.g-track p { margin: 0; color: var(--muted); }

/* ---------- FAQ with smooth open ---------- */
.g-accordion { max-width: 820px; margin: 0 auto; }
.g-accordion details { margin-bottom: .8rem; border-radius: 20px; background: var(--white); box-shadow: var(--shadow); }
.g-accordion summary { position: relative; padding: 1.3rem 4rem 1.3rem 1.5rem; list-style: none; cursor: pointer; font: 700 1.1rem/1.35 var(--font-head); color: var(--ink); }
.g-accordion summary::-webkit-details-marker { display: none; }
.g-accordion summary::before, .g-accordion summary::after { content: ''; position: absolute; top: 50%; right: 1.5rem; width: 16px; height: 2px; margin-top: -1px; background: var(--navy); transition: transform .3s var(--ease-out); }
.g-accordion summary::after { transform: rotate(90deg); }
.g-accordion details[open]:not(.is-closing) summary::after { transform: rotate(0deg); }
.g-answer p { margin: 0; padding: 0 1.5rem 1.4rem; }

/* ---------- Visit ---------- */
.g-visit-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem; align-items: stretch; }
.g-visit-card { position: relative; isolation: isolate; padding: 2.25rem; border-radius: 28px; }
.g-visit-card::before { content: ''; position: absolute; inset: -2px; z-index: -2; border-radius: 30px; background: conic-gradient(from var(--spin), var(--cyan), var(--navy), var(--cyan-pale), var(--cyan)); animation: spin 6s linear infinite; }
.g-visit-card::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 28px; background: var(--white); }
.g-visit-card ul { margin: 1rem 0 1.5rem; list-style: none; }
.g-visit-card li { display: flex; gap: .75rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.g-visit-card li svg { flex-shrink: 0; margin-top: .2rem; color: var(--cyan-ink); }
.g-visit-map iframe { display: block; width: 100%; height: 100%; min-height: 380px; border: 0; border-radius: 28px; }

/* ---------- Shared parts ---------- */
.cta { background: linear-gradient(120deg, var(--navy), var(--ink), #1d5f86, var(--navy)); background-size: 300% 300%; animation: cta-shift 14s ease infinite; }
@keyframes cta-shift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.page-header { background: linear-gradient(120deg, #e3faff, var(--white)); color: var(--text); }
.page-header::before { display: none; }
.page-header h1 { color: var(--ink); }
.page-header-sub { color: var(--text); }
.page-header .section-label { color: var(--cyan-ink); }
.breadcrumb a { color: var(--cyan-ink); }
.breadcrumb [aria-current] { color: var(--muted); }
.breadcrumb li + li::before { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .g-blob, .g-orbit-ring, .g-chip-inner, .g-ticker-row, .cta, .g-visit-card::before { animation: none; }
  .motion-ready .g-hero .hero-art-nerve { stroke-dasharray: none; animation: none; }
  .motion-ready .g-story-step { opacity: 1; }
}

/* ---------- Responsive ---------- */
/* Tablets and unfolded foldables: the chips ride the ring, so shrink the
   orbit and the chips to keep them on screen at every point of the turn. */
@media (min-width: 761px) and (max-width: 1400px) {
  .g-orbit { width: 70%; }
  .g-chip-inner { padding: .45rem .8rem .45rem .45rem; }
  .g-chip-inner > span:last-child { font-size: 0; }
  .g-chip-inner strong { font-size: .88rem; }
  .g-chip-icon { width: 28px; height: 28px; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .g-orbit { width: 62%; }
}
@media (max-width: 760px) {
  .g-hero-grid { grid-template-columns: 1fr; }
  .g-orbit { max-width: 380px; }
}
@media (max-width: 900px) {
  .g-story-grid, .g-doctor-grid, .g-visit-grid { grid-template-columns: 1fr; }
  .g-story-visual { display: none; }
  .g-story-step { min-height: 0; margin-bottom: 3rem; }
  .motion-ready .g-story-step { opacity: 1; }
  .g-story-media { display: block; margin-bottom: 1.25rem; }
  .g-story-media img { width: 100%; border-radius: 24px; }
  .g-track { grid-template-columns: 1fr; gap: 2rem; padding: 0 0 0 4rem; }
  .g-track::before, .g-track::after { top: 0; left: 18px; width: 4px; height: auto; }
  .g-track::before { bottom: 0; right: auto; }
  .g-track::after { height: calc(var(--p) * 100%); }
  .g-track li::before { top: 0; left: -4rem; }
}

@media (max-width: 560px) {
  .g-orbit-ring { display: none; }
  .g-ticker li { font-size: 1.1rem; }
}
