/*
 * Hero visuals that replace the keyboard photo (js/hero-fx.js).
 * <section class="hero" data-hero data-hero-fx="blueprint|planes">
 */
.hero[data-hero-fx] {
  overflow: hidden;
  background:
    radial-gradient(70% 80% at 78% 45%, rgb(153 204 0 / .10), transparent 65%),
    linear-gradient(160deg, #0a0c0d 0%, #111518 55%, #0b0d0e 100%);
}
.hero[data-hero-fx]::before { opacity: .6; }
.hero__fx { position: absolute; inset: 0; pointer-events: none; }
.hero__fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* keep the copy above the visuals */
.hero[data-hero-fx] > .container { z-index: 2; }
.hero[data-hero-fx] .scroll-cue { z-index: 2; }

/* ============ A · Blueprint grid + self-drawing wireframes ============ */
.hero__wire {
  position: absolute; top: 50%; right: max(4vw, calc((100vw - var(--container)) / 2 - 20px));
  width: min(440px, 36vw); translate: 0 -46%;
  color: var(--lime);
}
.hero__wire svg { width: 100%; height: auto; overflow: visible; }
.hero__wire .w-shape { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.hero__wire .w-soft { stroke: rgb(255 255 255 / .38); }
.hero__wire .w-fill { fill: rgb(153 204 0 / .08); }
.hero__wire .w-note { font-family: var(--font-label); font-weight: 700; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; fill: rgb(255 255 255 / .62); }
.hero__wire .w-red { stroke: #ff6f61; }
.hero__wire .w-ai-t { fill: var(--lime); }
.hero__wire .w-red-t { fill: #ff8a7e; }
.hero__wire .w-cap { position: absolute; left: 0; bottom: -34px; font-family: var(--font-label); font-weight: 700; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgb(255 255 255 / .5); }
.hero__wire .w-cap b { color: var(--lime); font-weight: 700; }

/* drawing: every stroke (.w-shape) has pathLength=1 so one dash covers it. Select by class, not [pathLength]: Chrome does not always re-match that attribute when the group class changes */
.hero__wire .w-shape { stroke-dasharray: 1; stroke-dashoffset: 1; }
.hero__wire .w-note, .hero__wire .w-fill-in { opacity: 0; }
/* --step is set per drawing so every scene finishes in about two seconds */
.hero__wire .is-drawing .w-shape { animation: wire-draw .7s var(--ease) forwards; animation-delay: calc(var(--i, 0) * var(--step, 30ms)); }
.hero__wire .is-drawing .w-note, .hero__wire .is-drawing .w-fill-in { animation: wire-fade .45s ease forwards; animation-delay: calc(var(--notes-at, 1500ms) + var(--i, 0) * 12ms); }
.hero__wire .is-leaving { animation: wire-out .6s ease forwards; }
@keyframes wire-draw { to { stroke-dashoffset: 0; } }
@keyframes wire-fade { to { opacity: 1; } }
@keyframes wire-out { to { opacity: 0; transform: translateY(-8px); } }
.hero__wire g[data-scene] { transform-box: fill-box; }
.hero__wire g[data-scene]:not(.is-drawing):not(.is-leaving):not(.is-static) { display: none; }
.hero__wire .is-static .w-shape { stroke-dashoffset: 0; }
.hero__wire .is-static .w-note, .hero__wire .is-static .w-fill-in { opacity: 1; }

@media (max-width: 900px) { .hero__wire { display: none; } }

/* ============ B · Angled wireframe planes ============ */
.hero__beams { position: absolute; inset: -10% -5%; }
.hero__beams i {
  position: absolute; display: block; width: 70%; height: 160%; top: -30%;
  background: linear-gradient(90deg, transparent, rgb(153 204 0 / .07) 40%, rgb(153 204 0 / .02) 60%, transparent);
  transform: skewX(-24deg);
}
.hero__beams i:nth-child(1) { left: 42%; }
.hero__beams i:nth-child(2) { left: 64%; width: 38%; opacity: .7; }
.hero__beams i:nth-child(3) { left: 82%; width: 22%; opacity: .5; }
@media (prefers-reduced-motion: no-preference) {
  .hero__beams i { animation: beam-drift 18s ease-in-out infinite alternate; }
  .hero__beams i:nth-child(2) { animation-duration: 24s; animation-delay: -6s; }
  .hero__beams i:nth-child(3) { animation-duration: 30s; animation-delay: -12s; }
}
@keyframes beam-drift { to { translate: -6% 0; } }

.hero__stack {
  position: absolute; top: 50%; right: max(2vw, calc((100vw - var(--container)) / 2 - 40px));
  width: min(460px, 38vw); aspect-ratio: 1; translate: 0 -48%;
  perspective: 1400px;
}
.hero__stack-inner {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(calc(56deg + var(--ry, 0deg))) rotateZ(calc(-38deg + var(--rx, 0deg)));
  transition: transform .8s var(--ease);
}
.hero__plane {
  --z: 0px;
  position: absolute; inset: 14%; border-radius: 22px;
  border: 1px solid rgb(153 204 0 / .55);
  background: linear-gradient(135deg, rgb(255 255 255 / .07), rgb(255 255 255 / .015));
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / .8), inset 0 0 0 1px rgb(255 255 255 / .04);
  transform: translateZ(calc(var(--z) + var(--spread, 0px) * var(--k)));
  transform-style: preserve-3d;
}
.hero__plane svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__plane .p-line { fill: none; stroke: rgb(255 255 255 / .45); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.hero__plane .p-lime { stroke: var(--lime); }
.hero__plane .p-fill { fill: rgb(153 204 0 / .18); stroke: none; }
.hero__plane .p-fill-soft { fill: rgb(255 255 255 / .06); stroke: none; }
.hero__plane[data-layer="1"] { --z: 0px; --k: 0; border-color: rgb(255 255 255 / .18); }
.hero__plane[data-layer="2"] { --z: 95px; --k: 1; }
.hero__plane[data-layer="3"] { --z: 190px; --k: 2; border-color: var(--lime); }
.hero__tag {
  font-size: 11px;
  position: absolute; left: 100%; top: 0; margin-left: 14px; white-space: nowrap;
  /* undo the stack's tilt so the label faces the viewer */
  transform-origin: 0 0; transform: rotateZ(38deg) rotateX(-56deg);
  font-family: var(--font-label); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgb(255 255 255 / .7);
}
.hero__tag::before { content: ""; display: inline-block; width: 22px; height: 1px; margin-right: 8px; vertical-align: middle; background: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .hero__plane { animation: plane-float 7s ease-in-out infinite; }
  .hero__plane[data-layer="2"] { animation-delay: -2.3s; }
  .hero__plane[data-layer="3"] { animation-delay: -4.6s; }
}
@keyframes plane-float { 50% { translate: 0 -10px; } }

@media (max-width: 900px) {
  .hero__stack { width: 80vw; right: -18vw; top: auto; bottom: -6%; translate: 0 0; opacity: .28; }
  .hero__tag { display: none; }
}
