/* =============================================================
   Alter Realitas — landing
   Tokens: sistema de diseño "Alter Realitas" (tokens.json).
   No inventes valores: si falta uno, agrégalo aquí como token.
   ============================================================= */

/* ---------- Fuente (Montserrat, SIL OFL 1.1 — ver fonts/LICENSE-OFL.txt) ---------- */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/montserrat-400.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/montserrat-500.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/montserrat-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/montserrat-700.woff2") format("woff2"); }

/* ---------- Tokens: tema Claro (por defecto) ---------- */
:root, [data-theme="light"] {
  --surface: #ffffff;
  --surface-soft: #f1edfc;
  --surface-raised: #ffffff;
  --line: #d9d4ee;
  --line-strong: #767ba8;
  --ink: #12227f;
  --ink-muted: #4b4f73;
  --brand: #4400da;
  --brand-hover: #3600b3;
  --on-brand: #ffffff;
  --brand-tint: #f1edfc;
  --focus-ring: #4400da;
  --error: #a1261b;
  --shadow-card: 0 8px 24px rgba(18, 34, 127, 0.08);
  --shadow-media: 0 8px 24px rgba(18, 34, 127, 0.12);
}

/* ---------- Tokens: tema Navy (hero, franjas destacadas, footer) ---------- */
[data-theme="dark"] {
  --surface: #12227f;
  --surface-soft: #0b1452;
  --surface-raised: #1b2a8f;
  --line: #3b4aa8;
  --line-strong: #8f98d6;
  --ink: #ffffff;
  --ink-muted: #c9b8f5;
  --brand: #b195ef;
  --brand-hover: #c9b8f5;
  --on-brand: #12227f;
  --brand-tint: #1b2a8f;
  --focus-ring: #b195ef;
  --error: #ffb4ab;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
}

:root {
  /* colores de marca a valor pleno */
  --navy: #12227f;
  --violet: #4400da;
  --lavender: #b195ef;
  --lavender-tint: #f1edfc;
  --navy-overlay: rgba(18, 34, 127, 0.85); /* control sobre video */

  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px; --space-10: 128px;

  --radius-sm: 6px; --radius-md: 12px; --radius-lg: 20px; --radius-full: 999px;

  /* layout */
  --gutter: var(--space-6);
  --section-y: var(--space-9);
  --hero-y: var(--space-10);
  --header-h: 96px;
  --logo-h: 56px;
  --logo-footer-h: 72px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--space-5); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
img, svg { display: block; }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 10;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--brand); color: var(--on-brand); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--space-4); color: var(--on-brand); }

.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;
}

/* ---------- Escala tipográfica ---------- */
.t-display { font-size: 56px; line-height: 60px; font-weight: 700; letter-spacing: -0.02em; }
.t-h1      { font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -0.01em; }
.t-h2      { font-size: 28px; line-height: 36px; font-weight: 600; }
.t-h3      { font-size: 20px; line-height: 28px; font-weight: 600; }
.t-lead    { font-size: 20px; line-height: 30px; font-weight: 400; }
.t-body    { font-size: 16px; line-height: 26px; font-weight: 400; }
.t-small   { font-size: 14px; line-height: 20px; font-weight: 400; }
.t-eyebrow { font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.t-eyebrow--strong { font-weight: 700; }
.t-caption { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.04em; }
.muted { color: var(--ink-muted); }

/* ---------- Secciones ---------- */
.section { position: relative; overflow: hidden; background: var(--surface); color: var(--ink); padding: var(--section-y) 0; }
.section--soft { background: var(--surface-soft); }
.wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

.head { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-6); }
.head .t-h1 { max-width: 20ch; }
.head .t-lead { max-width: 56ch; color: var(--ink-muted); }
.head--flush { margin-bottom: 0; }

/* ---------- Botones (ar-btn del sistema) ---------- */
.ar-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md); border: 1.5px solid transparent;
  font-family: var(--font-sans); font-size: 15px; line-height: 20px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.ar-btn--primary { background: var(--brand); color: var(--on-brand); }
.ar-btn--primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.ar-btn--secondary { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.ar-btn--secondary:hover { background: var(--brand-tint); color: var(--brand); }
.ar-btn--lg { padding: var(--space-4) var(--space-6); font-size: 17px; line-height: 24px; }
.ar-btn[disabled], .ar-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---------- Header ---------- */
.header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header .wrap { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); }
.header__logo { display: block; line-height: 0; }
.logo { height: var(--logo-h); width: auto; align-self: flex-start; }
.logo--footer { height: var(--logo-footer-h); }
.nav { display: flex; gap: var(--space-6); list-style: none; margin: 0; padding: 0; }
.nav a { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--brand); }

/* ---------- Hero ---------- */
.hero { padding: var(--hero-y) 0; }
.hero .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-6); align-items: center; }
.hero__copy { grid-column: span 6; display: flex; flex-direction: column; gap: var(--space-5); }
.hero__copy .t-lead { max-width: 46ch; color: var(--ink-muted); }
.hero__media { grid-column: span 6; }

/* Anillo decorativo: gesto del isotipo (anillo grueso interrumpido arriba y abajo) */
.ring { position: absolute; z-index: 0; pointer-events: none; }
.ring--hero { right: -160px; top: -200px; width: 640px; height: 640px; }
/* A la derecha: a la izquierda quedaba detrás del texto de Procedimientos */
.ring--strip { right: -150px; bottom: -190px; width: 380px; height: 380px; }

/* ---------- Placeholders (material real pendiente — no inventar capturas) ---------- */
.ph {
  position: relative; width: 100%; display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.section--soft .ph { background: #ffffff; }
[data-theme="dark"] .ph { background: var(--surface-soft); }
.ph--16-9 { aspect-ratio: 16 / 9; }
.ph--9-16 { aspect-ratio: 9 / 16; }
.ph--4-3  { aspect-ratio: 4 / 3; }
.ph__label { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-5); color: var(--ink-muted); }
.ph__label svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ph__tag {
  position: absolute; top: var(--space-3); left: var(--space-3); padding: 2px var(--space-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-raised); color: var(--ink-muted);
}
/* Video real del hero: sin audio, con control de pausa (README del sistema) */
.media-video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); background: var(--surface-soft); }

/* ---------- Hero: bajada en varios párrafos ---------- */
.hero__lead { display: flex; flex-direction: column; gap: var(--space-3); max-width: 46ch; }
.hero__lead .t-lead { color: var(--ink-muted); }
.hero__lead .hero__claim { color: var(--ink); font-weight: 600; }

/* ---------- Video del hero (sin audio, con pausa) ---------- */
.hero-video { position: relative; }
.hero-video__toggle {
  position: absolute; right: var(--space-3); bottom: var(--space-3);
  width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--lavender); border-radius: var(--radius-full);
  background: var(--navy-overlay); color: var(--ink); cursor: pointer;
}
.hero-video__toggle:hover { background: var(--navy); }
.hero-video__icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hero-video__icon--play { display: none; }
.hero-video__toggle[aria-pressed="true"] .hero-video__icon--play { display: block; }
.hero-video__toggle[aria-pressed="true"] .hero-video__icon--pause { display: none; }

/* ---------- Imágenes del producto ---------- */
.media-img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); }
.media-img--shadow { box-shadow: var(--shadow-media); }
.media-img--4-3 { aspect-ratio: 4 / 3; object-fit: cover; }
.media-img--doc { background: var(--surface); border: 1px solid var(--line); padding: var(--space-4); box-shadow: var(--shadow-card); }
.figure__caption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-2) var(--space-5); }
.link-action { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--brand); text-underline-offset: 3px; }
.link-action:hover { color: var(--brand-hover); }

/* ---------- Layouts ---------- */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-6); align-items: center; }
.split__text { grid-column: span 6; display: flex; flex-direction: column; gap: var(--space-4); }
.split__text .t-eyebrow { margin-bottom: var(--space-1); }
.split__text .t-lead { color: var(--ink); }
.split__media { grid-column: span 6; }
.split__media--phone { grid-column: span 5; justify-self: center; width: 100%; max-width: 340px; }
.split--media-left .split__text { order: 2; }
.split--media-left .split__media { order: 1; }
/* Texto angosto + imagen ancha (debriefing: el fragmento necesita ancho para leerse) */
.split--5-7 .split__text { grid-column: span 5; }
.split--5-7 .split__media { grid-column: span 7; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--lg { gap: var(--space-6); }
.stack--tight { gap: var(--space-2); }

/* ---------- Tarjetas (ar-card del sistema) ---------- */
.ar-card {
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5);
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink);
}
.ar-card__eyebrow { margin: 0 0 var(--space-1); font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.ar-card__title { font-size: 20px; line-height: 28px; font-weight: 600; }
.ar-card__body { font-size: 16px; line-height: 26px; color: var(--ink-muted); }
.icon { width: 24px; height: 24px; margin-bottom: var(--space-2); stroke: var(--brand); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Ítems institución ---------- */
.item { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-4); border-top: 2px solid var(--lavender); }
.item p { color: var(--ink-muted); }

/* ---------- Figuras inmersiva ---------- */
.figure { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }

/* ---------- Franja "Lo que viene" ---------- */
.strip { padding: var(--space-7) 0; }

/* ---------- Roles ---------- */
.role { display: flex; gap: var(--space-4); align-items: flex-start; }
.role__dot { flex: none; width: 44px; height: 44px; border-radius: var(--radius-full); border: 6px solid var(--lavender); }
.role__body { display: flex; flex-direction: column; gap: var(--space-1); }

/* ---------- Contacto ---------- */
.contact { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-6); align-items: start; }
.contact__intro { grid-column: span 5; display: flex; flex-direction: column; gap: var(--space-4); }
.contact__form {
  grid-column: 7 / span 6; display: flex; flex-direction: column; gap: var(--space-5);
  padding: var(--space-6); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.contact__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.contact__actions { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.form-status { min-height: 20px; }
.form-status--ok { color: var(--ink); font-weight: 600; }
.form-status--error { color: var(--error); font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Campos (ar-field del sistema) */
.ar-field { display: flex; flex-direction: column; gap: var(--space-2); color: var(--ink); }
.ar-field__label { font-size: 14px; line-height: 20px; font-weight: 600; }
.ar-field__input {
  font: inherit; font-size: 16px; line-height: 26px; width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-raised); color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
}
.ar-field__input::placeholder { color: var(--ink-muted); opacity: 1; }
.ar-field__input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-color: var(--brand); }
textarea.ar-field__input { min-height: 120px; resize: vertical; }
.ar-field__hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ar-field--error .ar-field__input { border-color: var(--error); }
.ar-field--error .ar-field__hint { color: var(--error); }

/* ---------- Footer ---------- */
.footer { padding: var(--space-7) 0; }
.footer .wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-6); flex-wrap: wrap; }
.footer__col { display: flex; flex-direction: column; gap: var(--space-2); }
.footer__col--end { align-items: flex-end; }
.footer .nav { flex-wrap: wrap; gap: var(--space-3) var(--space-5); }
.footer .nav a { color: var(--ink); white-space: nowrap; }
.footer .nav a:hover { color: var(--brand); }

/* =============================================================
   Tablet
   ============================================================= */
@media (max-width: 1024px) {
  .nav--header { gap: var(--space-5); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =============================================================
   Móvil (README: display → h1, h1 → h2; secciones space-8; gutter space-4)
   ============================================================= */
@media (max-width: 760px) {
  :root {
    --gutter: var(--space-4);
    --section-y: var(--space-8);
    --hero-y: var(--space-8);
    --header-h: 76px;
    --logo-h: 44px;
    --logo-footer-h: 60px;
  }
  .t-display { font-size: 40px; line-height: 46px; letter-spacing: -0.01em; }
  .t-h1 { font-size: 28px; line-height: 36px; }
  .nav--header { display: none; }

  .hero .wrap, .split, .contact { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .hero__copy, .hero__media, .split__text, .split__media, .contact__intro, .contact__form,
  .split--5-7 .split__text, .split--5-7 .split__media { grid-column: auto; }
  .media-img--doc { padding: var(--space-2); }
  .split--media-left .split__text { order: 1; }
  .split--media-left .split__media { order: 2; }
  .split__media--phone { max-width: 260px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .stack--lg { gap: var(--space-5); }

  .contact__form { padding: var(--space-5); }
  .contact__row { grid-template-columns: minmax(0, 1fr); }

  /* En móvil el anillo se aparta del título: queda en la esquina inferior, tras el placeholder */
  .ring--hero { right: -200px; top: auto; bottom: -180px; width: 380px; height: 380px; }
  .ring--strip { display: none; }

  .footer .wrap { flex-direction: column; align-items: flex-start; }
  .footer__col--end { align-items: flex-start; }
  .footer .nav { flex-wrap: wrap; gap: var(--space-4) var(--space-5); }
}
