/* Grupo Médico Dental. Dark by default; the switch in the menu bar changes to light ("light / dark switch" at the end). Brand colours: blue (the clinic wall) and orange (--coral, the logo and buttons).
   Shape rule: buttons and chips are pills, cards and images are 20px, inputs are 12px. */
:root {
  --bg: #F3F3F1;
  --surface: #FFFFFF;
  --surface-2: #E8E8E5;
  --ink: #262626;
  --muted: #5B5B58;
  --line: rgba(38, 38, 38, .14);
  --coral: #F1745A;
  --coral-text: #BF432B;       /* small coral text, passes 4.5:1 on --bg */
  --on-coral: #262626;
  --blue: #33B8FF;
  --blue-text: #006DA8;        /* small blue text, passes 4.5:1 on --bg and on the blue glow */
  --shadow: 0 18px 50px -24px rgba(38, 38, 38, .35);
  --g-top: #F7F6F3; --g-mid: #EEEDE9; --g-low: #F4F3F0;
  --g-1: #F7F6F3; --g-2: #ECEBE8; --g-3: #F5F4F1; --g-4: #EAE9E6; --g-5: #F6F5F2;
  --glow: rgba(241, 116, 90, .10);
  --glow2: rgba(130, 142, 178, .16);
  --lux-base: #F3F3F1; --lux-1: #F7F7F5; --lux-2: #EEF0F0; --lux-3: #F4F3F1;
  --lux-coral: rgba(241, 116, 90, .15); --lux-blue: rgba(51, 184, 255, .20); --lux-blue-soft: rgba(51, 184, 255, .11);
  --r-card: 20px;
  --r-input: 12px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
  --font-d: 'General Sans', 'Inter', system-ui, sans-serif;
  --font-b: 'Inter', system-ui, sans-serif;
  --pad: clamp(16px, 4vw, 56px);
  --max: 1320px;
}
/* dark is the default look. The light values above apply only when the visitor chose light with the switch. */
:root:not([data-theme="light"]) {
  --bg: #1B1B1A; --surface: #262625; --surface-2: #30302F;
  --ink: #F1F1EE; --muted: #AEAEAA; --line: rgba(241, 241, 238, .16);
  --coral-text: #F58A74; --blue-text: #4DC2FF; --shadow: 0 18px 50px -24px rgba(0, 0, 0, .7);
  --g-top: #1f2128; --g-mid: #121316; --g-low: #1d1c21;
  --g-1: #1f2128; --g-2: #111215; --g-3: #1e1d23; --g-4: #101114; --g-5: #1c1d24;
  --glow: rgba(241, 116, 90, .10);
  --glow2: rgba(118, 134, 184, .25);
  --lux-base: #0B0F13; --lux-1: #111A21; --lux-2: #0B0F13; --lux-3: #0F161C;
  --lux-coral: rgba(241, 116, 90, .17); --lux-blue: rgba(51, 184, 255, .26); --lux-blue-soft: rgba(51, 184, 255, .13);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background-color: var(--lux-base); color: var(--ink); font: 400 17px/1.6 var(--font-b); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
/* the background: a fixed gradient from the two brand colours only. Blue leads (large pools, top right and bottom left), orange answers (top left and bottom right corners) */
body::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(58vmax 46vmax at 4% -8%, var(--lux-coral), transparent 64%),
  radial-gradient(62vmax 52vmax at 102% 12%, var(--lux-blue), transparent 66%),
  radial-gradient(90vmax 62vmax at 6% 112%, var(--lux-blue), transparent 64%),
  radial-gradient(46vmax 36vmax at 104% 104%, var(--lux-coral), transparent 66%),
  radial-gradient(70vmax 50vmax at 50% 50%, var(--lux-blue-soft), transparent 70%),
  linear-gradient(158deg, var(--lux-1) 0%, var(--lux-2) 48%, var(--lux-3) 100%); }
/* a whisper of film grain on the background only, so the gradient never bands */
body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .05; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 500; letter-spacing: -.025em; line-height: 1.05; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.9rem); }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 6px; }
section { padding: clamp(72px, 10vw, 140px) var(--pad); max-width: var(--max); margin: 0 auto; position: relative; }

.eyebrow { font: 500 .78rem/1 var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--blue-text); margin-bottom: 18px; }

/* ---------- buttons ----------
   Hover is quiet on purpose (Phil, 12 Nov 2026: "not elegant enough" about a magnetic pull and a rolling label).
   The colour deepens, the button rises one pixel onto a soft shadow, and on a filled button a band of light
   crosses once. It eases in over 280ms and relaxes over 520ms. Nothing bounces, nothing follows the pointer.
   `translate` and `scale` are used, never `transform`: the motion script (js/motion.js) owns `transform`. */
.btn { --in: 280ms; --out: 520ms; --soft: cubic-bezier(.22, .61, .36, 1); position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; padding: 15px 26px; border-radius: 999px; border: 1px solid transparent; font: 500 .98rem/1 var(--font-d); text-decoration: none; cursor: pointer;
  transition: translate var(--out) var(--soft), box-shadow var(--out) var(--soft), background-color var(--out) ease, border-color var(--out) ease, color var(--out) ease, scale 160ms var(--ease-out); }
.btn:active { scale: .975; }
.btn-sm { padding: 11px 20px; font-size: .9rem; }
.btn-primary { --orange: #FF8A3D; background: var(--orange); color: var(--on-coral); }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--ink); }
.btn > i { transition: translate var(--out) var(--soft); }
/* the band of light: parked off the left edge, crosses once on hover, slips back unseen */
.btn-primary::after, .btn-wa::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 55%; pointer-events: none; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .24) 50%, transparent); transform: translateX(-110%); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transition-duration: var(--in), var(--in), var(--in), var(--in), var(--in), 160ms; }
  .btn:hover > i { transition-duration: var(--in); }
  .btn-primary:hover { background-color: var(--coral); translate: 0 -1px; box-shadow: 0 14px 28px -14px rgba(241, 116, 90, .75); }
  .btn-primary:hover::after, .btn-wa:hover::after { transform: translateX(195%); transition: transform 800ms cubic-bezier(.45, .05, .3, 1); }
  .btn-ghost:hover { border-color: color-mix(in srgb, var(--ink) 55%, transparent); background-color: color-mix(in srgb, var(--ink) 6%, transparent); }
  .btn:hover > i.ph-arrow-down-right { translate: 2px 2px; }
  .btn:hover > i.ph-arrow-up-right { translate: 2px -2px; }
}
@media (prefers-reduced-motion: reduce) { .btn, .btn > i { transition: none; } .btn::after { display: none; } }
.link { display: inline-block; margin-top: 16px; font: 500 .95rem var(--font-d); color: var(--coral-text); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* ---------- nav ---------- */
.nav { position: fixed; z-index: 50; top: 14px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 2 * var(--pad)), var(--max)); height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 12px 0 24px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--g-mid) 78%, transparent); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); transition: background-color 300ms ease, border-color 300ms ease, box-shadow 300ms ease, backdrop-filter 300ms ease; }
.nav.is-stuck { box-shadow: var(--shadow); }
@media (prefers-reduced-transparency: reduce) { .nav { background: var(--bg); backdrop-filter: none; } }
.logo { font: 600 1.12rem var(--font-d); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; color: var(--ink); }
.logo { display: inline-flex; align-items: center; }
.logo img { display: block; height: 24px; width: auto; }
.foot .logo img { height: 20px; }
.nav .logo-tooth { display: none; }
.nav-toggle, .nav-menu { display: none; }
.accent-dot { color: var(--coral); }
.nav-links { display: flex; gap: 30px; }
.nav-links a { text-decoration: none; font: 500 .95rem var(--font-d); color: var(--muted); transition: color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--ink); } }
.nav-right { display: flex; align-items: center; gap: 12px; }
.lang { position: relative; display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; --w: 46px; --i: 0; }
.lang button { position: relative; z-index: 1; width: var(--w); border: 0; background: transparent; color: var(--muted); font: 500 .8rem var(--font-d); padding: 7px 0; text-align: center; border-radius: 999px; cursor: pointer; transition: color 280ms ease; }
.lang button[aria-pressed="true"] { color: var(--on-coral); }
.lang-pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: var(--w); border-radius: 999px; background: var(--coral); transform: translateX(calc(var(--i) * var(--w))); }
.lang.anim .lang-pill { transition: transform 460ms var(--ease-out); }
@media (max-width: 860px) { .nav-links { display: none; } .nav .btn-sm { padding: 10px 16px; } .logo { font-size: 1rem; } }
@media (max-width: 860px) {
  .nav { display: flex; justify-content: space-between; padding: 0 10px 0 8px; gap: 0; }
  .nav .logo .logo-tooth { display: block; height: 30px; width: auto; margin-right: 8px; }
  .nav .nav-right { justify-self: end; }
  .nav .nav-right .btn-sm { display: none; }
  .nav-toggle { display: grid; place-items: center; justify-self: start; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.5rem; cursor: pointer; transition: background-color 200ms ease, transform 160ms ease; }
  .nav-toggle:active { transform: scale(.94); }
  .nav-toggle i { display: block; width: 1em; height: 1em; line-height: 1; animation: icon-pop 340ms var(--ease-out); }
  .nav-menu { display: flex; position: absolute; left: -1px; right: -1px; top: calc(100% + 8px); flex-direction: column; gap: 4px; padding: 10px; border-radius: 28px; border: 1px solid var(--line); background: color-mix(in srgb, var(--g-mid) 97%, #000); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-10px) scale(.98); transform-origin: top center; pointer-events: none; transition: opacity 320ms ease, transform 460ms var(--ease-out), visibility 0s linear 460ms; }
  .nav.menu-open .nav-menu { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity 360ms ease, transform 520ms var(--ease-out), visibility 0s; }
  .nav-menu > * { opacity: 0; transform: translateY(-6px); transition: opacity 200ms ease, transform 200ms ease; }
  .nav.menu-open .nav-menu > * { opacity: 1; transform: none; transition: opacity 380ms ease, transform 520ms var(--ease-out); }
  .nav.menu-open .nav-menu > :nth-child(1) { transition-delay: 70ms; }
  .nav.menu-open .nav-menu > :nth-child(2) { transition-delay: 120ms; }
  .nav.menu-open .nav-menu > :nth-child(3) { transition-delay: 170ms; }
  .nav.menu-open .nav-menu > :nth-child(4) { transition-delay: 220ms; }
  .nav.menu-open .nav-menu > :nth-child(5) { transition-delay: 270ms; }
  .nav-menu > a:not(.btn) { padding: 14px 16px; border-radius: 18px; text-decoration: none; font: 500 1.05rem var(--font-d); color: var(--ink); }
  .nav-menu > a:not(.btn):active { background: var(--line); }
  .nav-menu .btn { margin-top: 4px; justify-content: center; }
}
@keyframes icon-pop { from { opacity: 0; transform: rotate(-80deg) scale(.5); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nav-menu, .nav.menu-open .nav-menu, .nav-menu > * { transition: none !important; } .nav-toggle i { animation: none; } .btn-primary { transition: none; } }
@media (max-width: 520px) { .nav { padding-left: 8px; } .nav .logo img { height: 11px; } .nav .logo .logo-tooth { height: 22px; margin-right: 5px; } .nav-toggle { width: 44px; height: 44px; flex: none; } .nav .lang { --w: 30px; } .nav .lang button { font-size: .68rem; padding: 6px 0; } }

/* ---------- hero ---------- */
.hero { min-height: 100dvh; padding-top: 104px; padding-bottom: 48px; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.hero-title { font-size: clamp(2.8rem, 4.1vw, 4.4rem); letter-spacing: -.035em; line-height: 1.02; }
.ln { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.ln > span { display: block; transform: translateY(105%); transition: transform 900ms var(--ease-out); }
.is-ready .ln > span { transform: none; }
.hero-trust { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; color: var(--muted); font-size: .95rem; text-decoration: none; }
.hero-trust .rv-stars { font-size: .9rem; }
.hero-sub { max-width: 30em; margin-top: 28px; color: var(--muted); font-size: 1.12rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-media { margin: 0; height: min(78svh, 720px); border-radius: var(--r-card); overflow: hidden; clip-path: inset(100% 0 0 0 round var(--r-card)); transition: clip-path 1100ms var(--ease-io) 150ms; background: var(--surface-2); }
.is-ready .hero-media { clip-path: inset(0 0 0 0 round var(--r-card)); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); transition: transform 1600ms var(--ease-out) 150ms; }
.is-ready .hero-media img { transform: scale(1); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 92px; gap: 22px; } .hero-media { height: 36svh; order: -1; margin-top: 0; } .hero-media img { object-position: 50% 0; } .hero-title { font-size: clamp(2.3rem, 10vw, 3.6rem); } .hero-trust { margin-bottom: 14px; font-size: .85rem; } .hero-sub { margin-top: 16px; font-size: 1rem; } .hero-cta { margin-top: 22px; } }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 600ms var(--ease-out) var(--d, 0ms), transform 700ms var(--ease-out) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding-top: 24px; padding-bottom: 24px; }
.stat { padding: 40px 32px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.roll { display: flex; align-items: flex-end; height: 1em; font: 500 clamp(3.6rem, 8vw, 7rem)/1 var(--font-d); letter-spacing: -.04em; overflow: hidden; }
.roll .col { display: block; height: 1em; overflow: hidden; }
.roll .strip { display: flex; flex-direction: column; align-items: flex-start; transition: transform 1500ms var(--ease-out); }
.roll .strip span { display: block; height: 1em; line-height: 1; }
.roll .suf { color: var(--coral); line-height: 1; margin-left: .04em; font-size: .62em; align-self: flex-start; padding-top: .08em; }
.roll .sep { line-height: 1; }
.stat p { margin-top: 18px; color: var(--muted); max-width: 17em; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 8px; padding-bottom: 8px; } .stat, .stat:first-child { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-card); padding: 20px 18px; } .stat .roll { font-size: 2.7rem; } .stat p { margin-top: 10px; font-size: .88rem; line-height: 1.4; } }
@media (prefers-reduced-motion: reduce) { .roll .strip { transition: none; } }

/* ---------- about + bento ---------- */
.about-title { max-width: 16em; font-size: clamp(2rem, 4.2vw, 3.5rem); }
.about-text { max-width: 36em; margin-top: 24px; color: var(--muted); font-size: 1.1rem; }
.bento { display: grid; grid-template-columns: 1.3fr .9fr 1.3fr; gap: 16px; margin-top: 56px; align-items: stretch; }
.b { position: relative; border-radius: var(--r-card); overflow: hidden; min-height: 440px; }
.b-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.b-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 20, 20, .78), rgba(20, 20, 20, 0) 58%); }
.b-cap { position: absolute; z-index: 1; left: 24px; right: 24px; bottom: 24px; color: #fff; }
.b-cap h3 { font-size: 1.7rem; margin-bottom: 8px; }
.b-cap p { color: rgba(255, 255, 255, .9); max-width: 20em; }
.b-coral::after { background: linear-gradient(to top, var(--coral) 0%, color-mix(in srgb, var(--coral) 88%, transparent) 34%, rgba(241, 116, 90, 0) 66%); }
.b-coral .b-cap, .b-coral .b-cap p { color: var(--on-coral); }
.b-coral img { object-position: 50% 18%; }
@media (hover: hover) and (pointer: fine) { .b-img:hover img { transform: scale(1.05); } }
@media (max-width: 860px) {
  .bento { display: flex; gap: 12px; overflow-x: auto; margin-top: 32px; margin-inline: calc(var(--pad) * -1); padding: 0 var(--pad) 8px; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); scrollbar-width: none; }
  .bento::-webkit-scrollbar { display: none; }
  .b { flex: 0 0 78%; min-height: 360px; scroll-snap-align: start; }
  .bento .b.reveal { opacity: 1; transform: none; }
  .b-cap { left: 18px; right: 18px; bottom: 18px; }
  .b-cap h3 { font-size: 1.4rem; }
}

/* ---------- team: six portraits, three across in two rows on desktop, swipeable shelf on phones (same shelf as reviews) ---------- */
.team-head { margin-bottom: 44px; }
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 20px; }
@media (min-width: 1100px) { .team-grid { grid-template-columns: repeat(4, 1fr); } } /* seven doctors: 4 + 3 */
.tm-photo { margin: 0 0 20px; aspect-ratio: 4 / 5; border-radius: var(--r-card); overflow: hidden; background: var(--surface-2); }
.tm-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transition: transform 900ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .tm:hover .tm-photo img { transform: scale(1.04); } }
.tm-name { font-size: 1.35rem; }
.tm-role { margin-top: 6px; font: 500 .82rem/1.3 var(--font-d); letter-spacing: .08em; text-transform: uppercase; color: var(--blue-text); }
@media (max-width: 820px) {
  .team-head { margin-bottom: 26px; }
  .team-grid { display: flex; gap: 16px; overflow-x: auto; margin-inline: calc(var(--pad) * -1); padding: 4px var(--pad) 18px; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); scrollbar-width: none; }
  .team-grid::-webkit-scrollbar { display: none; }
  .tm { flex: 0 0 72%; scroll-snap-align: start; }
  .team-grid .tm.reveal { opacity: 1; transform: none; }
  .tm-photo { margin-bottom: 14px; }
  .tm-name { font-size: 1.2rem; }
}

/* ---------- treatments ---------- */
.treat-head { margin-bottom: 48px; }
.treat-body { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.acc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.acc li { border-bottom: 1px solid var(--line); }
.acc-btn { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; text-align: left; padding: 26px 0; background: none; border: 0; color: var(--ink); cursor: pointer; }
.acc-n { font: 500 .85rem var(--font-d); color: var(--muted); }
.acc-t { font: 500 clamp(1.3rem, 2.3vw, 1.9rem)/1.15 var(--font-d); letter-spacing: -.02em; transition: color 200ms ease, transform 300ms var(--ease-out); }
.acc-btn i { font-size: 1.3rem; transition: transform 350ms var(--ease-out); }
.is-open .acc-btn i { transform: rotate(135deg); }
.is-open .acc-t { color: var(--blue-text); }
@media (hover: hover) and (pointer: fine) { .acc-btn:hover .acc-t { transform: translateX(6px); } }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 420ms var(--ease-out); }
.acc-panel > div { overflow: hidden; padding-left: 60px; }
.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel p { color: var(--muted); max-width: 32em; padding-bottom: 4px; opacity: 0; transform: translateY(6px); transition: opacity 300ms ease, transform 400ms var(--ease-out); }
.is-open .acc-panel p { opacity: 1; transform: none; transition-delay: 120ms; }
.acc-panel .link { margin-bottom: 26px; }
.treat-media { position: sticky; top: 100px; aspect-ratio: 4 / 3.4; border-radius: var(--r-card); overflow: hidden; background: var(--surface-2); }
.treat-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); filter: blur(4px); transition: opacity 500ms ease, transform 900ms var(--ease-out), filter 500ms ease; }
.treat-media img.on { opacity: 1; transform: none; filter: none; }
@media (max-width: 860px) { .treat-body { grid-template-columns: 1fr; } .treat-media { display: none; } .acc-panel > div { padding-left: 0; } }

/* ---------- gallery ---------- */
.gal-head { margin-bottom: 44px; }
.masonry { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(170px, 15vw, 250px); grid-auto-flow: dense; gap: 16px; }
.m { margin: 0; border-radius: var(--r-card); overflow: hidden; background: var(--surface-2); }
.m-b { grid-column: span 2; grid-row: span 2; }
.m-w { grid-column: span 2; }
.m-t { grid-row: span 2; }
.m-more { display: none; }
.masonry.gal-open .m-more { display: block; }
.gal-all { display: flex; margin: 28px auto 0; }
.gal-all[hidden] { display: none; }
.m img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .m:hover img { transform: scale(1.04); } }
@media (max-width: 860px) { .masonry { grid-template-columns: 1fr 1fr; grid-auto-rows: 42vw; gap: 10px; } .m-b { grid-row: span 1; } }

/* ---------- reviews: three-up grid on desktop, swipeable shelf on phones (pattern from villadivamontenegro.com, GMD fonts and colours) ---------- */
.rv-head { text-align: center; margin-bottom: 44px; }
.rv-head h2 { margin: 0 auto; max-width: 700px; }
.rv-source { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin: 18px 0 0; color: var(--muted); font-size: .95rem; }
.rv-stars { display: flex; gap: 3px; color: var(--coral); font-size: 1rem; }
.rv-link { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--coral); padding-bottom: 1px; }
.rv-mount { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; }
.rv-card blockquote { margin: 0; font: 400 .97rem/1.6 var(--font-b); color: var(--ink); }
.rv-card cite { font: normal 400 .82rem var(--font-b); color: var(--muted); margin-top: auto; }
@media (max-width: 820px) {
  .rv-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; text-align: left; margin-bottom: 26px; }
  .rv-head h2 { margin: 0; }
  .rv-source { margin: 0; justify-content: flex-start; font-size: .82rem; }
  .rv-source > span[aria-hidden="true"]:not(.rv-stars) { display: none; }
  .rv-mount { display: flex; gap: 16px; overflow-x: auto; margin-inline: calc(var(--pad) * -1); padding: 4px var(--pad) 18px; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); scrollbar-width: none; }
  .rv-mount::-webkit-scrollbar { display: none; }
  .rv-card { flex: 0 0 78%; scroll-snap-align: start; }
}

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-copy p { margin: 22px 0 32px; color: var(--muted); max-width: 26em; font-size: 1.1rem; }
.form { background: var(--surface); padding: clamp(24px, 4vw, 44px); border-radius: var(--r-card); display: grid; gap: 8px; box-shadow: var(--shadow); }
.form label { font: 500 .92rem var(--font-d); color: var(--ink); margin-top: 8px; }
.form input, .form textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--muted); border-radius: var(--r-input); padding: 14px 16px; transition: border-color 150ms ease, box-shadow 150ms ease; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 45%, transparent); }
.form textarea { resize: vertical; }
.form .btn { margin-top: 16px; justify-self: start; }
.reasons { border: 0; padding: 0; margin: 8px 0 0; min-width: 0; }
.reasons legend { font: 500 .92rem var(--font-d); color: var(--ink); padding: 0; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span { display: inline-block; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 500 .92rem var(--font-d); transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 140ms var(--ease-out); }
.chips label:active span { transform: scale(.96); }
.chips input:checked + span { background: var(--coral); border-color: var(--coral); color: var(--on-coral); }
.chips input:focus-visible + span { outline: 2px solid var(--coral); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .chips label:hover span { border-color: var(--muted); } }
.btn-wa { background: #25D366; color: #06301A; }
@media (hover: hover) and (pointer: fine) { .btn-wa:hover { background-color: #1FBE5C; translate: 0 -1px; box-shadow: 0 14px 28px -14px rgba(37, 211, 102, .6); } }
.form-err { color: var(--coral-text); font-size: .92rem; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* ---------- find us: a wide map that melts into the page, with a glass address panel ---------- */
.visit { max-width: 1480px; padding-top: clamp(24px, 4vw, 56px); }
.map-card { position: relative; width: 100%; aspect-ratio: 21 / 9; min-height: 460px; } /* width: 100% stops min-height widening the card past the page */
.map-fade { position: absolute; inset: 0; overflow: hidden; -webkit-mask-image: radial-gradient(ellipse 66% 64% at 50% 50%, #000 38%, transparent 100%); mask-image: radial-gradient(ellipse 66% 64% at 50% 50%, #000 38%, transparent 100%); }
.map-fade::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 62% 50%, rgba(241, 116, 90, .10), transparent 60%), linear-gradient(90deg, color-mix(in srgb, var(--g-mid) 70%, transparent), transparent 55%); pointer-events: none; }
.map-fade iframe { position: absolute; inset: -4% -2%; width: 104%; height: 108%; border: 0; pointer-events: none; filter: saturate(.7) contrast(.95); }
:root:not([data-theme="light"]) .map-fade iframe { filter: grayscale(1) invert(.92) contrast(.82) brightness(.85); }
.map-link { position: absolute; inset: 0; z-index: 2; border-radius: var(--r-card); }
.map-link:focus-visible { outline-offset: -6px; }
.map-pin { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -100%); font-size: 2.6rem; color: var(--coral); line-height: 1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); pointer-events: none; }
.map-pin::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--coral); opacity: 0; transform: scale(.4); animation: pin-pulse 2.8s var(--ease-out) infinite; }
@keyframes pin-pulse { 0% { opacity: .75; transform: scale(.4); } 100% { opacity: 0; transform: scale(4.2); } }
@media (prefers-reduced-motion: reduce) { .map-pin::after { animation: none; } }
.map-panel { position: absolute; z-index: 3; left: clamp(16px, 3vw, 40px); top: 50%; transform: translateY(-50%); width: min(400px, calc(100% - 32px)); padding: clamp(24px, 3vw, 36px); border-radius: var(--r-card); background: color-mix(in srgb, var(--g-mid) 72%, transparent); border: 1px solid var(--line); -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%); box-shadow: var(--shadow); }
@media (prefers-reduced-transparency: reduce) { .map-panel { background: var(--g-mid); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.map-panel h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.map-panel address { font-style: normal; display: grid; gap: 3px; margin: 20px 0 14px; color: var(--muted); font-size: .96rem; }
.map-tel { display: block; margin-bottom: 24px; text-decoration: none; font: 500 1.02rem var(--font-d); }
@media (max-width: 860px) {
  .map-card { aspect-ratio: auto; min-height: 0; display: grid; }
  .map-fade { position: relative; inset: auto; height: 300px; order: 2; margin-top: -40px; }
  .map-pin { left: 50%; top: 190px; }
  .map-link { top: auto; height: 300px; bottom: 0; }
  .map-panel { position: relative; left: auto; top: auto; transform: none; width: auto; order: 1; z-index: 4; }
}

/* ---------- section dividers: one faint blue hairline that fades out at both ends ---------- */
main > section + section::before { content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--blue) 34%, transparent) 50%, transparent); }
main > section.stats::before, main > section#reviews::before, main > section#treatments::before, main > section#clinic::before, main > section#contact::before, main > section#visit::before { display: none; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    main > section + section::before { animation: divider-line linear both; animation-timeline: view(); animation-range: entry 10% entry 70%; }
  }
}
@keyframes divider-line { from { opacity: 0; transform: scaleX(.3); } to { opacity: 1; transform: none; } }

/* ---------- language switch: the copy fades and un-blurs, in a gentle top-to-bottom ripple ---------- */
html.lang-anim :is([data-i18n],[data-i18n-html],.acc-t,.acc-panel p,.acc-panel .link,.rv-card blockquote,.map-panel address) { transition: opacity 240ms ease, filter 240ms ease; }
html.lang-out :is([data-i18n],[data-i18n-html],.acc-t,.acc-panel p,.acc-panel .link,.rv-card blockquote,.map-panel address) { opacity: 0; filter: blur(3px); }

/* safety net: if the page script ever fails, show everything after a few seconds */
.show-all:not(.gsap-on) .reveal { opacity: 1; transform: none; }
.show-all:not(.gsap-on) .ln > span { transform: none; }
.show-all:not(.gsap-on) .hero-media { clip-path: inset(0 0 0 0 round var(--r-card)); }
.show-all:not(.gsap-on) .hero-media img { transform: none; }

/* ---------- footer: brand, opening hours, contact, socials ---------- */
.foot { position: relative; max-width: var(--max); margin: 0 auto; padding: clamp(48px, 6vw, 80px) var(--pad) 36px; color: var(--muted); font-size: .96rem; }
.foot::before { content: ''; position: absolute; top: 0; left: var(--pad); right: var(--pad); height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.foot-grid { display: grid; grid-template-columns: 1fr .9fr 1.5fr .8fr; gap: clamp(28px, 4vw, 64px); }
.foot .logo { color: var(--ink); }
.foot-brand p { margin-top: 18px; max-width: 16em; }
.foot h3 { font: 500 .78rem var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-bottom: 18px; }
.hours { display: grid; gap: 14px; margin: 0; }
.hours dt { color: var(--ink); font-weight: 500; margin-bottom: 2px; }
.hours dd { margin: 0; }
.foot-list, .foot-social { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.foot-list a { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); transition: color 180ms ease; }
.foot-list a i { font-size: 1.25rem; color: var(--coral); }
.foot-social { grid-auto-flow: column; justify-content: start; gap: 12px; }
.foot-social a { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.3rem; color: var(--ink); text-decoration: none; transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out); }
.foot-social a:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) {
  .foot-list a:hover { color: var(--coral-text); }
  .foot-social a:hover { background: var(--coral); border-color: var(--coral); color: var(--on-coral); }
}
.foot-bar { margin-top: clamp(36px, 5vw, 64px); padding-top: 22px; border-top: 1px solid var(--line); font-size: .86rem; }
@media (max-width: 960px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- WhatsApp bubble: same design as villadivamontenegro.com (Phil, 6 Nov) ----------
   Green pill with a white glyph and a small capital label on desktop; a round icon on phones and
   portrait tablets. Slides off the right edge while the page scrolls (main.js adds .is-tucked)
   and comes back 400ms after scrolling stops. */
.wa-float { position: fixed; z-index: 55; right: clamp(16px, 2vw, 28px); bottom: clamp(16px, 2.5vh, 26px); display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px 13px 16px; border-radius: 999px; background: #25D366; color: #fff; text-decoration: none; font: 600 13px/1 var(--font-d); letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 10px 30px rgba(20, 22, 31, .28); transition: transform 160ms var(--ease-out), background-color 140ms ease; animation: wa-in 700ms var(--ease-out) 1.2s backwards; }
.wa-float .wa-glyph { width: 20px; height: 20px; display: block; flex: none; }
.wa-float:active { transform: scale(.97); }
.wa-float:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
@media (hover: hover) { .wa-float:hover { background: #1FBD59; transform: translateY(-2px); } }
.wa-float.is-tucked { transform: translateX(calc(100% + clamp(16px, 2vw, 28px) + 40px)); transition: transform 200ms ease, background-color 140ms ease; }
.wa-float.is-tucked:focus-visible { transform: none; }
@media (hover: hover) { .wa-float.is-tucked:hover { transform: none; } }
@keyframes wa-in { from { opacity: 0; transform: translateY(14px) scale(.9); } to { opacity: 1; transform: none; } }
/* while you are dogfooding, sit above the bug button so they never overlap */
:root:has(.dgf-pill, .dgf-pillbar) .wa-float { bottom: 92px; }
@media (max-width: 820px), (min-width: 821px) and (max-width: 1024px) and (orientation: portrait) {
  .wa-float { padding: 0; width: 56px; height: 56px; justify-content: center; gap: 0; }
  .wa-float .wa-text { display: none; }
  .wa-float .wa-glyph { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) { .wa-float, .wa-float.is-tucked { animation: none; transition: background-color 140ms ease; } }

/* ---------- reduced motion ---------- */
/* ---------- lightbox ---------- */
.hero-media, .b-img, .tm-photo, .m { cursor: zoom-in; }
.lb-lock { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 200; overflow: hidden; background: rgba(8, 11, 14, .93); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transition: opacity 220ms ease, visibility 0s linear 220ms; }
.lb.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.lb-fig { position: absolute; inset: 72px 88px; display: grid; place-items: center; }
.lb-fig img { grid-area: 1 / 1; max-width: 100%; max-height: 100%; width: auto; height: auto; min-height: 0; border-radius: var(--r-card); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); will-change: transform; }
.lb-count { position: absolute; left: 0; right: 0; bottom: 26px; margin: 0; text-align: center; color: rgba(241, 241, 238, .6); font: 500 .85rem var(--font-d); letter-spacing: .06em; pointer-events: none; }
.lb-x, .lb-nav { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); color: #F1F1EE; font-size: 1.35rem; cursor: pointer; transition: background-color 180ms ease, transform 160ms var(--ease-out), border-color 180ms ease; }
.lb-x { top: 20px; right: 20px; }
.lb-nav { top: 50%; margin-top: -26px; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-x:active, .lb-nav:active { transform: scale(.94); }
.lb-single .lb-nav, .lb-single .lb-count { display: none; }
@media (hover: hover) and (pointer: fine) { .lb-x:hover, .lb-nav:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .4); } }
.lb-x:focus-visible, .lb-nav:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
@media (max-width: 760px) {
  .lb-fig { inset: 76px 14px 104px; }
  .lb-nav { top: auto; bottom: 18px; margin-top: 0; }
  .lb-prev { left: calc(50% - 92px); }
  .lb-next { right: calc(50% - 92px); }
  .lb-count { bottom: 34px; }
}
@media (prefers-reduced-transparency: reduce) { .lb { background: #0B0D10; -webkit-backdrop-filter: none; backdrop-filter: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ln > span, .hero-media, .hero-media img, .reveal, .treat-media img, .acc-panel, .acc-panel p, .b-img img, .m img, .lb { transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .hero-media img { transform: none; }
  .reveal { transform: none; }
}


/* ---------- skip link (keyboard users) ---------- */
.skip { position: fixed; left: 16px; top: -64px; z-index: 300; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 500 .95rem var(--font-d); text-decoration: none; transition: top 160ms var(--ease-out); }
.skip:focus { top: 16px; }

/* ---------- bigger tap areas without moving anything ---------- */
.lang button::after { content: ''; position: absolute; inset: -9px 0; }
.link, .rv-link, .map-tel, .foot-list a { position: relative; }
.link::after, .rv-link::after, .map-tel::after, .foot-list a::after { content: ''; position: absolute; inset: -11px -4px; }
.map-tel { width: fit-content; }
.btn i.ph-whatsapp-logo { font-size: 1.2em; line-height: 1; margin-left: -2px; }

/* ---------- open now / closed (contact) ---------- */
.contact-copy .open-st { display: inline-flex; align-items: center; gap: 10px; margin: -14px 0 32px; padding: 9px 16px; max-width: none; border: 1px solid var(--line); border-radius: 999px; font: 500 .92rem/1.2 var(--font-d); color: var(--muted); }
.contact-copy .open-st[hidden] { display: none; }
.st-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--muted); }
.open-st.is-open { color: var(--ink); }
.open-st.is-open .st-dot { background: #25D366; box-shadow: 0 0 0 4px rgba(37, 211, 102, .2); }

/* ---------- lab film: vertical video beside four steps that light up in time with it ---------- */
.lab { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(36px, 7vw, 112px); align-items: center; }
/* The film sits in a phone: dark bezel (--bz), rounded body (--fr), camera pill, side buttons.
   A device, so it does not follow the 20px card radius. */
.lab-film { --bz: 10px; --fr: 52px; position: relative; height: min(80svh, 720px); aspect-ratio: 9 / 16.4; padding: var(--bz); border-radius: var(--fr); background: linear-gradient(150deg, #4A4B51 0%, #1B1C20 20%, #0C0D10 72%, #2C2D32 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 0 0 3px #08090B, 0 34px 64px -30px rgba(38, 38, 38, .6), 0 12px 26px -14px rgba(38, 38, 38, .35); }
.lab-film::before, .lab-film::after { content: ''; position: absolute; width: 3px; background: #1E1F23; pointer-events: none; }
.lab-film::before { left: -3px; top: 18%; height: 15%; border-radius: 2px 0 0 2px; background: linear-gradient(#1E1F23 0 43%, transparent 43% 57%, #1E1F23 57% 100%); }
.lab-film::after { right: -3px; top: 25%; height: 10%; border-radius: 0 2px 2px 0; }
.lab-film video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--fr) - var(--bz)); background: #0E0F14; }
.lab-island { position: absolute; top: calc(var(--bz) + 11px); left: 50%; width: 30%; height: 26px; transform: translateX(-50%); border-radius: 999px; background: #050506; pointer-events: none; }
.lab-ctrl { position: absolute; right: calc(var(--bz) + 12px); top: calc(var(--bz) + 48px); display: flex; gap: 8px; }
:root:not([data-theme="light"]) .lab-film { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 0 0 3px #08090B, 0 0 0 1px rgba(255, 255, 255, .08), 0 34px 64px -30px rgba(0, 0, 0, .8); }
.lab-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%; background: rgba(12, 14, 18, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-size: 1.1rem; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 200ms ease; }
.lab-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .lab-btn:hover { background: rgba(12, 14, 18, .78); } }
@media (prefers-reduced-transparency: reduce) { .lab-btn { background: #0E0F14; -webkit-backdrop-filter: none; backdrop-filter: none; } }
.lab-sub { margin-top: 22px; max-width: 30em; color: var(--muted); font-size: 1.1rem; }
.lab-steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 4px; max-width: 30em; }
.lab-steps button { position: relative; display: grid; gap: 3px; width: 100%; padding: 14px 0 14px 26px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lab-steps button::before, .ls-bar { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; }
.lab-steps button::before { background: var(--line); }
.ls-bar { background: var(--coral); transform: scaleY(0); transform-origin: top; }
.ls-t { font: 500 1.3rem/1.2 var(--font-d); letter-spacing: -.01em; color: var(--muted); transition: color 300ms ease; }
.ls-d { color: var(--muted); font-size: .98rem; opacity: .72; transition: opacity 300ms ease; }
.lab-steps li.is-on .ls-t { color: var(--ink); }
.lab-steps li.is-on .ls-d { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .lab-steps button:hover .ls-t { color: var(--ink); } }
@media (max-width: 860px) {
  .lab { grid-template-columns: 1fr; gap: 0; }
  .lab-copy { display: contents; }
  .lab-copy h2 { order: 1; }
  .lab-sub { order: 2; margin-top: 16px; font-size: 1rem; }
  .lab-film { --bz: 9px; --fr: 46px; order: 3; height: auto; width: min(100% - 8px, calc(70svh * 9 / 16.4)); margin: 32px auto 0; }
  .lab-ctrl { top: calc(var(--bz) + 42px); }
  .lab-island { height: 22px; top: calc(var(--bz) + 10px); }
  .lab-steps { order: 4; margin-top: 44px; max-width: none; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .lab-steps button { padding: 10px 0 10px 16px; }
  .lab-steps button::before, .ls-bar { top: 10px; bottom: 10px; }
  .ls-t { font-size: 1.05rem; }
  .ls-d { font-size: .86rem; line-height: 1.4; }
}

/* ---------- hero buttons: same width once they stack on phones ---------- */
@media (max-width: 560px) { .hero-cta { display: grid; grid-template-columns: max-content; } .hero-cta .btn { justify-content: center; min-height: 52px; } }
/* small phones: shrink the about heading so "equipped for whatever" stays on one line */
@media (max-width: 400px) { .about-title { font-size: min(2rem, 8.2vw); } }

/* ---------- lab film: the picture fades in when the phone scrolls into view (main.js adds .wait, then .on) ---------- */
.lab-film video { transition: opacity 1400ms var(--ease-out); }
.lab-film.wait:not(.on) video { opacity: 0; }

/* =====================================================================================
   MOTION LAYER (js/motion.js, GSAP). Everything from here applies only while that script
   is running: it puts "gsap-on" on <html>. Without it, the simple reveals above still work.
   GSAP writes the `transform` of what it moves, so hover and press effects in this block
   use the separate `scale` and `translate` properties. That way the two never fight.
   ===================================================================================== */
.pre:not(.show-all) .nav { opacity: 0; }                 /* the menu bar waits for its entrance */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: clip; }

.gsap-on .reveal, .gsap-on .ln > span, .gsap-on .hero-media, .gsap-on .roll .strip { transition: none; }
.gsap-on .hero-media img { transition: none; transform: none; }
.hm-in { height: 100%; }
/* a heading split into lines for its entrance: room for descenders and accents inside each line mask */
.sl-mask { padding: .1em 0 .16em; margin: -.1em 0 -.16em; }
.sl { will-change: transform; }

/* background pools as real layers, so they can drift (same colours and positions as body::after) */
.gsap-on body::after { display: none; }
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: linear-gradient(158deg, var(--lux-1) 0%, var(--lux-2) 48%, var(--lux-3) 100%); }
.bg-fx i { position: absolute; display: block; will-change: transform; }
.bg-fx .c { background: radial-gradient(closest-side, var(--lux-coral), transparent 65%); }
.bg-fx .b { background: radial-gradient(closest-side, var(--lux-blue), transparent 65%); }
.bg-fx .s { background: radial-gradient(closest-side, var(--lux-blue-soft), transparent 70%); }

/* stats: each divider is a line that draws downward */
@media (min-width: 761px) {
  .gsap-on .stat { position: relative; border-left-color: transparent; }
  .gsap-on .stat + .stat::before { content: ''; position: absolute; left: -1px; top: 40px; bottom: 40px; width: 1px; background: var(--line); transform: scaleY(var(--ln, 1)); transform-origin: top; }
}

/* photos: a little spare picture above and below, so it can drift inside its frame as the page scrolls */
.gsap-on .b-img img { inset: -5% 0; height: 110%; }
.gsap-on .m { position: relative; }
.gsap-on .m img { position: absolute; left: 0; top: -6%; height: 112%; }
.gsap-on .b-img img, .gsap-on .tm-photo img, .gsap-on .m img { transition: scale 900ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .gsap-on .b-img:hover img { transform: none; scale: 1.05; }
  .gsap-on .tm:hover .tm-photo img { transform: none; scale: 1.05; }
  .gsap-on .m:hover img { transform: none; scale: 1.05; }
}

/* treatments: the script wipes between photos, so the old cross-fade is off */
.gsap-on .treat-media img { opacity: 1; transform: none; filter: none; transition: none; }
.gsap-on .acc { transition: border-color 1200ms ease; }
.gsap-on .acc:not(.is-in) { border-top-color: transparent; }

/* review cards: lift a little, and the edge lights up under the pointer */
.gsap-on .rv-card { position: relative; transition: translate 500ms var(--ease-out), box-shadow 500ms var(--ease-out); }
.gsap-on .rv-card::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity 350ms ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--coral), transparent 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
@media (hover: hover) and (pointer: fine) {
  .gsap-on .rv-card:hover { translate: 0 -5px; box-shadow: var(--shadow); }
  .gsap-on .rv-card:hover::before { opacity: 1; }
}

/* menu bar: a line draws under the link you point at; the section on screen stays marked */
.gsap-on .nav-links a { position: relative; }
.gsap-on .nav-links a::before { content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 1px; background: var(--coral); transform: scaleX(0); transform-origin: right center; transition: transform 480ms var(--ease-out); }
.gsap-on .nav-links a.is-active { color: var(--ink); }
.gsap-on .nav-links a.is-active::before { transform: scaleX(1); transform-origin: left center; }
@media (hover: hover) and (pointer: fine) { .gsap-on .nav-links a:hover::before { transform: scaleX(1); transform-origin: left center; } }

/* lab film: a band of light crosses the glass once, as the phone turns to face you */
.lab-glare { position: absolute; inset: var(--bz); border-radius: calc(var(--fr) - var(--bz)); overflow: hidden; pointer-events: none; }
.lab-glare i { position: absolute; top: -20%; bottom: -20%; left: 0; width: 46%; display: block; transform-origin: center; rotate: 18deg; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22) 45%, rgba(255, 255, 255, .34) 50%, rgba(255, 255, 255, .22) 55%, transparent); }

/* photo viewer: settles into place as it opens, eases back as it closes */
.gsap-on .lb-fig img { transition: scale 320ms var(--ease-out); }
.gsap-on .lb:not(.is-open) .lb-fig img { scale: .96; }

/* opener: a curtain in the page colour with the clinic's mark, lifted by js/motion.js */
.opener { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: var(--lux-base); will-change: transform; }
.opener .op-in { display: grid; justify-items: center; gap: 26px; }
.opener img { width: auto; height: 68px; }
.op-bar { display: block; width: 132px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.op-bar i { display: block; height: 100%; background: var(--coral); }

/* pointing at one photo quiets its neighbours */
@media (hover: hover) and (pointer: fine) {
  .gsap-on .m img, .gsap-on .tm-photo img { transition: scale 900ms var(--ease-out), opacity 500ms ease; }
  .gsap-on .masonry:has(.m:hover) .m:not(:hover) img { opacity: .58; }
  .gsap-on .team-grid:has(.tm:hover) .tm:not(:hover) .tm-photo img { opacity: .74; }
}

/* form chips: a small spring when picked. Open-now dot: a slow pulse (it is a live state) */
@media (prefers-reduced-motion: no-preference) {
  .gsap-on .chips input:checked + span { animation: chip-pop 420ms var(--ease-out); }
  .gsap-on .open-st.is-open .st-dot { animation: st-pulse 2.4s ease-out infinite; }
}
@keyframes chip-pop { 0% { scale: .9; } 55% { scale: 1.05; } 100% { scale: 1; } }
@keyframes st-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); } 100% { box-shadow: 0 0 0 9px rgba(37, 211, 102, 0); } }

/* ---------- light / dark switch ----------
   A round button in the menu bar (desktop) and a row in the phone menu. Hidden until the head script has set data-scheme. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-scheme="dark"] .to-dark, [data-scheme="light"] .to-light { display: none; }
.theme-btn, .nav-theme { display: none; }
.theme-btn { position: relative; flex: none; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.1rem; line-height: 1; cursor: pointer; transition: background-color 520ms ease, border-color 520ms ease, scale 160ms var(--ease-out); }
[data-scheme] .theme-btn { display: grid; place-items: center; }
.theme-btn:focus-visible { border-radius: 50%; }
.theme-btn:active { scale: .94; }
.js-theme i { grid-area: 1 / 1; display: block; transition: opacity 240ms ease, rotate 460ms var(--ease-out), scale 460ms var(--ease-out), filter 240ms ease; }
[data-scheme="light"] .js-theme .ph-sun, [data-scheme="dark"] .js-theme .ph-moon { opacity: 0; rotate: -70deg; scale: .6; filter: blur(2px); }
@media (hover: hover) and (pointer: fine) {
  .theme-btn:hover { transition-duration: 280ms, 280ms, 160ms; border-color: color-mix(in srgb, var(--ink) 55%, transparent); background-color: color-mix(in srgb, var(--ink) 6%, transparent); }
}
@media (max-width: 820px) {
  .nav .nav-right .theme-btn { display: none; }
  [data-scheme] .nav-menu .nav-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-radius: 18px; background: transparent; color: var(--ink); font: 500 1.05rem var(--font-d); text-align: left; cursor: pointer; }
  .nav-menu .nav-theme:active { background: var(--line); }
  .nav-theme .nt-ic { display: grid; place-items: center; font-size: 1.3rem; color: var(--muted); }
}
/* the change itself: one soft cross-fade of the whole page */
.theme-vt::view-transition-old(root), .theme-vt::view-transition-new(root) { animation-duration: 420ms; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
@media (prefers-reduced-motion: reduce) { .theme-btn, .js-theme i { transition: none; } }
