/* Chipnomics — estilos del sitio.
   Identidad "chip": fondo casi negro, un solo acento ámbar, esquinas cortadas en diagonal
   (como un chip), contactos cuadrados, cables de circuito y textos chicos en letra de máquina.
   Sin curvas en la interfaz: el único elemento redondeado es el logo.
   El sitio no permite estilos en línea (seguridad), así que todo el diseño vive acá. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0e0d0b;
  --surface: #15130f;
  --surface-2: #1b1813;
  --line: #2b2720;
  --line-2: #3d362a;
  --text: #f4f1ea;
  --muted: #aba597;
  --amber: #f5b83d;
  --amber-hi: #ffcb5c;
  --amber-soft: rgba(245, 184, 61, 0.12);
  --ink: #1a1405;
  --grid: rgba(245, 184, 61, 0.035);
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

/* Fondo: dos resplandores ámbar muy suaves y una cuadrícula casi invisible que solo se
   asoma arriba y se apaga hacia abajo (así no compite con las líneas de la página).
   Van en capas fijas detrás de todo, para que no se muevan al bajar. */
body::before,
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background:
    radial-gradient(1100px 760px at 88% -12%, rgba(245, 184, 61, 0.11), transparent 62%),
    radial-gradient(900px 640px at -8% 112%, rgba(245, 184, 61, 0.06), transparent 62%),
    linear-gradient(180deg, rgba(245, 184, 61, 0.025), transparent 45%);
}
body::after {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 70% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 70% 0%, #000 0%, transparent 75%);
}

img, svg { display: block; max-width: 100%; }

a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: var(--amber-hi); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--amber); color: var(--ink); font-weight: 800;
  padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: 16px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Piezas de la identidad ---------- */

/* Texto chico en letra de máquina (etiquetas, fechas, fuentes) */
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Contacto cuadrado: reemplaza a los puntos redondos */
.mark { display: inline-block; width: 8px; height: 8px; background: var(--amber); flex: none; }

/* Esquinas cortadas. La forma vive en capas de fondo (::before borde, ::after relleno)
   para que el contorno de foco del teclado no quede recortado. */
.cut, .btn, .tag { position: relative; isolation: isolate; }
.cut::before, .cut::after, .btn::before, .btn::after, .tag::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
}
.cut { --c: 22px; }
.cut::before {
  inset: 0;
  /* Borde gris con la esquina cortada de arriba en ámbar */
  background: linear-gradient(135deg, var(--amber) 0 calc(var(--c) * 0.71 + 12px), var(--line) calc(var(--c) * 0.71 + 12px));
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.cut::after {
  inset: 1px;
  background: var(--surface);
  clip-path: polygon(calc(var(--c) - 0.5px) 0, 100% 0, 100% calc(100% - var(--c) + 0.5px), calc(100% - var(--c) + 0.5px) 100%, 0 100%, 0 calc(var(--c) - 0.5px));
}


/* Nota de fuente, con la rayita al costado */
.source { display: flex; gap: 14px; max-width: 560px; }
.source::before { content: ""; width: 2px; flex: none; background: var(--line-2); }
.source p { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.7; letter-spacing: 0.04em; color: var(--muted); }

/* Botones con esquinas cortadas */
.btn {
  --c: 10px;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 28px; text-decoration: none;
  font-weight: 800; font-size: 17px; letter-spacing: -0.005em;
  color: var(--ink); background: none; border: 0;
}
.btn::before {
  inset: 0; background: var(--amber);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.btn:hover { color: var(--ink); }
.btn:hover::before { background: var(--amber-hi); }
.btn svg { width: 18px; height: 18px; }
.btn-ghost { color: var(--text); }
.btn-ghost::before { background: var(--line-2); }
.btn-ghost::after {
  inset: 1px; background: var(--bg);
  clip-path: polygon(calc(var(--c) - 0.5px) 0, 100% 0, 100% calc(100% - var(--c) + 0.5px), calc(100% - var(--c) + 0.5px) 100%, 0 100%, 0 calc(var(--c) - 0.5px));
}
.btn-ghost:hover { color: var(--text); }
.btn-ghost:hover::before { background: var(--amber); }

/* Etiquetas: rectas, con un contacto cuadrado y la esquina de arriba cortada */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tag {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 11px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--amber);
}
.tag::before {
  inset: 0; background: var(--amber-soft);
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
}
.tag i { width: 5px; height: 5px; background: var(--amber); flex: none; }

/* Número de capítulo: un chip chiquito igual al logo (dibujo en chip-badge.svg) con el número adentro */
.chip-no {
  flex: none;
  width: 64px; height: 64px;
  display: inline-flex; align-items: center; justify-content: center;
  background: url("/assets/img/chip-badge.svg") center / 100% 100% no-repeat;
  font-family: var(--mono); font-size: 14px; font-weight: 800; letter-spacing: 0.02em; color: var(--amber);
}

/* ---------- Cabecera ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 76px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: -0.02em; font-size: 19px; }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; }
.brand .g, .hi { color: var(--amber); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  position: relative; padding: 12px 12px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; background: var(--amber); }

/* ---------- Portada ---------- */
.hero { padding: 40px 0 128px; }
.hero .meta-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.hero .meta-row span { display: inline-flex; align-items: center; gap: 10px; }
.hero-grid { display: flex; flex-wrap: wrap; gap: 56px 64px; align-items: center; margin-top: 88px; }
.hero-text { flex: 1 1 520px; min-width: 0; }
.hero-art-box { flex: 1 1 480px; min-width: 0; max-width: 620px; margin: 0 auto; }
.hero-art { width: 100%; height: auto; }
.hero .eyebrow { margin: 0; color: var(--amber); font-size: 13px; }
.hero h1 { margin: 24px 0 0; font-size: clamp(42px, 5.2vw, 72px); line-height: 1.04; letter-spacing: -0.04em; font-weight: 800; }
.hero .lead { margin: 32px 0 0; max-width: 580px; font-size: 20px; color: var(--muted); }
.hero .actions { margin-top: 48px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero .source { margin-top: 64px; }

/* Dibujo del circuito */
.trace { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linejoin: miter; stroke-linecap: square; opacity: 0.42; }
.trace.faint { opacity: 0.18; }
.pad { fill: var(--bg); stroke: var(--amber); stroke-width: 2; }
.coin { fill: var(--bg); stroke: var(--amber); stroke-width: 2; }
.coin-t { fill: var(--amber); font: 700 16px var(--mono); }
.lbl { fill: var(--muted); font: 600 15px var(--mono); letter-spacing: 1.4px; }
.spark { fill: var(--amber); }
.signal { fill: none; stroke: var(--amber-hi); stroke-width: 3; stroke-linecap: square; stroke-dasharray: 12 600; stroke-dashoffset: 612; animation: signal 4.8s linear infinite; }
.signal.s2 { animation-delay: 1.6s; }
.signal.s3 { animation-delay: 3.2s; }
@keyframes signal { to { stroke-dashoffset: 0; } }

/* ---------- Secciones ---------- */
.section { padding: 120px 0; border-top: 1px solid var(--line); }
.section.flush { border-top: 0; padding-top: 0; }

/* Encabezado de capítulo, con un cable ámbar que termina en un contacto */
.chapter {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: 26px; border-bottom: 1px solid var(--line);
}
.chapter::before { content: ""; position: absolute; left: 0; bottom: -1px; width: 112px; height: 2px; background: var(--amber); }
.chapter::after { content: ""; position: absolute; left: 112px; bottom: -5px; width: 9px; height: 9px; border: 2px solid var(--amber); background: var(--bg); }
.chapter-name { display: flex; align-items: center; gap: 18px; }
.chapter h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }

.statement { margin: 72px 0 0; max-width: 840px; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 800; }
.section-lead { margin: 24px 0 0; max-width: 640px; color: var(--muted); font-size: 19px; }

/* Temas */
.topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 28px; margin-top: 72px; }
.card { padding: 44px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card .icon { width: 40px; height: 40px; color: var(--amber); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.card h3 { margin: 36px 0 12px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.card p { margin: 0; color: var(--muted); }
.card .tags { margin-top: 32px; }

/* Reglas */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 56px 48px; margin-top: 80px; }
.rule { position: relative; padding-top: 32px; border-top: 1px solid var(--line); }
.rule::before { content: ""; position: absolute; left: 0; top: -1px; width: 40px; height: 2px; background: var(--amber); }
.rule .n { display: block; font-family: var(--mono); font-size: 40px; font-weight: 700; line-height: 1; color: var(--amber); }
.rule h3 { margin: 28px 0 10px; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.rule p { margin: 0; color: var(--muted); font-size: 16px; }

/* Llamado a YouTube */
.cta { --c: 34px; padding: clamp(40px, 6vw, 80px); display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-end; justify-content: space-between; }
.cta-text { flex: 1 1 520px; min-width: 0; }
.cta .mono { margin: 0; display: flex; align-items: center; gap: 10px; }
.cta h2 { margin: 24px 0 0; font-size: clamp(36px, 4.4vw, 60px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 800; }
.cta p.sub { margin: 20px 0 0; color: var(--muted); font-size: 19px; max-width: 520px; }

/* Preguntas (details/summary: funciona sin JavaScript) */
.faq { max-width: 880px; margin-top: 40px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 24px; padding: 28px 0; font-weight: 700; font-size: 20px; line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--amber); font-weight: 700; font-size: 22px; line-height: 1.2; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 28px; max-width: 720px; color: var(--muted); }

/* ---------- Páginas de texto ---------- */
.page { padding: 88px 0 120px; }
.prose { max-width: 800px; }
.prose .kicker { margin: 0; display: flex; align-items: center; gap: 10px; }
.prose h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin: 22px 0 28px; }
.prose h2 { position: relative; font-size: 24px; font-weight: 800; margin: 64px 0 14px; padding-top: 24px; border-top: 1px solid var(--line); letter-spacing: -0.015em; }
.prose h2::before { content: ""; position: absolute; left: 0; top: -1px; width: 40px; height: 2px; background: var(--amber); }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 22px; list-style: square; }
.prose li { margin: 10px 0; }
.prose li::marker { color: var(--amber); }
.updated { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 44px; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 64px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 28px; flex-wrap: wrap; }
.site-footer nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-footer nav a:hover, .site-footer nav a[aria-current="page"] { color: var(--text); }
.site-footer .note { flex-basis: 100%; margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Pantallas chicas ---------- */
@media (max-width: 760px) {
  .hero { padding-bottom: 88px; }
  .hero-grid { margin-top: 56px; }
  .section { padding: 80px 0; }
  .statement { margin-top: 48px; }
  .topics, .rules { margin-top: 48px; }
  .card { padding: 32px 26px; }
  .chapter-name { gap: 18px; }
  .chapter h2 { font-size: 23px; }
  .faq summary { font-size: 18px; padding: 22px 0; }
}
@media (max-width: 480px) {
  .nav a { padding: 12px 8px; letter-spacing: 0.1em; }
  .hero .meta-row span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .signal { animation: none; display: none; }
}
