/*
 * Sistema de diseño de seismik.org y devs.seismik.org.
 *
 * La CSP del borde sólo admite estilos y scripts del propio dominio: nada de
 * fuentes externas, estilos en línea ni `style=""`. Por eso la tipografía es la
 * del sistema y todo el color sale de estos tokens.
 */
:root {
  color-scheme: dark;
  --bg: #060a13;
  --bg-soft: #0a101c;
  --surface: #0e1524;
  --surface-2: #131c2e;
  --surface-3: #1a2539;
  --line: #1c2740;
  --line-strong: #2a3854;
  --text: #eef3ff;
  --muted: #9dadc8;
  --faint: #6c7d9c;
  --primary: #7cc4ff;
  --primary-strong: #a9d8ff;
  --primary-ink: #04121f;
  --accent: #ff7a59;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #ff6b6b;
  /* Misma escala que el perímetro de sacudida de la app. */
  --mmi-3: #ffb300;
  --mmi-4: #fb8c00;
  --mmi-6: #e53935;
  --mmi-8: #8e0012;
  --glow: rgb(124 196 255 / 0.18);
  --shadow: 0 30px 80px -30px rgb(0 0 0 / 0.75);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1200px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5f7fb;
    --bg-soft: #eef2f8;
    --surface: #ffffff;
    --surface-2: #f3f6fb;
    --surface-3: #e9eef7;
    --line: #e1e7f1;
    --line-strong: #cbd5e4;
    --text: #0a1322;
    --muted: #46566f;
    --faint: #718199;
    --primary: #0b6bcb;
    --primary-strong: #0a58a8;
    --primary-ink: #ffffff;
    --accent: #e4572e;
    --glow: rgb(11 107 203 / 0.12);
    --shadow: 0 24px 60px -30px rgb(18 38 72 / 0.35);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--glow), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgb(255 122 89 / 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-strong); }
code, pre, kbd { font-family: var(--mono); font-size: 0.92em; }
h1, h2, h3 { color: var(--text); letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin: 0.2em 0 0.4em; letter-spacing: -0.035em; }
h3 { font-size: 1.15rem; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }
::selection { background: var(--primary); color: var(--primary-ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 8px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: var(--primary); color: var(--primary-ink);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { width: min(100% - 32px, var(--max)); margin-inline: auto; }
@media (min-width: 720px) { .container { width: min(100% - 64px, var(--max)); } }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 850; letter-spacing: 0.14em; font-size: 0.95rem;
}
.brand:hover { color: var(--text); }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }
.brand-tag {
  margin-left: 2px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--muted); font-size: 0.68rem; letter-spacing: 0.12em; font-weight: 750;
}
.primary-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.primary-nav a {
  padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 0.93rem; font-weight: 550;
  white-space: nowrap;
}
.header-actions .button { white-space: nowrap; }
.primary-nav a:hover { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.mobile-menu { display: none; margin-left: auto; position: relative; }
.mobile-menu summary {
  list-style: none; cursor: pointer; display: grid; place-items: center;
  width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text);
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary svg { width: 20px; height: 20px; }
.mobile-menu[open] .menu-panel { display: grid; }
.menu-panel {
  display: none; position: absolute; right: 0; top: 52px; min-width: 230px; padding: 8px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow);
}
.menu-panel a { padding: 11px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.menu-panel a:hover { background: var(--surface-2); }

/* El menú completo ocupa unos 1 250 px; por debajo, los enlaces partidos en dos
   líneas descuadraban la cabecera, así que se usa el menú compacto. */
@media (max-width: 1260px) {
  .primary-nav { display: none; }
  .header-actions { margin-left: auto; }
  .mobile-menu { display: block; margin-left: 0; }
  .header-actions .button:not(.keep) { display: none; }
}

/* ---------- Botones ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px;
  background: var(--primary); color: var(--primary-ink);
  font: inherit; font-weight: 750; font-size: 0.97rem; text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--primary) 70%, transparent);
}
.button:hover { color: var(--primary-ink); background: var(--primary-strong); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.secondary {
  background: color-mix(in srgb, var(--surface-2) 80%, transparent); color: var(--text);
  border-color: var(--line-strong); box-shadow: none;
}
.button.secondary:hover { border-color: var(--primary); color: var(--text); background: var(--surface-3); }
.button.ghost { background: transparent; color: var(--text); box-shadow: none; }
.button.compact { min-height: 38px; padding: 0 16px; font-size: 0.9rem; }
.button.full { width: 100%; }
.button svg { width: 18px; height: 18px; }
.text-button {
  padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--primary);
  font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
.text-button:hover { background: var(--surface-2); }
.danger-button { color: var(--danger); }

/* ---------- Tipos de texto ---------- */
.eyebrow {
  margin: 0 0 12px; color: var(--primary); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px;
  padding: 6px 14px 6px 8px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted); font-size: 0.85rem; font-weight: 600;
}
.pill b {
  padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.lead { max-width: 640px; color: var(--muted); font-size: clamp(1.08rem, 1.7vw, 1.28rem); line-height: 1.55; }
.muted { color: var(--muted); }
.fine-print { color: var(--faint); font-size: 0.86rem; line-height: 1.5; }
.gradient-text {
  background: linear-gradient(100deg, var(--text) 10%, var(--primary) 55%, var(--accent) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Secciones ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section.tight { padding-top: 0; }
.section-heading { max-width: 720px; margin-bottom: 44px; }
.section-heading.center { margin-inline: auto; text-align: center; }
.section-heading p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; }

.card {
  position: relative; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 70%, transparent), var(--surface));
}
.card h3 { margin-top: 14px; }
.card p { color: var(--muted); margin: 0; }
.card-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px;
  background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}
.card-icon svg { width: 22px; height: 22px; }
.card-icon.hot { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .split.reverse > :first-child { order: 0; } }

.check-list { display: grid; gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.check-list li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; color: var(--muted); }
.check-list li::before {
  content: ""; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent);
  background: color-mix(in srgb, var(--ok) 16%, transparent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.check-list li strong { color: var(--text); }

/* ---------- Aviso ---------- */
.notice {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start;
  padding: 22px 24px; border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 7%, var(--surface));
}
.notice svg { width: 24px; height: 24px; color: var(--warn); }
.notice p { margin: 0; color: var(--muted); }
.notice strong { color: var(--text); }
.warning { padding: 16px 18px; border-left: 4px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--muted); }

/* ---------- Pie ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-soft) 70%, transparent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding: 56px 0 36px; }
.footer-grid p { color: var(--faint); font-size: 0.92rem; max-width: 320px; margin-top: 14px; }
.footer-grid h4 { margin: 4px 0 14px; color: var(--text); font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; }
.footer-grid ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.footer-grid a { color: var(--muted); text-decoration: none; font-size: 0.94rem; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 20px 0 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.86rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Páginas de texto (privacidad, términos) ---------- */
.nav {
  width: min(100% - 32px, var(--max)); margin-inline: auto; height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 0.93rem; }
.nav nav a:hover { color: var(--text); background: var(--surface-2); }
main.narrow { width: min(100% - 32px, 820px); margin-inline: auto; padding: 56px 0 96px; }
main.narrow > h1 { font-size: clamp(2.3rem, 5.5vw, 3.8rem); line-height: 1.02; letter-spacing: -0.045em; margin: 0.2em 0 0.35em; }
.prose { margin-top: 36px; padding: clamp(24px, 4vw, 40px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.prose h2 { font-size: 1.35rem; margin: 1.9em 0 0.5em; letter-spacing: -0.02em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.35em 0; }
.prose strong { color: var(--text); }
body > footer:not(.site-footer):not(.developer-footer) {
  width: min(100% - 32px, var(--max)); margin: 0 auto; padding: 28px 0 48px;
  display: flex; flex-wrap: wrap; gap: 20px; border-top: 1px solid var(--line); color: var(--faint);
}
body > footer:not(.site-footer):not(.developer-footer) a { color: var(--muted); text-decoration: none; }

/* ---------- Animación ---------- */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes scroll-wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Ajustes de ritmo vertical */
.check-list + .fine-print { margin-top: 22px; }
.section.last { padding-bottom: clamp(40px, 6vw, 72px); }
/* Dos secciones seguidas comparten un solo margen, no la suma de ambos. */
.section + .section { padding-top: 0; }
@media (max-width: 520px) { .brand-tag { display: none; } .header-inner { gap: 12px; } }
