/* ==========================================================================
   Base — reset, design tokens, foundational typography
   Convention: mobile-first. Base rules target mobile; layer on larger-
   viewport styles with min-width media queries. Breakpoints: 600 / 900 / 1200.
   ========================================================================== */

:root {
  /* ------------------------------------------------------------------
     Color — tema oscuro. El magenta de marca (#ED2A91) se mantiene sin
     tocar: es el color del logo y el que recibe el widget de reservas de
     Nautisync (partials/booking-widget.php), así que cambiarlo aquí
     desincronizaría la marca del motor de reservas. Sobre negro necesita
     un hermano más claro para texto pequeño y enlaces, donde #ED2A91 se
     queda por debajo de 4.5:1 — ese es --color-primary-bright.

     La escala de negros no es un solo negro repetido: página, banda y
     tarjeta se separan ~3-5% de luminancia, que es lo que hace que una
     tarjeta se lea como tarjeta sin necesitar borde ni sombra fuerte.
     ------------------------------------------------------------------ */
  --color-primary: #ED2A91;
  --color-primary-dark: #C21F76;
  --color-primary-bright: #FF5CB4;
  --color-primary-rgb: 237, 42, 145;

  --color-black: #08080A;        /* fondo de página */
  --color-ink: #0E0E12;          /* bandas (header, footer, cta) */
  --color-surface: #15151B;      /* tarjetas */
  --color-surface-2: #1D1D25;    /* tarjetas elevadas, hover, chips */
  --color-white: #FFFFFF;

  /* Isla clara: el widget de Nautisync es un componente de terceros con
     su propio shadow DOM y su propia UI en claro. No se puede tematizar
     desde aquí, así que en vez de dejarlo peleado con el fondo se le da
     un panel blanco propio y se convierte en algo deliberado. */
  --color-panel-light: #FFFFFF;
  --color-panel-light-text: #16161A;
  --color-panel-light-muted: #5C5C68;

  --color-text: #F3F3F6;
  --color-text-muted: #9B9BAA;
  --color-border: rgba(255, 255, 255, 0.10);
  --color-border-strong: rgba(255, 255, 255, 0.22);
  --color-focus: var(--color-primary-bright);

  /* Type — self-hosted, subsetted (assets/fonts/). */
  --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Fluid scale (clamp: mobile-min, viewport-relative, desktop-max) — sizes
     grow smoothly between breakpoints instead of jumping at fixed steps.
     This is what gives headings real "large/cinematic" presence on desktop
     without overflowing small screens. */
  --fs-100: 0.875rem;
  --fs-200: 1rem;
  --fs-300: clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);
  --fs-400: clamp(1.35rem, 1.2rem + 0.75vw, 1.875rem);
  --fs-500: clamp(1.75rem, 1.45rem + 1.3vw, 2.75rem);
  --fs-600: clamp(2.25rem, 1.8rem + 2vw, 3.75rem);
  --fs-700: clamp(2.75rem, 2rem + 3.2vw, 5.25rem);
  --fs-hero: clamp(3rem, 1.9rem + 4.8vw, 6.75rem);

  --lh-tight: 1.08;
  --lh-normal: 1.6;

  /* Espaciado — escala de 4px: --space-N vale N × 4px.
     La escala tenía huecos en el 5 y el 10, y sin embargo el CSS los
     usaba: var(--space-5) aparecía 21 veces (el padding de las preguntas
     del FAQ, entre otras). Un var() sin definir invalida la declaración
     ENTERA en tiempo de cálculo, así que esos paddings valían 0 sin que
     nada avisara. tools/comprobar-css.php los detecta a partir de ahora. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Sobre negro, una sombra difuminada no se ve: lo que despega una
     tarjeta del fondo es el filo superior iluminado (inset) más una caída
     realmente negra debajo, no un desenfoque gris. */
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 2px 10px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 24px 60px rgba(0, 0, 0, 0.7);
  --shadow-primary: 0 14px 34px rgba(var(--color-primary-rgb), 0.42);

  /* Z-index scale — keep every stacking value here, never a magic number inline */
  --z-header: 100;
  --z-mobile-cta: 200;
  --z-consent-banner: 300;
  --z-lightbox: 350;
  --z-modal: 400;

  /* Alto del dock flotante de móvil (partials/mobile-dock.php). Lo
     referencian el padding inferior del body y el desplazamiento del
     banner de cookies, para que ninguno de los dos pueda quedarse
     desincronizado del alto real del dock. */
  --mobile-cta-height: 62px;
  --header-height: 80px;

  /* Motion — subtle only, per PROJECT.md §13 Phase 2. Every rule that
     uses these must also respect the reduced-motion override below. */
  --transition-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-standard: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* El fondo se pinta en <html> y no solo en el body: si el contenido no
   llega a llenar la ventana (páginas legales cortas) o el usuario hace
   overscroll, lo que asoma detrás debe ser el negro del sitio y no el
   blanco por defecto del navegador. color-scheme:dark hace además que los
   controles nativos —scrollbars, selects, autocompletado— salgan oscuros. */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--color-black);
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-200);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-black);
  -webkit-font-smoothing: antialiased;
}

/* Fixed glass header (see components.css .site-header) is removed from
   normal flow — pages without a hero need the equivalent space reserved
   so content doesn't start underneath it. Pages with a hero (body.has-hero)
   skip this: the hero itself is full-bleed and deliberately extends behind
   the header, which stays legible over any image via its own glass/blur
   treatment rather than needing the page underneath to make room. */
body:not(.has-hero) {
  padding-top: var(--header-height);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
  font-weight: 700;
}

h1 { font-size: var(--fs-700); }
h2 { font-size: var(--fs-600); margin-bottom: var(--space-6); }
h3 { font-size: var(--fs-500); }
h4 { font-size: var(--fs-400); }

@media (min-width: 900px) {
  h2 { margin-bottom: var(--space-8); }
}

p { margin: 0 0 var(--space-4); }

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Sobre negro, #ED2A91 se queda en ~4.0:1 — suficiente para un botón de
   48px pero no para texto corrido. Los enlaces usan el tono claro. */
a {
  color: var(--color-primary-bright);
}

::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* Accessible focus state — never remove without providing an equivalent */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* Global reduced-motion override — non-negotiable given this project's
   accessibility commitments (PROJECT.md §2). Component-level animations
   (card/button hover, carousel, hero entrance — see components.css) still
   scope their own transitions sensibly; this is the baseline safety net,
   not a substitute for that scoping. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Self-hosted fonts (assets/fonts/) — variable weight axis, single latin
   subset file each. */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-variable.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
