/* ==========================================================================
   iTunes.term — landing page
   Colores base tomados de Sources/iTunesKit/UI/Theme.swift
   ========================================================================== */
:root {
  --bg: #0b0d12;
  --bg-2: #14161c;          /* Theme.background */
  --surface: #1c1f27;       /* Theme.surface */
  --selection: #2d3750;     /* Theme.selection */
  --separator: #2a2e37;     /* Theme.separator */
  --text: #c6cad3;          /* Theme.text */
  --bright: #ffffff;        /* Theme.bright */
  --dim: #878d99;           /* Theme.dim */
  --accent: #7aa2f7;        /* Theme.accent */
  --marked: #e0af68;        /* Theme.marked */
  --error: #f7768e;         /* Theme.error */
  --violet: #bb9af7;
  --cyan: #7dcfff;
  --green: #9ece6a;
  --grad: linear-gradient(110deg, #7aa2f7 0%, #bb9af7 35%, #f7768e 65%, #e0af68 100%);
  --radius: 22px;
  --font: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --mx: 50vw;
  --my: 50vh;
  color-scheme: dark;
}

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

html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
code, pre, kbd { font-family: var(--mono); }
code { font-size: .88em; color: var(--cyan); background: rgba(122, 162, 247, .1); padding: .1em .4em; border-radius: 6px; }
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: .05em .45em;
  font-size: .82em;
  text-align: center;
  color: var(--bright);
  background: linear-gradient(180deg, #2b3040, #1c1f27);
  border: 1px solid #3b4050;
  border-bottom-width: 3px;
  border-radius: 7px;
}
::selection { background: var(--accent); color: var(--bg); }

/* ---------- capas de ambiente ---------- */
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-5%, 3%); } 40% { transform: translate(3%, -6%); }
  60% { transform: translate(-7%, -2%); } 80% { transform: translate(5%, 6%); } 100% { transform: translate(0, 0); }
}
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; z-index: -1; pointer-events: none;
  transform: translate(calc(var(--mx) - 260px), calc(var(--my) - 260px));
  background: radial-gradient(circle, rgba(122, 162, 247, .16), rgba(187, 154, 247, .07) 40%, transparent 70%);
  transition: transform .15s ease-out;
}
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 60;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(0);
  box-shadow: 0 0 12px rgba(122, 162, 247, .8);
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: 50;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px 10px 20px;
  background: rgba(20, 22, 28, .55);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
  transition: background .3s, border-color .3s;
}
.nav.scrolled { background: rgba(11, 13, 18, .82); border-color: rgba(122, 162, 247, .22); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--bright); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand em { font-style: normal; color: var(--accent); font-family: var(--mono); font-size: .8em; }
.brand-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; }
.brand-bars i { width: 4px; border-radius: 2px; background: var(--accent); animation: bars 1.1s ease-in-out infinite; }
.brand-bars i:nth-child(1) { height: 45%; animation-delay: -.2s; }
.brand-bars i:nth-child(2) { height: 90%; animation-delay: -.5s; }
.brand-bars i:nth-child(3) { height: 35%; animation-delay: -.8s; }
.brand-bars i:nth-child(4) { height: 75%; animation-delay: -.35s; }
@keyframes bars { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.brand-bars i { transform-origin: bottom; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--dim); font-size: 15px; padding: 6px 14px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--bright); background: rgba(122, 162, 247, .12); }

/* ---------- botones ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px/1 var(--font); color: var(--bright);
  padding: 16px 26px; border-radius: 16px; border: 1px solid transparent; cursor: pointer;
  overflow: hidden; isolation: isolate;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, background .3s;
  will-change: transform;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-ghost svg { fill: currentColor; stroke: none; }
.btn small { font: 500 12px var(--mono); opacity: .7; margin-left: 4px; }
.btn-primary {
  background: linear-gradient(120deg, #5b7fe0, #8b6fe8 50%, #c45f9e);
  background-size: 200% 200%;
  animation: gradshift 6s ease infinite;
  box-shadow: 0 10px 40px -8px rgba(122, 162, 247, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { box-shadow: 0 18px 60px -6px rgba(187, 154, 247, .85), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-ghost { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .14); backdrop-filter: blur(10px); }
.btn-ghost:hover { background: rgba(122, 162, 247, .12); border-color: rgba(122, 162, 247, .5); }
.btn-sm { padding: 10px 18px; font-size: 14px; border-radius: 999px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-glow { background: var(--accent); color: var(--bg); box-shadow: 0 0 24px rgba(122, 162, 247, .55); }
.btn-glow:hover { box-shadow: 0 0 40px rgba(122, 162, 247, .9); }
.btn-xl { padding: 22px 34px; font-size: 18px; border-radius: 20px; }
.btn-shine {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes gradshift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; padding: 140px 16px 120px; overflow: hidden;
}
.aurora { position: absolute; inset: 0; z-index: -1; filter: blur(70px) saturate(140%); opacity: .75; }
.aurora span { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: float 18s ease-in-out infinite; }
.aurora span:nth-child(1) { width: 55vw; height: 55vw; left: -10vw; top: -15vw; background: radial-gradient(circle, #3d5bd9 0%, transparent 65%); }
.aurora span:nth-child(2) { width: 45vw; height: 45vw; right: -10vw; top: 5vw; background: radial-gradient(circle, #8a4fd8 0%, transparent 65%); animation-delay: -6s; }
.aurora span:nth-child(3) { width: 40vw; height: 40vw; left: 30vw; bottom: -20vw; background: radial-gradient(circle, #c4457e 0%, transparent 65%); animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(6vw, 4vw) scale(1.12); }
  66% { transform: translate(-4vw, 6vw) scale(.92); }
}
.hero-inner { max-width: 980px; text-align: center; position: relative; z-index: 2; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px;
  padding: 8px 16px; border-radius: 999px; font: 500 13px var(--mono); color: var(--text);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(10px);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(158, 206, 106, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(158, 206, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(158, 206, 106, 0); } }
.hero-title {
  margin: 0; font-size: clamp(48px, 10vw, 128px); line-height: .95; letter-spacing: -.05em; font-weight: 700; color: var(--bright);
}
.hero-title .line { display: block; }
.gradient-text {
  background: var(--grad); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradtext 8s linear infinite;
}
@keyframes gradtext { to { background-position: 200% center; } }
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; background: inherit;
  -webkit-background-clip: text; background-clip: text; opacity: 0;
}
.glitch::before { animation: glitch-a 5s infinite; color: transparent; text-shadow: -3px 0 rgba(125, 207, 255, .7); }
.glitch::after { animation: glitch-b 5s infinite; color: transparent; text-shadow: 3px 0 rgba(247, 118, 142, .7); }
@keyframes glitch-a {
  0%, 92%, 100% { opacity: 0; clip-path: inset(0 0 0 0); transform: none; }
  93% { opacity: 1; clip-path: inset(10% 0 60% 0); transform: translate(-6px, 0); }
  95% { opacity: 1; clip-path: inset(55% 0 20% 0); transform: translate(5px, 0); }
  97% { opacity: 1; clip-path: inset(30% 0 45% 0); transform: translate(-3px, 0); }
}
@keyframes glitch-b {
  0%, 92%, 100% { opacity: 0; transform: none; }
  94% { opacity: 1; clip-path: inset(65% 0 5% 0); transform: translate(6px, 0); }
  96% { opacity: 1; clip-path: inset(5% 0 75% 0); transform: translate(-5px, 0); }
}
.hero-sub { max-width: 680px; margin: 28px auto 0; font-size: clamp(17px, 2vw, 20px); color: var(--text); }
.hero-sub strong { color: var(--bright); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 40px; }
.hero-term {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 36px;
  padding: 12px 20px; border-radius: 14px; font: 500 15px var(--mono); color: var(--bright);
  background: rgba(20, 22, 28, .7); border: 1px solid var(--separator);
}
.hero-term .prompt { color: var(--green); }
.hero-term .prompt::after { content: " ❯"; color: var(--accent); }
.caret { width: 9px; height: 18px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.visualizer { position: absolute; left: 0; right: 0; bottom: 0; height: 30vh; z-index: 1; pointer-events: none; mask-image: linear-gradient(to top, #000 10%, transparent); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent); }
.visualizer canvas { width: 100%; height: 100%; display: block; opacity: .55; }
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .3); border-radius: 14px;
}
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--bright); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- marquee ---------- */
.marquee {
  position: relative; overflow: hidden; padding: 22px 0; transform: rotate(-2deg) scale(1.04);
  background: linear-gradient(90deg, rgba(122, 162, 247, .14), rgba(187, 154, 247, .14), rgba(247, 118, 142, .14));
  border-block: 1px solid rgba(122, 162, 247, .25);
}
.marquee-track { display: flex; gap: 34px; width: max-content; animation: marquee 32s linear infinite; font: 700 clamp(22px, 3vw, 34px) var(--mono); letter-spacing: -.02em; color: var(--bright); white-space: nowrap; }
.marquee-track b { color: var(--accent); font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- secciones ---------- */
.section { position: relative; max-width: 1240px; margin: 0 auto; padding: 140px 16px 40px; }
.section-head { max-width: 820px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { margin: 0; font-size: clamp(36px, 6vw, 72px); line-height: 1.02; letter-spacing: -.045em; color: var(--bright); }
.section-head p:not(.eyebrow) { color: var(--dim); font-size: 18px; margin-top: 20px; }
.eyebrow {
  display: inline-block; margin: 0 0 18px; font: 600 13px var(--mono); letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); padding: 6px 14px; border-radius: 999px; background: rgba(122, 162, 247, .1); border: 1px solid rgba(122, 162, 247, .25);
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(40px) scale(.98); filter: blur(8px); transition: opacity .9s cubic-bezier(.2, .8, .2, 1), transform .9s cubic-bezier(.2, .8, .2, 1), filter .9s; transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- demo ---------- */
.scenes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 34px; }
.scene {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font: 500 15px var(--font); color: var(--text);
  padding: 10px 16px 10px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1);
  transition: all .25s;
}
.scene:hover { color: var(--bright); border-color: rgba(122, 162, 247, .5); transform: translateY(-2px); }
.scene.active { color: var(--bright); background: rgba(122, 162, 247, .16); border-color: var(--accent); box-shadow: 0 0 30px rgba(122, 162, 247, .35); }
.term-stage { position: relative; perspective: 1800px; }
.term-halo {
  position: absolute; inset: 6% 4%; z-index: -1; border-radius: 40px; filter: blur(60px); opacity: .7;
  background: conic-gradient(from var(--angle, 0deg), #7aa2f7, #bb9af7, #f7768e, #e0af68, #7aa2f7);
  animation: spin 10s linear infinite;
}
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --angle: 360deg; } }
.window {
  position: relative; border-radius: 16px; overflow: hidden; background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 50px 120px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  transform-style: preserve-3d; transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
.window.focused { box-shadow: 0 50px 120px -20px rgba(0, 0, 0, .8), 0 0 0 2px var(--accent), 0 0 60px rgba(122, 162, 247, .35); }
.window-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #20232c; border-bottom: 1px solid #000; }
.lights { display: flex; gap: 8px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.window-title { flex: 1; text-align: center; font: 500 12px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-badge { font: 500 11px var(--mono); color: var(--marked); padding: 3px 9px; border-radius: 999px; background: rgba(224, 175, 104, .12); white-space: nowrap; }
.window.focused .focus-badge { color: var(--green); background: rgba(158, 206, 106, .12); }
.tui-scroll { overflow-x: auto; overflow-y: hidden; background: var(--bg-2); }
.tui {
  --cw: 8px;
  display: block; width: max-content; margin: 0 auto; padding: 8px 0 10px;
  font-family: var(--mono); font-weight: 500; font-size: calc(var(--cw) / .6); line-height: 1.2;
  white-space: pre; color: var(--text); cursor: default; outline: none; user-select: none;
  font-variant-ligatures: none;
}
.tui .r { display: block; height: 1.2em; }
.tui .r span { display: inline-block; height: 1.2em; vertical-align: top; overflow: hidden; }
.tui b { font-weight: 800; }
.caption {
  position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 20px); opacity: 0;
  padding: 10px 18px; border-radius: 12px; font: 500 14px var(--font); color: var(--bright);
  background: rgba(11, 13, 18, .88); border: 1px solid rgba(122, 162, 247, .4); backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5); transition: all .35s cubic-bezier(.2, .8, .2, 1); pointer-events: none;
  max-width: calc(100% - 32px); text-align: center;
}
.caption.show { opacity: 1; transform: translate(-50%, 0); }
.keyhud { position: absolute; right: 20px; top: 56px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; z-index: 5; }
.keyhud kbd {
  font-size: 22px; padding: 8px 16px; min-width: 52px; border-radius: 12px;
  background: linear-gradient(180deg, #3a4157, #23273a); border-color: #4b5370; border-bottom-width: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 30px rgba(122, 162, 247, .45);
  animation: keypop 1.4s cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes keypop {
  0% { opacity: 0; transform: translateY(-14px) scale(.6); }
  12% { opacity: 1; transform: translateY(2px) scale(1.12); }
  20% { transform: translateY(0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(8px) scale(.95); }
}

/* ---------- stats ---------- */
.stats { max-width: 1100px; margin: 0 auto; padding: 120px 16px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { text-align: center; padding: 30px 12px; border-radius: var(--radius); background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .07); }
.stat b { display: block; font: 700 clamp(44px, 6vw, 72px)/1 var(--font); letter-spacing: -.05em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 10px; color: var(--dim); font-size: 15px; }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  position: relative; padding: 30px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, rgba(28, 31, 39, .9), rgba(20, 22, 28, .9));
  border: 1px solid rgba(255, 255, 255, .07);
  transform-style: preserve-3d; transition: transform .25s ease-out, border-color .3s;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(400px circle at var(--x, 50%) var(--y, 50%), rgba(122, 162, 247, .8), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s;
}
.card:hover::before { opacity: 1; }
.card-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(500px circle at var(--x, 50%) var(--y, 50%), rgba(122, 162, 247, .12), transparent 45%); }
.card:hover .card-glow { opacity: 1; }
.card h3 { margin: 18px 0 10px; font-size: 22px; letter-spacing: -.02em; color: var(--bright); transform: translateZ(30px); }
.card p { margin: 0; color: var(--dim); font-size: 15.5px; transform: translateZ(20px); }
.card p strong { color: var(--text); }
.card-icon {
  width: 54px; height: 54px; display: grid; place-items: center; font-size: 26px; border-radius: 16px;
  background: linear-gradient(140deg, rgba(122, 162, 247, .25), rgba(187, 154, 247, .12)); border: 1px solid rgba(122, 162, 247, .3);
  transform: translateZ(40px);
}
.card-xl { grid-column: span 2; grid-row: span 2; }
.card-xl h3 { font-size: 32px; }
.card-xl p { font-size: 17px; }
.card-tall { grid-row: span 2; }
.card-wide { grid-column: span 2; }
.format-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.format-chips span {
  font: 700 clamp(18px, 2.4vw, 28px) var(--mono); padding: 10px 18px; border-radius: 14px; color: var(--bright);
  background: rgba(122, 162, 247, .08); border: 1px solid rgba(122, 162, 247, .25);
  animation: chipfloat 4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.6s);
}
@keyframes chipfloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.mini-eq { display: flex; align-items: flex-end; gap: 6px; height: 170px; margin-top: 30px; }
.mini-eq i { flex: 1; height: 100%; border-radius: 6px; background: linear-gradient(to top, var(--accent), var(--violet), var(--error)); transform-origin: bottom; transform: scaleY(var(--h)); animation: eqbounce 1.6s ease-in-out infinite; }
.mini-eq i:nth-child(odd) { animation-delay: -.4s; }
.mini-eq i:nth-child(3n) { animation-delay: -.9s; }
@keyframes eqbounce { 50% { transform: scaleY(calc(var(--h) * .55)); } }
.pixel-cover { display: grid; grid-template-columns: repeat(10, 1fr); width: 120px; aspect-ratio: 1; margin-top: 20px; border-radius: 4px; overflow: hidden; image-rendering: pixelated; }
.pixel-cover i { transition: background 1.2s; }
.index-bar { position: relative; margin-top: 24px; height: 10px; border-radius: 999px; background: #2a2e37; overflow: visible; }
.index-bar span { position: absolute; inset: 0; border-radius: inherit; background: var(--grad); transform-origin: left; animation: indexing 3.5s cubic-bezier(.6, 0, .2, 1) infinite; box-shadow: 0 0 20px rgba(122, 162, 247, .6); }
.index-bar em { position: absolute; right: 0; top: 16px; font: 500 12px var(--mono); color: var(--accent); font-style: normal; }
@keyframes indexing { 0% { transform: scaleX(0); } 70%, 100% { transform: scaleX(1); } }

/* ---------- galería ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.shot {
  margin: 0; position: relative; border-radius: 18px; overflow: hidden; cursor: zoom-in;
  background: var(--bg-2); border: 1px solid rgba(255, 255, 255, .08); transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s;
}
.shot:hover { transform: translateY(-6px) scale(1.01); box-shadow: 0 30px 80px -20px rgba(122, 162, 247, .45); }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9.2; object-fit: cover; object-position: top left; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.shot:hover img { transform: scale(1.04); }
.shot-hero { grid-column: span 3; }
.shot-hero img { aspect-ratio: auto; }
.shot figcaption {
  position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: 12px; font-size: 14px; color: var(--text);
  background: rgba(11, 13, 18, .82); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .08);
}
.shot figcaption b { color: var(--bright); margin-right: 6px; }
.shot:not(.shot-hero) figcaption { position: static; margin: 0; border: 0; border-top: 1px solid rgba(255, 255, 255, .08); border-radius: 0; background: var(--surface); }
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(5, 6, 9, .9); backdrop-filter: blur(14px); animation: fadein .3s; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 14px; box-shadow: 0 40px 120px rgba(0, 0, 0, .8); animation: zoomin .4s cubic-bezier(.2, .8, .2, 1); }
.lightbox-close { position: absolute; top: 18px; right: 22px; font-size: 36px; line-height: 1; color: var(--bright); background: none; border: 0; cursor: pointer; }
@keyframes fadein { from { opacity: 0; } }
@keyframes zoomin { from { opacity: 0; transform: scale(.9); } }

/* ---------- atajos ---------- */
.keys-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.keys-group { padding: 24px; border-radius: var(--radius); background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .07); }
.keys-group h3 { margin: 0 0 16px; font: 700 13px var(--mono); letter-spacing: .18em; color: var(--accent); }
.keys-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, .06); font-size: 14.5px; }
.keys-row:last-child { border-bottom: 0; }
.keys-row span:last-child { color: var(--dim); text-align: right; }
.keys-row .caps { display: flex; flex-wrap: wrap; gap: 4px; flex: none; }
.keys-row kbd { transition: transform .1s, background .1s; }
.keys-row:hover kbd { transform: translateY(2px); border-bottom-width: 1px; background: var(--selection); }
.commands { margin-top: 28px; padding: 28px; border-radius: var(--radius); background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .07); }
.commands h3 { margin: 0 0 16px; color: var(--bright); }
.commands-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 24px; }
.commands-list div { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; color: var(--dim); }
.commands-list code { align-self: flex-start; }

/* ---------- instalar ---------- */
.install-card {
  position: relative; overflow: hidden; max-width: 900px; margin: 0 auto; padding: 70px 40px; text-align: center;
  border-radius: 32px; background: linear-gradient(160deg, rgba(28, 31, 39, .95), rgba(14, 16, 22, .95));
  border: 1px solid rgba(122, 162, 247, .25);
  box-shadow: 0 40px 120px -30px rgba(122, 162, 247, .45);
}
.install-orb { position: absolute; width: 600px; height: 600px; left: 50%; top: -360px; margin-left: -300px; border-radius: 50%; background: radial-gradient(circle, rgba(122, 162, 247, .45), transparent 65%); filter: blur(30px); animation: float 14s ease-in-out infinite; pointer-events: none; }
.install-card h2 { position: relative; margin: 0; font-size: clamp(36px, 6vw, 64px); letter-spacing: -.045em; color: var(--bright); line-height: 1.05; }
.install-sub { position: relative; color: var(--dim); max-width: 560px; margin: 18px auto 36px; }
.badges { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.badges li { font: 500 13px var(--mono); color: var(--green); padding: 6px 12px; border-radius: 999px; background: rgba(158, 206, 106, .1); border: 1px solid rgba(158, 206, 106, .25); }
.steps { list-style: none; padding: 0; margin: 50px 0 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; text-align: left; }
.steps li { display: flex; gap: 14px; padding: 20px; border-radius: 18px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .07); }
.steps li > span { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font: 700 15px var(--mono); color: var(--bg); background: var(--grad); }
.steps b { color: var(--bright); display: block; }
.steps pre, .checksum pre { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: #0b0d12; border: 1px solid var(--separator); overflow-x: auto; }
.steps pre code, .checksum pre code { background: none; padding: 0; color: var(--green); }
.checksum { position: relative; margin: 12px auto 0; max-width: 640px; text-align: left; padding: 14px 18px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .07); }
.checksum summary { cursor: pointer; color: var(--text); font-weight: 500; }
.checksum > code { display: block; margin-top: 10px; word-break: break-all; font-size: 13px; }

/* ---------- footer ---------- */
.footer { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 100px 16px 50px; color: var(--dim); font-size: 14px; text-align: center; }
.brand-bars.small { height: 28px; }
.brand-bars.small i { width: 6px; }

/* ---------- modo captura (?shot=...) ---------- */
body.shot-mode { background: var(--bg-2); }
body.shot-mode > *:not(main),
body.shot-mode main > *:not(#demo),
body.shot-mode #demo > *:not(.term-stage),
body.shot-mode .term-halo,
body.shot-mode .window-bar,
body.shot-mode .caption,
body.shot-mode .keyhud { display: none !important; }
body.shot-mode #demo { padding: 0; max-width: none; }
body.shot-mode .reveal { opacity: 1; transform: none; filter: none; transition: none; }
body.shot-mode .window { border: 0; border-radius: 0; box-shadow: none; transform: none !important; }
body.shot-mode .tui { padding: 12px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card-tall { grid-row: auto; }
  .mini-eq { height: 110px; }
  .keys-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .shot-hero { grid-column: span 2; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .section { padding-top: 100px; }
  .stats { grid-template-columns: repeat(2, 1fr); padding-top: 80px; }
  .bento, .keys-grid, .gallery, .steps, .commands-list { grid-template-columns: 1fr; }
  .card-xl, .card-wide, .shot-hero { grid-column: auto; grid-row: auto; }
  .card-xl h3 { font-size: 26px; }
  .install-card { padding: 50px 18px; }
  .btn { padding: 14px 20px; }
  .btn-xl { font-size: 15px; padding: 18px 20px; }
  .btn small { display: none; }
  .keyhud { right: 10px; top: 50px; }
  .keyhud kbd { font-size: 16px; padding: 6px 12px; min-width: 40px; }
  .hero-term { font-size: 13px; }
  .focus-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
