/* MG RENTAL & SUPPLIES — DEMO V2 · BASECAMP CINEMATOGRÁFICO */

:root {
  --black: #060606;
  --ink: #0d0d0d;
  --graphite: #17171a;
  --graphite-2: #232326;
  --white: #f2f0ea;
  --paper: #d8d5cc;
  --muted: #9a978f;
  --line: rgba(242, 240, 234, 0.16);
  --line-strong: rgba(242, 240, 234, 0.42);
  --red: #ec1c14;
  --red-deep: #b3120c;
  --warm: #ffd9a1;

  --display: "Big Shoulders Display", "Bahnschrift Condensed", "DIN Condensed", Impact, sans-serif;
  --body: "Barlow", "Bahnschrift", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", "Consolas", monospace;

  --pad: clamp(1.25rem, 4.2vw, 4.75rem);
  --header-h: 4.75rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 180ms;
  --t-mid: 700ms;
  --t-slow: 1400ms;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--black);
  color: var(--white);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--black);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: normal; color: var(--red); }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; z-index: 1000; top: 0.75rem; left: 0.75rem;
  padding: 0.75rem 1rem; color: var(--black); background: var(--white);
  font-family: var(--mono); font-size: 0.8rem;
  transform: translateY(-160%); transition: transform var(--t-fast) ease;
}
.skip-link:focus { transform: none; }

.code, .chapter-tag, .slate, .hero-rail, .plan-meta, figcaption .code {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-tag {
  display: inline-flex; align-items: center; gap: 0.75rem;
  color: var(--muted);
}
.chapter-tag span {
  color: var(--white);
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line-strong);
}

/* ---------- HEADER ---------- */

.site-header {
  position: fixed; z-index: 60; inset: 0 0 auto 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: var(--header-h);
  padding: 0 var(--pad);
  padding-top: env(safe-area-inset-top);
  transition: background 400ms ease, border-color 400ms ease, transform 500ms var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  background: rgba(6, 6, 6, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.brand img { width: auto; height: 2.9rem; }

.slate { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--paper); }
.slate i {
  width: 0.45rem; height: 0.45rem; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 3px rgba(236, 28, 20, 0.18);
}

.site-nav { justify-self: end; display: flex; align-items: center; gap: 1.75rem; }
.site-nav a {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper); transition: color var(--t-fast) ease;
}
.site-nav a:hover { color: var(--white); }
.site-nav .nav-cta {
  color: var(--white); padding: 0.75rem 1.1rem;
  border: 1px solid var(--red);
  transition: background var(--t-fast) ease;
}
.site-nav .nav-cta:hover { background: var(--red); }

/* ---------- BUTTONS ---------- */

.btn {
  position: relative; display: inline-flex; align-items: center; gap: 0.9rem;
  min-height: 3.4rem; padding: 0 1.4rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  isolation: isolate; overflow: hidden;
  transition: transform var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 300ms var(--ease-out); }

.btn:active { transform: scale(0.98); }
.btn--red { background: var(--red); color: var(--white); }
.btn--red::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--white);
  transform: scaleX(0); transform-origin: left; transition: transform 380ms var(--ease-out);
}

.btn--ghost { color: var(--white); border-bottom: 1px solid var(--line-strong); padding: 0 0.2rem; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover svg { transform: translate(2px, -2px); }
  .btn--red:hover { color: var(--black); }
  .btn--red:hover::before { transform: scaleX(1); }
  .btn--ghost:hover { border-color: var(--white); }
  .btn--ghost:hover svg { transform: translateY(2px); }
  .needs button:hover { border-color: var(--white); color: var(--white); }
}
.btn--xl { min-height: 4.25rem; padding: 0 2rem; font-size: 0.9rem; }

/* ---------- MOTION PRIMITIVES ---------- */

/* 6 · reveal editorial: la línea sube desde una máscara */
.line-mask { display: block; overflow: hidden; padding: 0.16em 0 0.04em; margin: -0.16em 0 -0.04em; }
.line-mask > span { display: inline-block; }
.js .reveal.line-mask > span,
.js .hero .line-mask > span {
  transform: translateY(105%);
  transition: transform 1000ms var(--ease-out);
}
.js .reveal.line-mask.is-in > span,
.js .hero.is-live .line-mask > span { transform: none; }

.js .reveal:not(.line-mask) {
  opacity: 0; transform: translateY(18px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}
.js .reveal:not(.line-mask).is-in { opacity: 1; transform: none; }

/* 3 · máscara roja: barrido que abre la imagen */
.mask-reveal .shot-media { position: relative; }
.js .mask-reveal .shot-media { clip-path: inset(0 100% 0 0); transition: clip-path 1100ms var(--ease-in-out) 150ms; }
.js .mask-reveal .shot-media::after {
  content: ""; position: absolute; inset: 0; z-index: 2; background: var(--red);
  transform: scaleX(1); transform-origin: right;
  transition: transform 800ms var(--ease-in-out) 850ms;
}
.js .mask-reveal.is-in .shot-media { clip-path: inset(0 0 0 0); }
.js .mask-reveal.is-in .shot-media::after { transform: scaleX(0); }

/* 5 · escala cinematográfica lenta */
.shot-media img { transform: scale(var(--s, 1)) translate3d(0, var(--py, 0px), 0); will-change: transform; }
.js .mask-reveal .shot-media img { --s: 1.14; transition: --s 0s; }
.js .mask-reveal.is-in .shot-media img { animation: slow-scale 2600ms var(--ease-out) forwards; }
@keyframes slow-scale { from { --s: 1.14; } to { --s: 1.04; } }
@property --s { syntax: "<number>"; inherits: true; initial-value: 1; }

/* ---------- 01 · HERO ---------- */

.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; align-items: end;
  padding: calc(var(--header-h) + 2rem) var(--pad) 6.5rem;
  overflow: hidden; isolation: isolate;
  background: #03060a;
}

.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-video {
  width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%;
  transform: scale(1.14);
  filter: brightness(0.55) saturate(0.8);
  transition: transform 3200ms var(--ease-out), filter 2600ms ease;
}
.hero.is-live .hero-video { transform: scale(1.02); filter: brightness(1) saturate(0.92); }
.hero-video.is-poster-only { background: url("assets/video/hero_poster.webp") center / cover; }

.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 5, 8, 0.92) 0%, rgba(3, 5, 8, 0.72) 30%, rgba(3, 5, 8, 0.12) 58%, rgba(3, 5, 8, 0) 72%),
    linear-gradient(0deg, rgba(6, 6, 6, 0.95) 0%, rgba(6, 6, 6, 0.2) 34%, rgba(6, 6, 6, 0) 55%),
    linear-gradient(180deg, rgba(6, 6, 6, 0.6) 0%, rgba(6, 6, 6, 0) 22%);
}

.grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: 0.09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* 1 · profundidad de entrada: letterbox que se abre */
.letterbox {
  position: absolute; left: 0; right: 0; z-index: 3; height: 50.5%;
  background: var(--black); pointer-events: none;
  transition: transform 1500ms var(--ease-in-out) 150ms;
}
.letterbox--top { top: 0; transform-origin: top; }
.letterbox--bottom { bottom: 0; transform-origin: bottom; }
.no-js .letterbox, html:not(.js) .letterbox { display: none; }
.hero.is-live .letterbox { transform: scaleY(0); }

.viewfinder { position: absolute; inset: calc(var(--header-h) + 0.75rem) var(--pad) 4.25rem; pointer-events: none; z-index: 1; }
.viewfinder i { position: absolute; width: 1.4rem; height: 1.4rem; border: 0 solid var(--line-strong); }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.viewfinder i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.viewfinder i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.hero-copy { position: relative; z-index: 2; }
/* desktop: cada línea del H1 toma el ancho de su texto; la máscara solo recorta en vertical (reveal) */
@media (min-width: 901px) {
  .hero-title .line-mask { width: max-content; }
}
.hero-eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper); margin-bottom: 1.4rem; }
.hero-eyebrow > span::before { content: ""; display: inline-block; width: 2.2rem; height: 1px; background: var(--red); vertical-align: middle; margin-right: 0.9rem; }

.hero-title {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(3.3rem, min(9.2vw, 17.5vh), 10.5rem);
  line-height: 0.84; letter-spacing: -0.005em;
}
.hero-title .line-mask:nth-child(2) { padding-left: 0.62em; }
.hero-title .line-mask:nth-child(3) { padding-left: 0.62em; }

.hero-lede { margin-top: 1.6rem; max-width: 30rem; font-size: clamp(1.05rem, 1.35vw, 1.3rem); color: var(--paper); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; margin-top: 2.2rem; }

.js .hero .hero-actions { opacity: 0; transform: translateY(14px); transition: opacity 900ms var(--ease-out) 1500ms, transform 900ms var(--ease-out) 1500ms; }
.js .hero.is-live .hero-actions { opacity: 1; transform: none; }
.js .hero .line-mask:nth-child(1) > span { transition-delay: 700ms; }
.js .hero .hero-title .line-mask:nth-child(1) > span { transition-delay: 850ms; }
.js .hero .hero-title .line-mask:nth-child(2) > span { transition-delay: 970ms; }
.js .hero .hero-title .line-mask:nth-child(3) > span { transition-delay: 1090ms; }
.js .hero .hero-lede > span { transition-delay: 1300ms; }

.hero-rail {
  position: absolute; z-index: 2; left: var(--pad); right: calc(var(--pad) + 8rem); bottom: 1.6rem;
  display: flex; gap: 2.5rem; color: var(--muted);
}
.hero-rail b { color: var(--red); font-weight: 500; }
.hero-rail [data-timecode] { color: var(--white); font-variant-numeric: tabular-nums; }

.video-toggle {
  position: absolute; z-index: 3; right: var(--pad); bottom: 1.1rem;
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; padding: 0 0.9rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper);
  border: 1px solid var(--line);
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease;
}
.video-toggle:hover { border-color: var(--line-strong); color: var(--white); }
.video-toggle__icon { width: 0.6rem; height: 0.7rem; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.video-toggle[aria-pressed="true"] .video-toggle__icon { border: 0; width: 0; height: 0; border-left: 0.6rem solid currentColor; border-top: 0.35rem solid transparent; border-bottom: 0.35rem solid transparent; }

/* ---------- 02 · STATEMENT ---------- */

.statement {
  position: relative;
  padding: clamp(6rem, 16vh, 11rem) var(--pad) 0;
  background: var(--black);
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.25rem;
}
.statement .chapter-tag { grid-column: 1 / -1; margin-bottom: 2.5rem; }
.statement-title {
  grid-column: 1 / -1;
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(3.4rem, 12.5vw, 14rem); line-height: 0.82;
}
.statement-title .line-mask:nth-child(2) { padding-left: 1.1em; }
.red-sweep { position: relative; }
.red-sweep::after {
  content: ""; position: absolute; left: -0.05em; right: -0.05em; top: 0.08em; bottom: 0.02em;
  background: var(--red); transform: scaleX(0); transform-origin: left; mix-blend-mode: multiply;
}
.js .is-in .red-sweep::after { animation: sweep 1300ms var(--ease-in-out) 500ms forwards; }
@keyframes sweep {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  50.1% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}
.statement-body {
  grid-column: 7 / span 5; margin-top: 3.5rem;
  font-size: clamp(1.1rem, 1.45vw, 1.35rem); color: var(--paper); max-width: 34rem;
}
.statement-kicker { margin-top: 1.1rem; color: var(--white); font-weight: 600; }

.ticker {
  grid-column: 1 / -1; margin: clamp(5rem, 12vh, 8rem) calc(var(--pad) * -1) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 1.1rem 0;
}
.ticker-track {
  display: flex; gap: 1.6rem; width: max-content; white-space: nowrap;
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2rem, 4.2vw, 4rem); line-height: 1; color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  transform: translate3d(var(--tx, 0px), 0, 0);
}
.ticker-track i { font-style: normal; color: var(--red); -webkit-text-stroke: 0; }

/* ---------- 03 · SISTEMA MG ---------- */

.system {
  position: relative;
  height: 640vh;
  background:
    radial-gradient(ellipse 60% 50% at 62% 52%, rgba(35, 35, 40, 0.8), transparent 70%),
    var(--ink);
}
.system-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid;
  grid-template-columns: minmax(18rem, 25rem) 1fr;
  grid-template-rows: auto 1fr auto;
  column-gap: 2rem;
  padding: calc(var(--header-h) + 1.5rem) var(--pad) 2rem;
}
.system-head { grid-column: 1; grid-row: 1; }
.system-title {
  margin-top: 1.25rem;
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.4rem, 3.8vw, 4.2rem); line-height: 0.86;
}

.system-plan { grid-column: 2; grid-row: 1 / span 3; position: relative; display: grid; place-items: center; perspective: 1600px; min-height: 0; }
.plan-rig {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  transform-style: preserve-3d;
  transform: rotateX(16deg) rotateZ(-3deg) scale(0.84);
  will-change: transform;
}
.plan { width: 100%; height: 100%; max-height: 86vh; overflow: visible; }
.plan-meta {
  position: absolute; right: 0; bottom: 0; display: flex; gap: 1.5rem; color: var(--muted);
}
.plan-meta__state { color: var(--white); }

.system-steps {
  grid-column: 1; grid-row: 2; align-self: center;
  list-style: none; margin: 2rem 0 0; padding: 0;
  border-top: 1px solid var(--line);
}
.system-steps li { border-bottom: 1px solid var(--line); }
.system-steps button {
  display: flex; align-items: baseline; gap: 1rem; width: 100%; min-height: 2.9rem; padding: 0.55rem 0;
  text-align: left; color: var(--muted);
  transition: color 300ms ease;
}
.system-steps .n { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; }
.system-steps .t {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: 1.45rem; line-height: 1; letter-spacing: 0.01em;
  transition: transform 400ms var(--ease-out);
}
.system-steps p {
  display: grid; grid-template-rows: 0fr; overflow: hidden;
  color: var(--paper); font-size: 1rem; line-height: 1.45;
  max-height: 0; opacity: 0;
  transition: max-height 500ms var(--ease-out), opacity 400ms ease, padding 500ms var(--ease-out);
}
.system-steps li.is-active button { color: var(--white); }
.system-steps li.is-active .n { color: var(--red); }
.system-steps li.is-active .t { transform: translateX(0.35rem); }
.system-steps li.is-active p { max-height: 6rem; opacity: 1; padding: 0 0 1rem 2.25rem; }
.system-steps li.is-done button { color: var(--paper); }

.system-evidence {
  grid-column: 1; grid-row: 3; margin: 1.25rem 0 0; width: min(100%, 18rem);
}
@media (min-width: 901px) and (max-height: 780px) {
  .system-evidence { display: none; }
}
.evidence-frame { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--graphite); border: 1px solid var(--line); }
.evidence-frame img { width: 100%; height: 100%; object-fit: cover; }
.evidence-empty {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 0.4rem; text-align: center;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  background:
    linear-gradient(45deg, transparent 49.6%, var(--line) 50%, transparent 50.4%),
    linear-gradient(-45deg, transparent 49.6%, var(--line) 50%, transparent 50.4%);
}
.evidence-empty[hidden], .evidence-frame img[hidden] { display: none; }
.evidence-empty strong { font-family: var(--display); font-size: 1.6rem; font-weight: 800; color: var(--white); letter-spacing: 0.02em; }
.evidence-wipe { position: absolute; inset: 0; background: var(--red); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.evidence-wipe.is-running { animation: plate-wipe 720ms var(--ease-in-out); }
@keyframes plate-wipe {
  0% { transform: scaleX(0); transform-origin: left; }
  45% { transform: scaleX(1); transform-origin: left; }
  55% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}
.system-evidence figcaption { margin-top: 0.6rem; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.system-evidence figcaption [data-evidence-code] { color: var(--red); }

.system-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.system-progress i { display: block; height: 100%; background: var(--red); transform: scaleX(var(--p, 0)); transform-origin: left; }

/* — plano SVG — */
.plan .face-top { fill: #1d1d20; }
.plan .face-x { fill: #141416; }
.plan .face-y { fill: #0e0e10; }
.plan .edge, .plan .face-top, .plan .face-x, .plan .face-y {
  stroke: rgba(242, 240, 234, 0.62); stroke-width: 1.1; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  transition: stroke 500ms ease, fill 700ms ease;
}
.plan .edge { fill: none; }
.plan .ground { fill: rgba(242, 240, 234, 0.025); stroke: rgba(242, 240, 234, 0.45); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan .grid { stroke: rgba(242, 240, 234, 0.09); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.plan .tick { fill: var(--muted); font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; }
.plan .cable { fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.plan .link { fill: none; stroke: rgba(242, 240, 234, 0.5); stroke-width: 1; stroke-dasharray: 4 6; vector-effect: non-scaling-stroke; }
.plan .signal { fill: none; stroke: var(--red); stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: 0.85; }
.plan .window { fill: #0b0b0c; stroke: rgba(242, 240, 234, 0.4); stroke-width: 1; vector-effect: non-scaling-stroke; transition: fill 900ms ease; }
.plan .bulb { fill: rgba(242, 240, 234, 0.35); transition: fill 900ms ease; }
.plan .beam { fill: url(#beam); opacity: 0; transition: opacity 1200ms ease; mix-blend-mode: screen; }
.plan .pin { fill: var(--black); stroke: var(--red); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.plan .label-line { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.plan .label { fill: var(--white); font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: 0.1em; }
.plan .label-num { fill: var(--red); }

/* capas: aparecen desde arriba (2.5D) */
.js .plan .layer {
  opacity: 0; transform: translateY(-46px);
  transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out);
}
.js .plan .layer.is-on { opacity: 1; transform: none; }
.js .plan .layer[data-layer="1"] { transform: none; }
.plan .layer .draw { stroke-dasharray: var(--len, 2000); stroke-dashoffset: var(--len, 2000); transition: stroke-dashoffset 1600ms var(--ease-in-out) 250ms; }
.plan .layer.is-on .draw { stroke-dashoffset: 0; }
.no-draw .plan .layer .draw { stroke-dasharray: none; }

/* capa activa = trazo rojo */
.plan .layer.is-current .face-top,
.plan .layer.is-current .face-x,
.plan .layer.is-current .face-y,
.plan .layer.is-current .edge { stroke: var(--red); }
.plan .layer.is-current .label { fill: var(--white); }

/* 7 · operación encendida */
.plan.is-live .window { fill: var(--warm); }
.plan.is-live .bulb { fill: #fff3d6; }
.plan.is-live .beam { opacity: 0.55; }
.plan.is-live .face-top { fill: #232326; }

/* ---------- 04 · EN TERRENO ---------- */

.field { padding: clamp(6rem, 14vh, 10rem) 0 clamp(4rem, 10vh, 7rem); background: var(--black); }
.field-intro { padding: 0 var(--pad); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.25rem; align-items: end; margin-bottom: clamp(3rem, 8vh, 6rem); }
.field-intro .chapter-tag { grid-column: 1 / -1; margin-bottom: 2rem; }
.field-title {
  grid-column: 1 / span 8;
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(3.4rem, 10vw, 11rem); line-height: 0.84;
}
.field-note { grid-column: 9 / span 4; color: var(--muted); font-size: 1rem; max-width: 20rem; padding-bottom: 0.8rem; }

.shot { margin: 0; position: relative; }
.shot-media { overflow: hidden; background: var(--graphite); }
.shot-media img { width: 100%; height: 100%; object-fit: cover; }
.shot-caption { font-size: 0.98rem; color: var(--paper); }
.shot-caption .code { display: block; color: var(--red); margin-bottom: 0.45rem; }
.shot-caption--below { margin-top: 0.9rem; max-width: 30rem; }

.shot--full .shot-media { height: min(92vh, 62rem); }
.shot--full .shot-media img { object-position: 50% 60%; }
.shot--full .shot-caption {
  position: absolute; left: var(--pad); bottom: clamp(1.5rem, 4vh, 3rem); z-index: 3;
  padding: 1.1rem 1.3rem 1.2rem; background: rgba(6, 6, 6, 0.86);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.shot--full .shot-caption strong {
  display: block; font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(1.8rem, 3.4vw, 3.4rem); line-height: 0.9; color: var(--white);
}

.pair {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.25rem;
  padding: clamp(4rem, 12vh, 8rem) var(--pad) 0; align-items: start;
}
.shot--wide { grid-column: 1 / span 7; }
.shot--wide .shot-media { aspect-ratio: 4 / 3; }
.pair-side { grid-column: 9 / span 4; display: grid; gap: 2.5rem; padding-top: 3rem; }
.pair-quote {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2rem, 3.4vw, 3.4rem); line-height: 0.9;
}
.shot--portrait .shot-media { aspect-ratio: 4 / 5; }

.comms {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.25rem;
  padding: clamp(6rem, 16vh, 11rem) var(--pad) 0; align-items: center;
}
.shot--tall { grid-column: 1 / span 5; }
.shot--tall .shot-media { aspect-ratio: 4 / 5; }
.shot--tall .shot-media img { object-position: 50% 40%; }
.comms-copy { grid-column: 7 / span 6; }
.block-title {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.8rem, 6.2vw, 6.6rem); line-height: 0.84;
}
.block-sub { margin-top: 1.5rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.channels {
  list-style: none; margin: 1rem 0 0; padding: 0;
  columns: 2; column-gap: 2rem;
  border-top: 1px solid var(--line);
}
.channels li {
  break-inside: avoid; display: flex; align-items: baseline; gap: 1rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-weight: 700; font-size: 1.45rem; text-transform: uppercase; letter-spacing: 0.02em;
}
.channels span { font-family: var(--mono); font-size: 0.72rem; color: var(--red); letter-spacing: 0.1em; min-width: 1.6rem; }
.js .channels li { opacity: 0; transform: translateX(-10px); transition: opacity 500ms ease, transform 600ms var(--ease-out); }
.js .channels.is-in li { opacity: 1; transform: none; }

.shot--band { margin-top: clamp(6rem, 16vh, 11rem); }
.shot--band .shot-media { height: min(78vh, 52rem); }
.shot--band .shot-media img { object-position: 50% 55%; }
.shot-caption--band {
  position: absolute; right: var(--pad); top: 50%; z-index: 3; transform: translateY(-50%);
  text-align: right;
}
.shot-caption--band strong {
  display: block; font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.6rem, 6.4vw, 7rem); line-height: 0.84; color: var(--white);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.55);
}
.shot--band .shot-media::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(270deg, rgba(6, 6, 6, 0.88) 0%, rgba(6, 6, 6, 0.4) 38%, rgba(6, 6, 6, 0) 60%);
}

.triptych {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.25rem; row-gap: 3rem;
  padding: clamp(6rem, 16vh, 11rem) var(--pad) 0; align-items: start;
}
.triptych-title { grid-column: 1 / span 5; grid-row: 1; align-self: end; }
.tri--a { grid-column: 7 / span 6; grid-row: 1; }
.tri--a .shot-media { aspect-ratio: 4 / 3; }
.tri--b { grid-column: 1 / span 4; grid-row: 2; margin-top: 4rem; }
.tri--b .shot-media { aspect-ratio: 1 / 1; }
.tri--c { grid-column: 5 / span 5; grid-row: 2; }
.tri--c .shot-media { aspect-ratio: 5 / 6; }
.tri--d { grid-column: 10 / span 3; grid-row: 2; margin-top: 9rem; }
.tri--d .shot-media { aspect-ratio: 4 / 5; }

/* ---------- 05 · ESCALA ---------- */

.scale {
  position: relative; min-height: 115vh; overflow: hidden; isolation: isolate;
  display: grid; align-content: end; padding: 0 var(--pad) clamp(5rem, 12vh, 8rem);
  margin-top: clamp(6rem, 16vh, 11rem);
}
.scale-media { position: absolute; inset: 0; z-index: -1; }
.scale-img { position: absolute; inset: -10% 0; }
.scale-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; transform: translate3d(0, var(--py, 0px), 0) scale(1.06); }
.scale::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(0deg, rgba(6, 6, 6, 0.96) 0%, rgba(6, 6, 6, 0.5) 32%, rgba(6, 6, 6, 0) 60%),
    linear-gradient(180deg, var(--black) 0%, rgba(6, 6, 6, 0) 18%);
}
.scale-copy .chapter-tag { margin-bottom: 1.75rem; color: var(--paper); }
.scale-title {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(3.2rem, 9.6vw, 10.5rem); line-height: 0.84;
}
.scale-cap { position: absolute; right: var(--pad); bottom: clamp(5rem, 12vh, 8rem); max-width: 16rem; color: var(--paper); font-size: 0.95rem; text-align: right; }
.scale-cap .code { display: block; color: var(--red); margin-bottom: 0.4rem; }

/* ---------- 06 · COTIZAR ---------- */

.quote {
  position: relative; padding: clamp(6rem, 16vh, 10rem) var(--pad);
  background: var(--graphite);
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.25rem; row-gap: 3rem;
  border-top: 3px solid var(--red);
}
.quote-head { grid-column: 1 / span 7; }
.quote-head .chapter-tag { margin-bottom: 2rem; }
.quote-title {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(3.2rem, 8.4vw, 9rem); line-height: 0.84;
}
.quote-sub { margin-top: 1.5rem; color: var(--paper); max-width: 26rem; }

.needs {
  grid-column: 1 / -1; margin: 0; padding: 0; border: 0; min-width: 0;
  display: flex; flex-wrap: wrap; gap: 0.6rem;
}
.needs button {
  display: inline-flex; align-items: center; gap: 0.75rem; min-height: 3.25rem; padding: 0 1.2rem;
  border: 1px solid var(--line-strong); color: var(--paper);
  font-family: var(--display); font-weight: 700; font-size: 1.3rem; text-transform: uppercase; letter-spacing: 0.02em;
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease, transform 160ms ease;
}
.needs button span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; color: var(--muted); transition: color 220ms ease; }
.needs button:active { transform: scale(0.97); }
.needs button[aria-pressed="true"] { background: var(--white); border-color: var(--white); color: var(--black); }
.needs button[aria-pressed="true"] span { color: var(--red); }

.quote-action { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.5rem; }
.quote-preview { color: var(--muted); font-size: 0.95rem; max-width: 38rem; }
.quote-preview span { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; margin-right: 0.4rem; }
.quote-preview q { color: var(--paper); quotes: "“" "”"; }

/* ---------- 07 · CIERRE ---------- */

.closing { position: relative; min-height: 100vh; overflow: hidden; isolation: isolate; display: grid; grid-template-rows: 1fr auto; }
.closing-media { position: absolute; inset: 0; z-index: -1; }
.closing-media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; filter: brightness(0.38) saturate(0.7); }
.closing::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(6, 6, 6, 0.94) 0%, rgba(6, 6, 6, 0.6) 55%, rgba(6, 6, 6, 0.25) 100%); }
.closing-inner { align-self: center; padding: calc(var(--header-h) + 3rem) var(--pad) 3rem; }
.closing-logo { width: clamp(9rem, 16vw, 14rem); height: auto; margin-bottom: 2.75rem; }
.closing-title {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.8rem, 7.2vw, 8rem); line-height: 0.86;
}
.contact-list { list-style: none; margin: 3rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 3rem; }
.contact-list li { display: grid; gap: 0.2rem; padding: 0.8rem 0; }
.contact-list span { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.contact-list a { font-size: clamp(1.1rem, 1.6vw, 1.4rem); font-weight: 500; border-bottom: 1px solid var(--line-strong); padding-bottom: 0.15rem; transition: border-color var(--t-fast) ease, color var(--t-fast) ease; }
.contact-list a:hover { border-color: var(--red); }
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem;
  padding: 1.4rem var(--pad) calc(1.4rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.site-footer a:hover { color: var(--white); }

/* ---------- HUD de capítulo ---------- */

.chapter-hud {
  position: fixed; z-index: 40; left: calc(var(--pad) / 2); top: 50%;
  display: flex; align-items: center; gap: 0.75rem;
  writing-mode: vertical-rl; translate: -50% -50%; rotate: 180deg;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper);
  opacity: 0; transform: translateY(8px); transition: opacity 400ms ease, transform 400ms var(--ease-out);
  pointer-events: none;
}
.chapter-hud.is-visible { opacity: 1; transform: none; }
.chapter-hud b { color: var(--red); font-weight: 500; }

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1100px) {
  .chapter-hud { display: none; }
  .system-sticky { grid-template-columns: minmax(15rem, 20rem) 1fr; }
  .system-steps .t { font-size: 1.25rem; }
  .system-evidence { width: min(100%, 15rem); }
  .hero-rail { gap: 1.5rem; }
}

@media (max-width: 900px) {
  :root { --header-h: 4rem; }
  .slate, .hide-sm { display: none; }
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav { gap: 1rem; }
  .site-nav a:not(.nav-cta) { display: none; }
  .brand img { height: 2.45rem; }

  .hero { padding-bottom: 5.5rem; }
  .hero-video { object-position: 86% 50%; }
  .hero-shade {
    background:
      linear-gradient(0deg, rgba(6, 6, 6, 1) 0%, rgba(6, 6, 6, 0.9) 34%, rgba(6, 6, 6, 0.2) 62%, rgba(6, 6, 6, 0) 76%),
      linear-gradient(180deg, rgba(6, 6, 6, 0.65) 0%, rgba(6, 6, 6, 0) 20%);
  }
  .hero-title { font-size: clamp(2.9rem, 13.6vw, 6.5rem); }
  .hero-title .line-mask:nth-child(2), .hero-title .line-mask:nth-child(3) { padding-left: 0; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 0.9rem; }
  .hero-actions .btn { justify-content: space-between; }
  .hero-actions .btn--ghost { min-height: 3rem; }
  .hero-rail { right: auto; bottom: 1.3rem; }
  .viewfinder { display: none; }

  .statement-title .line-mask:nth-child(2) { padding-left: 0; }
  .statement-body { grid-column: 1 / -1; }

  /* Sistema MG móvil: narrativa axial — plano arriba, capa activa abajo */
  .system { height: 560vh; }
  .system-sticky {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: calc(var(--header-h) + 1rem) var(--pad) 1.25rem;
    row-gap: 0.75rem;
  }
  .system-head { grid-row: 1; }
  .system-title { font-size: 2.3rem; margin-top: 0.75rem; }
  .system-title br { display: none; }
  .system-plan { grid-column: 1; grid-row: 2; perspective: 900px; }
  .plan { max-height: 100%; }
  .plan .label { font-size: 30px; }
  .plan .tick { display: none; }
  .plan-meta { left: 0; right: auto; bottom: -0.25rem; gap: 1rem; }
  .plan-meta span:not(.plan-meta__state) { display: none; }
  .system-steps { grid-row: 3; margin: 0; border-top: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.3rem; position: relative; }
  .system-steps li { border: 0; }
  .system-steps li button { flex-direction: column; gap: 0.35rem; min-height: 2.75rem; padding: 0.5rem 0 0; border-top: 2px solid var(--line); }
  .system-steps li.is-done button { border-top-color: var(--paper); }
  .system-steps li.is-active button { border-top-color: var(--red); }
  .system-steps .t { display: none; }
  .system-steps li.is-active .t { transform: none; }
  .system-steps p { display: none; }
  .system-evidence { grid-row: 3; display: none; }
  .system-caption-m { display: block; }
}

/* bloque de texto móvil para Sistema (lo inyecta script.js) */
.system-caption-m { display: none; }
@media (max-width: 900px) {
  .system-caption-m {
    display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 1rem; align-items: start;
    grid-column: 1; grid-row: 3; padding-bottom: 3.9rem; min-height: 9.5rem;
  }
  .system-caption-m h3 { grid-column: 1; grid-row: 1; }
  .system-caption-m p { grid-column: 1; grid-row: 2; }
  .system-caption-m .thumb { grid-column: 2; grid-row: 1 / span 2; width: 5.25rem; aspect-ratio: 1; overflow: hidden; background: var(--graphite); border: 1px solid var(--line); position: relative; }
  .system-caption-m .thumb img { width: 100%; height: 100%; object-fit: cover; }
  .system-caption-m .thumb .evidence-wipe { position: absolute; inset: 0; }
  .system-caption-m h3 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 2.1rem; line-height: 0.9; }
  .system-caption-m h3 span { font-family: var(--mono); font-size: 0.72rem; color: var(--red); letter-spacing: 0.1em; margin-right: 0.5rem; vertical-align: middle; }
  .system-caption-m p { color: var(--paper); font-size: 0.98rem; line-height: 1.4; }
  .system-steps { grid-row: 3; align-self: end; }

  .field-title { grid-column: 1 / -1; }
  .field-note { grid-column: 1 / -1; margin-top: 1.5rem; }
  .shot--full .shot-media { height: 64svh; }
  .shot--full .shot-media img { object-position: 62% 100%; }
  .shot--full .shot-caption { left: 1rem; right: 1rem; }
  .pair, .comms, .triptych { grid-template-columns: 1fr; row-gap: 2.5rem; }
  .shot--wide, .pair-side, .shot--tall, .comms-copy, .triptych-title, .tri--a, .tri--b, .tri--c, .tri--d { grid-column: 1; grid-row: auto; margin-top: 0; }
  .pair-side { padding-top: 0; }
  .shot--wide { margin: 0 calc(var(--pad) * -1); }
  .shot--wide .shot-caption { padding: 0 var(--pad); }
  .shot--portrait { width: 78%; justify-self: end; }
  .shot--tall { margin: 0 calc(var(--pad) * -1); }
  .shot--tall .shot-caption { padding: 0 var(--pad); }
  .channels li { font-size: 1.2rem; }
  .shot--band .shot-media { height: 70svh; }
  .shot--band .shot-media::before { background: linear-gradient(0deg, rgba(6, 6, 6, 0.9) 0%, rgba(6, 6, 6, 0.1) 55%); }
  .shot-caption--band { top: auto; bottom: 1.5rem; transform: none; left: var(--pad); text-align: left; }
  .triptych { row-gap: 2rem; }
  .tri--b { width: 72%; }
  .tri--c { width: 86%; justify-self: end; }
  .tri--d { width: 60%; }
  .scale { min-height: 95svh; }
  .scale-cap { position: static; text-align: left; margin-top: 2rem; }
  .quote-head { grid-column: 1 / -1; }
  .needs button { font-size: 1.1rem; min-height: 3rem; padding: 0 0.95rem; }
  .quote-action .btn { width: 100%; justify-content: space-between; }
  .chapter-hud { display: none; }
}

@media (max-width: 520px) {
  .channels { columns: 1; }
  .hero-rail > span:nth-child(2) { display: none; }
  .hero-eyebrow { font-size: 0.66rem; }
  .hero-eyebrow > span::before { width: 1.2rem; margin-right: 0.6rem; }
  .contact-list { flex-direction: column; }
}

/* ---------- REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .hero-video { transform: none; filter: none; }
  .letterbox { display: none; }
  .js .mask-reveal .shot-media { clip-path: none; }
  .js .mask-reveal .shot-media::after { display: none; }
  .js .mask-reveal .shot-media img { --s: 1; animation: none; }
  .plan-rig { transform: none !important; }
}
