/* Anti-IA · sitio web
   Chasis de los sitios de las otras apps (inspirado en apple.com): mosaicos a todo lo ancho que alternan claro y
   oscuro, tipografía del sistema con tracking negativo y todo en monocromo, salvo el azul del cursor
   del ícono (#2997FF en oscuro / #0071E3 en claro). El código va en JetBrains Mono.
   Identidad: mitad negra / mitad blanca, como el ícono «IDE Negro / IDE Blanco».
   El juego es vertical: las capturas usan marco de teléfono (.screen.tall). */

@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Tonos crudos */
  --white: #ffffff;
  --parchment: #f5f5f7;
  --ink: #1d1d1f;
  --ink-muted: #6e6e73;      /* 4.9:1 sobre blanco */
  --hairline: #d2d2d7;
  --black: #000000;
  --night: #050608;          /* fondo del héroe: editor apagado */
  --tile: #161617;
  --on-dark: #f5f5f7;
  --on-dark-muted: #a1a1a6;  /* 7.6:1 sobre negro */
  --blue-dark: #2997FF;      /* 7.4:1 sobre negro */
  --blue-light: #0071E3;     /* 4.6:1 sobre blanco */

  /* Botón principal: azul de Apple con texto blanco (4.6:1) en ambos temas */
  --btn: var(--blue-light);
  --on-btn: #ffffff;

  /* Sintaxis (las del juego) */
  --syn-kw: #c678dd;
  --syn-num: #d19a66;
  --syn-str: #98c379;
  --syn-fn: #61afef;
  --syn-com: #7f848e;

  /* Superficies de la página (cambian con el tema del sistema) */
  --bg: var(--white);
  --bg-alt: var(--parchment);
  --text: var(--ink);
  --text-muted: var(--ink-muted);
  --accent: var(--blue-light);
  --line: var(--hairline);
  --nav-bg: rgb(245 245 247 / 0.8);

  @media (prefers-color-scheme: dark) {
    --bg: var(--black);
    --bg-alt: var(--tile);
    --text: var(--on-dark);
    --text-muted: var(--on-dark-muted);
    --accent: var(--blue-dark);
    --line: #424245;
    --nav-bg: rgb(22 22 23 / 0.8);
  }

  --font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius-card: 18px;
  --wrap: 1024px;

  accent-color: var(--accent);
  scrollbar-color: color-mix(in srgb, var(--text) 40%, transparent) transparent;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
code, kbd, .mono { font-family: var(--mono); letter-spacing: 0; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

/* ---------- Navegación: barra delgada con vidrio ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent); }
.brand .dash { color: var(--accent); margin-inline: -0.12em; }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 13px; letter-spacing: -0.01em; }
.nav-links a { color: var(--text); opacity: 0.8; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links a[aria-current="page"] { opacity: 1; font-weight: 600; }
.nav .btn { min-height: 28px; padding: 5px 14px; font-size: 13px; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
}

/* ---------- Botones: píldora azul ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 22px; border-radius: 980px;
  background: var(--btn); color: var(--on-btn);
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  border: 0;
  transition: transform 0.15s ease, filter 0.2s ease;
  touch-action: manipulation;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 35%, transparent); font-weight: 400; }
.btn.ghost:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.soon { margin-top: 14px; font-size: 14px; color: var(--text-muted); }

/* ---------- Mosaicos ---------- */
.tile { padding: 88px 0 0; overflow: hidden; text-align: center; }
.tile.alt { background: var(--bg-alt); }
.tile.dark { background: var(--black); color: var(--on-dark); --text: var(--on-dark); --text-muted: var(--on-dark-muted); --accent: var(--blue-dark); --bg: var(--black); --bg-alt: var(--tile); color-scheme: dark; }
/* Brillo azul detrás del producto, como la luz del monitor */
.tile.glow {
  background:
    radial-gradient(60% 45% at 50% 100%, rgb(41 151 255 / 0.26), transparent 70%),
    radial-gradient(40% 35% at 20% 90%, rgb(41 151 255 / 0.12), transparent 70%),
    var(--night);
  --bg: var(--night);
}
/* Violeta de la IA rival para la sección VS IA */
.tile.versus {
  background:
    radial-gradient(55% 45% at 50% 100%, rgb(168 85 247 / 0.26), transparent 70%),
    radial-gradient(35% 30% at 20% 85%, rgb(41 151 255 / 0.20), transparent 70%),
    #07060d;
  --bg: #07060d;
}

.eyebrow { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--accent); margin: 0 0 10px; letter-spacing: 0; }
.eyebrow::before { content: "// "; opacity: 0.6; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
.display { font-size: clamp(38px, 7vw, 80px); line-height: 1.05; letter-spacing: -0.035em; }
.headline { font-size: clamp(32px, 5vw, 56px); line-height: 1.07; letter-spacing: -0.03em; }
.hl { color: var(--accent); }
.headline code { font-size: 0.86em; letter-spacing: -0.06em; font-weight: 700; }
.lead { font-size: clamp(19px, 2.4vw, 24px); line-height: 1.35; color: var(--text-muted); margin: 16px auto 0; max-width: 40ch; text-wrap: pretty; letter-spacing: -0.015em; }
.note { font-size: 14px; color: var(--text-muted); max-width: 62ch; margin: 28px auto 0; text-wrap: pretty; }
.pad-b { padding-bottom: 88px; }

/* ---------- Ventana de editor (código real del juego) ---------- */
.ide {
  width: min(100%, 520px); margin: 40px auto 0; text-align: left;
  background: #0b0c0f; color: #e6e6e6; color-scheme: dark;
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.10), 0 30px 80px rgb(41 151 255 / 0.18);
  font-family: var(--mono); font-size: clamp(13px, 1.9vw, 15px); line-height: 1.7; letter-spacing: 0;
}
.ide-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #15171c; border-bottom: 1px solid rgb(255 255 255 / 0.06); }
.ide-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.ide-bar i:nth-child(2) { background: #febc2e; }
.ide-bar i:nth-child(3) { background: #28c840; }
.ide-bar span { margin-left: 10px; font-size: 12px; color: #a1a1a6; }
.ide pre { margin: 0; padding: 16px 18px; overflow-x: auto; counter-reset: ln; }
.ide pre code { display: block; }
.ide .l { display: block; white-space: pre; }
.ide .l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 2ch; margin-right: 16px; text-align: right; color: #5c6370; }
.ide .term { border-top: 1px solid rgb(255 255 255 / 0.08); padding: 12px 18px 14px; background: #08090b; color: #a1a1a6; }
.ide .term b { color: var(--blue-dark); font-weight: 700; }
.ide .term .ok { color: #28c840; }
.ide .cursor { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.2em; background: var(--blue-dark); }
@media (prefers-reduced-motion: no-preference) {
  .ide .cursor { animation: blink 1.1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
}
.kw { color: var(--syn-kw); } .num { color: var(--syn-num); } .str { color: var(--syn-str); } .fn { color: var(--syn-fn); } .com { color: var(--syn-com); }

/* ---------- Capturas verticales (1320 × 2868) ---------- */
.screen {
  border-radius: clamp(22px, 4vw, 44px);
  box-shadow: rgb(0 0 0 / 0.22) 3px 5px 30px 0;
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  background: #0b0c0f;
}
.tile.dark .screen { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 30px 80px rgb(41 151 255 / 0.16); }
.tile.versus .screen { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 30px 80px rgb(168 85 247 / 0.20); }

.stage { margin: 56px auto 0; padding-inline: 16px; display: flex; justify-content: center; align-items: flex-end; gap: clamp(12px, 3vw, 36px); }
.stage .screen { width: min(34vw, 300px); }
.stage .screen.side { width: min(26vw, 240px); margin-bottom: 40px; }
/* Recorte inferior suave para que el teléfono "salga" del mosaico */
.stage.crop { max-height: 600px; overflow: hidden; align-items: flex-start; mask-image: linear-gradient(#000 80%, transparent); -webkit-mask-image: linear-gradient(#000 80%, transparent); }
.stage.crop .screen.side { margin-top: 48px; margin-bottom: 0; }
@media (max-width: 640px) {
  .stage .screen.side { display: none; }
  .stage .screen { width: min(72vw, 300px); }
  .stage.crop { max-height: 520px; }
}

/* ---------- Mitad negra / mitad blanca ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split .half { padding: 64px clamp(16px, 4vw, 56px) 72px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.split .half.black { background: #000; color: #f5f5f7; color-scheme: dark; --accent: var(--blue-dark); }
.split .half.white { background: #fff; color: #1d1d1f; color-scheme: light; --accent: var(--blue-light); }
.split h3 { font-family: var(--mono); font-size: clamp(20px, 2.6vw, 28px); letter-spacing: 0; }
.split p { margin: 8px 0 0; font-size: 15px; max-width: 30ch; }
.split .half.black p { color: #a1a1a6; }
.split .half.white p { color: #6e6e73; }
.mini { width: min(100%, 340px); margin-top: 28px; text-align: left; border-radius: 14px; overflow: hidden; font-family: var(--mono); font-size: 13px; line-height: 1.75; letter-spacing: 0; }
.mini pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.mini .bar { padding: 7px 14px; font-size: 11px; }
.half.black .mini { background: #0f1014; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.10); }
.half.black .mini .bar { background: var(--blue-dark); color: #001428; }
.half.white .mini { background: #f5f5f7; color: #1d1d1f; box-shadow: 0 0 0 1px #d2d2d7; }
.half.white .mini .bar { background: var(--blue-light); color: #fff; }
.half.white .kw { color: #a626a4; } .half.white .num { color: #986801; } .half.white .str { color: #50a14f; } .half.white .fn { color: #0b5cc5; } .half.white .com { color: #696c77; }
@media (max-width: 640px) { .split { grid-template-columns: 1fr; } }

/* ---------- Tarjetas ---------- */
.uses { list-style: none; padding: 0; margin: 40px auto 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; max-width: 900px; }
.uses li { background: var(--bg); border-radius: var(--radius-card); padding: 20px 16px; text-align: left; }
.tile:not(.alt) .uses li { background: var(--bg-alt); }
.uses strong { display: block; font-size: 17px; }
.uses span { font-size: 14px; color: var(--text-muted); line-height: 1.4; display: block; margin-top: 4px; }
.uses .file { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0; margin: 0 0 6px; }
.uses .ico { width: 28px; height: 28px; margin: 0 0 10px; color: var(--accent); }
.uses .ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Rivales de VS IA */
.rivals { list-style: none; padding: 0; margin: 40px auto 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; max-width: 900px; text-align: left; }
.rivals li { background: rgb(255 255 255 / 0.06); border: 1px solid rgb(255 255 255 / 0.10); border-radius: var(--radius-card); padding: 20px; }
.rivals .name { font-family: var(--mono); font-weight: 700; font-size: 19px; letter-spacing: 0; }
.rivals .lvl { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 980px; }
.rivals .easy { background: rgb(40 200 64 / 0.16); color: #5ee07a; }
.rivals .mid { background: rgb(41 151 255 / 0.18); color: #6cb6ff; }
.rivals .hard { background: rgb(168 85 247 / 0.22); color: #d3a6ff; }
.rivals p { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }

/* Pasos numerados */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 36px auto 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 24px; max-width: 900px; text-align: left; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--btn); color: var(--on-btn); font-family: var(--mono); font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.steps strong { display: block; }
.steps span { color: var(--text-muted); font-size: 15px; }
.steps code { font-size: 0.9em; color: var(--accent); }

/* Explorador de carpetas */
.tree { list-style: none; margin: 36px auto 0; padding: 18px 20px; max-width: 560px; text-align: left; font-family: var(--mono); font-size: 14px; letter-spacing: 0; line-height: 1.9; background: var(--bg); border-radius: var(--radius-card); box-shadow: 0 0 0 1px var(--line); }
.tile:not(.alt) .tree { background: var(--bg-alt); }
.tree li { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 12px; }
@media (max-width: 480px) { .tree li { line-height: 1.5; padding: 4px 0; } .tree li span:last-child { font-size: 12px; } }
.tree li span:first-child::before { content: "▸ "; color: var(--accent); }
.tree li span:last-child { color: var(--text-muted); }

/* Cifras */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 28px; max-width: 900px; margin: 44px auto 0; }
.facts b { display: block; font-family: var(--mono); color: var(--accent); font-size: clamp(40px, 6vw, 60px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.facts span { color: var(--text-muted); font-size: 15px; }

/* Galería deslizable (scroll nativo con imán) */
.gallery { margin-top: 48px; padding-bottom: 88px; }
.gallery-track {
  display: flex; gap: 20px; overflow-x: auto; padding: 8px max(16px, (100vw - var(--wrap)) / 2) 24px;
  scroll-snap-type: x mandatory; scroll-padding-inline: max(16px, (100vw - var(--wrap)) / 2);
  overscroll-behavior-x: contain; scrollbar-width: thin;
}
.gallery-track:focus-visible { outline-offset: -4px; }
.gallery-track figure { margin: 0; flex: 0 0 auto; width: min(62vw, 240px); scroll-snap-align: start; }
.gallery-track .screen { width: 100%; border-radius: clamp(20px, 5vw, 32px); }
.gallery-track figcaption { font-size: 14px; color: var(--text-muted); margin-top: 12px; text-align: left; }
@media (prefers-reduced-motion: no-preference) { .gallery-track { scroll-behavior: smooth; } }

.privacy-points { list-style: none; padding: 0; margin: 36px auto 0; max-width: 760px; display: grid; gap: 14px; text-align: left; }
.privacy-points li { padding: 18px 20px; border-radius: var(--radius-card); background: var(--bg-alt); }
.tile.alt .privacy-points li { background: var(--bg); }

/* Aparición suave: el estado final es el visible; solo se anima si el usuario lo permite */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; translate: 0 24px; transition: opacity 0.7s ease, translate 0.7s cubic-bezier(.2,.7,.2,1); }
  .js .reveal.visible { opacity: 1; translate: 0 0; }
}

/* ---------- Páginas de texto (legal / soporte) ---------- */
.doc { padding: 64px 0 88px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(36px, 5vw, 48px); letter-spacing: -0.03em; line-height: 1.08; }
.doc .updated { color: var(--text-muted); font-size: 14px; margin-top: 10px; }
.doc h2 { font-size: 24px; letter-spacing: -0.02em; margin: 44px 0 10px; scroll-margin-top: 72px; }
.doc h3 { font-size: 19px; margin: 24px 0 6px; }
.doc ul, .doc ol { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
.doc .lead { margin-left: 0; max-width: none; }
.summary { background: var(--bg-alt); border-radius: var(--radius-card); padding: 22px 24px; margin-top: 32px; }
.summary h2 { margin-top: 0; font-size: 19px; }
.summary ul { margin: 0; }
.table-scroll { overflow-x: auto; margin: 16px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details > summary { cursor: pointer; font-weight: 600; font-size: 17px; }
details p, details ol, details ul { margin: 10px 0 0; color: var(--text-muted); }
.callout { background: var(--bg-alt); border-radius: var(--radius-card); padding: 6px 24px 18px; margin-top: 44px; }
.callout h2 { margin-top: 18px; }

/* ---------- Pie ---------- */
.footer { background: var(--bg-alt); color: var(--text-muted); font-size: 12px; padding: 28px 0 40px; letter-spacing: -0.01em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }
.footer-links a { color: var(--text); font-size: 13px; }
.footer p { margin: 6px 0; line-height: 1.5; }
