/* =========================================================
   Tomel — base.css
   Sistema de diseño: tokens de color (modo día y noche), formas de la T,
   tipografía, espacio y reset. Si cambias un color o una medida, cámbialo AQUÍ.
   Los componentes solo usan estos tokens; ningún color escrito directo.
   ========================================================= */

/* Fuentes servidas desde el sitio (los mismos archivos de Google Fonts, sin ir a otro dominio).
   Son variables: un archivo cubre todos los pesos. latin-ext solo se baja si una página usa esos caracteres.
   Manrope latin se precarga en el <head> (es la del titular del hero). */
@font-face { font-family: "Manrope"; font-weight: 400 800; font-display: swap; src: url("../fonts/manrope-latin.woff2") format("woff2");
  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: "Manrope"; font-weight: 400 800; font-display: swap; src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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; }
@font-face { font-family: "Montserrat"; font-weight: 500 600; font-display: swap; src: url("../fonts/montserrat-latin.woff2") format("woff2");
  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: "Montserrat"; font-weight: 500 600; font-display: swap; src: url("../fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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; }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  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: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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; }

/* Respaldo de Manrope mientras carga: Arial escalada para ocupar el mismo ancho.
   Así el cambio de fuente no mueve el texto (sin esto, en Windows el 800 cae en
   Arial Black y el titular pasa de 2 renglones a 1: CLS). Medido con canvas. */
@font-face { font-family: "Manrope Fallback"; src: local("Arial"), local("ArialMT"); font-weight: 100 550; size-adjust: 102%; }
@font-face { font-family: "Manrope Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 551 700; size-adjust: 98.5%; }
@font-face { font-family: "Manrope Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 701 900; size-adjust: 101%; }

/* ---------- Color · modo día (Corte) ---------- */
:root {
  /* Superficies */
  --page: #FAF9F6;                 /* fondo de la página */
  --surface: #FFFFFF;              /* tarjetas */
  --surface-alt: #F4F2EE;          /* sección alterna */
  --surface-dark: #0B1628;         /* tarjeta destacada (texto claro) */
  --surface-dark-raised: #16264A;  /* superficies dentro de la destacada */
  --surface-strong: #0B1628;       /* momentos fuertes: hero, renovación, CTA */

  /* Texto */
  --ink: #0B1628;
  --ink-muted: #555E6E;
  --ink-on-dark: #F3F0EA;          /* texto sobre navy */
  --ink-muted-on-dark: #B4BCCB;

  /* Acento: #1466FF para rellenos (botones, viñetas, marcas); como TEXTO se usa
     #0F52D6, porque #1466FF no llega a AA sobre la sección alterna. */
  --fill-primary: #1466FF;
  --fill-primary-hover: #0B3FA8;
  --on-accent: #FFFFFF;
  --accent: #0F52D6;               /* enlaces sobre claro */
  --accent-hover: #0B3FA8;
  --accent-strong: #0F52D6;        /* texto de acento sobre --accent-soft */
  --accent-soft: #E8F0FF;          /* fondo tenue del acento */
  --accent-on-dark: #4D8BFF;       /* acento sobre navy */
  --accent-on-dark-hover: #7AA8FF;
  --on-accent-dark: #0B1628;       /* texto de botones con --accent-on-dark */

  /* Detalle cálido (en día, solo sobre navy) */
  --sand: #D9CFBF;
  --on-sand: #0B1628;

  /* Líneas, controles y estados */
  --line: #E6E2DA;
  --line-dark: #22335A;            /* líneas sobre navy */
  --line-strong: #0B1628;          /* borde de los momentos fuertes (en día no se nota) */
  --control: #878D98;              /* bordes de inputs y rieles apagados: 3:1 con el fondo */
  --glass: rgba(250, 249, 246, .86);
  --focus: #1466FF;
  --success: #0E7A4F;
  --warning: #A65F00;
  --danger: #C2261F;
  --success-text: #0E7A4F;         /* estados como texto (en noche se aclaran) */
  --warning-text: #A65F00;

  /* WhatsApp: verde de la marca con logo blanco, igual en día y en noche */
  --whatsapp: #25D366;
  --whatsapp-hover: #1EBE5A;
  --on-whatsapp: #FFFFFF;

  /* Tipografía */
  --font-display: "Manrope", "Manrope Fallback", "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Manrope", "Manrope Fallback", "Helvetica Neue", Arial, sans-serif;
  --font-label: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Espacio (retícula de 4px) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --space-24: 96px; --space-32: 128px;

  /* Radios: bajos. La forma la da la T; nada de tarjetas "tile" redondeadas. */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --radius-pill: 999px;            /* solo puntitos e interruptores */
  --shadow-card: none;             /* sin sombras suaves */

  /* ---------- Formas de la T ----------
     Corte (arriba-izq) · curva chica (arriba-der) · curva grande (abajo-der) · recta (abajo-izq).
     Tamaños por componente: corte / curva chica / curva grande. */
  --t-boton-corte: 11px;   --t-boton-chica: 4px;   --t-boton-grande: 16px;    /* botones */
  --t-tarjeta-corte: 18px; --t-tarjeta-chica: 6px; --t-tarjeta-grande: 28px;  /* tarjetas y planes */
  --t-bloque-corte: 26px;  --t-bloque-chica: 10px; --t-bloque-grande: 40px;   /* hero, renovación, CTA, tabla */
  --t-badge-corte: 6px;    --t-badge-chica: 0px;   --t-badge-grande: 8px;     /* badges */
  --t-control-corte: 8px;  --t-control-chica: 4px; --t-control-grande: 12px;  /* inputs y píldoras */
  --t-vineta-corte: 3px;   --t-vineta-grande: 4px;                            /* viñetas (cuadrito de 9px) */
  --t-corte: var(--t-tarjeta-corte);
  --t-chica: var(--t-tarjeta-chica);
  --t-grande: var(--t-tarjeta-grande);

  --content-max: 1120px;
  --text-max: 680px;
  --header-h: 56px;
}

/* ---------- Color · modo noche (Nocturna) ----------
   Lo pone el <head> en <html data-theme="dark"> antes de pintar (tema.js lo cambia). */
[data-theme="dark"] {
  --page: #0B1628;
  --surface: #15243F;
  --surface-alt: #0F1C33;
  --surface-dark: #1D2F52;
  --surface-dark-raised: #2A3E66;
  --surface-strong: #07101F;
  --ink: #F3F0EA;
  --ink-muted: #B4BCCB;
  --fill-primary: #4D8BFF;
  --fill-primary-hover: #7AA8FF;
  --on-accent: #0B1628;
  --accent: #4D8BFF;
  --accent-hover: #7AA8FF;
  --accent-strong: #7AA8FF;
  --accent-soft: #1B2F57;
  --line: #22335A;
  --line-strong: #22335A;
  --control: #6F7FA0;
  --glass: rgba(11, 22, 40, .86);
  --focus: #4D8BFF;
  --success-text: #4CC38A;
  --warning-text: #F0B45A;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

/* Los logos son navy: en noche se aclaran al tono del texto */
[data-theme="dark"] :is(img[src*="logo-horizontal"], img[src*="tomel-principal"]) { filter: brightness(0) invert(95%) sepia(8%) saturate(200%); }

h1, h2, h3, h4, .display-xl, .display-l, .headline { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
/* (las clases de titular también van en <p>: el eslogan grande cuando el H1 o el H2 con keyword va chico) */
p { margin: 0; }
ul { margin: 0; padding: 0; }

/* Escala tipográfica del manual */
.display-xl { font-size: clamp(44px, 7vw, 80px); line-height: 1.05; letter-spacing: -0.035em; }
/* Celular: el titular del hero cabe en ~3 líneas y deja ver el botón en la primera pantalla */
@media (max-width: 640px) { .display-xl { font-size: clamp(34px, 9.4vw, 44px); line-height: 1.06; } }
.display-l  { font-size: clamp(36px, 5vw, 56px); line-height: 1.07; letter-spacing: -0.03em; }
.headline   { font-size: clamp(28px, 3.4vw, 36px); line-height: 1.17; letter-spacing: -0.02em; }
.title      { font-size: 24px; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }
.lead       { font-size: clamp(18px, 2vw, 21px); line-height: 1.45; font-weight: 500; color: var(--ink-muted); }
.small      { font-size: 14px; line-height: 1.45; color: var(--ink-muted); }
/* Eyebrow: con un marcador que tiene la forma del brazo de la T (18×10, corte + curva grande) */
.eyebrow {
  font-family: var(--font-label);
  font-size: 13px; line-height: 1.2; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--ink-muted);
}
.eyebrow::before { content: ""; display: inline-block; width: 18px; height: 10px; margin-right: 10px; vertical-align: 0; border-radius: 0 0 8px 0;
  background: linear-gradient(135deg, transparent 3.7px, var(--marca, var(--fill-primary)) 4.7px); }
.mono { font-family: var(--font-mono); font-size: 14px; }

.sr-only { position: absolute; 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: 16px; top: -48px; z-index: 100; padding: 8px 16px; background: var(--ink); color: var(--page); border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; color: var(--page); }
