:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #efece3;
  --text: #1d2621;
  --muted: #5b655f;
  --line: #ddd8cb;
  --accent: #1f5c45;
  --accent-strong: #154232;
  --accent-soft: #e2eee7;
  --warn-soft: #f7ecd6;
  --warn: #7a5410;
  --code-bg: #17201b;
  --code-text: #e7efe9;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(20 30 25 / 6%), 0 8px 24px rgb(20 30 25 / 6%);
  --maxw: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111613;
    --surface: #182019;
    --surface-2: #1e2820;
    --text: #e8ede9;
    --muted: #a3ada6;
    --line: #2c3830;
    --accent: #6cc39c;
    --accent-strong: #8fd6b5;
    --accent-soft: #1c3329;
    --warn-soft: #33290f;
    --warn: #e9c46a;
    --code-bg: #0b0f0d;
    --code-text: #dfe8e2;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111613; --surface: #182019; --surface-2: #1e2820; --text: #e8ede9; --muted: #a3ada6;
  --line: #2c3830; --accent: #6cc39c; --accent-strong: #8fd6b5; --accent-soft: #1c3329;
  --warn-soft: #33290f; --warn: #e9c46a; --code-bg: #0b0f0d; --code-text: #dfe8e2; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--bg); font-size: .8rem; font-weight: 800; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav .nav-hide { display: none; }
@media (min-width: 760px) { .nav .nav-hide { display: inline-block; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1px solid transparent; font-size: .98rem; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-strong); color: var(--bg); }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn svg { width: 18px; height: 18px; }

/* Hero */
.hero { padding: 72px 0 56px; }
.eyebrow { display: inline-block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 680px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 48px; }
@media (min-width: 820px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.fact strong { display: block; font-size: 1.15rem; }
.fact span { color: var(--muted); font-size: .9rem; }

/* Sections */
section.block { padding: 64px 0; border-top: 1px solid var(--line); }
.section-intro { max-width: 720px; margin-bottom: 32px; }
.section-intro p { color: var(--muted); font-size: 1.05rem; }
.grid-2 { display: grid; gap: 20px; }
.grid-3 { display: grid; gap: 20px; }
@media (min-width: 820px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .tag { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.card ul { padding-left: 1.1em; margin: .4em 0 1em; }
.card li { margin: .25em 0; }
.muted { color: var(--muted); }

.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-x: auto; margin: 0; }
.figure svg { width: 100%; min-width: 640px; height: auto; display: block; }
.figure figcaption { color: var(--muted); font-size: .9rem; margin-top: 10px; }
.shot { border-radius: 10px; border: 1px solid var(--line); }

.status { list-style: none; padding: 0; margin: 0; }
.status li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.status li:last-child { border-bottom: 0; }
.pill { flex: none; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; height: fit-content; margin-top: 2px; }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.wip { background: var(--warn-soft); color: var(--warn); }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* Tutorial cards */
.tut-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.tut-card:hover { border-color: var(--accent); color: var(--text); }
.tut-card .step-count { color: var(--muted); font-size: .9rem; margin-top: auto; padding-top: 12px; }

/* Code */
code { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.code { position: relative; margin: 14px 0 18px; }
.code pre { margin: 0; background: var(--code-bg); color: var(--code-text); padding: 38px 18px 16px; border-radius: 10px; overflow-x: auto; font-size: .86rem; line-height: 1.55; }
.code pre code { background: none; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.code .label { position: absolute; top: -10px; left: 12px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--accent); color: var(--bg); padding: 2px 8px; border-radius: 6px; }
.code.prompt pre { background: var(--accent-soft); color: var(--text); border: 1px solid var(--line); white-space: pre-wrap; }
.code.prompt pre code { white-space: pre-wrap; }
.copy { position: absolute; top: 8px; right: 8px; font: 600 .75rem system-ui, sans-serif; border: 1px solid rgb(255 255 255 / 20%); background: rgb(255 255 255 / 8%); color: var(--code-text); padding: 4px 9px; border-radius: 6px; cursor: pointer; }
.code.prompt .copy { color: var(--text); border-color: var(--line); background: var(--surface); }

/* Tutorial layout */
.tut-hero { padding: 56px 0 24px; }
.tut-hero p.lead { color: var(--muted); font-size: 1.12rem; max-width: 720px; }
.tut-layout { display: grid; gap: 40px; padding-bottom: 72px; }
@media (min-width: 980px) { .tut-layout { grid-template-columns: 240px 1fr; } }
.toc { font-size: .92rem; }
@media (min-width: 980px) { .toc { position: sticky; top: 84px; align-self: start; } }
.toc ol { padding-left: 1.2em; margin: 0; }
.toc li { margin: 6px 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.tut-body { max-width: 760px; min-width: 0; }
.step { padding: 28px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.step:first-child { padding-top: 0; }
.step h2 { font-size: 1.4rem; display: flex; gap: 12px; align-items: baseline; }
.step h2 .n { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--bg); font-size: .95rem; }
.callout { border-radius: 10px; padding: 14px 16px; margin: 16px 0; border: 1px solid var(--line); background: var(--surface); font-size: .96rem; }
.callout.warn { background: var(--warn-soft); border-color: transparent; }
.callout.warn strong:first-child { color: var(--warn); }
.callout.info { background: var(--accent-soft); border-color: transparent; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 28px; position: relative; margin: 8px 0; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border: 2px solid var(--accent); border-radius: 4px; }
.next { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* Video tutorial */
.player { display: grid; gap: 20px; margin: 8px 0 48px; }
@media (min-width: 980px) { .player { grid-template-columns: 1fr 280px; } }
.player video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.chapters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; align-self: start; }
.chapters h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 4px 6px 10px; }
.chapters ol { list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.chapters button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: .93rem; color: var(--text); }
.chapters button:hover { background: var(--surface-2); }
.chapters button:focus-visible { outline: 2px solid var(--accent); }
.chapters button.current { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.chapters .time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; }
.player-note { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.cmds-heading { border-top: 1px solid var(--line); padding-top: 40px; margin-bottom: 8px; }

.video-thumb { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 16px; aspect-ratio: 16 / 9; background: #111613; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .play { position: absolute; inset: 0; display: grid; place-items: center; }
.video-thumb .play span { width: 64px; height: 64px; border-radius: 50%; background: rgb(17 22 19 / 72%); display: grid; place-items: center; }
.video-thumb .play svg { width: 26px; height: 26px; fill: #fff; margin-left: 4px; }
.video-thumb .dur { position: absolute; right: 10px; bottom: 10px; background: rgb(0 0 0 / 72%); color: #fff; font-size: .8rem; font-weight: 600; padding: 2px 7px; border-radius: 5px; }

/* Integrantes */
.team-hero { padding-bottom: 32px; }
.team-photo { margin: 0 0 64px; }
.team-photo img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.team-photo figcaption { color: var(--muted); font-size: .9rem; margin-top: 10px; }
.contact-mail { display: block; font-size: clamp(1.4rem, 3.5vw, 1.9rem); font-weight: 700; margin: 6px 0 12px; text-decoration: none; overflow-wrap: anywhere; }

/* Preguntas frecuentes */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 16px 0; list-style-position: outside; }
.faq details[open] summary { color: var(--accent); }
.faq details p { color: var(--muted); margin: 0 0 18px; }

/* Fondo animado de la portada (fondo.js) */
.bg-net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: .75; }
@media (max-width: 760px) { .bg-net { opacity: .55; } }
