/* Geist y Geist Mono (SIL OFL, ver assets/fonts/OFL.txt), alojadas acá y recortadas a latín. */
@font-face {
  font-family: "Geist"; src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono"; src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --bg: #000;
  --fg: #ededed;
  --muted: #8f8f8f;
  --dim: #5c5c5c;
  --line: rgba(255, 255, 255, 0.09);
  --panel: #0a0a0a;
  --panel-2: #111;
  --radius: 12px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* --- Navegación --- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sm { font-size: 14px; }
.mark {
  width: 22px; height: 22px; border-radius: 6px; background: #161616; border: 1px solid #2c2c2c;
  position: relative; flex: none;
}
.mark::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 2px solid #f5f5f5; }
.mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #f5f5f5; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--muted); }
.nav-links a:not(.btn):hover { color: var(--fg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 18px; border-radius: 8px; font-weight: 500; font-size: 14px;
  border: 1px solid var(--line); transition: background .15s, color .15s;
}
.btn-sm { height: 32px; padding: 0 12px; }
.btn-light { background: #ededed; color: #000; border-color: #ededed; }
.btn-light:hover { background: #fff; }
/* GitHub con estrellas: ícono, nombre y contador separado por una línea fina. */
.gh { gap: 8px; color: var(--fg); padding: 0 10px; }
.gh:hover { background: rgba(255, 255, 255, 0.06); }
.gh-stars { display: inline-flex; align-items: center; gap: 5px; padding-left: 9px; border-left: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.gh-stars[hidden] { display: none; }

/* --- Matriz de puntos --- */
.matrix {
  position: relative; height: clamp(300px, 56vw, 640px);
  overflow: hidden;
}
.matrix canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* --- Hero --- */
.hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 clamp(16px, 4vw, 40px) 96px;
  /* Sube sobre la cola de la matriz para que el ícono nazca de los puntos que se apagan. */
  margin-top: calc(-1 * clamp(90px, 13vw, 170px));
  position: relative; z-index: 1;
  scroll-margin-top: 64px;
}
.key {
  appearance: none; border: 0; padding: 0; background: none; cursor: pointer;
  border-radius: 18px; outline-offset: 6px;
}
.key-cap {
  display: grid; place-items: end start;
  width: 104px; height: 96px; padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #2a2a2a 0%, #151515 100%);
  border: 1px solid #3a3a3a;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -6px 0 rgba(0,0,0,.55),
    0 10px 0 #0c0c0c,
    0 12px 0 #2a2a2a,
    0 30px 40px rgba(0,0,0,.6);
  transform: translateY(0);
  transition: transform .08s ease, box-shadow .08s ease;
}
.key-label { font-family: var(--sans); font-weight: 600; font-size: 22px; color: #f2f2f2; letter-spacing: -0.01em; }
.key:active .key-cap, .key.is-down .key-cap {
  transform: translateY(9px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.1),
    inset 0 -3px 0 rgba(0,0,0,.55),
    0 1px 0 #0c0c0c,
    0 3px 0 #2a2a2a,
    0 12px 18px rgba(0,0,0,.6);
}
.key-hint { margin: 26px 0 0; font-size: 13px; color: var(--muted); height: 20px; }
.toast {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 6px; padding: 8px 14px; border-radius: 999px;
  background: #111; border: 1px solid var(--line); font-size: 13px; color: var(--fg);
  opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: #f5f5f5; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }

.headline {
  margin: 36px 0 0; font-size: clamp(36px, 6.4vw, 68px); line-height: 1.04; letter-spacing: -0.045em; font-weight: 600;
}
.lede { max-width: 560px; margin: 22px auto 0; font-size: clamp(16px, 1.6vw, 18px); color: var(--muted); }

/* Botón principal de descarga: lo primero que se ve después del título. */
.cta { display: flex; flex-direction: column; align-items: center; margin-top: 36px; }
.btn-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 58px; padding: 0 30px; border-radius: 14px;
  background: #ededed; color: #000; font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 10px 40px rgba(255,255,255,.12);
  transition: background .15s, box-shadow .25s, transform .35s cubic-bezier(0.32, 0.72, 0, 1);
}
.btn-download svg { transition: transform .35s cubic-bezier(0.32, 0.72, 0, 1); }
@media (hover: hover) {
  .btn-download:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,.4), 0 14px 50px rgba(255,255,255,.2); }
  .btn-download:hover svg { transform: translateY(2px); }
}
.btn-download:active { transform: scale(.97); }
.cta-meta { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

.download {
  width: min(680px, 100%); margin-top: 32px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  overflow: hidden;
}
.dl-row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 14px 14px 14px 20px;
}
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-label { font-weight: 500; font-size: 14px; }
.dl-meta { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.dl-meta .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 6px; background: #1a1a1a; border: 1px solid #2a2a2a; }
.dl-cmd {
  font-family: var(--mono); font-size: 12.5px; color: #bdbdbd;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid #2a2a2a; background: #141414; color: #d8d8d8; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: #1f1f1f; color: #fff; }
.icon-btn-light { background: #ededed; color: #000; border-color: #ededed; }
.icon-btn-light:hover { background: #fff; color: #000; }
.icon-btn.copied { color: #000; background: #ededed; border-color: #ededed; }
.fineprint { margin: 18px 0 0; font-size: 13px; color: var(--dim); }

/* --- Declaración --- */
.statement {
  border-top: 1px solid var(--line);
  padding: clamp(64px, 10vw, 140px) clamp(16px, 4vw, 40px);
  scroll-margin-top: 64px;
}
.statement p {
  max-width: 1100px; margin: 0;
  font-size: clamp(28px, 4.4vw, 56px); line-height: 1.1; letter-spacing: -0.035em; font-weight: 500;
}
.statement .dim { color: #555; }
.statement {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: clamp(32px, 6vw, 96px); align-items: center;
}

/* Buffer circular al lado del texto. */
.buffer {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--dim);
}
.buffer-head, .buffer-foot { display: flex; justify-content: space-between; align-items: center; }
.buffer-head { margin-bottom: 14px; color: var(--muted); }
.buffer-head span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.buffer-foot { margin-top: 12px; }
.buffer-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #ff4d4d;
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.7); animation: buffer-pulse 1.6s ease-in-out infinite;
}
@keyframes buffer-pulse { 50% { opacity: 0.35; } }
.buffer-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.buffer-grid i {
  --a: 0.08; aspect-ratio: 1; border-radius: 3px;
  background: rgba(237, 237, 237, var(--a));
  transition: background-color .5s ease, transform .3s var(--spring, ease), box-shadow .3s ease;
}
.buffer-grid i.head { background: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.55); transform: scale(1.12); }
/* Al apretar F9: el buffer entero se "guarda" en una pasada de luz. */
.buffer.saved .buffer-grid i { background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, 0.35); transition-delay: calc(var(--i) * 6ms); }
.buffer.saved #buffer-state { color: var(--fg); }

/* --- Columnas --- */
.columns {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.columns article { padding: 40px clamp(16px, 3vw, 40px) 48px; }
.columns article + article { border-left: 1px solid var(--line); }
.columns h3 { margin: 0 0 10px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.columns p { margin: 0; color: var(--muted); font-size: 15px; }

/* --- Datos --- */
.specs {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.specs div { display: flex; flex-direction: column; gap: 4px; padding: 28px clamp(16px, 2vw, 28px); }
.specs div + div { border-left: 1px solid var(--line); }
.specs strong { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.specs span { font-size: 13px; color: var(--muted); }

/* --- Preguntas --- */
.faq { max-width: 760px; margin: 0 auto; padding: clamp(64px, 9vw, 120px) clamp(16px, 4vw, 40px); scroll-margin-top: 64px; }
.faq h2 { margin: 0 0 24px; font-size: clamp(28px, 3.6vw, 40px); font-weight: 500; letter-spacing: -0.03em; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 36px 20px 0; position: relative;
  font-size: 16px; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg);
  transition: transform .2s, margin .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { margin: 0 0 22px; color: var(--muted); }

/* --- Pie --- */
.footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding: 28px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line); font-size: 13px;
}
.footer .brand { margin-right: auto; }
.footer a:hover { color: var(--fg); }
.footer .credit { color: #bdbdbd; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; transition: color .2s ease, text-decoration-color .2s ease; }
.footer .credit:hover { text-decoration-color: currentColor; }
.footer .langs { display: flex; gap: 10px; font-family: var(--mono); font-size: 12px; }
.footer .langs a { color: var(--dim); }
.footer .langs a[aria-current] { color: var(--fg); }

/* Aviso de idioma (lo arma main.js si el navegador prefiere otro) */
.lang-offer {
  position: fixed; left: 0; right: 0; bottom: 16px; z-index: 50; margin: 0 auto; width: max-content; transform: translateY(12px); opacity: 0;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  padding: 10px 10px 10px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(17, 17, 17, .92); backdrop-filter: blur(8px); font-size: 13px; color: var(--muted);
  transition: opacity .3s ease, transform .4s cubic-bezier(0.32, 0.72, 0, 1);
}
.lang-offer.show { opacity: 1; transform: none; }
.lang-offer a { color: var(--fg); font-weight: 500; white-space: nowrap; }
.lang-offer button {
  width: 26px; height: 26px; flex: none; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font: inherit; font-size: 16px; line-height: 1; cursor: pointer;
}
.lang-offer button:hover { background: var(--panel-2); color: var(--fg); }

/* --- Animaciones --- */
:root {
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --snap: cubic-bezier(0.12, 0.9, 0.25, 1);
}

/* El logo como ojo: el punto sigue al mouse, la ficha se inclina y parpadea. */
.eye {
  --tx: 0deg; --ty: 0deg; --px: 0px; --py: 0px;
  position: relative; display: grid; place-items: center;
  width: 88px; height: 88px; margin-bottom: 30px; border-radius: 24px;
  background: radial-gradient(120% 90% at 30% 15%, #2b2b2b 0%, #141414 45%, #070707 100%);
  border: 1px solid #2f2f2f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -10px 20px rgba(0,0,0,.6), 0 24px 40px rgba(0,0,0,.65);
  transform: perspective(500px) rotateX(var(--tx)) rotateY(var(--ty));
}
.eye-ring {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  border: 5px solid #f2f2f2; box-shadow: 0 0 18px rgba(255,255,255,.08);
  transition: transform .09s ease-out;
}
.eye-pupil {
  width: 18px; height: 18px; border-radius: 50%; background: #f5f5f5;
  transform: translate(var(--px), var(--py));
  transition: background .2s, box-shadow .2s;
}
.eye.blink .eye-ring { transform: scaleY(.08); }
.eye.rec .eye-pupil { background: #ff453a; box-shadow: 0 0 14px rgba(255,69,58,.9), 0 0 32px rgba(255,69,58,.45); }
.eye-pulse {
  position: absolute; inset: -1px; border-radius: 24px; pointer-events: none;
  border: 1px solid rgba(255,255,255,.5); opacity: 0;
}
.eye.rec .eye-pulse { animation: pulse .7s var(--spring); }
@keyframes pulse {
  from { opacity: .9; transform: scale(1); }
  to { opacity: 0; transform: scale(1.45); }
}

/* Tecla: se aplasta un poco al apretarla. */
@media (hover: hover) {
  .key:hover .key-cap { transform: translateY(2px); }
}
.key:active .key-cap, .key.is-down .key-cap { transform: translateY(9px) scaleX(1.03) scaleY(.94); transition-timing-function: var(--snap); transition-duration: .05s; }

/* Botones con resorte. */
.btn, .icon-btn { transition: background .15s, color .15s, border-color .15s, transform .35s var(--spring); }
.btn:active, .icon-btn:active { transform: scale(.94); }
#download svg { transition: transform .35s var(--spring); }
@media (hover: hover) {
  #download:hover svg { transform: translateY(2px); }
}
.icon-btn { position: relative; }
.icon-btn .i-check { position: absolute; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .35s var(--spring); }
.icon-btn .i-copy { transition: opacity .2s, transform .35s var(--spring); }
.icon-btn.copied .i-check { opacity: 1; transform: none; }
.icon-btn.copied .i-copy { opacity: 0; transform: scale(.5); }

/* Celdas con luz que sigue al mouse (estilo Vercel). */
.glow > * { position: relative; overflow: hidden; }
.glow > *::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.09), transparent 60%);
  transition: opacity .3s;
}
.glow > *::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  padding: 1px; border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.5), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity .3s;
}
@media (hover: hover) {
  .glow:hover > *::before, .glow:hover > *::after { opacity: 1; }
}

/* Texto grande que se enciende palabra por palabra al bajar. */
.statement .w { color: #3a3a3a; transition: color .4s ease; }
.statement .w.on { color: var(--fg); }

/* Secciones que aparecen al entrar en pantalla. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .9s var(--spring); }
.js .reveal.in { opacity: 1; transform: none; }

:focus-visible { outline: 2px solid #ededed; outline-offset: 3px; border-radius: 6px; }

/* --- Celulares --- */
@media (max-width: 860px) {
  .statement { grid-template-columns: 1fr; }
  .buffer { max-width: 380px; }
  .columns { grid-template-columns: 1fr; }
  .columns article + article { border-left: 0; border-top: 1px solid var(--line); }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specs div + div { border-left: 0; }
  .specs div:nth-child(even) { border-left: 1px solid var(--line); }
  .specs div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .nav-links a:not(.btn) { display: none; }
  .nav-links { gap: 10px; }
  .gh-label { display: none; }
  .dl-row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px; }
  .dl-label { grid-column: 1 / -1; }
  .hero { padding-top: 56px; }
  .cta, .btn-download { width: 100%; }
  .lang-offer { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .key-cap, .toast, .eye-ring, .eye-pupil, .btn, .icon-btn, .statement .w { transition: none; }
  .eye.rec .eye-pulse { animation: none; }
  .buffer-dot { animation: none; }
  .buffer-grid i { transition: none; }
  .lang-offer { transition: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
/* Pantallas muy angostas: de GitHub queda solo el ícono. */
@media (max-width: 400px) {
  .gh-stars { display: none; }
}
