/* ==========================================================
   Hidro & Fisioterapia El Viñedo
   Sistema visual tomado de DESIGN.md (Function) y adaptado:
   superficies en capas, UN solo acento (azul petróleo de su Instagram),
   DM Serif Display (romana + itálica) para titulares, Manrope para todo lo demás,
   botones píldora de 40px, tarjetas de 24px. Mobile first.
   ========================================================== */
:root {
  /* Superficies */
  --canvas: #F4F8F9;       /* fondo de página (equivale a Parchment) */
  --surface: #E6F0F2;      /* tarjetas y paneles (Aged Paper) */
  --hairline: #CBDADF;     /* líneas y bordes (Warm Taupe) */
  /* Texto */
  --ink: #12263A;
  --charcoal: #2C3E50;
  --graphite: #4D6070;
  --ash: #7F8E97;          /* solo formularios */
  /* Acento único */
  --accent: #1D7B9E;
  --accent-grad: linear-gradient(116deg, #1D7B9E, #8FC3D3);
  --accent-ring: rgba(29, 123, 158, .22);

  --serif: "DM Serif Display", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  --track: -.023em;        /* solo para Manrope */

  --r-card: 24px;
  --r-btn: 40px;
  --shadow-xl: rgba(18, 38, 58, .1) 12px 32px 80px 0;
  --shadow-lg: rgba(0, 0, 0, .15) 0 0 20px 0;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(20px, 4vw, 40px);
  --section: clamp(64px, 9vw, 96px);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; letter-spacing: var(--track); color: var(--charcoal); background: var(--canvas); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
svg { width: 1em; height: 1em; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--accent); color: #fff; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 20px; }
.skip:focus { left: 8px; }
.wrap { width: min(1280px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Tipografía ---------- */
.h2 { font-family: var(--serif); font-weight: 400; letter-spacing: normal; color: var(--ink); font-size: clamp(34px, 5vw, 56px); line-height: 1.08; max-width: 18ch; }
.hero__title em { font-style: italic; }
.h2 em, h3 em { font-style: normal; }   /* fuera del hero, los títulos van en un solo estilo */
.eyebrow { font-family: var(--serif); font-size: 21px; font-weight: 400; letter-spacing: normal; line-height: 1.2; color: var(--accent); margin-bottom: 18px; }
.eyebrow::after { content: ""; display: block; width: 32px; height: 2px; border-radius: 2px; background: currentColor; margin-top: 10px; }
.eyebrow--light { color: #fff; text-shadow: 0 1px 10px rgba(6, 16, 28, .5); }
.lead { font-size: 18px; font-weight: 300; line-height: 1.45; color: var(--charcoal); }

/* ---------- Botones (píldora, nunca rectangulares) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border-radius: var(--r-btn);
  font-size: 16px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background .25s, color .25s, border-color .25s, transform .2s;
}
.btn:active { transform: scale(.98); }
.btn--sm { min-height: 40px; padding: 10px 18px; font-size: 14px; }
.site-header .btn--sm { min-height: 34px; padding: 7px 14px; font-size: 13px; }   /* compact header CTA */
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #166683; }
.btn--outline { border: 1.5px solid var(--accent); color: var(--accent); }
.btn--outline:hover { background: var(--surface); }
.btn--outline-light { border: 1.5px solid rgba(255,255,255,.8); color: #fff; }
.btn--outline-light:hover { background: rgba(255,255,255,.12); }
.btn--ghost { padding: 8px 12px; color: var(--ink); font-weight: 600; font-size: 14px; }
.btn--ghost:hover { background: var(--surface); }
.btn svg { font-size: 18px; }
.wa-ico { font-size: 20px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--accent); }
.link-arrow svg { transition: transform .3s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }
.card { background: var(--surface); border-radius: var(--r-card); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================
   ANUNCIO + NAVEGACIÓN
   ========================================================== */
.announce { background: var(--accent); color: #fff; text-align: center; font-size: 14px; padding: 9px 16px; line-height: 1.35; }
.announce a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; margin-left: 6px; white-space: nowrap; }

.site-header { position: sticky; top: 0; z-index: 40; background: rgba(244, 248, 249, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--hairline); }
.site-header__in { height: var(--header-h); display: flex; align-items: center; gap: 10px; }
.brand { margin-right: auto; }
.brand__logo { height: 48px; width: auto; }
.site-header__call { display: none; }
.menu-btn { display: grid; gap: 6px; place-content: center; width: 44px; height: 44px; margin-right: -8px; border-radius: 50%; }
.menu-btn span { display: block; width: 22px; height: 1.5px; background: var(--ink); transition: transform .35s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
/* Menú móvil: cortina que baja desde el encabezado + botones en cascada.
   Siempre está en el DOM; el estado cerrado lo recorta (clip-path) y lo oculta (visibility) al terminar. */
@media (max-width: 1023px) {
  .nav {
    display: flex; flex-direction: column; position: fixed; left: 0; right: 0; top: 100%;   /* the header (backdrop-filter) is the containing block, so 100% = right under it */
    gap: 10px; padding: 16px var(--gutter) 24px; background: var(--canvas); border-bottom: 1px solid var(--hairline); box-shadow: var(--shadow-xl);
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path .3s cubic-bezier(.4, 0, .2, 1), visibility 0s .3s;
  }
  .nav.open { clip-path: inset(0 0 -40px 0); visibility: visible; transition: clip-path .45s var(--ease), visibility 0s; }
  .nav li { opacity: 0; transform: translateY(-10px); transition: opacity .18s, transform .25s; }
  .nav.open li { opacity: 1; transform: none; transition: opacity .35s, transform .5s var(--ease); }
  .nav.open li:nth-child(1) { transition-delay: .08s; } .nav.open li:nth-child(2) { transition-delay: .13s; }
  .nav.open li:nth-child(3) { transition-delay: .18s; } .nav.open li:nth-child(4) { transition-delay: .23s; }
  .nav.open li:nth-child(5) { transition-delay: .28s; }
  .nav li:nth-child(4) { transition-delay: .03s; } .nav li:nth-child(3) { transition-delay: .06s; }   /* al cerrar, en orden inverso */
  .nav li:nth-child(2) { transition-delay: .09s; } .nav li:nth-child(1) { transition-delay: .12s; }
  /* items con el mismo aspecto que el botón "Agendar cita" */
  .nav a { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px; border-radius: var(--r-btn);
    background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; line-height: 1; letter-spacing: var(--track); transition: background .25s, transform .2s; }
  .nav a:hover { background: #166683; }
  .nav a:active { transform: scale(.98); }
}

/* ==========================================================
   HERO: foto a sangre con velo oscuro
   ========================================================== */
/* mobile: the photo (faces) owns the top half; all the text sits in the bottom half over the veil */
.hero { position: relative; min-height: calc(100svh - var(--header-h) - 58px); display: flex; align-items: flex-end; overflow: hidden; color: #fff; isolation: isolate; }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; z-index: -2; filter: brightness(.82) saturate(.95); animation: heroZoom 1.8s var(--ease) both; }
@keyframes heroZoom { from { transform: scale(1.06); } }
/* mobile: the text sits in the lower half, so the veil is strongest there */
.hero__veil { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 24, 38, 0) 0%, rgba(10, 24, 38, .05) 30%, rgba(10, 24, 38, .6) 46%, rgba(10, 24, 38, .9) 62%, rgba(10, 24, 38, .96) 100%); }
.hero__in { padding: 0 0 24px; display: grid; gap: 14px; text-align: center; justify-items: center; }   /* mobile: centered */
.hero__title { font-family: var(--serif); font-weight: 400; letter-spacing: normal; font-size: clamp(40px, 11.2vw, 88px); line-height: .98; color: #fff; text-shadow: 0 2px 28px rgba(6, 16, 28, .45); }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__title .line > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.hero__title.is-in .line > span { transform: none; }
.hero__title.is-in .line:nth-child(2) > span { transition-delay: .12s; }
.hero__title em { color: #CFEAF2; }
.hero__lead { font-size: 17px; font-weight: 400; line-height: 1.4; color: rgba(255, 255, 255, .92); max-width: 30ch; margin-inline: auto; text-shadow: 0 1px 14px rgba(6, 16, 28, .5); }
.hero__actions { display: grid; gap: 8px; margin-top: 4px; }
.hero__actions .btn { width: 100%; }

/* Bloque de cifras (separadas por líneas verticales) */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.stats > div { padding: 2px 12px; border-left: 1px solid var(--hairline); }
.stats > div:first-child { padding-left: 0; border-left: 0; }
.stats dt { font-family: var(--serif); font-size: clamp(22px, 7.2vw, 30px); line-height: 1.05; color: var(--ink); white-space: nowrap; }
.stats dd { font-size: 13px; line-height: 1.3; color: var(--graphite); margin-top: 4px; }
.stats--light > div { border-color: rgba(255, 255, 255, .28); }
.stats--light dt { color: #fff; }
.stats--light dd { color: rgba(255, 255, 255, .85); }
.stats--hero { display: none; }
.stats-strip { padding: 22px 0; border-bottom: 1px solid var(--hairline); }
.stats-strip .stats { margin-top: 0; }
.stats-strip .stats > div { text-align: center; padding-inline: 8px; }   /* mobile: centered columns */
.stats [data-count] { font-variant-numeric: tabular-nums; display: inline-block; text-align: right; }   /* width is locked in JS so the count-up never shifts the line */
/* DM Serif Display draws "+" as a hairline; this plus uses the same stroke weight as the numerals */
.plus { display: inline-block; position: relative; width: .5em; height: .5em; margin-right: .06em; vertical-align: .1em; }
.plus::before, .plus::after { content: ""; position: absolute; background: currentColor; border-radius: .01em; }
.plus::before { left: 0; right: 0; top: 50%; height: .11em; transform: translateY(-50%); }
.plus::after { top: 0; bottom: 0; left: 50%; width: .11em; transform: translateX(-50%); }

/* ==========================================================
   SECCIONES
   ========================================================== */
.specs, .steps, .feature, .team, .units, .spaces, .contact { padding: var(--section) 0; }
.services, .testi { padding: var(--section) 0; background: var(--surface); }
.footer { background: var(--surface); }

/* Especialidades: tarjetas con ícono de línea animado.
   Al revelarse, cada trazo se dibuja (pathLength=1 + dashoffset); solo animación de entrada. */
.speclist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 32px; }
.spec { background: var(--surface); border-radius: 20px; padding: 16px 16px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
  font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--ink); letter-spacing: var(--track); }
.ic { width: 48px; height: 48px; border-radius: 14px; background: var(--canvas); display: grid; place-items: center; transition: background .4s var(--ease); }
.ic svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; transition: stroke .4s var(--ease); }
.ic g { transform-box: fill-box; transform-origin: center; }
.ic :is(path, rect, circle) { stroke-dasharray: 1; stroke-dashoffset: 1; }
.spec.is-in .ic :is(path, rect, circle) { animation: ic-draw 1.2s cubic-bezier(.22, 1, .36, 1) .35s forwards; animation-delay: calc(var(--d, 0s) + .35s); }
@media (hover: hover) { .spec:hover .ic { background: var(--accent); } .spec:hover .ic svg { stroke: #fff; } }

@keyframes ic-draw   { to { stroke-dashoffset: 0; } }

/* Tarjetas de pasos numerados */
.steps__lead { color: var(--charcoal); font-size: 18px; margin-top: 14px; }
.steps__grid { display: grid; gap: 16px; margin-top: 32px; }
/* Cada etapa con su foto real (fotogramas de sus videos de Instagram) */
.step { background: var(--surface); border-radius: var(--r-card); padding: 12px 12px 28px; display: grid; gap: 10px; align-content: start; }
.step > :not(.step__img) { margin-inline: 12px; }
.step__img { margin: 0 0 10px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: var(--hairline); }
.step__img img { width: 100%; height: 100%; object-fit: cover; }
.step h3 { font-family: var(--serif); font-weight: 400; letter-spacing: normal; font-size: 30px; line-height: 1.12; color: var(--ink); }
.step p { color: var(--charcoal); }
.step .step__meta { font-size: 14px; color: var(--graphite); margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--hairline); }

/* Servicios */
.services__layout { display: grid; gap: 40px; }
.services__layout > * { min-width: 0; }   /* let the card row scroll instead of widening the column */
/* Móvil y tablet: tarjetas con foto que se deslizan de lado (como la galería) */
.svc-list { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 28px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 4px; scroll-padding-inline: var(--gutter); }
.svc-list::-webkit-scrollbar { display: none; }
.svc { flex: none; width: 78vw; max-width: 340px; scroll-snap-align: start; background: var(--canvas); border-radius: var(--r-card); overflow: hidden; text-align: center; }
.svc__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.svc h3 { font-family: var(--serif); font-weight: 400; letter-spacing: normal; font-size: 24px; line-height: 1.15; color: var(--ink); padding: 16px 18px 0; }
.svc p { font-size: 15px; color: var(--graphite); margin-top: 6px; padding: 0 18px 20px; }
.svc-preview { display: none; }

/* Hidroterapia */
.feature__grid { display: grid; gap: 32px; align-items: center; }
.feature__img { border-radius: var(--r-card); overflow: hidden; aspect-ratio: 1; background: var(--surface); }
.feature__video { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature__text { display: grid; gap: 18px; justify-items: start; }
.feature__text .h2 { margin-top: -6px; }
/* "¿Cómo iniciar tus sesiones?" (pasos publicados por ellos) */
.howto__title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--graphite); margin-top: 6px; }
.howto { display: grid; gap: 12px; width: 100%; margin-top: -6px; }
.howto li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--surface); border-radius: 18px; }
.howto__n { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; }
.howto b { display: block; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.howto li span:not(.howto__n) { display: block; font-size: 14px; color: var(--graphite); margin-top: 3px; }

/* Equipo: retrato que cambia, una doctora a la vez */
.doc { margin-top: 32px; display: grid; gap: 22px; }
.doc__photo { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-card); overflow: hidden; background: var(--surface); touch-action: pan-y; }
.doc__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%;
  opacity: 0; transform: scale(1.04); transition: opacity .6s var(--ease), transform 1.2s var(--ease); }
.doc__photo img.is-active { opacity: 1; transform: none; }
.doc__body { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.doc__tabs { order: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--surface); border-radius: 20px; }
.doc__tab { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px 9px; border-radius: 16px;
  font: 600 13px/1.2 var(--sans); color: var(--graphite); transition: background-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease); }
.doc__tab img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; filter: grayscale(1); opacity: .75; transition: filter .3s var(--ease), opacity .3s var(--ease); }
.doc__tab:hover { color: var(--ink); }
.doc__tab:active { transform: scale(.97); }
.doc__tab[aria-selected="true"] { background: var(--canvas); color: var(--ink); }
.doc__tab[aria-selected="true"] img { filter: none; opacity: 1; box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--accent); }
.doc__panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }
.doc__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the three panels share one cell, so the block keeps the tallest height and nothing below jumps */
.doc__panels { display: grid; text-align: center; }
.doc__panel { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s .35s; }
.doc__panel.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .55s var(--ease) .12s, transform .55s var(--ease) .12s, visibility 0s; }
.doc__role { font-size: 14px; font-weight: 600; color: var(--accent); }
.doc__panel h3 { font-family: var(--serif); font-weight: 400; letter-spacing: normal; font-size: 30px; line-height: 1.1; color: var(--ink); margin-top: 6px; }
.doc__text { font-size: 16px; line-height: 1.55; color: var(--charcoal); margin-top: 12px; max-width: 46ch; }
.doc__panel .btn { margin-top: 20px; width: 100%; }

/* Testimonios: pila centrada, sin tarjeta */
.testi__in { max-width: 760px; }
.testi__list { display: grid; gap: 28px; margin-top: 32px; }
.quote { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.quote__av { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--canvas); border: 1px solid var(--hairline); font-family: var(--serif); font-size: 22px; color: var(--accent); }
.quote blockquote { font-family: var(--serif); font-style: italic; letter-spacing: normal; font-size: 22px; line-height: 1.3; color: var(--ink); }
.quote figcaption { margin-top: 10px; display: grid; font-size: 14px; }
.quote figcaption b { font-weight: 600; color: var(--ink); }
.quote figcaption span { color: var(--graphite); }

/* Unidades */
.units__grid { display: grid; gap: 20px; margin-top: 32px; }
.unit { background: var(--surface); border-radius: var(--r-card); overflow: hidden; display: grid; }
.unit__img { aspect-ratio: 16 / 10; overflow: hidden; }
.unit__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.unit:hover .unit__img img { transform: scale(1.03); }
.unit__body { padding: 24px; display: grid; gap: 8px; justify-items: start; }
.unit__body .eyebrow { margin-bottom: 0; }
.unit h3 { font-family: var(--serif); font-weight: 400; letter-spacing: normal; font-size: 26px; line-height: 1.15; color: var(--ink); }
.unit p:not(.eyebrow) { color: var(--charcoal); }
.unit .link-arrow { margin-top: 6px; }

/* Instalaciones */
.spaces__head { display: grid; gap: 20px; justify-items: start; margin-bottom: 28px; }
.spaces__track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; --pad: max(var(--gutter), calc((100vw - 1280px) / 2)); padding: 0 var(--pad) 4px; scroll-padding-inline: var(--pad); cursor: grab; }
.spaces__track::-webkit-scrollbar { display: none; }
.spaces__track.is-drag { cursor: grabbing; scroll-snap-type: none; }
.space { flex: none; width: 68vw; max-width: 340px; scroll-snap-align: start; }
.space img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-card); pointer-events: none; user-select: none; display: block; }
.space figcaption { margin-top: 12px; }
.space figcaption b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.space figcaption span { display: block; font-size: 13px; color: var(--graphite); margin-top: 2px; }
/* primera tarjeta: el recorrido en video */
.space__play { position: relative; display: block; width: 100%; border-radius: var(--r-card); overflow: hidden; cursor: pointer; }
.space__play::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 24, 38, 0) 45%, rgba(10, 24, 38, .45)); }
.space__playicon { position: absolute; z-index: 1; left: 50%; top: 50%; translate: -50% -50%; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 26px; box-shadow: 0 8px 30px rgba(10, 24, 38, .35); transition: transform .3s var(--ease); }
.space__playicon svg { margin-left: 3px; }
.space__playicon::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .7); animation: playRing 2.4s ease-out infinite; }
@keyframes playRing { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.space__play:hover .space__playicon { transform: scale(1.06); }
/* flechas (escritorio) y barra de progreso */
.spaces__nav { display: none; gap: 10px; }
.spaces__arrow { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--ash); display: grid; place-items: center; color: var(--ink); font-size: 20px; transition: background .25s, color .25s, border-color .25s, opacity .25s; }
.spaces__arrow--prev svg { transform: scaleX(-1); }
.spaces__arrow:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.spaces__arrow:disabled { opacity: .35; cursor: default; }
.spaces__bar { height: 2px; background: var(--hairline); border-radius: 2px; overflow: hidden; width: min(1280px, 100% - 2 * var(--gutter)); margin: 24px auto 0; }
.spaces__bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, .15)); transition: transform .15s linear; }

/* Contacto */
.contact__grid { display: grid; gap: 32px; }
.info { display: grid; gap: 14px; margin-top: 24px; }
.info li { display: flex; gap: 12px; font-size: 16px; color: var(--charcoal); }
.info svg { font-size: 20px; color: var(--accent); margin-top: 2px; }
.info a { color: var(--ink); font-weight: 600; }
.form { padding: 28px 24px; display: grid; gap: 16px; }
.form h3 { font-family: var(--serif); font-weight: 400; letter-spacing: normal; font-size: 28px; color: var(--ink); margin-bottom: 4px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field select {
  font: inherit; font-weight: 400; font-size: 16px; color: var(--ink); letter-spacing: var(--track);
  height: 50px; padding: 12px 20px; border-radius: 9999px; border: 1px solid var(--ash); background: var(--canvas);
  outline: none; transition: box-shadow .2s, border-color .2s; -webkit-appearance: none; appearance: none;
}
.field select { background: var(--canvas) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2312263A' stroke-width='1.5'/%3E%3C/svg%3E") right 20px center no-repeat; }
.field input::placeholder { color: var(--graphite); }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.field.err input { border-color: #B4403A; }
.form .btn { width: 100%; margin-top: 4px; }
.map { border-radius: var(--r-card); overflow: hidden; height: 280px; background: var(--surface); }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.5) contrast(1.02); }

/* Footer */
.footer { padding: 56px 0 28px; }
.footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.footer__lead { grid-column: 1 / -1; display: grid; gap: 18px; }
.footer__logo { height: 64px; width: auto; }
.footer h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: -.28px; color: #166683; margin: 0 0 12px; }
.footer__cols a { display: block; padding: 5px 0; font-size: 15px; color: var(--charcoal); }
.footer__cols a:hover { color: var(--accent); }
.footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--graphite); }

/* WhatsApp flotante */
.wa-float { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 26px; box-shadow: var(--shadow-xl); transition: transform .3s var(--ease), opacity .4s; opacity: 0; transform: translateY(16px); pointer-events: none; }
.wa-float.show { opacity: 1; transform: none; pointer-events: auto; }

/* Video */
.video-modal { border: 0; padding: 0; background: transparent; max-width: min(420px, 92vw); width: 100%; overflow: visible; }
.video-modal::backdrop { background: rgba(12, 28, 44, .82); }
.video-modal video { width: 100%; max-height: 86vh; border-radius: var(--r-card); background: #000; }
.video-modal__close { position: absolute; top: -52px; right: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--canvas); font-size: 24px; line-height: 1; }

/* short phones (e.g. 360x740): smaller title so the text still starts around the middle of the photo */
@media (max-width: 719px) and (max-height: 760px) {
  .hero__title { font-size: 10vw; }
  .hero__lead { font-size: 16px; }
  .hero__actions .btn { min-height: 44px; padding-block: 10px; }
}

/* ==========================================================
   TABLET Y ESCRITORIO
   ========================================================== */
@media (min-width: 720px) {
  .speclist { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 40px; }
  .spec { padding: 20px 20px 22px; gap: 18px; font-size: 16px; align-items: flex-start; text-align: left; }
  .hero__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
  .hero__actions .btn { width: auto; }
  .steps__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .doc__panel .btn { width: auto; }
  .units__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spaces__head { display: flex; justify-content: space-between; align-items: flex-end; }
  .spaces__nav { display: flex; }
  .space { width: 34vw; }
  .svc { width: 42vw; }
}

@media (min-width: 1024px) {
  .doc { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 96px); align-items: center; margin-top: 48px; }
  .doc__photo { max-height: 640px; }
  .doc__body { gap: 40px; }
  .doc__tabs { order: 0; display: flex; width: max-content; }
  .doc__tab { flex-direction: row; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 40px; font-size: 14px; }
  .doc__tab img { width: 36px; height: 36px; }
  .doc__panels { text-align: left; }
  .doc__panel { align-items: flex-start; }
  .doc__panel h3 { font-size: 44px; }
  .doc__text { font-size: 17px; }
  .doc__panel .btn { margin-top: 28px; }
  :root { --header-h: 76px; }
  .brand__logo { height: 56px; }
  .menu-btn { display: none; }
  .nav { display: flex; gap: 28px; margin-right: 12px; }
  .nav a { font-size: 15px; color: var(--ink); padding: 6px 0; position: relative; }
  .nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--accent); transform: scaleX(0); transition: transform .3s var(--ease); }
  .nav a:hover::after, .nav a.is-current::after { transform: scaleX(1); }
  .site-header__call { display: inline-flex; }

  .hero { min-height: min(calc(100svh - var(--header-h) - 38px), 860px); }
  .stats--hero { display: grid; }
  .stats-strip { display: none; }
  /* desktop: the text column is on the left, so the veil is strongest there and the team stays visible on the right */
  .hero__veil { background: linear-gradient(90deg, rgba(10, 24, 38, .92) 0%, rgba(10, 24, 38, .8) 34%, rgba(10, 24, 38, .45) 58%, rgba(10, 24, 38, .1) 80%), linear-gradient(0deg, rgba(10, 24, 38, .55) 0%, rgba(10, 24, 38, 0) 40%); }
  .hero__bg { object-position: 70% 30%; }
  .hero__in { padding: 80px 0 56px; gap: 22px; text-align: left; justify-items: start; }
  .hero__lead { margin-inline: 0; max-width: 34ch; }
  .hero__actions { justify-content: flex-start; }
  .hero__bg { object-position: 50% 30%; }
  .hero__title { font-size: clamp(64px, 6.6vw, 92px); }
  .stats { max-width: 560px; margin-top: 22px; }
  .stats dt { font-size: 40px; }
  .stats dd { font-size: 14px; }

  .services__layout { grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: start; }
  .svc-preview { display: block; position: sticky; top: calc(var(--header-h) + 32px); border-radius: var(--r-card); overflow: hidden; aspect-ratio: 4 / 5; }
  .svc-preview img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s, transform .8s var(--ease); }
  .svc-preview img.swap { opacity: 0; transform: scale(1.03); }
  /* Escritorio: lista sin números; la foto grande cambia al pasar el cursor */
  .svc-list { display: block; overflow: visible; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--hairline); }
  .svc { width: auto; max-width: none; background: none; border-radius: 0; overflow: visible; text-align: left; padding: 18px 0; border-bottom: 1px solid var(--hairline); }
  .svc__img { display: none; }
  .svc h3 { font-size: 26px; padding: 0; }
  .svc p { padding: 0; margin-top: 4px; }
  .svc { cursor: default; transition: padding .4s var(--ease); }
  .svc.is-on h3 { color: var(--accent); }
  .svc.is-on { padding-left: 8px; }

  .feature__grid { grid-template-columns: 1fr 1fr; gap: 72px; }
  .testi__list { gap: 36px; }
  .quote blockquote { font-size: 24px; }
  .contact__grid { grid-template-columns: 1.1fr 1fr; gap: 48px 72px; align-items: start; }
  .map { grid-column: 1 / -1; height: 360px; }
  .footer__cols { grid-template-columns: 2fr 1fr 1fr; }
  .footer__lead { grid-column: auto; }
  .space { width: 26vw; }
  .step { padding: 14px 14px 36px; }
  .step > :not(.step__img) { margin-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .doc__photo img, .doc__panel, .doc__panel.is-active { transform: none; transition-duration: .01s; transition-delay: 0s; }
  .space__playicon::before { animation: none; opacity: 0; }
  .nav, .nav li { transition-delay: 0s !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__title .line > span { transform: none; }
  .ic :is(path, rect, circle) { stroke-dashoffset: 0; }
  .ic *, .spec.is-in .ic * { animation: none !important; }
}
