/* Dirección: una mesa de juego de noche. Tinta oscura, verde de "pasa" y coral de "suspende";
   la tipografía grande lleva el mensaje y los números van en monoespaciada, como en un terminal. */
:root {
  --ink: #0b0f14;
  --panel: #121922;
  --panel-2: #18212d;
  --line: rgba(148, 170, 190, .16);
  --line-2: rgba(148, 170, 190, .30);
  --text: #eef2ef;
  --muted: #8f9ca9;
  --mint: #3df2b1;
  --mint-ink: #04241a;
  --coral: #ff5a6e;
  --amber: #f2c14e;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, Menlo, monospace;
  --r: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--text); font: 17px/1.65 var(--f-body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(148, 170, 190, .07) 1px, transparent 0); background-size: 28px 28px; }
a { color: var(--mint); text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; letter-spacing: -.02em; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { font: 700 13px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mint); margin: 0 0 14px; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

/* Cabecera */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11, 15, 20, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 14px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 17px var(--f-display); white-space: nowrap; }
.logo img { width: 34px; height: 34px; border-radius: 50%; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav a.active { box-shadow: inset 0 -2px 0 var(--mint); border-radius: 0; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 16px var(--f-body); text-decoration: none; cursor: pointer;
  border-radius: 12px; padding: 13px 20px; border: 1px solid transparent; color: var(--text); background: var(--panel-2); transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--mint); color: var(--mint-ink); }
.btn.primary:hover { background: #6ff7c6; }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--mint); }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.nav .btn.small { padding: 8px 14px; color: var(--mint-ink); }

/* Portada */
.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(44px, 7vw, 86px); line-height: .98; font-weight: 800; margin: 0 0 22px; letter-spacing: -.035em; }
.mark { color: var(--mint); position: relative; white-space: nowrap; }
.mark::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .12em; background: var(--mint); opacity: .35; border-radius: 4px; }
.lead { font-size: 20px; line-height: 1.55; color: var(--muted); max-width: 33em; margin: 0 0 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.sim { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.sim-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: 600 13px var(--f-mono); color: var(--muted); margin-bottom: 12px; }
.sim-head span:first-child { color: var(--text); }
.sim canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.sim-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.sim-count { display: flex; align-items: baseline; gap: 4px; }
.sim-count b { font: 700 40px/1 var(--f-mono); color: var(--mint); font-variant-numeric: tabular-nums; }
.sim-count span { color: var(--muted); font-size: 15px; }

.gap-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(61, 242, 177, .05), transparent 40%, transparent 60%, rgba(255, 90, 110, .05)); }
.gap-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 32px; align-items: center; padding-top: 44px; padding-bottom: 44px; }
.gap-num .mono { font-size: clamp(56px, 8vw, 96px); font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.gap-num p { color: var(--muted); margin: 8px 0 0; font-size: 15px; max-width: 22em; }
.gap-num:last-child { text-align: right; } .gap-num:last-child p { margin-left: auto; }
.gap-mid p { margin: 0; font-size: 18px; text-align: center; }
.good { color: var(--mint); } .bad { color: var(--coral); }

.block { padding: 88px 0; }
.block.alt { background: linear-gradient(180deg, rgba(24, 33, 45, .55), rgba(11, 15, 20, 0)); border-top: 1px solid var(--line); }
.block h2 { font-size: clamp(32px, 4.4vw, 50px); line-height: 1.05; margin: 0 0 16px; font-weight: 800; }
.two-col { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: start; }
.col-head { position: sticky; top: 96px; display: grid; gap: 4px; justify-items: start; }
.col-head p.muted { margin: 0 0 18px; font-size: 18px; }

.syllabus { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.syllabus a { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: baseline; padding: 20px 4px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: background .15s, padding .15s; }
.syllabus a:hover { background: rgba(61, 242, 177, .04); padding-left: 12px; }
.syllabus .num { font: 700 15px var(--f-mono); color: var(--muted); }
.syllabus h3 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 600; }
.syllabus p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.chip { font: 700 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
.chip.free { color: var(--mint); background: rgba(61, 242, 177, .1); }
.chip.lock { color: var(--muted); background: rgba(148, 170, 190, .1); }
.chip.done { color: var(--mint-ink); background: var(--mint); }

.howto { list-style: none; counter-reset: h; padding: 0; margin: 4px 0 24px; display: grid; gap: 12px; }
.howto li { counter-increment: h; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: baseline; font-size: 17px; }
.howto li::before { content: counter(h, decimal-leading-zero); font: 700 14px var(--f-mono); color: var(--mint); }

.ig { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 16px; max-width: 400px; justify-self: center; width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4); transform: rotate(1.5deg); }
.ig-top { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.ig-top img, .ig-c img { width: 32px; height: 32px; border-radius: 50%; }
.ig-top span { display: block; color: var(--muted); font-size: 12px; }
.ig-reel { margin: 14px 0; aspect-ratio: 4/3; border-radius: 14px; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, rgba(61, 242, 177, .18), transparent 60%), var(--ink); }
.ig-reel .mono { font-size: 72px; font-weight: 700; color: var(--mint); line-height: 1; }
.ig-reel small { color: var(--muted); }
.ig-c { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 6px 0; }
.ig-c p { margin: 0; } .ig-c b { margin-right: 6px; }
.ig-c .av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font: 700 10px var(--f-mono); color: var(--muted); }
.ig-c.reply { padding-left: 24px; }

.faq h2 { margin-bottom: 26px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font: 600 19px var(--f-display); padding: 20px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); color: var(--mint); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); margin: 0 0 20px; max-width: 62ch; }

footer.site { border-top: 1px solid var(--line); padding: 36px 0 56px; color: var(--muted); font-size: 14px; }
footer.site .container { display: grid; gap: 10px; max-width: 900px; margin: 0; margin-inline: auto; }

/* Acceso */
.gate { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 48px 0; }
.gate-card { width: min(460px, 100% - 40px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 24px; padding: 34px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.gate-card img { width: 60px; height: 60px; border-radius: 50%; }
.gate-card h1 { font-size: 30px; margin: 16px 0 6px; } .gate-card > p { color: var(--muted); margin: 0 0 22px; }
.code-input { width: 100%; text-align: center; font: 700 26px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; padding: 16px;
  border-radius: 14px; background: var(--ink); color: var(--text); border: 1px solid var(--line-2); margin-bottom: 12px; }
.code-input.err { border-color: var(--coral); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.gate-msg { min-height: 24px; font-size: 15px; margin: 12px 0 0; }
.gate-msg.err { color: var(--coral); } .gate-msg.ok { color: var(--mint); }
.gate-help { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; font-size: 15px; color: var(--muted); }

/* Formación */
.course { display: grid; grid-template-columns: 280px 1fr; gap: 40px; padding: 36px 0 72px; align-items: start; }
.sidebar { position: sticky; top: 88px; }
.sidebar h2 { font-size: 17px; margin: 0 0 12px; }
.progress { height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--mint); transition: width .4s; }
.progress-label { font: 600 13px var(--f-mono); color: var(--muted); margin: 8px 0 14px; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list a { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font-size: 15px; line-height: 1.3; }
.lesson-list a:hover { color: var(--text); background: rgba(148, 170, 190, .06); }
.lesson-list a.current { color: var(--text); background: var(--panel); }
.lesson-list .dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 700 12px var(--f-mono); border: 1px solid var(--line-2); }
.lesson-list a.done .dot { background: var(--mint); border-color: var(--mint); color: var(--mint-ink); }
.lesson-list a.current .dot { border-color: var(--mint); color: var(--mint); }
.lesson-list a.locked { opacity: .45; }
.sidebar .tool { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.toggle-list { display: none; margin: 0 0 10px; }

.lesson { max-width: 760px; }
.lesson-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 4px; }
.lesson-head .big { font: 700 15px var(--f-mono); color: var(--mint); }
.lesson-head .lvl { font: 600 13px var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lesson h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.04; font-weight: 800; margin: 6px 0 24px; }
.lesson h3 { font-size: 22px; margin: 30px 0 8px; }
.lesson p, .lesson li { max-width: 65ch; }
.lesson li { margin-bottom: 6px; }
.video { aspect-ratio: 16/9; border-radius: 18px; border: 1px solid var(--line); margin: 0 0 28px; display: grid; place-content: center; text-align: center; color: var(--muted);
  background: radial-gradient(circle at 50% 45%, rgba(61, 242, 177, .12), transparent 55%), var(--panel); font-size: 15px; }
.video-real { display: block; width: 100%; aspect-ratio: 16/9; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); margin: 0 0 28px; }
.video .play { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; background: rgba(61, 242, 177, .14); color: var(--mint); font-size: 22px; }
.key { border-left: 3px solid var(--mint); padding: 6px 0 6px 18px; margin: 26px 0; font: 600 21px/1.4 var(--f-display); max-width: 34em; }
.key.bad { border-left-color: var(--coral); }
.formula { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 18px 0; font: 600 16px/1.55 var(--f-mono); color: var(--mint); }
.note { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
td { font-variant-numeric: tabular-nums; }
th { color: var(--muted); font: 600 12px var(--f-mono); text-transform: uppercase; letter-spacing: .05em; }

.quiz { margin-top: 36px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 24px; }
.quiz .label { font: 700 12px var(--f-mono); color: var(--mint); letter-spacing: .08em; text-transform: uppercase; }
.quiz .q { font: 600 21px/1.35 var(--f-display); margin: 8px 0 16px; }
.opt { display: block; width: 100%; text-align: left; font: 600 16px var(--f-body); color: var(--text); background: var(--ink); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 13px 16px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s; }
.opt:hover { border-color: var(--mint); }
.opt.right { border-color: var(--mint); background: rgba(61, 242, 177, .1); }
.opt.wrong { border-color: var(--coral); background: rgba(255, 90, 110, .08); }
.feedback { margin: 12px 0 0; font-size: 15px; }
.pos { color: var(--mint); } .neg { color: var(--coral); }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.band { margin-top: 26px; background: var(--panel); border: 1px solid rgba(61, 242, 177, .3); border-radius: 18px; padding: 24px;
  display: flex; gap: 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.band h2 { font-size: 24px; margin: 0 0 4px; } .band p { margin: 0; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 22px; }
.facts div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 6px; }
.facts b { font-size: 26px; color: var(--mint); }
.facts span { color: var(--muted); font-size: 15px; line-height: 1.4; }
.reco { margin: 26px 0 12px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(120deg, rgba(61, 242, 177, .12), rgba(61, 242, 177, .03)); border: 1px solid rgba(61, 242, 177, .4); border-radius: 18px; padding: 22px; }
.reco strong { font: 700 21px var(--f-display); }
.reco p { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr; } }
.pending { border: 1px dashed var(--amber); color: var(--amber); border-radius: 12px; padding: 14px 16px; margin: 20px 0; }
.done-card { text-align: center; } .done-card svg { width: 96px; margin: 0 auto 8px; display: block; }

/* Calculadora */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips button { font: 600 14px var(--f-body); color: var(--text); background: transparent; border: 1px solid var(--line-2); border-radius: 99px; padding: 8px 14px; cursor: pointer; }
.chips button:hover { border-color: var(--mint); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.calc label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.calc input[type=number] { width: 100%; margin-top: 6px; padding: 11px 12px; font: 700 17px var(--f-mono); color: var(--text); background: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; }
.calc input:disabled { opacity: .5; }
.calc .check { display: flex; gap: 8px; align-items: center; margin-top: 16px; color: var(--text); font-size: 15px; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 22px; }
.res { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.res small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; min-height: 2.6em; }
.res b { font: 700 26px var(--f-mono); font-variant-numeric: tabular-nums; }
.res.hl { border-color: rgba(61, 242, 177, .45); background: linear-gradient(180deg, rgba(61, 242, 177, .07), var(--panel)); }

/* Pantallas medianas y móviles */
@media (max-width: 960px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; gap: 40px; }
  .col-head { position: static; }
  .sim { max-width: 520px; width: 100%; justify-self: center; }
  .gap-grid { grid-template-columns: 1fr 1fr; }
  .gap-mid { grid-column: 1 / -1; order: 3; }
  .gap-mid p { text-align: left; }
  .course { grid-template-columns: 1fr; gap: 24px; }
  .sidebar { position: static; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
  .sidebar .lesson-list, .sidebar .tool { display: none; }
  .sidebar.open .lesson-list, .sidebar.open .tool { display: block; }
  .toggle-list { display: inline-flex; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 18px; }
  .nav a.hide-sm { display: none; }
  .hero { padding-top: 36px; }
  .lead { font-size: 18px; }
  .block { padding: 64px 0; }
  .syllabus a { grid-template-columns: 40px 1fr; }
  .syllabus .chip { grid-column: 2; justify-self: start; }
  .gap-grid { grid-template-columns: 1fr; gap: 22px; }
  .gap-num:last-child { text-align: left; } .gap-num:last-child p { margin-left: 0; }
  .results { grid-template-columns: 1fr 1fr; }
  .key { font-size: 19px; }
}
@media (max-width: 440px) { .logo-text { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
