/* OIBA v2 · base compartida (portada y legales)
   Fuentes autoalojadas con licencia SIL OFL 1.1 (ver assets/fonts/OFL-*.txt).
   Audiowide se sirve sin modificar (tiene nombre reservado); Exo 2 en subconjuntos. */

@font-face { font-family: "Audiowide"; src: url("../fonts/Audiowide-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("../fonts/exo2-latin.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Exo 2"; src: url("../fonts/exo2-latin-ext.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Paleta de marca (valores exactos) */
  --navy: #081A2D;
  --deep: #06111F;
  --surface: #102D48;
  --surface-2: #16385A;
  --gold: #C4A46B;
  --gold-light: #DFC894;
  --gold-deep: #7C6339;
  --ivory: #F5F1E8;
  --ivory-2: #E9E1D2;

  /* Roles */
  --ink: var(--ivory);
  --ink-2: rgb(245 241 232 / 0.8);   /* 10.3:1 sobre #081A2D; 7.4:1 sobre #16385A */
  --ink-3: rgb(245 241 232 / 0.68);  /* 7.7:1 sobre #081A2D; 5.8:1 sobre #16385A */
  --line: rgb(245 241 232 / 0.14);
  --paper-ink: var(--navy);
  --paper-ink-2: rgb(8 26 45 / 0.76); /* 7.6:1 sobre #F5F1E8; 7.0:1 sobre #E9E1D2 */
  --paper-line: rgb(8 26 45 / 0.14);

  --font-display: "Audiowide", "Exo 2", system-ui, sans-serif;
  --font-body: "Exo 2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: 0.875rem;
  --step-0: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-1: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  --step-3: clamp(1.9rem, 1.3rem + 2.4vw, 3.1rem);
  --step-4: clamp(2.3rem, 1.4rem + 3.6vw, 4.4rem);

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 128px;
  --gutter: clamp(20px, 5vw, 72px);
  --wrap-gutter: max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --max: 1320px;
  --header-h: 68px;
  --r-pill: 999px;
  --r-frame: 16px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  /* Escala de tiempos: pulsación, hover/color, menú y acordeones, cambio de vista, entrada de secciones */
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --t-press: 140ms;
  --t-ui: 200ms;
  --t-panel: 240ms;
  --t-swap: 320ms;
  --t-enter: 480ms;
  --stagger: 50ms;
  --t-scene: 800ms;

  color-scheme: dark;
  accent-color: var(--gold);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
a, button, summary, [role="button"] { touch-action: manipulation; -webkit-tap-highlight-color: rgb(196 164 107 / 0.18); }
/* Controles con respuesta propia al toque: sin el recuadro del navegador encima */
.btn, .nav-toggle, .menu-sheet__close, .menu-sheet__links a, .case__btn, .faq__item summary { -webkit-tap-highlight-color: transparent; }
/* Suave solo tras la carga: el salto inicial a un enlace directo (#servicio) es inmediato */
@media (prefers-reduced-motion: no-preference) { html.is-ready { scroll-behavior: smooth; } }
/* Paneles modales: la página detrás no se desplaza y conserva su posición */
html:has(dialog[open]) { scroll-behavior: auto; overflow: hidden; overscroll-behavior: none; }
/* Lenis (smooth-scroll.js): reglas recomendadas por la librería. Con Lenis activo, la suavidad la
   pone Lenis; el desplazamiento nativo de las anclas queda instantáneo para no sumar dos inercias.
   Se omite su regla que desactiva los iframes: la demo navegable del detalle debe seguir usable. */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
@media (min-width: 901px) { html { scrollbar-gutter: stable; } }
body {
  margin: 0;
  background: var(--deep);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
p, h1, h2, h3, h4, ol, ul, dl, dd, figure, blockquote { margin: 0; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
strong { font-weight: 600; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-wrap: balance; overflow-wrap: break-word; hyphens: manual; }
h1 { font-size: var(--step-4); line-height: 1.06; letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.015em; }
h3 { font-size: var(--step-1); line-height: 1.25; letter-spacing: -0.005em; }
p { text-wrap: pretty; }

::selection { background: var(--gold); color: var(--deep); }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; border-radius: 4px; }
.paper :focus-visible { outline-color: var(--gold-deep); }
html { scrollbar-color: var(--surface-2) var(--deep); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--sp-4); top: -100px; z-index: 400; background: var(--ivory); color: var(--navy); font-weight: 600; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-pill); text-decoration: none; }
.skip-link:focus { top: var(--sp-3); }

.wrap { width: min(100% - 2 * var(--wrap-gutter), var(--max)); margin-inline: auto; }

/* ---------- Superficie de lectura (marfil) ---------- */
.paper { background: var(--ivory); color: var(--paper-ink); color-scheme: light; }
.paper ::selection { background: var(--navy); color: var(--ivory); }

/* ---------- Botones: variantes explícitas ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding: 0 var(--sp-5);
  border: 0; border-radius: var(--r-pill);
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; letter-spacing: 0.01em;
  text-decoration: none; text-align: center; max-width: 100%; cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-ui) ease, color var(--t-ui) ease, box-shadow var(--t-ui) ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--gold); color: var(--deep); }
.btn--quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgb(245 241 232 / 0.38); }
.btn--quiet-paper { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1px rgb(8 26 45 / 0.4); }
.btn--small { min-height: 40px; padding: 0 var(--sp-4); font-size: 0.9375rem; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--gold-light); }
  .btn--quiet:hover { box-shadow: inset 0 0 0 1px var(--gold-light); color: var(--gold-light); }
  .btn--quiet-paper:hover { box-shadow: inset 0 0 0 1px var(--navy); background: rgb(8 26 45 / 0.05); }
}
.btn-icon { width: 18px; height: 18px; flex: none; }

/* Nota junto a WhatsApp */
.wa-note { font-size: var(--step--1); line-height: 1.5; color: var(--ink-3); max-width: 46ch; }
.wa-note a { color: var(--gold-light); }
.paper .wa-note { color: var(--paper-ink-2); }
.paper .wa-note a { color: var(--gold-deep); }

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: calc(var(--header-h) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center;
  transition: background-color var(--t-panel) ease, box-shadow var(--t-panel) ease;
}
.site-header.is-scrolled { background: rgb(6 17 31 / 0.92); box-shadow: 0 1px 0 var(--line); }
@supports (backdrop-filter: blur(12px)) { .site-header.is-scrolled { background: rgb(6 17 31 / 0.78); backdrop-filter: blur(12px) saturate(1.2); } }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); }
.brand { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.brand img { height: 40px; width: auto; }
.nav-inline { display: flex; align-items: center; gap: var(--sp-1); }
.nav-inline a:not(.btn) {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--sp-3);
  color: var(--ink-2); font-weight: 500; font-size: 0.9375rem; text-decoration: none;
  transition: color var(--t-ui) ease;
}
.nav-inline a:not(.btn)::after {
  content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 8px; height: 1px;
  background: var(--gold-light); transform: scaleX(0); transform-origin: left; transition: transform var(--t-ui) var(--ease-out);
}
.nav-inline a[aria-current="true"], .nav-inline a[aria-current="page"] { color: var(--ink); }
.nav-inline a[aria-current="true"]::after, .nav-inline a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .nav-inline a:not(.btn):hover { color: var(--ink); } }
.nav-inline .btn { margin-left: var(--sp-3); }
.nav-toggle { display: none; }
.header-wa { display: none; }

@media (max-width: 900px) {
  .js .nav-inline { display: none; }
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-4);
    background: none; border: 0; border-radius: var(--r-pill); color: var(--ink); font-weight: 600; cursor: pointer;
    box-shadow: inset 0 0 0 1px rgb(245 241 232 / 0.28);
    transition: transform var(--t-press) var(--ease-out);
  }
  .js .nav-toggle:active { transform: scale(0.97); }
  .js .site-header__inner { gap: var(--sp-2); }
  /* WhatsApp siempre a mano después de la portada; aparece por posición, no por dirección del scroll */
  .js .header-wa {
    display: inline-flex; margin-left: auto; opacity: 0; transform: translateY(-6px); visibility: hidden; pointer-events: none;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .js .header-wa.is-shown { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s; }
  .no-js .nav-inline { flex-wrap: wrap; justify-content: flex-end; }
  .no-js .site-header { position: absolute; height: auto; padding-block: var(--sp-2); }
}
.nav-toggle__bars { width: 18px; height: 10px; position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 2px; }
.nav-toggle__bars::before { top: 0; } .nav-toggle__bars::after { bottom: 0; }

/* ---------- Menú (diálogo, móvil) ---------- */
.menu-sheet {
  margin: 0; padding: 0; border: 0; max-width: none; max-height: none; width: 100%; height: 100dvh;
  background: var(--deep); color: var(--ink);
  --menu-from: circle(22px at var(--mx, calc(100% - 56px)) var(--my, 34px));
  opacity: 0; clip-path: var(--menu-from);
  /* Salida (cerrar): más breve que la entrada */
  transition: clip-path 220ms var(--ease-out), opacity 160ms ease 60ms, overlay 220ms allow-discrete, display 220ms allow-discrete;
  overflow: auto;
}
.menu-sheet[open] {
  opacity: 1; clip-path: circle(150vmax at var(--mx, calc(100% - 56px)) var(--my, 34px));
  transition: clip-path 280ms var(--ease-out), opacity 160ms ease, overlay 280ms allow-discrete, display 280ms allow-discrete;
}
@starting-style { .menu-sheet[open] { opacity: 0; clip-path: var(--menu-from); } }
.menu-sheet::backdrop { background: transparent; }
.menu-sheet { overscroll-behavior: contain; }
.menu-sheet__inner { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) max(var(--sp-7), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); }
.menu-sheet__top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.menu-sheet__close { min-height: 44px; transition: transform var(--t-press) var(--ease-out); padding: 0 var(--sp-4); background: none; border: 0; border-radius: var(--r-pill); color: var(--ink); font-weight: 600; cursor: pointer; box-shadow: inset 0 0 0 1px rgb(245 241 232 / 0.28); }
.menu-sheet__links { list-style: none; padding: var(--sp-6) 0 var(--sp-6); display: grid; align-content: end; gap: var(--sp-1); }
/* Horizontal: dos columnas para que todo quepa sin desplazar */
@media (max-height: 520px) {
  .menu-sheet__links { align-content: start; grid-template-columns: 1fr 1fr; column-gap: var(--sp-6); padding: var(--sp-3) 0 var(--sp-4); }
  .menu-sheet__links a { min-height: 48px; font-size: 1.3rem; }
  .menu-sheet__inner { padding-bottom: max(var(--sp-4), env(safe-area-inset-bottom)); }
  .menu-sheet__foot { grid-template-columns: auto 1fr; align-items: center; column-gap: var(--sp-5); }
}
.menu-sheet__links a {
  display: flex; align-items: center; min-height: 56px; font-family: var(--font-display); font-size: clamp(1.6rem, 7vw, 2.2rem);
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line);
}
.menu-sheet[open] .menu-sheet__links li { animation: menu-item 280ms var(--ease-enter) both; animation-delay: calc(40ms * var(--i, 0) + 40ms); }
@keyframes menu-item { from { opacity: 0; transform: translateY(10px); } }
.menu-sheet__close:active { transform: scale(0.97); }
.menu-sheet__links a { transition: color var(--t-ui) ease; }
.menu-sheet__links a:active { color: var(--gold-light); }
/* Orientación: la sección en la que estás lleva el aro de la marca */
.menu-sheet__links a[aria-current="true"] { color: var(--gold-light); }
.menu-sheet__links a[aria-current="true"]::after { content: ""; margin-left: auto; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--gold); }
.menu-sheet__foot { display: grid; gap: var(--sp-4); }

/* ---------- Pie ---------- */
.site-footer { background: var(--deep); border-top: 1px solid var(--line); padding: var(--sp-8) 0 var(--sp-6); }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); gap: var(--sp-7) var(--sp-6); }
.site-footer__brand img { height: 34px; width: auto; }
.site-footer__brand p { margin-top: var(--sp-4); color: var(--ink-3); font-size: var(--step--1); max-width: 30ch; }
.site-footer__label { font-weight: 600; font-size: var(--step--1); color: var(--gold-light); margin-bottom: var(--sp-3); }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: var(--sp-1); }
.site-footer a, .footer-link-btn {
  display: inline-flex; align-items: center; min-height: 40px; color: var(--ink-2); text-decoration: none; font-size: 0.9375rem;
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left; transition: color var(--t-ui) ease;
}
.footer-link-btn { text-decoration: underline; text-decoration-color: rgb(245 241 232 / 0.35); text-underline-offset: 0.25em; }
@media (hover: hover) and (pointer: fine) { .site-footer a:hover, .footer-link-btn:hover { color: var(--gold-light); } }
.site-footer__base { margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--step--1); }
@media (max-width: 820px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* ---------- Aviso "Cookies y privacidad" (región no modal) ---------- */
.cookienotice {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 140; display: flex; justify-content: center;
  padding: var(--sp-4) var(--gutter) max(var(--sp-4), env(safe-area-inset-bottom));
  pointer-events: none;
}
.cookienotice__box {
  pointer-events: auto; width: min(760px, 100%); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-5);
  padding: var(--sp-5); border-radius: var(--r-frame);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 18px 40px -12px rgb(3 9 17 / 0.7), inset 0 0 0 1px rgb(223 200 148 / 0.28);
  transform: translateY(0); opacity: 1;
  transition: transform var(--t-panel) var(--ease-out), opacity var(--t-panel) var(--ease-out);
}
.cookienotice:not(.is-open) .cookienotice__box { transform: translateY(24px); opacity: 0; pointer-events: none; }
.cookienotice__copy { flex: 1 1 320px; }
.cookienotice__title { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: var(--sp-2); }
.cookienotice__copy p { font-size: 0.9375rem; color: var(--ink-2); }
.cookienotice__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.cookienotice__actions a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gold-light); font-size: 0.9375rem; font-weight: 500; }

@media (min-width: 900px) {
  /* En escritorio el aviso vive en la esquina: no tapa el contacto centrado del inicio */
  .cookienotice { justify-content: flex-end; }
  .cookienotice__box { width: min(360px, 100%); padding: var(--sp-4) var(--sp-5); gap: var(--sp-2) var(--sp-4); }
  .cookienotice__copy p { font-size: 0.875rem; line-height: 1.5; }
  .cookienotice__actions { gap: 0 var(--sp-4); }
  .cookienotice__actions a { font-size: 0.875rem; }
}
@media (max-width: 600px) {
  .cookienotice { padding: 0 8px max(8px, env(safe-area-inset-bottom)); }
  .cookienotice__box { padding: 14px 16px; gap: 8px 12px; border-radius: 14px; }
  .cookienotice__copy { flex-basis: 100%; }
  .cookienotice__box { padding: 10px 14px 6px; gap: 0 12px; }
  .cookienotice__copy { font-size: 0.8125rem; line-height: 1.45; }
  .cookienotice__copy p { display: inline; font-size: 0.8125rem; line-height: 1.45; }
  .cookienotice__copy .cookienotice__title { font-size: 0.875rem; margin: 0 6px 0 0; }
  .cookienotice__actions { width: 100%; gap: 0 10px; }
  .cookienotice__actions a { font-size: 0.8125rem; }
  .cookienotice__actions .btn { margin-left: auto; min-height: 44px; padding-inline: 14px; }
}

/* ---------- Toque: objetivos de al menos 44 px ---------- */
@media (pointer: coarse) {
  .btn--small { min-height: 44px; }
  .site-footer a, .footer-link-btn { min-height: 44px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .btn:active, .nav-toggle:active, .menu-sheet__close:active { transform: none; }
  /* Menú: fundido breve en lugar del círculo que crece */
  .menu-sheet, .menu-sheet[open] { clip-path: none !important; }
  .menu-sheet { transition-property: opacity, overlay, display !important; transition-duration: 160ms !important; }
}
