/* ============================================================
   TrilogIA 47 — Presentación interactiva (v2)
   Paleta y tipografías tomadas de trilogia47.com
   ============================================================ */
:root {
  --bg: #0b0d1f;
  --bg2: #0f1228;
  --panel: rgba(21, 24, 52, 0.72);
  --panel2: rgba(28, 32, 64, 0.85);
  --line: rgba(255, 255, 255, 0.10);
  --text: #f5f3ff;
  --text2: #b3b5cc;
  --muted: #6e7090;
  --lime: #a8e85c;
  --cyan: #4dd9f5;
  --violet: #8f7cf2;
  --magenta: #e94fd4;
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Inter Tight", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--sans); font-weight: 300; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure { margin: 0; }
.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.grad { background: linear-gradient(90deg, var(--cyan) 0%, var(--violet) 50%, var(--magenta) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Capas de ambiente ---------- */
.aurora { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; filter: blur(60px) saturate(130%); opacity: 0.9; transform: scale(1.15); }
.noise { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
main { position: relative; z-index: 2; }

/* ---------- Intro ---------- */
.intro { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: block; }
.intro__logo { position: absolute; filter: drop-shadow(0 0 22px rgba(77,217,245,0.35)); }
.intro__logo svg { width: 100%; height: 100%; overflow: visible; }
.intro__word { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); color: var(--muted); opacity: 0; }
.intro.is-done { display: none; }

/* ---------- Logo vectorial ---------- */
.crisp { position: absolute; pointer-events: none; opacity: 0; filter: drop-shadow(0 0 26px rgba(77,217,245,0.45)) drop-shadow(0 0 60px rgba(233,79,212,0.25)); will-change: opacity, transform; }
.crisp svg { width: 100%; height: 100%; overflow: visible; }
.t47-logo .tq { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.t47-logo .tri { fill: none; stroke-width: 1.7; stroke-linejoin: round; }
.t47-logo .node { fill: var(--lime); }
.t47-logo .node-in { fill: #0b0d1f; }

/* ---------- Chrome fijo ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: rgba(255,255,255,0.06); }
.progress__bar { height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--cyan), var(--magenta)); }

.topbar { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(20px, 4vw, 48px);
  background: linear-gradient(to bottom, rgba(11,13,31,0.85), rgba(11,13,31,0)); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 34px; height: 34px; display: block; filter: drop-shadow(0 0 8px rgba(77,217,245,0.4)); }
.brand__mark svg { width: 100%; height: 100%; overflow: visible; }
.brand__name { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand__name em { font-style: normal; color: var(--cyan); }
.brand__name b { color: var(--lime); font-weight: 600; }
.topbar__right { display: flex; align-items: center; gap: 22px; }
.topbar__counter { color: var(--muted); }
.topbar__counter #secNow { color: var(--text); }

.dots { position: fixed; right: clamp(14px, 2.4vw, 30px); top: 50%; transform: translateY(-50%); z-index: 50; display: flex; flex-direction: column; gap: 14px; }
.dot { position: relative; width: 14px; height: 14px; display: grid; place-items: center; cursor: pointer; background: none; border: 0; padding: 0; }
.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); transition: transform .35s var(--ease), background .35s; }
.dot:hover::before { transform: scale(1.5); background: var(--text2); }
.dot.is-active::before { background: var(--lime); transform: scale(1.7); box-shadow: 0 0 12px rgba(168,232,92,0.6); }
.dot__label { position: absolute; right: 24px; top: 50%; transform: translate(6px, -50%); white-space: nowrap; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text2); opacity: 0; transition: opacity .25s, transform .35s var(--ease); pointer-events: none; }
.dot:hover .dot__label { opacity: 1; transform: translate(0, -50%); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 14px 22px; border-radius: 4px; border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s; will-change: transform; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: .1s; }
.btn--primary { background: var(--lime); color: #0b0d1f; font-weight: 500; }
.btn--primary:hover { box-shadow: 0 10px 30px rgba(168,232,92,0.28); }
.btn--ghost { border-color: rgba(255,255,255,0.22); color: var(--text); background: rgba(11,13,31,0.4); backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: var(--text); background: rgba(255,255,255,0.06); }
.btn--small { padding: 10px 16px; font-size: 0.66rem; }

/* ---------- Escenas ---------- */
.scene { position: relative; min-height: 100vh; min-height: 100svh; width: 100%; overflow: hidden; }
.scene__inner { position: relative; width: min(1180px, 100% - clamp(40px, 8vw, 96px)); margin: 0 auto; padding: clamp(96px, 12vh, 140px) 0 clamp(64px, 8vh, 96px); }
.eyebrow { color: var(--lime); margin-bottom: 22px; }
.eyebrow::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); margin-right: 10px; vertical-align: 1px; box-shadow: 0 0 10px var(--lime); }
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -0.02em; }
.mask { overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.mask > span { display: inline-block; will-change: transform; }

/* 01 · Hero */
.scene--hero { display: flex; align-items: center; justify-content: center; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__content { position: relative; width: min(1180px, 100% - clamp(40px, 8vw, 96px)); padding-top: 8vh; }
.hero__tags { display: flex; flex-wrap: wrap; gap: 18px 28px; color: var(--text2); margin-bottom: 34px; }
.tag i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); margin-right: 10px; vertical-align: 1px; box-shadow: 0 0 10px var(--lime); }
.hero__title { font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 6.8vw, 6.2rem); line-height: 0.98; letter-spacing: -0.025em; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero__title .line > span { display: inline-block; }
.hero__title i { font-style: italic; font-weight: 300; }
.hero__lead { max-width: 560px; margin-top: 34px; font-size: clamp(1rem, 1.35vw, 1.18rem); color: var(--text2); }
.hero__hint { position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); }
.hero__wheel { width: 20px; height: 32px; border: 1px solid rgba(255,255,255,0.25); border-radius: 12px; position: relative; }
.hero__wheel span { position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--lime); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1 } 70% { transform: translateY(12px); opacity: 0 } 100% { transform: translateY(0); opacity: 0 } }

/* 02 · Manifiesto */
.scene--manifesto { display: flex; align-items: center; }
.manifesto { font-family: var(--serif); font-weight: 300; font-size: clamp(1.7rem, 4.1vw, 3.6rem); line-height: 1.18; letter-spacing: -0.015em; max-width: 1080px; }
.manifesto em { font-style: italic; color: var(--lime); }
.manifesto .w { display: inline-block; opacity: 0.12; will-change: opacity, transform; }
.manifesto__foot { max-width: 620px; margin-top: 44px; font-size: clamp(1rem, 1.3vw, 1.15rem); color: var(--text2); }
.manifesto__foot strong { color: var(--text); font-weight: 500; }

/* 03 · Capacidades */
.scene--caps { display: flex; align-items: center; }
.scene--caps .scene__inner { padding-top: clamp(84px, 10vh, 120px); }
.caps__head { display: flex; flex-direction: column; margin-bottom: clamp(28px, 4vh, 48px); }
.caps__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; perspective: 1200px; }
.cap { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 2.2vw, 28px); min-height: 230px; overflow: hidden;
  backdrop-filter: blur(10px); transition: border-color .3s, background .3s, transform .5s var(--ease); will-change: transform, opacity; transform-style: preserve-3d; }
.cap::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(77,217,245,0.16), transparent 45%); }
.cap::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px; opacity: 0; transition: opacity .35s;
  background: linear-gradient(135deg, rgba(77,217,245,0.6), rgba(233,79,212,0.5)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.cap:hover { background: var(--panel2); }
.cap:hover::before, .cap:hover::after { opacity: 1; }
.cap__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cap__n { color: var(--cyan); }
.cap__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(77,217,245,0.08); border: 1px solid rgba(77,217,245,0.18); transition: background .3s, transform .5s var(--ease); }
.cap__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--cyan); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cap:hover .cap__icon { background: rgba(168,232,92,0.12); transform: translateZ(30px); }
.cap:hover .cap__icon svg { stroke: var(--lime); }
.cap h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.2rem, 1.7vw, 1.5rem); line-height: 1.1; margin-bottom: 10px; letter-spacing: -0.01em; }
.cap p { color: var(--text2); font-size: 0.93rem; }

/* 04 · Avatares / hologramas */
.scene--avatars { display: flex; flex-direction: column; justify-content: center; }
.avatars__head { width: min(1180px, 100% - clamp(40px, 8vw, 96px)); margin: 0 auto; padding: clamp(90px, 11vh, 120px) 0 0; position: relative; z-index: 3; }
.avatars__lead { max-width: 520px; margin-top: 18px; color: var(--text2); font-size: clamp(0.95rem, 1.2vw, 1.1rem); }
.holo__stage { position: relative; height: clamp(380px, 56vh, 560px); margin-top: clamp(10px, 3vh, 30px); perspective: 1400px; display: flex; align-items: center; justify-content: center; }
.holo { position: absolute; width: clamp(150px, 15vw, 230px); aspect-ratio: 9 / 15.5; transform-style: preserve-3d; will-change: transform, opacity; }
.holo__frame { position: relative; width: 100%; height: 100%; border-radius: 18px; overflow: hidden; border: 1px solid rgba(77,217,245,0.35);
  box-shadow: 0 0 0 1px rgba(77,217,245,0.08), 0 30px 60px rgba(0,0,0,0.45), inset 0 0 40px rgba(77,217,245,0.12); background: #0e1230; }
.holo__frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1) contrast(1.05); }
.holo__frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(77,217,245,0.10), transparent 30%, transparent 70%, rgba(11,13,31,0.75)); }
.holo__scan { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 4px); mix-blend-mode: overlay; pointer-events: none; }
.holo__scan::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; top: -30%; background: linear-gradient(180deg, transparent, rgba(77,217,245,0.28), transparent); animation: scan 3.6s linear infinite; }
@keyframes scan { to { top: 120%; } }
.holo figcaption { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 4px; z-index: 2; }
.holo figcaption b { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; letter-spacing: -0.01em; }
.holo figcaption span { color: var(--text2); font-size: 0.56rem; }
.holo__base { position: absolute; left: 50%; bottom: -34px; width: 150%; height: 40px; transform: translateX(-50%) rotateX(70deg); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(77,217,245,0.55), rgba(77,217,245,0.12) 60%, transparent); filter: blur(6px); }

/* 05 · Proyectos (horizontal cinematográfico) */
.scene--projects { display: flex; flex-direction: column; justify-content: center; }
.projects__head { position: relative; width: min(1180px, 100% - clamp(40px, 8vw, 96px)); margin: 0 auto; padding: clamp(90px, 11vh, 120px) 0 clamp(18px, 3vh, 30px); }
.projects__counter { position: absolute; right: 0; bottom: clamp(24px, 3.4vh, 36px); color: var(--muted); font-size: 0.9rem; }
.projects__counter #projNow { color: var(--text); }
.track { display: flex; gap: clamp(18px, 2.4vw, 32px); padding: 0 clamp(20px, 4vw, 48px) 6vh; width: max-content; will-change: transform; }
.project { position: relative; flex: 0 0 auto; width: clamp(320px, 66vw, 980px); height: clamp(380px, 62vh, 600px); border-radius: 22px; overflow: hidden; background: #0e1230; border: 1px solid var(--line); }
.project img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); will-change: transform; }
.project::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,13,31,0.15) 0%, rgba(11,13,31,0) 35%, rgba(11,13,31,0.55) 62%, rgba(11,13,31,0.94) 100%); }
.project__index { position: absolute; top: 18px; left: 26px; z-index: 2; font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 6vw, 5.2rem); line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.45); }
.project__body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: clamp(20px, 2.6vw, 36px); display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.project__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--text2); }
.pill { padding: 5px 10px; border-radius: 999px; font-size: 0.62rem; }
.pill--lime { background: rgba(168,232,92,0.16); color: var(--lime); }
.pill--magenta { background: rgba(233,79,212,0.18); color: var(--magenta); }
.project h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 2.8vw, 2.6rem); line-height: 1.02; letter-spacing: -0.02em; }
.project h3 em { display: block; font-style: italic; font-weight: 300; color: var(--text2); font-size: 0.72em; margin-top: 4px; }
.project p { color: var(--text2); font-size: 0.95rem; max-width: 560px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 6px 10px; border: 1px solid rgba(255,255,255,0.18); border-radius: 4px; color: var(--text); font-size: 0.6rem; backdrop-filter: blur(6px); background: rgba(11,13,31,0.35); }

/* 06 · Cifras (odómetro) */
.scene--stats { display: flex; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: clamp(26px, 4vh, 44px); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px, 2.6vw, 36px); backdrop-filter: blur(10px); will-change: transform, opacity; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: linear-gradient(90deg, var(--cyan), var(--magenta)); opacity: 0.7; }
.stat--wide { grid-column: 1 / -1; display: flex; align-items: center; gap: 26px; background: linear-gradient(90deg, rgba(77,217,245,0.10), rgba(233,79,212,0.10)); }
.stat__n { font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 6.4vw, 5.6rem); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; }
.stat__unit { font-size: 0.5em; color: var(--text2); margin-left: 2px; }
.stat__n .infinity { color: var(--lime); }
.odo { display: inline-flex; height: 1em; overflow: hidden; line-height: 1; }
.odo__col { position: relative; width: 0.62em; height: 1em; }
.odo__strip { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; will-change: transform; }
.odo__strip span { display: block; height: 1em; line-height: 1; text-align: center; }
.stat__l { margin-top: 14px; color: var(--text2); font-size: 0.95rem; max-width: 300px; }
.stat--wide .stat__l { margin-top: 0; max-width: 620px; }

/* 07 · Metodología */
.scene--method { display: flex; align-items: center; }
.method__head { margin-bottom: clamp(30px, 5vh, 56px); }
.steps__wrap { position: relative; padding-left: 40px; }
.steps__line { position: absolute; left: 12px; top: 8px; width: 2px; height: calc(100% - 16px); overflow: visible; }
.steps__line line { stroke: var(--cyan); stroke-width: 2; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; }
.step { position: relative; will-change: transform, opacity; padding: 16px; border-radius: 14px; border: 1px solid transparent; transition: background .4s, border-color .4s; }
.step.is-on { background: rgba(21,24,52,0.5); border-color: var(--line); }
.step__dot { position: absolute; left: -40px; top: 20px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg2); border: 2px solid var(--muted); display: grid; place-items: center; transition: border-color .3s, box-shadow .3s; }
.step__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background .3s, transform .3s var(--ease); }
.step.is-on .step__dot { border-color: var(--lime); box-shadow: 0 0 16px rgba(168,232,92,0.45); }
.step.is-on .step__dot::after { background: var(--lime); transform: scale(1.3); }
.step__n { color: var(--cyan); display: block; margin-bottom: 12px; }
.step h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.15rem, 1.6vw, 1.45rem); line-height: 1.1; margin-bottom: 10px; letter-spacing: -0.01em; }
.step p { color: var(--text2); font-size: 0.92rem; }
@media (min-width: 901px) {
  .steps__wrap { padding-left: 0; padding-top: 46px; }
  .steps__line { left: 0; top: 12px; width: 100%; height: 2px; }
  .step__dot { left: 16px; top: -46px; }
}

/* 08 · Cierre */
.scene--end { display: flex; align-items: center; }
.end__title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 6.2vw, 5.4rem); line-height: 0.98; letter-spacing: -0.025em; max-width: 820px; }
.end__title em { font-style: italic; font-weight: 300; }
.end__lead { max-width: 560px; margin-top: 28px; color: var(--text2); font-size: clamp(1rem, 1.35vw, 1.18rem); }
.end__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.end__foot { display: flex; flex-direction: column; gap: 10px; margin-top: clamp(60px, 10vh, 120px); color: var(--muted); font-size: 0.62rem; max-width: 720px; text-transform: none; letter-spacing: 0.04em; }

/* ---------- Estados iniciales para animación ---------- */
.js .hero__tags, .js .hero__lead, .js .hero__title .line > span { opacity: 0; }
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .mask > span { transform: translateY(110%); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .caps__grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 14px; }
  .project { width: min(86vw, 520px); height: clamp(420px, 66vh, 620px); }
  .topbar__counter { display: none; }
  .holo { width: clamp(120px, 24vw, 170px); }
  .projects__counter { display: none; }
}
@media (max-width: 640px) {
  .caps__grid { grid-template-columns: 1fr; gap: 12px; }
  .cap { min-height: 0; }
  .stats { grid-template-columns: 1fr; }
  .stat--wide { flex-direction: column; gap: 8px; align-items: flex-start; }
  .dots { display: none; }
  .hero__hint { display: none; }
  .brand__name { display: none; }
  .holo { width: 30vw; }
  .holo figcaption b { font-size: 1rem; }
  .holo figcaption span { display: none; }
  .hero__content { padding-top: 22vh; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__wheel span, .holo__scan::after { animation: none; }
  .js .hero__tags, .js .hero__lead, .js .hero__title .line > span, .js .reveal, .js .mask > span { opacity: 1; transform: none; }
  .manifesto .w { opacity: 1; }
  .intro { display: none; }
}
