/* Diseño: una columna editorial con rejilla de 12; el demo ocupa todo el ancho y el instructivo lleva índice fijo a la izquierda. */
:root {
  --hue: 248;
  --bg: hsl(var(--hue) 16% 97%);
  --surface: hsl(var(--hue) 30% 100%);
  --sunken: hsl(var(--hue) 16% 93%);
  --fg: hsl(var(--hue) 30% 10%);
  --muted: hsl(var(--hue) 10% 36%);
  --line: hsl(var(--hue) 14% 87%);
  --line-strong: hsl(var(--hue) 10% 72%);
  --accent: hsl(var(--hue) 65% 31%);
  --accent-fg: #fff;
  --accent-soft: hsl(var(--hue) 55% 94%);
  --good: #17703f; --warn: #8f5a00;
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: hsl(var(--hue) 18% 8%); --surface: hsl(var(--hue) 15% 11.5%); --sunken: hsl(var(--hue) 15% 6.5%);
    --fg: hsl(var(--hue) 15% 94%); --muted: hsl(var(--hue) 9% 68%); --line: hsl(var(--hue) 11% 20%); --line-strong: hsl(var(--hue) 10% 32%);
    --accent: hsl(var(--hue) 70% 72%); --accent-fg: hsl(var(--hue) 30% 8%); --accent-soft: hsl(var(--hue) 40% 17%);
    --good: #5fd39a; --warn: #f0b34a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: hsl(var(--hue) 18% 8%); --surface: hsl(var(--hue) 15% 11.5%); --sunken: hsl(var(--hue) 15% 6.5%);
  --fg: hsl(var(--hue) 15% 94%); --muted: hsl(var(--hue) 9% 68%); --line: hsl(var(--hue) 11% 20%); --line-strong: hsl(var(--hue) 10% 32%);
  --accent: hsl(var(--hue) 70% 72%); --accent-fg: hsl(var(--hue) 30% 8%); --accent-soft: hsl(var(--hue) 40% 17%);
  --good: #5fd39a; --warn: #f0b34a; color-scheme: dark;
}
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/schibsted-grotesk-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/schibsted-grotesk-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/schibsted-grotesk-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/schibsted-grotesk-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/dm-mono-latin-400-normal.woff2') format('woff2'); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.08; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }

/* cabecera */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { font-weight: 800; letter-spacing: -.02em; text-decoration: none; font-size: 18px; margin-right: auto; display: inline-flex; align-items: center; gap: 10px; }
.brand i { width: 26px; height: 26px; background: var(--accent); border-radius: 4px; display: inline-block; }
.top nav { display: flex; gap: 22px; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; }
.top nav a:hover { color: var(--fg); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 6px; border: 1px solid transparent; font: 700 15px/1 var(--font); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { background: var(--sunken); }

/* portada */
.hero { padding-block: 72px 56px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 56px; align-items: end; }
.hero h1 { font-size: clamp(40px, 6.4vw, 84px); font-weight: 800; letter-spacing: -.04em; margin-top: 18px; }
.hero h1 span { font-weight: 400; color: var(--muted); }
.hero p.lead { margin-top: 24px; font-size: 20px; color: var(--muted); max-width: 44ch; }
.hero .cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.facts { border-top: 2px solid var(--fg); display: grid; }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: baseline; }
.facts dt { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }

/* demo */
.section { padding-block: 64px; border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -.03em; margin-top: 12px; }
.section-head p { color: var(--muted); max-width: 52ch; }
.frame { border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .35); }
.frame-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--sunken); font: 400 13px/1.3 var(--mono); color: var(--muted); }
.frame-bar a { color: var(--fg); font-family: var(--font); font-weight: 600; font-size: 14px; }
.frame iframe { display: block; width: 100%; height: min(82vh, 860px); min-height: 560px; border: 0; background: var(--bg); }
.preview-card { padding: 56px 28px; display: grid; gap: 16px; justify-items: start; }
.preview-card h3 { font-size: 24px; }

/* instructivo */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: 88px; display: grid; gap: 2px; font-size: 15px; }
.toc a { padding: 7px 0 7px 14px; border-left: 2px solid var(--line); text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--fg); border-left-color: var(--accent); }
.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 0; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px 16px; padding: 28px 0; border-top: 1px solid var(--line); }
.steps > li:first-child { border-top: 2px solid var(--fg); }
.steps > li::before { content: counter(s, decimal-leading-zero); font: 500 14px/1.9 var(--mono); color: var(--accent); }
.steps h3 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.steps p, .steps ul { grid-column: 2; color: var(--muted); }
.steps ul { padding-left: 18px; display: grid; gap: 4px; }
.steps li b, .steps li strong { color: var(--fg); font-weight: 600; }
.try { grid-column: 2; margin-top: 4px; padding: 12px 14px; background: var(--accent-soft); border-radius: 6px; font-size: 15px; color: var(--fg); }
.try b { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-right: 8px; }
code, .kbd { font: 400 .88em var(--mono); background: var(--sunken); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; overflow-wrap: anywhere; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--fg); }
.cols3 > div { padding: 24px 24px 24px 0; border-bottom: 1px solid var(--line); }
.cols3 > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.cols3 h3 { font-size: 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.cols3 h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); }
.cols3 ul { padding-left: 18px; display: grid; gap: 8px; color: var(--muted); }
.cols3 li::marker { color: var(--line-strong); }

.install { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--fg); }
.install > div { padding: 22px 20px 22px 0; }
.install > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.install h3 { font-size: 18px; margin-bottom: 8px; }
.install p { color: var(--muted); font-size: 15px; }

footer { border-top: 1px solid var(--line); padding-block: 40px; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .hero .wrap, .guide { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .toc a { border: 1px solid var(--line); border-radius: 18px; padding: 6px 12px; }
  .top nav { display: none; }
  .cols3, .install { grid-template-columns: minmax(0, 1fr); }
  .cols3 > div, .cols3 > div + div, .install > div, .install > div + div { padding: 20px 0; border-left: 0; }
  .hero { padding-block: 40px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .steps > li { grid-template-columns: 38px minmax(0, 1fr); }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .frame iframe { min-height: 520px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* =====================================================================
   Página del proyecto: portada con degradado, videos, galería y visor.
   ===================================================================== */
:root { --hue2: calc(var(--hue) + 70); --grad: linear-gradient(120deg, hsl(var(--hue) 75% 52%), hsl(var(--hue2) 80% 55%)); --grad-text: linear-gradient(100deg, hsl(var(--hue) 80% 45%), hsl(var(--hue2) 85% 50%)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --grad-text: linear-gradient(100deg, hsl(var(--hue) 90% 76%), hsl(var(--hue2) 90% 74%)); } }
:root[data-theme="dark"] { --grad-text: linear-gradient(100deg, hsl(var(--hue) 90% 76%), hsl(var(--hue2) 90% 74%)); }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
.brand i { background: var(--grad); border-radius: 7px; }
.btn-primary { background: var(--grad); color: #fff; border-radius: 999px; box-shadow: 0 10px 26px -12px hsl(var(--hue) 80% 45% / .7); }
.btn-ghost { border-radius: 999px; }
.icon-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); cursor: pointer; font-size: 18px; }

.hero { position: relative; overflow: hidden; background:
  radial-gradient(700px 460px at 92% 8%, hsl(var(--hue2) 85% 62% / .28), transparent 70%),
  radial-gradient(640px 520px at 0% 100%, hsl(var(--hue) 85% 60% / .24), transparent 70%); }
.hero .wrap { align-items: center; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 48px; }
.hero h1 .grad { font-weight: 800; color: transparent; }
.hero h1 { font-size: clamp(38px, 5.6vw, 72px); }
.chips { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 5px 12px; border-radius: 999px; font: 500 13px/1.3 var(--mono); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.hero small { display: block; margin-top: 14px; color: var(--muted); font-size: 14px; }

.vframe { border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px hsl(var(--hue) 50% 20% / .55); }
.vframe .bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--sunken); border-bottom: 1px solid var(--line); font: 400 12px var(--mono); color: var(--muted); }
.vframe .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.vframe .bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vframe video, .vframe img { display: block; width: 100%; height: auto; aspect-ratio: 1440 / 900; background: var(--sunken); cursor: pointer; }
.vframe.movil { max-width: 300px; margin-inline: auto; border-radius: 26px; }
.vframe.movil video { aspect-ratio: 390 / 844; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: -8px; padding-bottom: 56px; }
.stat { padding: 20px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 15px; }

.section.alt { background: linear-gradient(180deg, hsl(var(--hue) 60% 50% / .05), hsl(var(--hue2) 60% 50% / .05)); }
.section-head h2 { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flow { display: grid; gap: 56px; }
.flow article { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.flow article:nth-child(even) .vframe { order: 2; }
.flow .num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #fff; font: 500 15px var(--mono); margin-bottom: 14px; }
.flow .who { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.flow h3 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.flow p { color: var(--muted); }
.flow p + p { margin-top: 10px; }

.vgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.vgrid figure { display: grid; gap: 12px; align-content: start; }
.vgrid figcaption b { display: block; font-size: 17px; }
.vgrid figcaption { color: var(--muted); font-size: 15px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cards .card { padding: 24px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cards .card h3 { font-size: 19px; margin-bottom: 10px; }
.cards .card p, .cards .card li { color: var(--muted); font-size: 15.5px; }
.cards .card ul { padding-left: 18px; display: grid; gap: 6px; }
.stores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stores figure { display: grid; gap: 8px; }
.stores img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 12px; box-shadow: 0 0 0 1px var(--line), 0 16px 30px -20px rgba(0,0,0,.4); }
.stores figcaption { font-size: 14px; color: var(--muted); } .stores figcaption b { color: var(--fg); display: block; font-size: 15px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font: 500 14px var(--font); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.shot { display: grid; gap: 8px; align-content: start; }
.shot button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 14px 28px -20px rgba(0,0,0,.45); }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .25s; }
.shot.movil img { aspect-ratio: 16 / 10; object-fit: contain; background: var(--sunken); }
.shot button:hover img { transform: scale(1.03); }
.shot figcaption { font-size: 14px; color: var(--muted); } .shot figcaption b { display: block; color: var(--fg); font-size: 15px; }
dialog#visor { width: min(1280px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--fg); }
dialog#visor::backdrop { background: rgb(5 5 15 / .78); }
.visor .head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.visor .head p { margin-right: auto; font-size: 14px; color: var(--muted); }
.visor .head button, .visor .head a { min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font: 500 14px var(--font); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.visor .stage { max-height: calc(94vh - 60px); overflow: auto; background: var(--sunken); }
.visor .stage img { display: block; width: 100%; height: auto; }
.visor.movil .stage img { width: auto; max-width: 100%; max-height: calc(94vh - 60px); margin-inline: auto; }

.arch { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 14px; align-items: stretch; margin-bottom: 28px; }
.arch .node { padding: 20px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.arch .node h3 { font-size: 18px; margin-bottom: 8px; }
.arch .node ul { padding-left: 18px; color: var(--muted); font-size: 15px; display: grid; gap: 4px; }
.arch .arrow { display: grid; place-items: center; font-size: 22px; color: var(--accent); }
.tunnel { padding: 14px 18px; border-radius: 12px; background: var(--accent-soft); margin-bottom: 28px; }

footer { background: linear-gradient(160deg, hsl(var(--hue) 45% 14%), hsl(var(--hue) 40% 8%)); color: hsl(var(--hue) 15% 80%); border-top: 0; }
footer a { color: #fff; }

/* instructivos: video junto a cada tarea */
.task { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; padding: 28px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 2px solid var(--fg); }
.task h3 { font-size: 22px; font-weight: 750; margin-bottom: 10px; }
.task ol { padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.task ol b { color: var(--fg); }
.guide h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -.02em; margin: 8px 0 6px; }
.guide section + section { margin-top: 56px; }
.guide .intro { color: var(--muted); margin-bottom: 20px; max-width: 60ch; }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow article, .task { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .flow article:nth-child(even) .vframe { order: 0; }
  .vgrid, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stores { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .arch { grid-template-columns: minmax(0, 1fr); } .arch .arrow { transform: rotate(90deg); }
}
@media (max-width: 600px) {
  .stats, .vgrid, .cards { grid-template-columns: minmax(0, 1fr); }
  .stores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top .btn-primary { padding: 0 14px; font-size: 14px; }
}
@media (max-width: 960px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.vgrid .vframe.movil { max-width: 190px; }
