/*
 * Spine & Wellness Center Lakewood Ranch
 * Sitewide shared stylesheet
 * Loaded once, cached across page navigations.
 *
 * Contents: fonts, design tokens, base reset, shared components
 * (buttons, header, mobile menu, footer, reveal system, polish).
 * Page-specific CSS continues to live in each page's inline <style>.
 */

@property --beam-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

@font-face { font-family:'Plus Jakarta Sans'; font-style:normal; font-weight:200 800; font-display:swap; src:url('../fonts/plus-jakarta-sans.woff2') format('woff2-variations'),url('../fonts/plus-jakarta-sans.woff2') format('woff2'); }
@font-face { font-family:'Fraunces'; font-style:normal; font-weight:500; font-display:swap; src:url('../fonts/fraunces-500.woff2') format('woff2'); }
@font-face { font-family:'Fraunces'; font-style:italic; font-weight:500; font-display:swap; src:url('../fonts/fraunces-500-italic.woff2') format('woff2'); }
@font-face { font-family:'Fraunces'; font-style:normal; font-weight:600; font-display:swap; src:url('../fonts/fraunces-600.woff2') format('woff2'); }
@font-face { font-family:'Fraunces'; font-style:italic; font-weight:600; font-display:swap; src:url('../fonts/fraunces-600-italic.woff2') format('woff2'); }
@font-face { font-family:'Fraunces'; font-style:normal; font-weight:700; font-display:swap; src:url('../fonts/fraunces-700.woff2') format('woff2'); }

@keyframes beam-spin { to { --beam-angle: 360deg; } }
@keyframes pageIn { from { opacity:0; } to { opacity:1; } }

:root {
  --c-brand:        #3FB3C6;
  --c-brand-light:  #74D1D4;
  --c-brand-tint:   #AEE6E8;
  --c-brand-deep:   #1D6773;
  --c-brand-darker: #0F4C5C;
  --c-ink:        #0F1820;
  --c-ink-soft:   #2a3540;
  --c-muted:      #5a6a78;
  --c-bg:         #ffffff;
  --c-bg-soft:    #f6f9fb;
  --c-bg-tint:    #ebf5f7;
  --c-border:     #e3e8ec;
  --font-sans:  'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ts-sm:   clamp(13px, 0.85rem, 14px);
  --ts-base: clamp(15px, 1rem, 16.5px);
  --ts-lg:   clamp(17px, 1.1rem, 19px);
  --ts-xl:   clamp(20px, 1.35rem, 24px);
  --ts-2xl:  clamp(24px, 1.8rem, 32px);
  --ts-3xl:  clamp(30px, 2.4rem, 44px);
  --ts-4xl:  clamp(38px, 3.4rem, 60px);
  --ts-5xl:  clamp(48px, 4.8rem, 88px);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;
  --sh-sm: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.06);
  --sh-md: 0 4px 6px rgba(0,0,0,.05), 0 10px 15px rgba(0,0,0,.08);
  --sh-lg: 0 16px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.04);
  --sh-xl: 0 24px 60px rgba(0,0,0,.14);
  --ease:  cubic-bezier(0.32, 0.72, 0.4, 1);
  --ease2: cubic-bezier(0.2, 0.8, 0.2, 1);
  --container: 1320px;
  --header-h:  72px;
}

/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; scrollbar-width: thin; scrollbar-color: var(--c-brand-light) transparent; }
body { margin: 0; font-family: var(--font-sans); font-size: var(--ts-base); line-height: 1.6; color: var(--c-ink); background: var(--c-bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; max-width: 100%; padding-top: var(--header-h); }
img, svg, video, picture, iframe { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; background: transparent; border: 0; padding: 0; color: inherit; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; color: var(--c-ink); }
h1 em, h2 em { font-style: italic; color: var(--c-brand-deep); font-weight: 500; }
p { margin: 0 0 1em; color: var(--c-ink-soft); }
.js-on body { animation: pageIn .55s cubic-bezier(.16,1,.3,1) both; }

/* Selection + focus + cursor + scrollbar polish */
::selection { background: var(--c-brand-tint); color: var(--c-brand-darker); }
::-moz-selection { background: var(--c-brand-tint); color: var(--c-brand-darker); }
:focus-visible { outline: 2px solid var(--c-brand-deep); outline-offset: 3px; border-radius: 4px; }
:where(button, a, summary, [role="button"]):not([disabled]) { cursor: pointer; }
@supports (text-wrap: balance) { h1, h2, h3, .section-head > * { text-wrap: balance; } }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-brand-light); border-radius: 10px; border: 2px solid var(--c-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--c-brand-deep); }

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 9999; padding: 12px 20px; background: var(--c-brand-darker); color: #fff; font-weight: 600; border-radius: 0 0 var(--r-md) 0; }
.skip-link:focus { left: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 26px; border-radius: var(--r-pill); font-weight: 600; font-size: var(--ts-base); text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease), color .2s var(--ease); white-space: nowrap; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--c-brand-deep); color: #fff; box-shadow: 0 8px 24px rgba(29,103,115,.28); }
.btn-primary:hover { background: var(--c-brand-darker); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(15,76,92,.34); }
.btn-secondary { background: var(--c-bg); color: var(--c-brand-deep); border: 1.5px solid var(--c-brand-light); }
.btn-secondary:hover { background: var(--c-bg-tint); border-color: var(--c-brand-deep); transform: translateY(-2px); }
.btn-on-dark { background: #fff; color: var(--c-brand-darker); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.btn-on-dark:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0,0,0,.26); }
.btn-ghost-on-dark { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.btn-ghost-on-dark:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn-large { padding: 18px 32px; font-size: var(--ts-lg); }
button:active, .btn:active, .site-cta:active, a.btn:active { transform: translateY(0) scale(.97); }

.btn-pulse, .site-cta, .btn-on-dark.btn-large { position: relative; isolation: isolate; }
.btn-pulse::before, .site-cta::before, .btn-on-dark.btn-large::before {
  content: ""; position: absolute; inset: -2px; border-radius: var(--r-pill);
  background: conic-gradient(from var(--beam-angle), transparent 0%, transparent 38%, rgba(116,209,212,.7) 47%, rgba(174,230,232,.85) 50%, rgba(116,209,212,.7) 53%, transparent 62%, transparent 100%);
  z-index: -1; animation: beam-spin 4.5s linear infinite;
  opacity: .28; transition: opacity 0.4s ease; pointer-events: none;
}
.btn-pulse:hover::before, .site-cta:hover::before, .btn-on-dark.btn-large:hover::before { opacity: .65; }

/* Eyebrow / section head */
.eyebrow { display: inline-block; font-size: var(--ts-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--c-brand-deep); margin-bottom: 14px; }
.eyebrow-light { color: var(--c-brand-light); }
.section-head { max-width: 760px; margin: 0 auto 56px; text-align: center; padding: 0 20px; }
.section-head h2 { font-size: var(--ts-3xl); margin-bottom: 16px; }
.section-lede { font-size: var(--ts-lg); color: var(--c-muted); margin: 0 auto; max-width: 620px; }

/* Header */
.site-header { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; z-index: 100; display: flex; align-items: center; background: rgba(255,255,255,.92); border-bottom: 1px solid transparent; border-radius: 0; backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); transition: width 0.5s cubic-bezier(0.4,0,0.2,1), top 0.5s cubic-bezier(0.4,0,0.2,1), border-radius 0.5s cubic-bezier(0.4,0,0.2,1), background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease; }
.site-header.is-scrolled { top: 12px; width: min(1100px, calc(100vw - 32px)); border-radius: var(--r-pill); background: rgba(255,255,255,.94); border-bottom: none; border: 1px solid var(--c-border); box-shadow: 0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04); }
.site-header-inner { width: 100%; max-width: var(--container); margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 14px 20px; min-height: var(--header-h); transition: padding 0.45s cubic-bezier(0.4,0,0.2,1); }
.site-header.is-scrolled .site-header-inner { padding: 10px 22px; min-height: 60px; }
.site-logo { display: flex; align-items: center; flex-shrink: 0; }
.site-logo-img { width: auto; height: 44px; }
.site-nav { display: none; flex: 1; }
.site-cta { display: none; }
.site-nav-toggle { margin-left: auto; width: 44px; height: 44px; display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.site-nav-toggle span { width: 24px; height: 2px; background: var(--c-brand-darker); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s var(--ease); }

/* Mobile menu */
.mobile-menu { position: fixed; top: 0; right: 0; width: min(360px, 86vw); height: 100dvh; background: #fff; transform: translateX(100%); transition: transform .3s var(--ease); z-index: 200; display: flex; flex-direction: column; overflow-y: auto; padding: 22px 24px 32px; }
.mobile-menu[aria-hidden="false"] { transform: translateX(0); }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.mobile-menu-close { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-pill); }
.mobile-menu-close svg { width: 24px; height: 24px; color: var(--c-brand-darker); }
.mobile-menu-list { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu-list > li > a,
.mobile-menu-list > li > .mobile-submenu-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-size: var(--ts-lg); font-weight: 600; color: var(--c-ink); text-decoration: none; border-radius: var(--r-md); }
.mobile-menu-list > li > a:hover,
.mobile-menu-list > li > .mobile-submenu-trigger:hover { background: var(--c-bg-tint); }
.caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .25s var(--ease); }
.mobile-submenu-trigger[aria-expanded="true"] .caret { transform: rotate(-135deg); }
.mobile-submenu { display: none; padding: 4px 8px 12px 12px; }
.mobile-submenu-trigger[aria-expanded="true"] + .mobile-submenu { display: block; }
.mobile-submenu h5 { font-family: var(--font-sans); font-size: var(--ts-sm); text-transform: uppercase; letter-spacing: .12em; color: var(--c-brand-deep); margin: 12px 8px 6px; font-weight: 700; }
.mobile-submenu ul { display: flex; flex-direction: column; gap: 2px; }
.mobile-submenu a { display: block; padding: 10px 12px; font-size: var(--ts-base); color: var(--c-ink-soft); text-decoration: none; border-radius: var(--r-sm); }
.mobile-submenu a:hover { background: var(--c-bg-soft); color: var(--c-brand-deep); }
.mobile-menu-cta { display: block; margin: 28px 0 18px; background: var(--c-brand-deep); color: #fff; text-decoration: none; padding: 16px; text-align: center; border-radius: var(--r-pill); font-weight: 600; }
.mobile-menu-utility { display: flex; flex-direction: column; gap: 6px; padding: 12px 8px 0; border-top: 1px solid var(--c-border); }
.mobile-menu-utility a { font-size: var(--ts-sm); color: var(--c-muted); text-decoration: none; padding: 6px 8px; }
.mobile-menu-overlay { position: fixed; inset: 0; background: rgba(15,24,32,.55); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); z-index: 150; }
.mobile-menu-overlay.is-visible { opacity: 1; pointer-events: auto; }
body.menu-open { overflow: hidden; }

/* Reveal animation system */
.reveal { opacity: 0; transition: opacity 1.1s cubic-bezier(.16,1,.3,1), transform 1.1s cubic-bezier(.16,1,.3,1); transform: translateY(80px) scale(.95); }
.reveal[data-reveal="up"] { transform: translateY(80px) scale(.95); }
.reveal[data-reveal="left"] { transform: translateX(-90px) scale(.95); }
.reveal[data-reveal="right"] { transform: translateX(90px) scale(.95); }
.reveal[data-reveal="top"] { transform: translateY(-80px) scale(.95); }
.reveal[data-reveal="zoom"],
.reveal[data-reveal="fade"] { transform: scale(.92); }
.reveal.is-revealed { opacity: 1; transform: none; }
.reveal:not(.is-revealed) { will-change: transform, opacity; }
.stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.stagger > .reveal:nth-child(2) { transition-delay: .1s; }
.stagger > .reveal:nth-child(3) { transition-delay: .2s; }
.stagger > .reveal:nth-child(4) { transition-delay: .3s; }
.stagger > .reveal:nth-child(5) { transition-delay: .4s; }
.stagger > .reveal:nth-child(6) { transition-delay: .5s; }
.stagger > .reveal:nth-child(7) { transition-delay: .6s; }
.stagger > .reveal:nth-child(8) { transition-delay: .7s; }
.stagger > .reveal:nth-child(9) { transition-delay: .8s; }

/* Utility classes */
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Universal card-arrow pattern: any element with .arrow inside an anchor/button gets a smooth translate on hover */
a:hover > .arrow, button:hover > .arrow, .related-card:hover .arrow, .card:hover .arrow { transform: translateX(4px); }

/* Hover micro-interactions (hover-effects skill) */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  /* Google-style review cards: subtle lift + brand border */
  .review:hover {
    transform: translateY(-3px);
    border-color: var(--c-brand-light);
    box-shadow: 0 14px 36px rgba(15,76,92,.14);
  }
  /* Footer column links: slide-right on hover. Specificity bumped to .site-footer .footer-col a so
     this beats per-page inline <style> declarations that re-declare .footer-col a after site.css. */
  .site-footer .footer-col a {
    display: inline-block;
    transition: color .2s var(--ease), transform .2s var(--ease);
  }
  .site-footer .footer-col a:hover { transform: translateX(3px); }
  /* Site logo: subtle scale */
  .site-logo { transition: transform .18s var(--ease); }
  .site-logo:hover { transform: scale(1.03); }
  /* FAQ items, closed state: border hint */
  .faq-item:not([open]):hover {
    border-color: var(--c-brand-light);
    box-shadow: 0 4px 14px rgba(15,30,52,.06);
  }
  /* Anatomy chip buttons (back-pain): pop. Specificity .bp-stage .bp-chips button to beat
     back-pain.html's inline <style> rule that loads after site.css. */
  .bp-stage .bp-chips button {
    transition: color .25s ease, border-color .25s ease, background .25s ease, transform .18s ease, box-shadow .18s ease;
  }
  .bp-stage .bp-chips button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15,76,92,.14);
  }
}

/* Reduced motion safety net */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal, [data-cascade] { opacity: 1 !important; transform: none !important; filter: none !important; }
  .js-on body, button:active, .btn:active, .site-cta:active, a.btn:active { animation: none; transform: none; }
}

/* ============== Anatomy explainer: two-column grid + hotspot explorer (reusable) ============== */
.anat-grid { max-width: var(--container); margin: 0 auto; padding: 0 20px; display: grid; gap: 32px; align-items: center; }
.anat-copy { max-width: 600px; }
.anat-copy > .eyebrow { margin-bottom: 12px; }
.anat-copy h2 { font-size: var(--ts-3xl); margin-bottom: 14px; }
.anat-copy .section-lede { margin: 0 0 18px; max-width: none; }
@media (min-width: 900px) { .anat-grid { grid-template-columns: 1fr minmax(340px, 440px); gap: clamp(40px, 5vw, 72px); } }

.anat { margin: 0 auto; width: 100%; max-width: 440px; }
.anat__frame { position: relative; width: 100%; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--c-border); box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 22px 54px -24px rgba(15,76,92,.45); }
.anat__img { width: 100%; height: auto; display: block; }
.anat__spot { position: absolute; left: var(--x, 50%); top: var(--y, 50%); transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--c-brand-deep); color: #fff; font: 700 14px/1 var(--font-sans); border: 2px solid #fff; box-shadow: 0 4px 14px rgba(15,76,92,.45); cursor: pointer; z-index: 2; transition: transform .2s var(--ease), background .2s var(--ease); }
.anat__spot::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--c-brand); opacity: .7; animation: anatPulse 2.4s ease-out infinite; }
.anat__spot:hover, .anat__spot[aria-pressed="true"] { transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 4px 16px rgba(15,76,92,.5), 0 0 0 4px rgba(63,179,198,.55); }
.anat__spot:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 3px; }
.anat__spot[aria-pressed="true"]::before { animation: none; opacity: 0; }
@keyframes anatPulse { 0% { transform: scale(1); opacity: .7; } 70% { transform: scale(1.5); opacity: 0; } 100% { opacity: 0; } }
.anat__readout { margin-top: 16px; min-height: 86px; background: var(--c-bg-soft); border: 1px solid var(--c-border); border-radius: 14px; padding: 16px 18px; }
.anat__tip { margin: 0; font-size: var(--ts-base); color: var(--c-ink-soft); }
.anat__tip strong { display: block; font-family: var(--font-sans); font-weight: 700; color: var(--c-brand-deep); margin-bottom: 4px; font-size: var(--ts-sm); text-transform: uppercase; letter-spacing: .06em; }
.anat__hint { font-size: var(--ts-sm); color: var(--c-muted); text-align: center; margin: 10px 0 0; }
@media (max-width: 899px) { .anat__spot { width: 44px; height: 44px; font-size: 15px; } }
.anat--dark .anat__frame { background: #0a1430; border-color: rgba(255,255,255,.14); }
.anat--dark .anat__readout { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.anat--dark .anat__tip { color: rgba(255,255,255,.9); }
.anat--dark .anat__tip strong { color: var(--c-brand-tint); }
.anat--dark .anat__hint { color: rgba(255,255,255,.6); }
/* Living anatomy: clicking a marker zooms + spotlights the region so the IMAGE visibly responds (init JS builds .anat__media/.anat__spotlight/.anat__reset at runtime) */
.anat__frame { --fx: 50%; --fy: 50%; }
.anat__media { position: relative; z-index: 0; display: block; transform-origin: var(--fx) var(--fy); transition: transform .6s cubic-bezier(.4,0,.2,1); will-change: transform; }
.anat__frame.is-focused .anat__media { transform: scale(1.9); }
.anat__spotlight { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .5s ease; background: radial-gradient(circle at var(--fx) var(--fy), rgba(6,12,24,0) 8%, rgba(6,12,24,.32) 17%, rgba(6,12,24,.74) 33%, rgba(6,12,24,.95) 100%); }
.anat__frame.is-focused .anat__spotlight { opacity: 1; }
.anat__frame.is-focused .anat__spot:not([aria-pressed="true"]) { opacity: .18; }
.anat__frame.is-focused .anat__spot[aria-pressed="true"] { transform: translate(-50%, -50%) scale(1.2); background: var(--c-brand); box-shadow: 0 0 0 5px rgba(63,179,198,.9), 0 0 34px 12px rgba(63,179,198,.75); }
.anat__reset { position: absolute; top: 10px; right: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; background: rgba(7,15,28,.74); color: #fff; font: 700 11px/1 var(--font-sans); letter-spacing: .05em; text-transform: uppercase; padding: 8px 13px; border-radius: var(--r-pill); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.anat__reset::before { content: ""; width: 11px; height: 11px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.anat__frame.is-focused .anat__reset { opacity: 1; transform: none; pointer-events: auto; }
.anat__frame.is-focused .anat__hint, .anat__hint.is-hidden { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .anat__media { transition: none; } }
