@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-display: swap; }

:root {
  --canvas: #07080a;
  --surface: #121317;
  --surface-2: #1b1c21;
  --ink: #f4efe7;
  --ink-soft: #b3aca2;
  --ink-faint: #7d776f;
  --accent: #d97757;
  --accent-ink: #1a0f0a;
  --line: rgba(244, 239, 231, .14);
  --display: "Instrument Serif", Georgia, serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font-family: var(--text); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.is-gated { overflow: hidden; }
em { font-family: var(--display); font-style: italic; font-weight: 400; color: var(--accent); }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip {
  position: fixed; top: 14px; left: 50%; transform: translate(-50%, -160%);
  z-index: 90; background: var(--ink); color: var(--canvas); padding: 10px 16px;
  border-radius: 999px; font-size: 14px; text-decoration: none; transition: transform .25s var(--ease);
}
.skip:focus-visible { transform: translate(-50%, 0); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn--solid { background: var(--accent); color: var(--accent-ink); }
.btn--solid:hover { background: #e4876a; }
.btn--line { border-color: var(--line); background: rgba(255, 255, 255, .03); }
.btn--line:hover { border-color: rgba(244, 239, 231, .4); }
.btn--big { min-height: 56px; padding: 0 30px; font-size: 16px; }

/* ---------- Entrada ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 110%, #1a1210 0%, var(--canvas) 60%);
  padding: var(--gutter); transition: opacity .9s var(--ease), visibility .9s;
}
.gate.is-out { opacity: 0; visibility: hidden; }
.gate__inner { max-width: 560px; text-align: center; }
.gate__mark {
  margin: 0 auto 28px; width: 56px; height: 56px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 16px; font-weight: 700; letter-spacing: -.02em;
}
.gate__title { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 8vw, 84px); line-height: .98; margin: 0 0 16px; letter-spacing: -.01em; }
.gate__sub { color: var(--ink-soft); margin: 0 0 34px; font-size: 17px; }
.gate__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gate__load { margin-top: 34px; display: grid; gap: 10px; justify-items: center; color: var(--ink-faint); font-size: 13px; }
.gate__bar { width: 180px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.gate__bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .3s; }

/* ---------- Barra ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 60; display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px; pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar__mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); font-weight: 700; text-decoration: none; background: rgba(7, 8, 10, .35); backdrop-filter: blur(8px); }
.bar__right { display: flex; gap: 10px; align-items: center; }
.bar__sound { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(7, 8, 10, .35); backdrop-filter: blur(8px); cursor: pointer; display: grid; place-items: center; }
.bar__sound svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bar__sound svg path:first-child { fill: var(--ink); stroke: none; }
.bar__sound[aria-pressed="false"] .w1, .bar__sound[aria-pressed="false"] .w2 { opacity: .2; }
.bar__cta { min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 999px; background: var(--ink); color: var(--canvas); text-decoration: none; font-weight: 600; font-size: 14px; }

/* ---------- Escenario ---------- */
.stage { position: fixed; inset: 0; height: 100svh; overflow: hidden; background: #000; z-index: 1; }
.leg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; visibility: hidden; will-change: opacity, transform; }
.leg.is-on { visibility: visible; }
.leg--manhole video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.manhole__dark {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 46%, transparent calc(var(--iris, 0) * 1vmax), rgba(6, 5, 4, .55) calc(var(--iris, 0) * 1vmax + 1.2vmax), #050403 calc(var(--iris, 0) * 1vmax + 5vmax));
}
.manhole__lid {
  position: absolute; left: 50%; top: 46%; width: 34vmin; height: 34vmin; margin: -17vmin 0 0 -17vmin; border-radius: 50%;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(0, 0, 0, .35) 9px 12px),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(0, 0, 0, .35) 9px 12px),
    radial-gradient(circle at 40% 35%, #4a4540, #23201d 70%);
  box-shadow: inset 0 0 0 1.6vmin #2b2723, inset 0 0 0 2.2vmin #3a3530, 0 2vmin 5vmin rgba(0, 0, 0, .8);
  transform: translate(calc(var(--lid, 0) * 140vmin), calc(var(--lid, 0) * -10vmin)) rotate(calc(var(--lid, 0) * 40deg));
}
.skyfade { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: linear-gradient(to bottom, #1f5fae 0%, #3f82cc 34%, rgba(90, 150, 215, .85) 52%, rgba(120, 170, 225, 0) 74%); }
.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%); }
.flash { position: absolute; inset: 0; background: #fff6ea; opacity: 0; pointer-events: none; mix-blend-mode: screen; }

/* ---------- Teléfono ---------- */
.phone {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; pointer-events: none;
  opacity: 0; visibility: hidden; background: radial-gradient(70% 80% at 50% 50%, rgba(4, 4, 8, .35), rgba(4, 4, 8, .82));
}
.phone.is-on { visibility: visible; }
.phone__body {
  width: min(330px, 74vw); aspect-ratio: 9 / 19.2; border-radius: 52px; padding: 11px; position: relative;
  background: linear-gradient(145deg, #3b3d42, #15161a 40%, #2a2b30);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 90px rgba(0, 0, 0, .7), 0 8px 24px rgba(0, 0, 0, .5);
  transform: perspective(1400px) rotateX(var(--prx, 8deg)) rotateY(var(--pry, -6deg)) scale(var(--ps, .92));
}
.phone__island { position: absolute; top: 22px; left: 50%; width: 92px; height: 26px; margin-left: -46px; background: #000; border-radius: 20px; z-index: 3; }
.phone__screen {
  position: relative; width: 100%; height: 100%; border-radius: 42px; overflow: hidden;
  background: radial-gradient(120% 70% at 20% 0%, #3a2a5e 0%, #1a1530 35%, #0b0a12 75%);
  color: #fff;
}
.phone__status { display: flex; justify-content: space-between; padding: 18px 28px 0; font-size: 13px; font-weight: 600; position: relative; z-index: 2; }
.phone__icons { letter-spacing: .04em; font-size: 11px; }
.phone__lock, .phone__bank { position: absolute; inset: 0; padding: 70px 14px 20px; transition: opacity .25s; }
.phone__date { margin: 18px 0 0; text-align: center; font-size: 15px; opacity: .85; }
.phone__time { margin: 0; text-align: center; font-size: 78px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.notif {
  margin-top: 30px; display: flex; gap: 10px; padding: 12px; border-radius: 22px;
  background: rgba(240, 236, 230, .16); backdrop-filter: blur(20px);
  transform: translateY(calc((1 - var(--n, 0)) * -40px)) scale(calc(.92 + var(--n, 0) * .08)); opacity: var(--n, 0);
}
.notif__icon { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.notif__icon svg { width: 22px; height: 22px; fill: #fff; }
.notif__app { margin: 0; font-size: 12px; opacity: .8; display: flex; justify-content: space-between; }
.notif__title { margin: 2px 0 0; font-size: 14px; font-weight: 700; }
.notif__text { margin: 2px 0 0; font-size: 13px; line-height: 1.3; opacity: .9; }
.phone__bank { opacity: 0; background: #0d0d10; display: flex; flex-direction: column; padding-top: 86px; }
.bank__label { margin: 0 8px; font-size: 14px; color: #9a9aa3; }
.bank__amount { margin: 4px 8px 0; font-size: 64px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.bank__amount span { font-size: 22px; color: #9a9aa3; margin-right: 4px; vertical-align: 26px; letter-spacing: 0; }
.bank__amount small { font-size: 26px; color: #9a9aa3; }
.bank__note { margin: 8px 8px 0; color: #9a9aa3; font-size: 13px; }
.plan { margin-top: auto; padding: 16px; border-radius: 22px; background: #f3ede4; color: #1d1712; }
.plan__name { margin: 0; font-family: var(--display); font-size: 28px; line-height: 1; }
.plan__price { margin: 4px 0 14px; font-size: 13px; color: #6d6156; }
.plan__btn {
  display: flex; justify-content: center; align-items: center; height: 46px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700;
  transform: scale(calc(1 - var(--press, 0) * .06)); box-shadow: 0 0 0 calc(var(--press, 0) * 8px) rgba(217, 119, 87, .35);
}

/* ---------- Textos ---------- */
.copy { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.cap, .floor { position: absolute; opacity: 0; visibility: hidden; will-change: opacity, transform; }
.cap.is-on, .floor.is-on { visibility: visible; }
.cap--lead { left: var(--gutter); bottom: 14vh; max-width: min(640px, 86vw); }
.cap--trail { right: var(--gutter); bottom: 16vh; max-width: min(560px, 86vw); text-align: right; }
.cap--center { left: 50%; top: 50%; width: min(900px, 92vw); text-align: center; translate: -50% -50%; }
.cap--low { bottom: 10vh; }
.cap--touch { top: auto; bottom: 12vh; translate: -50% 0; }
.cap__kicker { margin: 0 0 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--ink-soft); text-transform: uppercase; }
.cap__h { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(42px, 6.4vw, 92px); line-height: .98; letter-spacing: -.012em; text-shadow: 0 2px 30px rgba(0, 0, 0, .55); }
.cap__h--sm { font-size: clamp(34px, 4.6vw, 66px); }
.cap__h--xl { font-size: clamp(52px, 9vw, 150px); line-height: .92; }
.cap__p { margin: 18px 0 0; max-width: 40ch; font-size: clamp(16px, 1.3vw, 19px); color: var(--ink-soft); text-shadow: 0 1px 14px rgba(0, 0, 0, .7); }
.cap--trail .cap__p { margin-left: auto; }
.cap__hint { margin: 0; font-size: 15px; color: var(--ink); background: rgba(7, 8, 10, .5); display: inline-block; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); backdrop-filter: blur(8px); }

.floor {
  left: var(--gutter); top: 50%; translate: 0 -50%; width: min(420px, 84vw); padding: 24px 26px 26px;
  background: rgba(10, 12, 16, .62); border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px;
  backdrop-filter: blur(16px) saturate(1.2); box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
}
.floor--r { left: var(--gutter); }
.floor__n { margin: 0 0 10px; font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .06em; }
.floor__h { margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3vw, 42px); line-height: 1; }
.floor__p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- Chispa (gesto firma) ---------- */
.spark {
  position: fixed; z-index: 30; left: 0; top: 0; width: 84px; height: 84px; margin: -42px 0 0 -42px; border: 0; padding: 0;
  border-radius: 50%; background: transparent; cursor: pointer; opacity: 0; visibility: hidden;
  transform: translate(var(--sx, 50vw), var(--sy, 50vh));
}
.spark.is-on { visibility: visible; }
.spark span {
  position: absolute; inset: 26px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe2c8 30%, rgba(217, 119, 87, .8) 55%, transparent 72%);
  animation: spark 1.6s var(--ease) infinite;
}
.spark span::before, .spark span::after { content: ""; position: absolute; inset: -18px; border-radius: 50%; border: 1px solid rgba(255, 220, 190, .5); animation: ring 1.6s var(--ease) infinite; }
.spark span::after { animation-delay: .8s; }
@keyframes spark { 50% { transform: scale(1.25); } }
@keyframes ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* ---------- Final ---------- */
.final {
  position: fixed; inset: 0; z-index: 40; display: grid; align-items: end; justify-items: end;
  padding: 0 var(--gutter) max(28px, env(safe-area-inset-bottom)); opacity: 0; visibility: hidden; pointer-events: none;
}
.final.is-on { visibility: visible; }
.final.is-live { pointer-events: auto; }
.final__bg {
  position: absolute; left: var(--gutter); top: 13vh; margin: 0; max-width: 13ch; font-family: var(--display); font-style: italic;
  font-size: clamp(40px, 5vw, 86px); line-height: .95; color: rgba(255, 236, 214, .82); text-shadow: 0 4px 40px rgba(40, 20, 50, .45); letter-spacing: -.015em; pointer-events: none;
}
.final__panel {
  position: relative; width: min(470px, 100%); padding: 28px; border-radius: 26px;
  background: rgba(12, 11, 12, .66); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 40px 80px rgba(0, 0, 0, .45); margin-bottom: 4vh;
}
.final__kicker { margin: 0 0 12px; font-family: var(--mono); font-size: 12px; color: var(--ink-soft); letter-spacing: .08em; text-transform: uppercase; }
.final__title { margin: 0 0 12px; font-family: var(--display); font-weight: 400; font-size: clamp(36px, 3.6vw, 52px); line-height: .98; }
.final__lead { margin: 0 0 22px; color: var(--ink-soft); font-size: 15px; }
.final .btn--big { width: 100%; }
.final__opts { display: grid; gap: 8px; margin-top: 12px; }
.opt { display: grid; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; transition: border-color .2s, background-color .2s; }
.opt:hover { border-color: rgba(217, 119, 87, .6); background: rgba(217, 119, 87, .08); }
.opt__t { font-weight: 600; font-size: 15px; }
.opt__s { font-size: 13px; color: var(--ink-faint); }
.final__replay { margin-top: 14px; background: none; border: 0; color: var(--ink-faint); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }

/* ---------- Hojas ---------- */
.sheet {
  width: min(760px, calc(100vw - 32px)); max-height: min(86svh, 820px); padding: 28px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 26px;
  background: #101114; color: var(--ink); box-shadow: 0 50px 120px rgba(0, 0, 0, .7); overflow: auto;
}
.sheet::backdrop { background: rgba(3, 3, 4, .62); backdrop-filter: blur(6px); }
.sheet[open] { animation: sheet .35s var(--ease); }
@keyframes sheet { from { opacity: 0; transform: translateY(18px); } }
.sheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.sheet__head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; }
.sheet__x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: none; font-size: 24px; cursor: pointer; line-height: 1; }
.sheet__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.proj { display: block; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .2s, transform .2s var(--ease); }
.proj:hover { border-color: rgba(217, 119, 87, .6); transform: translateY(-2px); }
.proj__tag { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .05em; text-transform: uppercase; }
.proj h3 { margin: 10px 0 6px; font-size: 18px; }
.proj p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.sheet__list { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
a.row:hover { border-color: rgba(217, 119, 87, .6); }
.row__k { font-weight: 600; min-width: 120px; }
.row__k small { display: block; font-weight: 400; color: var(--ink-faint); font-size: 12px; }
.row__v { color: var(--ink-soft); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row__v--mono { font-family: var(--mono); font-size: 13px; }
.copy-btn { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: none; cursor: pointer; font-size: 13px; }
.copy-btn.is-done { border-color: var(--accent); color: var(--accent); }
.sheet__lead, .sheet__note { color: var(--ink-soft); font-size: 15px; margin: 0 0 16px; }
.sheet__note { margin: 16px 0 0; }
.sheet__warn { margin: 16px 0 0; font-size: 13px; color: var(--ink-soft); padding: 14px 16px; border-radius: 14px; background: rgba(217, 119, 87, .08); border: 1px solid rgba(217, 119, 87, .3); }

.track { position: relative; width: 1px; pointer-events: none; }

/* ---------- Móvil ---------- */
@media (max-width: 720px) {
  .cap--lead, .cap--trail { left: var(--gutter); right: var(--gutter); bottom: 12vh; text-align: left; }
  .cap--trail .cap__p { margin-left: 0; }
  .floor, .floor--r { left: var(--gutter); right: var(--gutter); top: auto; bottom: 10vh; translate: none; width: auto; }
  .final { justify-items: stretch; }
  .final__bg { top: 11vh; font-size: 13vw; }
  .final__panel { padding: 18px; margin-bottom: 1vh; }
  .final__lead, .final__kicker { display: none; }
  .final__title { font-size: 30px; }
  .opt { padding: 10px 14px; }
  .opt__s { display: none; }
  .bar__cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spark span, .spark span::before, .spark span::after { animation: none; }
}

/* ---------- Tomas reales: mirada que baja y bajada rápida ---------- */
.leg--tilt video, .leg--move video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.leg--tilt video { transform: translateY(var(--ty, 0%)) scale(1.45); transform-origin: 50% 50%; }
.leg--move video { transform: translateY(var(--my, 0%)) scale(var(--ms, 1.08)); }
.streaks {
  position: absolute; inset: -20% 0; opacity: 0; pointer-events: none; mix-blend-mode: screen;
  background:
    repeating-linear-gradient(90deg, rgba(255, 214, 170, 0) 0 37px, rgba(255, 214, 170, .22) 38px 39px, rgba(255, 214, 170, 0) 40px 83px),
    linear-gradient(180deg, rgba(255, 190, 140, 0), rgba(255, 190, 140, .35) 50%, rgba(255, 190, 140, 0));
  transform: scaleY(1.6);
}
.final__bg { color: rgba(255, 240, 222, .9); }

.final__links { display: flex; gap: 18px; flex-wrap: wrap; }
.final__links a.final__replay { display: inline-block; }

/* ---------- Cielo: estrellas arriba y atardecer abajo, en una sola tira ---------- */
.sky { overflow: hidden; }
.sky__strip { position: absolute; left: 0; top: 0; width: 100%; height: 200%; transform: translateY(var(--sy, 0%)) scale(var(--sk, 1)); transform-origin: 50% 75%; will-change: transform; }
.sky__strip video { position: absolute; left: 0; width: 100%; height: 56%; object-fit: cover; }
.sky__stars { top: 0; }
.sky__sunset { top: 44%; -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%); mask-image: linear-gradient(to bottom, transparent 0%, #000 22%); }

.final__bg { top: 9vh; max-width: 12ch; font-size: clamp(30px, 3.4vw, 60px); }
@media (max-width: 720px) { .final__bg { top: 9vh; font-size: 8vw; } }
