/* ==========================================================================
   Dra. Patricia Segura López — "Ink & Pulse" design system
   Tokens → base → components → sections → motion → responsive
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("fonts/pinyon-script.woff2") format("woff2"); font-display: block; } /* a fallback script looks like a different name: wait for the real one */

/* ---------- Tokens ---------- */
:root {
  /* brand */
  --brand-500: #2b3486;
  --brand-700: #1c2160;
  --brand-900: #0b0e2a;
  --accent: #4450c8;          /* periwinkle ink, readable on paper */
  --accent-2: #a2742a;        /* warm gold, used sparingly */
  --accent-on-dark: #8b95ff;  /* the same accents, tuned for the navy band */
  --accent-2-on-dark: #e8c98a;

  /* type */
  --font-display: "Source Serif 4", "Georgia", serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-script: "Pinyon Script", cursive;
  --fs-xs: .86rem;
  --fs-sm: 1rem;
  --fs-md: 1.15rem;
  --fs-lg: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --fs-display-sm: clamp(1.8rem, 1.3rem + 1.8vw, 2.7rem);
  --fs-display: clamp(2.5rem, 1.6rem + 3.4vw, 4.6rem);
  --fs-display-xl: clamp(2.8rem, 1.6rem + 5vw, 6rem);
  --fs-hero: min(clamp(2.4rem, 1.4rem + 3.2vw, 4.4rem), 6.6svh);

  /* spacing & shape */
  --space-1: .5rem; --space-2: 1rem; --space-3: 1.5rem; --space-4: 2.5rem; --space-5: 4rem; --space-6: 6rem; --space-7: 9rem;
  --container: 76rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius-sm: .6rem; --radius-md: 1.1rem; --radius-lg: 1.8rem; --radius-pill: 999px;

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-fast: .35s; --dur: .7s; --dur-slow: 1.1s;
  --beat: 3.4s; /* ~70 bpm, shared by every pulsing element */
}

/* surface palette: paper */
:root {
  color-scheme: light;
  --bg: #f6f6fb;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-strong: #eef0fb;
  --border: rgba(27, 33, 96, .2);
  --text: #141736;
  --text-2: #343a66;
  --text-3: #545a82;
  --ink: var(--brand-500);
  --on-ink: #ffffff;
  --glow: rgba(43, 52, 134, .35);
  --shadow: 0 24px 60px -28px rgba(27, 33, 96, .45), 0 2px 6px rgba(27, 33, 96, .06);
  --mesh-a: #b9c0ff; --mesh-b: #e4d2ff; --mesh-c: #bfe0ff;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* Section paging: on mouse/trackpad, app.js animates one section per gesture (.has-paging).
   Touch keeps native scroll with a gentle "proximity" snap so a swipe is never fought. */
html:not(.has-paging) { scroll-snap-type: y proximity; }
.hero, .about, .intro, .services, .feature, .gallery, .clinic, .cta { scroll-snap-align: start; }
.footer { scroll-snap-align: end; }
.has-paging, .has-paging body { scroll-behavior: auto; }

/* side dots */
.pager { position: fixed; right: 1.4rem; top: 50%; z-index: 45; display: none; flex-direction: column; gap: .9rem; transform: translateY(-50%); --dot: var(--text); }
.has-paging .pager { display: flex; }
.pager.is-on-dark { --dot: #eef0fb; }
.pager__dot { position: relative; width: .6rem; height: .6rem; padding: 0; border: 0; border-radius: var(--radius-pill); background: var(--dot); opacity: .45; cursor: pointer; transition: height var(--dur) var(--ease-out), opacity var(--dur-fast), background var(--dur-fast); }
.pager__dot::before { content: ""; position: absolute; inset: -.6rem; } /* bigger hit area */
.pager__dot:hover { opacity: .7; }
.pager__dot.is-active { height: 1.8rem; opacity: 1; background: var(--accent); }
.pager.is-on-dark .pager__dot.is-active { background: var(--accent-on-dark); }
.pager__label { position: absolute; right: 1.4rem; top: 50%; transform: translate(.4rem, -50%); white-space: nowrap; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; color: var(--dot); opacity: 0; pointer-events: none; transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.pager__dot:hover .pager__label, .pager__dot:focus-visible .pager__label { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 1100px) { .has-paging .pager { display: none; } }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, dl, dd, figure, address { margin: 0; }
address { font-style: normal; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; } /* sections focused by in-page links */
.skip { position: fixed; left: 1rem; top: -4rem; z-index: 60; padding: .7rem 1.1rem; border-radius: var(--radius-sm); background: var(--ink); color: var(--on-ink); font-weight: 600; }
.skip:focus { top: 1rem; }
.sprite { position: absolute; width: 0; height: 0; }
.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* grain: a fixed noise layer over everything */
.grain { position: fixed; inset: -50%; z-index: 60; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-4%)} 60%{transform:translate(-4%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

/* reading progress */
.progress { position: fixed; inset: 0 0 auto 0; z-index: 55; height: 2px; pointer-events: none; }
.progress__bar { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transform: scaleX(0); }


/* ---------- Typography ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: .6rem; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--space-2); }
.eyebrow__beat, .eyebrow svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow--light { color: var(--accent-2); }
.display { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-display); line-height: 1.05; letter-spacing: -.015em; text-wrap: balance; }
.display--xl { font-size: var(--fs-display-xl); }
.display--sm { font-size: var(--fs-display-sm); }
.display em, .hero__title em { font-style: italic; font-weight: 400; color: var(--accent); }
.lead { font-size: var(--fs-lg); line-height: 1.55; color: var(--text-2); max-width: 36rem; }
.signature { font-family: var(--font-script); font-weight: 400; line-height: 1; color: var(--text); }
.signature--sm { font-size: 2.2rem; }
.link { color: var(--accent); background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 100% 1px; transition: background-size var(--dur-fast) var(--ease-out); }
.link:hover { background-size: 0 1px; }

/* split text: each word is wrapped by app.js; the inner span slides up */
[data-split] .word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
[data-split] .word__inner { display: inline-block; transform: translateY(110%); transition: transform var(--dur-slow) var(--ease-out); transition-delay: calc(var(--i) * 45ms + var(--d, 0s)); }
[data-split].is-visible .word__inner { transform: none; }

/* ---------- Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; gap: .7rem; padding: .95rem 1.6rem; border-radius: var(--radius-pill); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .01em; border: 1px solid var(--border); background: var(--surface); color: var(--text); isolation: isolate; overflow: hidden; transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast); will-change: transform; }
.btn__icon { width: 1.15rem; height: 1.15rem; fill: currentColor; flex: none; }
.btn--ghost .btn__icon[href], .btn--ghost svg use[href="#arrow"] { fill: none; }
.btn--ghost svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--ghost svg use[href="#phone"] { fill: currentColor; stroke: none; }
.btn--ghost:hover { background: var(--surface-strong); border-color: var(--accent); }
.btn--primary { background: var(--ink); color: var(--on-ink); border-color: transparent; box-shadow: 0 10px 40px -10px var(--glow); }
.btn--primary::after { /* sheen that follows the cursor */ content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .35), transparent 60%); opacity: 0; transition: opacity var(--dur-fast); }
.btn--primary:hover::after { opacity: 1; }
.btn--xl { padding: 1.2rem 2.1rem; font-size: var(--fs-md); }
.btn--xl .btn__icon { width: 1.4rem; height: 1.4rem; }
.btn:active { transform: scale(.97); }

/* pulse rings timed to the heartbeat */
.pulse::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 2px solid var(--ink); animation: ring var(--beat) ease-out infinite; z-index: -2; }
@keyframes ring { 0%, 18% { opacity: .8; transform: scale(1); } 60%, 100% { opacity: 0; transform: scale(1.3, 1.8); } }

/* glass surface */
.glass { background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* 3D tilt + cursor glow */
.tilt { transform-style: preserve-3d; transition: transform var(--dur-fast) var(--ease-out); will-change: transform; }
.tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%); opacity: 0; transition: opacity var(--dur-fast); mix-blend-mode: soft-light; }
.tilt:hover::after { opacity: 1; }

/* ECG dividers that draw themselves */
.divider { display: block; width: 100%; height: 4rem; overflow: visible; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-draw] use { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2s var(--ease-out); }
[data-draw].is-visible use { stroke-dashoffset: 0; }

/* blobs for mesh backgrounds */
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .7; will-change: transform; animation: drift 18s var(--ease-in-out) infinite alternate; }
.blob--1 { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: var(--mesh-a); }
.blob--2 { width: 40vw; height: 40vw; right: -8vw; top: 6vw; background: var(--mesh-b); animation-delay: -6s; animation-duration: 22s; }
.blob--3 { width: 34vw; height: 34vw; left: 30vw; bottom: -18vw; background: var(--mesh-c); animation-delay: -12s; animation-duration: 26s; }
.blob--4 { width: 50vw; height: 50vw; left: -20vw; top: 10%; background: var(--mesh-b); opacity: .45; }
.blob--5 { width: 40vw; height: 40vw; right: -15vw; bottom: 0; background: var(--mesh-c); opacity: .4; animation-delay: -9s; }
.blob--6 { width: 60vw; height: 30vw; left: 20vw; top: 20%; background: var(--mesh-a); opacity: .5; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(6vw, -4vw, 0) scale(1.15); } }

/* ---------- Nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; padding: 1rem 0; transition: padding var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast), transform var(--dur) var(--ease-out); border-bottom: 1px solid transparent; }
.nav.is-scrolled { padding: .45rem 0; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-color: var(--border); }
.nav.is-hidden { transform: translateY(-110%); }
.nav__inner { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.nav__brand { display: flex; align-items: center; gap: .8rem; }
.nav__logo { height: 2.3rem; width: auto; animation: heartbeat var(--beat) ease-in-out infinite; transform-origin: 50% 40%; }
.feature__watermark { filter: brightness(0) invert(1); }
.nav__name { font-family: var(--font-script); font-size: 1.6rem; font-weight: 400; line-height: 1; }
.nav__links { display: flex; gap: 1.8rem; }
.nav__link { position: relative; font-size: var(--fs-sm); font-weight: 600; color: var(--text); padding: .5rem 0; overflow: hidden; }
.nav__link span { display: inline-block; transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast); }
.nav__link::after { content: ""; position: absolute; left: 0; bottom: .25rem; height: 1px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform var(--dur-fast) var(--ease-out); }
.nav__link:hover span { color: var(--text); transform: translateY(-2px); }
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__actions { display: flex; align-items: center; gap: .8rem; }
.nav__phone { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--accent); }
.nav__phone svg { width: 1rem; height: 1rem; fill: currentColor; }
@keyframes heartbeat { 0%, 36%, 100% { transform: scale(1); } 8% { transform: scale(1.12); } 16% { transform: scale(1); } 24% { transform: scale(1.08); } }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 5.5rem 0 3rem; overflow: hidden; isolation: isolate; }
.hero__mesh { position: absolute; inset: 0; z-index: -2; }
.hero__grid { position: absolute; inset: 0; z-index: -1; opacity: .55; pointer-events: none;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 4rem 4rem; mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 70%); }
.hero__backdrop-ecg { position: absolute; z-index: -1; left: 0; top: 67%; width: 100%; height: auto; transform: translateY(-50%); color: var(--accent); overflow: visible; pointer-events: none; }
/* two-column hero: keep the trace faint behind the copy so the phone number stays clean */
@media (min-width: 1025px) {
  .hero__backdrop-ecg { -webkit-mask-image: linear-gradient(90deg, #000 0, rgba(0,0,0,.28) 7%, rgba(0,0,0,.28) 46%, #000 53%); mask-image: linear-gradient(90deg, #000 0, rgba(0,0,0,.28) 7%, rgba(0,0,0,.28) 46%, #000 53%); }
}
.hero__inner { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: center; }
.hero__eyebrow { margin-bottom: var(--space-2); }
.hero__title { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-hero); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; }
.hero__lead { margin-top: var(--space-2); font-size: var(--fs-md); color: var(--text-2); max-width: 36rem; }
.hero__cta { margin-top: var(--space-3); }
.phone { display: grid; justify-items: start; gap: .35rem; }
.phone--center { justify-items: center; }
.phone__label { display: inline-flex; align-items: center; gap: .6rem; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.phone__live { position: relative; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }
.phone__live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: live var(--beat) ease-out infinite; }
@keyframes live { 0%, 15% { transform: scale(1); opacity: .7; } 60%, 100% { transform: scale(3.2); opacity: 0; } }
.phone__number { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 1.4rem + 1.4vw, 2.7rem); line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--accent); cursor: text; user-select: all; }
.phone__number--xl { font-size: clamp(2.8rem, 2rem + 3.4vw, 5rem); }
.phone__note { font-size: var(--fs-sm); color: var(--text-3); }
.phone__button { display: none; margin: .4rem 0; }
.link:not([href]) { background: none; color: inherit; font-weight: 600; } /* a phone number on a computer: text, not a link */
.tel { color: inherit; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (hover: none), (pointer: coarse) {
  .phone__number { display: none; }
  .phone__button { display: inline-flex; }
}
.stats { margin-top: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.stat { min-width: 0; max-width: 11rem; display: flex; flex-direction: column; justify-content: space-between; } /* figures share a baseline */
@media (min-width: 721px) { .stats { flex-wrap: nowrap; } } /* three figures always on one row on desktop */
.stat dt { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; line-height: 1.35; text-transform: uppercase; color: var(--text-2); }
.stat dd { font-family: var(--font-display); font-size: 1.9rem; color: var(--brand-500); line-height: 1.1; margin-top: .2rem; font-variant-numeric: tabular-nums; }

.hero__visual { position: relative; }
.frame { position: relative; z-index: 1; width: min(100%, 30rem, (100svh - 10rem) * .8); margin-inline: auto; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: visible; }
.frame__glow { position: absolute; inset: -12%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); filter: blur(30px); opacity: .8; animation: breathe var(--beat) ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .6; } 10% { transform: scale(1.06); opacity: .9; } 20% { transform: scale(1); } 30% { transform: scale(1.04); opacity: .8; } }
.frame__photos { position: relative; height: 100%; border-radius: inherit; overflow: hidden; box-shadow: var(--shadow), inset 0 0 0 1px var(--border); transform: translateZ(30px); }
.frame__photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: crossfade 18s linear infinite; }
.frame__photos img:nth-child(1) { animation-delay: -1.2s; }
.frame__photos img:nth-child(2) { animation-delay: 4.8s; }
.frame__photos img:nth-child(3) { animation-delay: 10.8s; }
@keyframes crossfade { 0% { opacity: 0; transform: scale(1.06); } 6.67%, 33.33% { opacity: 1; } 40%, 100% { opacity: 0; transform: scale(1); } }
.frame__badge { position: absolute; left: -2rem; bottom: 2rem; display: flex; align-items: center; gap: .8rem; padding: .8rem 1.1rem .8rem .9rem; border-radius: var(--radius-md); font-size: var(--fs-xs); line-height: 1.35; color: var(--text-2); background: color-mix(in srgb, var(--bg) 78%, transparent); transform: translateZ(60px); }
.frame__badge img { height: 2rem; width: auto; }
.frame__badge strong { display: block; font-size: var(--fs-sm); color: var(--text); }
.frame__badge .frame__name { font-family: var(--font-script); font-weight: 400; font-size: 1.7rem; line-height: 1.1; color: var(--brand-700); margin-bottom: .1rem; }

.scroll-hint { position: absolute; left: 50%; bottom: 2rem; transform: translateX(-50%); width: 1px; height: 4rem; overflow: hidden; }
.scroll-hint__line { display: block; width: 100%; height: 100%; background: linear-gradient(var(--accent), transparent); animation: hint 2.2s var(--ease-in-out) infinite; }
@keyframes hint { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* ---------- About ---------- */
.about { padding: var(--space-7) 0; }
.about__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--space-6); align-items: start; }
.about__sticky { position: sticky; top: 7rem; }

/* beating heart under the about title */
.heart { position: relative; width: min(100%, 15rem); margin: var(--space-5) 0 0 var(--space-2); }
.heart__svg { position: relative; z-index: 1; display: block; width: 100%; overflow: visible; transform-origin: 50% 55%; filter: drop-shadow(0 22px 34px var(--glow)); animation: heartbeat var(--beat) ease-in-out infinite; }
.heart__shape { fill: url(#heart-fill); }
.heart__shine { fill: url(#heart-shine); }
.heart__trace { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.heart__trace--base { stroke-opacity: .28; }
.heart__trace--sweep { stroke-dasharray: .35 1; stroke-dashoffset: .35; animation: sweep var(--beat) var(--ease-in-out) infinite; filter: drop-shadow(0 0 6px #fff); }
@keyframes sweep { 0% { stroke-dashoffset: .35; } 45%, 100% { stroke-dashoffset: -1; } }
.heart__ripple { position: absolute; left: 50%; top: 48%; width: 78%; aspect-ratio: 1; border: 1.5px solid var(--accent); border-radius: 50%; opacity: 0; transform: translate(-50%, -50%) scale(.7); animation: ripple var(--beat) var(--ease-out) infinite; }
.heart__ripple--late { animation-delay: .27s; }
@keyframes ripple { 0%, 4% { opacity: .45; transform: translate(-50%, -50%) scale(.75); } 55%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); } }
.about__content { display: grid; gap: var(--space-4); }
.ticket { display: grid; overflow: hidden; }
.ticket__row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title id" "meta id"; align-items: center; column-gap: 1rem; padding: 1.1rem 1.4rem; border-top: 1px solid var(--border); transition: background var(--dur-fast); }
.ticket__row:first-child { border-top: 0; }
.ticket__row:hover { background: var(--surface-strong); }
.ticket__title { grid-area: title; font-weight: 600; }
.ticket__meta { grid-area: meta; font-size: var(--fs-sm); color: var(--text-2); }
.ticket__id { grid-area: id; font-size: var(--fs-xs); letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--text-2); padding: .3rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-pill); }
.about__photo { width: min(100%, 22rem); margin-left: auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transform: rotate(2deg); }
.about__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* ---------- Intro ---------- */
.intro { padding: 0 0 var(--space-7); }
.intro .divider { margin-bottom: var(--space-6); }
.intro__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--space-6); align-items: start; }
.intro__head .lead { margin-top: var(--space-3); }
.intro__sub { font-family: var(--font-display); font-size: var(--fs-display-sm); margin-bottom: var(--space-2); }
.checklist li { display: flex; gap: .9rem; padding: 1rem 0; border-top: 1px solid var(--border); font-size: var(--fs-lg); line-height: 1.45; }
.checklist li:last-child { border-bottom: 1px solid var(--border); }
.checklist svg { flex: none; width: 1.4rem; height: 1.4rem; margin-top: .25rem; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.checklist--light svg { stroke: var(--accent-2); }

/* ---------- Services: bento ---------- */
.services { padding: 0 0 var(--space-7); }
.services__head { display: grid; gap: var(--space-2); margin-bottom: var(--space-5); max-width: 46rem; }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.bento__item { position: relative; padding: 1.8rem; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-height: 16rem; display: flex; flex-direction: column; gap: .6rem; overflow: hidden; }
.bento__item--wide { grid-column: span 2; background: linear-gradient(135deg, var(--surface-strong), var(--surface)); }
.bento__item h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; color: var(--brand-700); line-height: 1.1; letter-spacing: -.01em; margin-top: auto; }
.bento__item p { font-size: var(--fs-sm); color: var(--text-2); }
.bento__icon { width: 3.2rem; height: 3.2rem; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease-out) .2s, transform var(--dur-fast) var(--ease-out); }
.is-visible .bento__icon { stroke-dashoffset: 0; }
.bento__item:hover .bento__icon { transform: translateY(-4px) rotate(-4deg); }
.bento__link { display: flex; flex-direction: column; gap: .6rem; height: 100%; }
.bento__more { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--accent); margin-top: .4rem; }
.bento__more svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-fast) var(--ease-out); }
.bento__item:hover .bento__more svg { transform: translateX(5px); }

/* ---------- Feature band ---------- */
.feature { position: relative; padding: var(--space-7) 0; background: var(--brand-900); color: #eef0fb; overflow: hidden; isolation: isolate; --accent: var(--accent-on-dark); --accent-2: var(--accent-2-on-dark); --glow: rgba(139, 149, 255, .5); --text: #eef0fb; --text-2: rgba(238, 240, 251, .9); --border: rgba(255, 255, 255, .22); --surface: rgba(255, 255, 255, .08); --surface-strong: rgba(255, 255, 255, .14); }
.feature { --mesh-b: #7a3fd0; --mesh-c: #1b6fb8; }
.feature__mesh { position: absolute; inset: 0; z-index: -1; }
.feature__watermark { position: absolute; right: -6%; top: 8%; height: 46rem; width: auto; opacity: .06; pointer-events: none; z-index: -1; }
.feature__item { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--space-6); align-items: center; }
.feature__item + .feature__item { margin-top: var(--space-7); }
.feature__item--reverse .feature__body { order: 2; }
.feature__body .lead { margin: var(--space-3) 0; }
.feature__media { border-radius: var(--radius-lg); overflow: hidden; padding: .6rem; transform: rotate(-1.5deg); }
.feature__item--reverse .feature__media { transform: rotate(1.5deg); }
.feature__media img { border-radius: calc(var(--radius-lg) - .6rem); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* ---------- Gallery: pinned horizontal ---------- */
.gallery { position: relative; height: 230vh; }
.gallery__pin { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: var(--space-4); }
.gallery__head { display: grid; gap: var(--space-2); }
.gallery__track { display: flex; gap: 1.5rem; padding-left: max(var(--gutter), (100vw - var(--container)) / 2); will-change: transform; }
.gallery__card { position: relative; flex: none; width: min(42vw, 40rem); aspect-ratio: 3 / 2; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.gallery__card img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.2s var(--ease-out); }
.gallery__card:hover img { transform: scale(1); }
.gallery__card figcaption { position: absolute; left: 1.4rem; bottom: 1.2rem; padding: .5rem .9rem; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(10px); font-size: var(--fs-sm); font-weight: 600; }

/* ---------- Clinic ---------- */
.clinic { padding: var(--space-6) 0 var(--space-7); }
.clinic .divider { margin-bottom: var(--space-6); }
.clinic__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: var(--space-4); align-items: stretch; }
.clinic__info { padding: var(--space-4); display: grid; gap: var(--space-3); align-content: start; }
.clinic__info address { color: var(--text-2); font-size: var(--fs-lg); }
.hours { display: grid; }
.hours > div { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--border); }
.hours dt { color: var(--text-2); }
.hours dd { font-weight: 600; }
.clinic__map { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); min-height: 24rem; }
.clinic__map iframe { width: 100%; height: 100%; min-height: 24rem; border: 0; display: block; }
/* with paging on, the map ignores the pointer until clicked, so the wheel keeps paging the site */
.has-paging .clinic__map { cursor: pointer; }
.has-paging .clinic__map:not(.is-active) iframe { pointer-events: none; }
.has-paging .clinic__map::after { content: "Haz clic para mover el mapa"; position: absolute; left: 50%; bottom: 1rem; transform: translate(-50%, .4rem); padding: .45rem .9rem; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.has-paging .clinic__map:not(.is-active):hover::after { opacity: 1; transform: translate(-50%, 0); }

/* ---------- CTA ---------- */
/* CTA + footer share the last screen, so both scale with its height (like the hero) */
.cta { position: relative; padding: min(var(--space-7), 7svh) 0 min(var(--space-7), 5svh); overflow: hidden; isolation: isolate; text-align: center; }
.cta__mesh { position: absolute; inset: 0; z-index: -1; }
.cta__inner { display: grid; justify-items: center; gap: min(var(--space-3), 2.4svh); }
.cta .display--xl { font-size: min(var(--fs-display-xl), 9svh); }
.cta .phone__number--xl { font-size: min(clamp(2.8rem, 2rem + 3.4vw, 5rem), 7.5svh); }

/* ---------- Legal (aviso de privacidad) ---------- */
.legal { padding: 9rem 0 var(--space-6); }
.legal__inner { max-width: 46rem; }
.legal__updated { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--text-3); }
.legal__intro { margin-top: var(--space-3); }
.legal section { margin-top: var(--space-5); }
.legal h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); line-height: 1.25; color: var(--brand-700); margin-bottom: var(--space-2); }
.legal p + p, .legal p + ul, .legal ul + p { margin-top: var(--space-2); }
.legal ul { display: grid; gap: .5rem; }
.legal li { position: relative; padding-left: 1.4rem; color: var(--text-2); }
.legal li::before { content: ""; position: absolute; left: 0; top: .75em; width: .55rem; height: 1px; background: var(--accent); }
.legal strong { color: var(--text); }
.legal p { color: var(--text-2); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: min(var(--space-6), 5svh) 0 min(var(--space-4), 3svh); font-size: var(--fs-sm); color: var(--text-2); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--space-4); }
.footer__brand p { margin-top: .4rem; }
.footer__ids { color: var(--text-3); }
.footer h3 { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-500); margin-bottom: .6rem; }
.footer__bottom { margin-top: min(var(--space-5), 3svh); display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--space-3); color: var(--text-3); }
.footer__ecg { height: 2.2rem; width: 100%; fill: none; stroke: var(--border); stroke-width: 2; }
.footer__logo { height: 2.4rem; width: auto; opacity: .7; }

/* mobile call bar */
.callbar { position: fixed; inset: auto 0 0 0; z-index: 50; display: none; align-items: center; justify-content: center; gap: .6rem; padding: 1rem; background: var(--ink); color: var(--on-ink); font-weight: 600; }
.callbar svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }

/* ---------- Motion: intro + scroll reveals ---------- */
[data-intro] { opacity: 0; transform: translateY(26px); animation: rise var(--dur-slow) var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }
.js [data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js [data-parallax] { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion, .pulse::before, .phone__live::after, .scroll-hint, .grain { display: none; }
  .blob, .nav__logo, .frame__glow, .frame__photos img, [data-intro], .heart__svg { animation: none; }
  .heart__ripple, .heart__trace--sweep { display: none; }
  .frame__photos img:first-child { opacity: 1; }
  [data-intro], .js [data-reveal], [data-split] .word__inner { opacity: 1; transform: none; transition: none; }
  [data-draw] use, .bento__icon { stroke-dashoffset: 0; transition: none; }
  .tilt { transform: none !important; }
  .gallery { height: auto; }
  .gallery__pin { position: static; height: auto; overflow-x: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero__inner, .about__grid, .intro__grid, .feature__item, .clinic__grid { grid-template-columns: 1fr; }
  .feature__item--reverse .feature__body { order: 0; }
  .about__sticky { position: static; }
  .heart { display: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento__item--wide { grid-column: span 2; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav__links, .nav__phone { display: none; }
  .nav__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* still names the logo link */
  .hero { padding-top: 6rem; }
  .hero__visual { order: -1; }
  .hero__backdrop-ecg { top: 33%; } /* behind the photo, not the title */
  .frame { width: min(100%, 24rem); }
  .frame__badge { left: .8rem; bottom: .8rem; }
  .stats { gap: var(--space-3); }
  .stat dd { font-size: 1.7rem; }
  .bento { grid-template-columns: 1fr; }
  .bento__item, .bento__item--wide { grid-column: auto; min-height: 0; }
  .about__photo { margin-left: 0; }
  .gallery { height: auto; }
  .gallery__pin { position: static; height: auto; }
  .gallery__track { overflow-x: auto; scroll-snap-type: x mandatory; padding-right: var(--gutter); -webkit-overflow-scrolling: touch; transform: none !important; }
  .gallery__card { width: 82vw; scroll-snap-align: start; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { grid-template-columns: 1fr; justify-items: start; }
  .callbar { display: flex; }
  body { padding-bottom: 3.6rem; }
}
