/* ──────────────────────────────────────────────────────────────
   Seguridad Ecológica — caso de estudio (portfolio)
   Vanilla CSS. Sin build. Tokens arriba, componentes abajo.
   ────────────────────────────────────────────────────────────── */
:root {
  --bg: #090d0c;
  --bg-2: #0e1412;
  --bg-3: #131b18;
  --card: rgba(255, 255, 255, 0.035);
  --card-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --ink: #edf3ee;
  --ink-2: #b4c0b8;
  --ink-3: #7d8b83;
  --ink-4: #56635c;
  --green: #4ade80;
  --green-2: #2f8a3f;
  --green-deep: #14532d;
  --green-glow: rgba(74, 222, 128, 0.18);
  --amber: #f5b544;
  --purple: #b79cff;
  --blue: #7cb7ff;
  --red: #ff7b7b;
  --paper: #fbfbf7;
  --radius: 18px;
  --radius-sm: 10px;
  --font-display: "Instrument Serif", "Georgia", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow-xl: 0 40px 80px -20px rgba(0, 0, 0, 0.7), 0 18px 36px -18px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 18px 40px -14px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--green); color: #05130a; }

/* fondo: malla + grano */
.bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(47, 138, 63, 0.28), transparent 60%),
    radial-gradient(700px 500px at 95% 10%, rgba(124, 183, 255, 0.10), transparent 60%),
    radial-gradient(800px 700px at 50% 110%, rgba(47, 138, 63, 0.14), transparent 60%),
    var(--bg);
}
.bg::after {
  content: ""; position: absolute; inset: 0; opacity: 0.16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
}

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

/* ── nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 14px 0; transition: background .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding: 8px 0; background: rgba(9, 13, 12, 0.72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.brand-mark img { width: 22px; height: 22px; object-fit: contain; }
.brand small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; line-height: 1; margin-top: 2px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-size: 14px; transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--ink); background: var(--card-2); }
.nav-cta { margin-left: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; letter-spacing: -0.005em; transition: transform .25s var(--ease), background .2s, box-shadow .2s, border-color .2s;
  border: 1px solid var(--line-2); color: var(--ink);
}
.btn:hover { transform: translateY(-1px); background: var(--card-2); }
.btn-primary { background: var(--green); color: #06170c; border-color: transparent; box-shadow: 0 10px 30px -10px var(--green-glow), 0 0 0 1px rgba(74,222,128,.25); }
.btn-primary:hover { background: #6ce89a; box-shadow: 0 14px 34px -10px rgba(74,222,128,.45); }
.btn svg { width: 16px; height: 16px; }

.nav-burger { display: none; margin-left: auto; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); }
.nav-burger span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 3px auto; border-radius: 2px; }

/* ── tipografía ── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--green);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--green); opacity: .8; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
h1 { font-family: var(--font-display); font-size: clamp(42px, 6.2vw, 78px); line-height: 1.02; }
h2 { font-family: var(--font-display); font-size: clamp(34px, 4.4vw, 56px); line-height: 1.06; }
h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
h1 em, h2 em { font-style: italic; color: var(--green); }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }

/* ── secciones ── */
.section { padding: clamp(72px, 10vw, 130px) 0; position: relative; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head h2 { margin: 14px 0 16px; }
.section-head .lead { margin: 0; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); }

/* reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .1s; } .reveal[data-delay="2"] { transition-delay: .2s; } .reveal[data-delay="3"] { transition-delay: .3s; } .reveal[data-delay="4"] { transition-delay: .4s; }

/* ── hero ── */
.hero { padding: clamp(120px, 16vw, 180px) 0 clamp(40px, 6vw, 80px); position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { margin: 22px 0 22px; }
.hero .lead { margin-bottom: 30px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 26px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); }
.hero-note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-glow); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--green-glow); } 50% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } }

.hero-visual { position: relative; aspect-ratio: 1.15; perspective: 1400px; }
.hero-visual .glow { position: absolute; inset: 10% 0 0; background: radial-gradient(60% 50% at 50% 50%, rgba(74,222,128,.22), transparent 70%); filter: blur(30px); z-index: 0; }
.hero-browser { position: absolute; left: 0; top: 4%; width: 88%; z-index: 1; transform-style: preserve-3d; will-change: transform; transition: transform .15s ease-out; }
.hero-phone { position: absolute; right: -2%; bottom: 0; width: 30%; z-index: 2; will-change: transform; transition: transform .15s ease-out; }
.hero-badge {
  position: absolute; z-index: 3; left: 58%; top: 2%; padding: 10px 14px; border-radius: 14px; background: rgba(14, 20, 18, .85); border: 1px solid var(--line-2); backdrop-filter: blur(10px);
  font-size: 12.5px; color: var(--ink-2); box-shadow: var(--shadow-md); display: flex; gap: 10px; align-items: center; animation: float 6s ease-in-out infinite;
}
.hero-badge b { color: var(--ink); font-weight: 600; }
.hero-badge .ok { width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #05130a; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* marcos de dispositivos */
.browser { border-radius: 14px; background: #0f1513; border: 1px solid var(--line-2); box-shadow: var(--shadow-xl); overflow: hidden; }
.browser-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: #151d1a; border-bottom: 1px solid var(--line); }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a3430; display: block; }
.browser-bar i:nth-child(1) { background: #ff5f57; } .browser-bar i:nth-child(2) { background: #febc2e; } .browser-bar i:nth-child(3) { background: #28c840; }
.browser-bar span { margin-left: 8px; flex: 1; height: 18px; border-radius: 6px; background: rgba(255,255,255,.05); font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; }
.browser img { width: 100%; }
.phone { border-radius: 40px; background: #0b100f; border: 1px solid var(--line-2); padding: 9px; box-shadow: var(--shadow-xl); position: relative; }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 30%; height: 20px; border-radius: 12px; background: #0b100f; z-index: 2; }
.phone-screen { border-radius: 32px; overflow: hidden; background: #fff; }
.phone-screen img { width: 100%; }
.phone.sm { border-radius: 30px; padding: 7px; } .phone.sm .phone-screen { border-radius: 24px; } .phone.sm::before { height: 14px; top: 13px; }

/* ── stats ── */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: clamp(40px, 6vw, 72px); }
.stat { background: var(--bg-2); padding: 22px 20px; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 44px); line-height: 1; letter-spacing: -0.02em; color: var(--ink); font-weight: 400; }
.stat b small { font-size: .55em; color: var(--green); margin-left: 2px; }
.stat span { display: block; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); letter-spacing: .02em; }

/* ── cards ── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; position: relative; overflow: hidden; transition: border-color .3s, transform .4s var(--ease), background .3s; }
.card:hover { border-color: var(--line-2); background: var(--card-2); transform: translateY(-2px); }
.card .num { font-family: var(--font-mono); font-size: 12px; color: var(--green); letter-spacing: .1em; margin-bottom: 14px; display: block; }
.card h3 { margin-bottom: 10px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.card.accent::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px; background: linear-gradient(90deg, var(--green), transparent); }
.icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(74,222,128,.1); color: var(--green); margin-bottom: 18px; border: 1px solid rgba(74,222,128,.18); }
.icon svg { width: 20px; height: 20px; }

/* ── switcher (dos caras) ── */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); margin-bottom: 34px; }
.tab { padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-3); transition: background .25s, color .25s; }
.tab.active { background: var(--ink); color: var(--bg); }
.pane { display: none; }
.pane.active { display: grid; animation: fade .5s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pane { grid-template-columns: 1.6fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.pane.phone-pane { grid-template-columns: 1fr 1.6fr; }
.pane .phones-duo { display: flex; gap: 18px; justify-content: center; align-items: flex-start; }
.pane .phones-duo .phone { width: 46%; } .pane .phones-duo .phone:last-child { margin-top: 44px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.feature-list li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; color: var(--ink-2); font-size: 15px; }
.feature-list li b { color: var(--ink); display: block; font-weight: 600; margin-bottom: 2px; }
.feature-list li .chk { width: 22px; height: 22px; border-radius: 7px; background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.25); color: var(--green); display: grid; place-items: center; font-size: 12px; margin-top: 2px; }

/* ── tour (scrollytelling) ── */
.tour { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.tour-steps { display: grid; gap: 10px; }
.step { padding: 22px 24px; border-radius: var(--radius); border: 1px solid transparent; transition: background .35s, border-color .35s; cursor: pointer; }
.step.active { background: var(--card-2); border-color: var(--line-2); }
.step .k { font-family: var(--font-mono); font-size: 12px; color: var(--green); letter-spacing: .1em; }
.step h3 { margin: 6px 0 8px; font-size: 19px; }
.step p { margin: 0; color: var(--ink-2); font-size: 15px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .5s var(--ease), opacity .4s, margin .4s; }
.step.active p { max-height: 200px; opacity: 1; }
.step .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tag { font-family: var(--font-mono); font-size: 11px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-3); }
.tag.g { color: var(--green); border-color: rgba(74,222,128,.35); } .tag.p { color: var(--purple); border-color: rgba(183,156,255,.35); } .tag.a { color: var(--amber); border-color: rgba(245,181,68,.35); } .tag.b { color: var(--blue); border-color: rgba(124,183,255,.35); }
.tour-visual { position: sticky; top: 90px; }
.tour-stage { position: relative; }
.tour-frame { transition: opacity .5s var(--ease), transform .6s var(--ease); }
.tour-frame.hidden { display: none; }
.tour-imgs { position: relative; aspect-ratio: 16 / 10; background: #0f1513; }
.tour-imgs img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .55s var(--ease), transform .8s var(--ease); transform: scale(1.015); }
.tour-imgs img.active { opacity: 1; transform: none; }
.tour-phone { width: min(320px, 78%); margin: 0 auto; }
.tour-phone .phone-screen { position: relative; aspect-ratio: 780 / 1688; }
.tour-phone .phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .55s var(--ease); }
.tour-phone .phone-screen img.active { opacity: 1; }
.tour-caption { margin-top: 14px; font-size: 13px; color: var(--ink-3); text-align: center; font-family: var(--font-mono); }
.tour-caption b { color: var(--ink-2); font-weight: 500; }

/* ── galería de teléfonos ── */
.rail-wrap { position: relative; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
.rail { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 0 24px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-item { flex: 0 0 auto; width: 232px; scroll-snap-align: start; }
.rail-item:nth-child(even) { margin-top: 34px; }
.rail-item figcaption { margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.rail-item figcaption b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }
.rail-nav { display: flex; gap: 8px; }
.rail-nav button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; transition: background .2s; }
.rail-nav button:hover { background: var(--card-2); }
.rail-nav svg { width: 16px; height: 16px; }
.section-head.row { display: flex; align-items: end; justify-content: space-between; max-width: none; gap: 20px; }
.section-head.row > div { max-width: 700px; }

/* ── documentos (papers) ── */
.papers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.paper { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; transition: transform .5s var(--ease), border-color .3s; }
.paper:hover { transform: translateY(-4px) rotate(-.4deg); border-color: var(--line-2); }
.paper .sheet { border-radius: 6px; overflow: hidden; background: var(--paper); box-shadow: 0 1px 0 rgba(0,0,0,.4), 0 14px 30px -12px rgba(0,0,0,.8); aspect-ratio: 1300 / 1837; position: relative; }
.paper .sheet.land { aspect-ratio: 1300 / 919; }
.paper .sheet img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.paper h3 { font-size: 16px; margin: 16px 0 4px; }
.paper p { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.paper .tag { margin-top: 12px; display: inline-block; }

/* ── arquitectura ── */
.arch { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.arch-diagram { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.arch-diagram svg { width: 100%; height: auto; display: block; }
.stack { display: grid; gap: 14px; }
.stack-group { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.stack-group h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-family: var(--font-mono); font-weight: 500; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 13px; padding: 6px 11px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--ink-2); }
.chip b { color: var(--ink); font-weight: 600; }
.decisions { margin-top: 40px; }

/* ── timeline ── */
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--green), var(--line-2)); }
.tl { display: grid; grid-template-columns: 24px 140px 1fr; gap: 18px; padding: 18px 0; align-items: start; border-bottom: 1px dashed var(--line); }
.tl:last-child { border-bottom: 0; }
.tl .pt { width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--green); margin: 6px 0 0 6px; box-shadow: 0 0 0 4px rgba(74,222,128,.1); }
.tl .when { font-family: var(--font-mono); font-size: 13px; color: var(--green); padding-top: 3px; }
.tl h3 { font-size: 17px; margin-bottom: 4px; }
.tl p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

/* ── dark mode showcase ── */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.duo figcaption { margin-top: 10px; font-size: 13px; color: var(--ink-3); font-family: var(--font-mono); }

/* ── cierre ── */
.closing { text-align: center; padding: clamp(80px, 12vw, 160px) 0; }
.closing h2 { max-width: 20ch; margin: 16px auto 20px; }
.closing .lead { margin: 0 auto 30px; }
.closing .hero-ctas { justify-content: center; }
.quote { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; color: var(--ink); max-width: 30ch; margin: 0 auto; font-style: italic; }
.quote + .muted { margin-top: 14px; font-size: 14px; }

/* ── footer ── */
.footer { border-top: 1px solid var(--line); padding: 34px 0 48px; font-size: 13.5px; color: var(--ink-3); }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--ink-2); } .footer a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 18px; }

/* ── lightbox ── */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5, 8, 7, .92); backdrop-filter: blur(10px); display: none; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: flex; animation: fade .25s; }
.lightbox img { max-width: min(96vw, 1500px); max-height: 86vh; width: auto; height: auto; border-radius: 10px; box-shadow: var(--shadow-xl); cursor: default; }
.lightbox figcaption { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--ink-2); background: rgba(14,20,18,.8); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
.lightbox .close { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(14,20,18,.8); display: grid; place-items: center; }
.zoom { cursor: zoom-in; }

/* ── responsive ── */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .papers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav.open .nav-links { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: rgba(9,13,12,.96); padding: 14px var(--gutter) 20px; border-bottom: 1px solid var(--line); }
  .nav.open .nav-cta { margin: 8px 0 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { aspect-ratio: 1.25; margin-top: 10px; }
  .grid-3, .grid-2, .duo { grid-template-columns: 1fr; }
  .pane, .pane.phone-pane { grid-template-columns: 1fr; }
  .tour { grid-template-columns: 1fr; }
  .tour-visual { position: relative; top: 0; order: -1; margin-bottom: 20px; }
  .step p { max-height: none; opacity: 1; }
  .arch { grid-template-columns: 1fr; }
  .tl { grid-template-columns: 24px 1fr; }
  .tl .when { grid-column: 2; }
  .tl h3, .tl p { grid-column: 2; }
  .section-head.row { flex-direction: column; align-items: start; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .papers { grid-template-columns: 1fr; }
  .rail-item { width: 200px; }
  .hero-badge { display: none; }
  .hero-phone { width: 34%; }
  .tabs { display: flex; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-badge, .hero-note .dot { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* tour: solo la imagen activa recibe el click (están apiladas) */
.tour-stage img { pointer-events: none; }
.tour-stage img.active { pointer-events: auto; }

/* .phone define position:relative más abajo: en el hero tiene que ganar el absolute */
.hero-visual .hero-phone { position: absolute; }

/* ── ajustes tras el QA visual ── */
.tab { white-space: nowrap; }
@media (min-width: 901px) {
  .hero-grid { grid-template-columns: 1fr 1.12fr; }
  .hero-visual { aspect-ratio: 1.4; }
  .hero-browser { width: 96%; top: 7%; }
  .hero-visual .hero-phone { width: 24%; right: -1%; bottom: -3%; }
  .hero-badge { left: auto; right: 0; top: -2%; }
}
/* en celular cada paso del recorrido lleva su captura adentro (no hay panel fijo) */
.step-img { display: none; margin-top: 18px; }
.step-img.is-phone { max-width: 230px; margin-left: auto; margin-right: auto; }
@media (max-width: 900px) {
  .tour-visual { display: none; }
  .step-img { display: block; }
  .step, .step.active { background: var(--card); border-color: var(--line); cursor: default; }
}
@media (min-width: 901px) { .hero h1 { font-size: clamp(40px, 5.1vw, 68px); } }
/* sin JS, el contenido se ve igual */
html:not(.js) .reveal { opacity: 1; transform: none; }

/* números técnicos, solo en "Por dentro" */
.stats.four { grid-template-columns: repeat(4, 1fr); margin: 0 0 clamp(28px, 4vw, 48px); }
@media (max-width: 560px) { .stats.four { grid-template-columns: repeat(2, 1fr); } }
