/* ==========================================================================
   Super 8 Digital Cartridge — studiofabi
   Zimula InkTrap for headings, Zimula Regular for copy, mono for data.
   ========================================================================== */

@font-face {
  font-family: 'Zimula';
  src: url('../fonts/ZimulaVariable-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --blue:      #2f54dd;
  --green:     #52d17d;
  --red:       #ff595e;
  --offwhite:  #f9f9f9;

  --ink-900:   #07080d;
  --ink-800:   #0c0e16;
  --ink-700:   #141726;
  --ink-600:   #1e2233;
  --ink-500:   #2c3145;
  --ink-400:   #4a5068;
  --ink-300:   #7d8398;
  --ink-200:   #b6bac7;

  --paper:     #f9f9f9;
  --paper-2:   #f1efea;
  --paper-3:   #e6e2d9;

  --blue-dim:  #2440a8;
  --blue-lift: #6f8bff;

  --zim: 'Zimula', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Fira Code', Menlo, monospace;

  /* cnct axis: 1 = ink trap · 1000 = ink spot (what headings use) */
  --pad: clamp(20px, 5vw, 76px);
  --maxw: 1340px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink-900);
  color: var(--offwhite);
  font-family: var(--zim);
  font-variation-settings: 'wght' 400, 'cnct' 500;
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
::selection { background: var(--blue); color: #fff; }

/* ---------------- type ---------------- */
h1, h2, h3, h4, .display {
  font-family: var(--zim);
  font-variation-settings: 'wght' 800, 'cnct' 1000;   /* ink spot */
  text-transform: uppercase;
  letter-spacing: -.02em;
  line-height: .92;
}
h2.sec-title { font-size: clamp(34px, 5.6vw, 70px); }
h3 { font-size: clamp(18px, 2vw, 23px); font-variation-settings: 'wght' 750, 'cnct' 1000; letter-spacing: -.01em; }
h4 { font-size: 15px; font-variation-settings: 'wght' 700, 'cnct' 1000; letter-spacing: 0; }

p { font-variation-settings: 'wght' 400, 'cnct' 500; max-width: 62ch; color: var(--ink-200); }
.on-paper p { color: var(--ink-500); }
p.lede { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; }
p + p { margin-top: 14px; }

.eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-300);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--blue-lift); flex: none; }
.on-paper .eyebrow { color: var(--ink-400); }
.on-paper .eyebrow::before { background: var(--blue); }

.data { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
code, .code-i {
  font-family: var(--mono); font-size: .86em;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue-lift); padding: 1px 5px; border-radius: 2px;
}
.on-paper code, .on-paper .code-i { color: var(--blue-dim); background: color-mix(in srgb, var(--blue) 9%, transparent); }

a { color: inherit; }

/* ---------------- film grain ---------------- */
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 900;
  opacity: .26; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  animation: grainshift 700ms steps(4) infinite;
}
@keyframes grainshift {
  0%{transform:translate(0,0)} 25%{transform:translate(-2%,1%)}
  50%{transform:translate(1%,-2%)} 75%{transform:translate(-1%,-1%)} 100%{transform:translate(0,0)}
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; opacity: .15; } }

/* ---------------- layout ---------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
section { position: relative; }
.band { padding: clamp(80px, 12vh, 140px) 0; position: relative; z-index: 3; }
.band.ink   { background: var(--ink-900); }
.band.ink2  { background: var(--ink-800); }
.band.paper { background: var(--paper); color: var(--ink-800); }
.sec-head { margin-bottom: clamp(34px, 6vh, 64px); }
.sec-head h2 { margin-top: 12px; }
.sec-head p.lede { margin-top: 18px; }

.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: clamp(24px,4vw,60px); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: clamp(18px,2.4vw,30px); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.sprockets {
  height: 24px; position: relative; z-index: 3;
  background-color: var(--ink-700);
  background-image: repeating-linear-gradient(to right, transparent 0 14px, var(--ink-900) 14px 26px, transparent 26px 46px);
  border-block: 1px solid var(--ink-600);
}

/* ---------------- nav ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px var(--pad); border-bottom: 1px solid transparent;
  transition: background .35s, border-color .35s;
}
.nav.solid {
  background: color-mix(in srgb, var(--ink-900) 93%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--ink-600);
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-brand img { height: 22px; display: block; }
.nav-brand .divider { width: 1px; height: 17px; background: var(--ink-500); }
.nav-brand .title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-200); transition: color .2s;
}
.nav-links a:hover { color: #fff; }
.nav-links a.cta {
  color: #fff; border: 1px solid var(--blue-lift); padding: 8px 13px; border-radius: 2px;
  background: color-mix(in srgb, var(--blue) 24%, transparent);
}
.nav-links a.cta:hover { background: var(--blue); }
@media (max-width: 800px) { .nav-links a:not(.cta) { display: none; } .nav-brand .title, .nav-brand .divider { display: none; } }

/* ---------------- 3D stage ---------------- */
#stage { position: fixed; inset: 0; z-index: 1; visibility: hidden; }
#stage canvas { display: block; width: 100%; height: 100%; }
#stage.interactive { pointer-events: auto; cursor: default; }
#stage.interactive.pointing { cursor: pointer; }
#glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(47,84,221,.20), transparent 72%),
    radial-gradient(90% 70% at 50% 100%, rgba(7,8,13,.9), transparent 60%),
    var(--ink-900);
  visibility: hidden;
}
.act { position: relative; z-index: 2; pointer-events: none; }
.act .beat { height: 100vh; }

/* ---------------- loader ---------------- */
.loader {
  position: fixed; inset: 0; z-index: 950; background: var(--ink-900);
  display: grid; place-items: center; transition: opacity .6s, visibility .6s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader .cnt { font-variation-settings: 'wght' 900, 'cnct' 1000; font-size: clamp(70px,16vw,180px); line-height: 1; }
.loader .bar { width: min(240px,58vw); height: 2px; background: var(--ink-600); margin: 20px auto 0; overflow: hidden; }
.loader .bar i { display: block; height: 100%; width: 0; background: var(--blue-lift); transition: width .3s; }
.loader .lbl { margin-top: 13px; font-family: var(--mono); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-300); }
.loader .inner { text-align: center; }

/* ---------------- hero ---------------- */
.hero {
  position: absolute; inset: 0 0 auto 0; height: 100vh;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--pad); pointer-events: none; z-index: 4;
}
.hero .word {
  font-variation-settings: 'wght' 880, 'cnct' 1000;
  font-size: clamp(38px, 7.2vw, 112px);
  line-height: .84; letter-spacing: -.045em; text-transform: uppercase;
  white-space: nowrap;
}
.hero .word.l { justify-self: start; }
.hero .word.r { justify-self: end; color: var(--blue-lift); }
.hero .mid { width: clamp(150px, 26vw, 400px); }
/* sits low, above the scroll hint. It used to hang at 50% + 24vh, which with
   the photo behind lands squarely on the face of the cartridge. */
.hero-tag {
  position: absolute; left: 50%; top: auto; bottom: 82px;
  transform: translateX(-50%);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--paper-2); text-align: center;
}
.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--ink-200);
}
.scroll-hint i { width: 1px; height: 30px; background: linear-gradient(var(--ink-300), transparent); animation: hintdrop 2s ease-in-out infinite; }
@keyframes hintdrop { 50% { transform: scaleY(.5); transform-origin: top; opacity: .4; } }
@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr; grid-template-rows: auto 1fr auto;
    padding: 14vh var(--pad) 21vh; text-align: center;
  }
  .hero .word.l { justify-self: center; align-self: start; }
  .hero .word.r { justify-self: center; align-self: end; }
  .hero .mid { width: 100%; }
  .hero-tag { top: auto; bottom: 92px; left: var(--pad); right: var(--pad); transform: none; }
  .scroll-hint { bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { .scroll-hint i { animation: none; } }

/* ---------------- HUD (caption + manifest) ---------------- */
.hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; visibility: hidden; }
.hud-caption { position: absolute; left: var(--pad); bottom: clamp(84px,18vh,180px); max-width: min(400px,40vw); }
.hud-caption .step {
  font-family: var(--mono); font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--blue-lift); display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.hud-caption .step b { background: var(--blue); color: #fff; padding: 3px 7px; border-radius: 2px; font-variation-settings: 'wght' 500; }
.hud-caption h2 { font-size: clamp(26px,3.4vw,44px); margin-bottom: 10px; }
.hud-caption p { font-size: 15px; max-width: 40ch; }
.hud-swap { transition: opacity .26s, transform .26s; }
.hud-swap.out { opacity: 0; transform: translateY(7px); }
@media (max-width: 900px) { .hud-caption { max-width: none; right: var(--pad); bottom: clamp(28px,6vh,60px); } .hud-caption h2 { font-size: clamp(24px,7vw,38px); } .hud-caption p { font-size: 14px; max-width: 34ch; } }

.manifest {
  position: absolute; right: var(--pad); top: 50%; transform: translateY(-50%);
  width: 226px; pointer-events: auto;
  border-left: 1px solid var(--ink-600); padding: 12px 10px 12px 13px;
  background: linear-gradient(90deg, rgba(7,8,13,.74), rgba(7,8,13,.4));
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  opacity: 0; transition: opacity .35s;
}
.manifest .hd { font-family: var(--mono); font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 9px; }
.manifest ol { list-style: none; }
.manifest li {
  display: flex; align-items: baseline; gap: 9px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em;
  color: var(--ink-400); padding: 3px 5px; margin-left: -5px; border-radius: 2px;
  cursor: pointer; transition: color .2s, background .2s;
}
.manifest li .n { width: 17px; flex: none; text-align: right; color: var(--ink-500); font-size: 9.5px; }
.manifest li:hover { background: rgba(111,139,255,.12); color: #fff; }
.manifest li.done { color: var(--ink-200); }
.manifest li.done .n { color: var(--green); }
.manifest li.active { color: #fff; }
.manifest li.active .n { color: var(--blue-lift); }
@media (max-width: 900px) { .manifest { display: none; } }

/* 3D labels */
#labels { position: absolute; inset: 0; pointer-events: none; }
.lbl3d {
  position: absolute; transform: translate(-50%,-50%); white-space: nowrap;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  display: flex; align-items: center; gap: 7px; opacity: 0; transition: opacity .25s;
}
.lbl3d.show { opacity: 1; }
.lbl3d .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--blue-lift); box-shadow: 0 0 0 3px rgba(111,139,255,.18); flex: none; }
.lbl3d .tx { background: rgba(7,8,13,.78); padding: 3px 8px; border: 1px solid var(--ink-600); border-radius: 2px; backdrop-filter: blur(6px); }
.lbl3d .tx b { color: var(--blue-lift); font-variation-settings: 'wght' 400; margin-right: 6px; }
.lbl3d.hot .tx { border-color: var(--blue-lift); background: rgba(47,84,221,.5); }

/* ---------------- act overlays (motor / system / parts) ---------------- */
.overlay-panel {
  position: absolute; left: var(--pad); top: 50%; transform: translateY(-50%);
  max-width: min(430px, 42vw); pointer-events: auto;
  max-height: 86vh; overflow: visible;
}
.overlay-panel.right { left: auto; right: var(--pad); }
@media (max-width: 900px) {
  .overlay-panel, .overlay-panel.right {
    left: var(--pad); right: var(--pad); max-width: none;
    top: auto; bottom: clamp(24px,5vh,50px); transform: none;
  }
}

/* hotspot chips */
.hotspots { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.hot-chip {
  display: flex; gap: 13px; align-items: flex-start; text-align: left;
  border: 1px solid var(--ink-600); background: rgba(12,14,22,.72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 3px; padding: 10px 13px; cursor: pointer; color: inherit;
  transition: border-color .2s, background .2s, transform .2s;
  font: inherit;
}
.hot-chip:hover, .hot-chip.on { border-color: var(--blue-lift); background: rgba(47,84,221,.2); transform: translateX(4px); }
.hot-chip .ix { font-family: var(--mono); font-size: 9.5px; color: var(--blue-lift); letter-spacing: .16em; padding-top: 3px; }
.hot-chip h4 { margin-bottom: 2px; font-size: 14px; }
.hot-chip p { font-size: 12.8px; line-height: 1.45; max-width: none; color: var(--ink-300); }

/* the vignette that flies in on hover */
.vignette-card {
  position: absolute; right: var(--pad); top: 50%; transform: translate(14px,-50%);
  width: min(320px, 34vw); pointer-events: none;
  border: 1px solid var(--ink-600); border-radius: 4px; overflow: hidden;
  background: rgba(7,8,13,.9); backdrop-filter: blur(12px);
  opacity: 0; transition: opacity .3s, transform .3s;
}
.vignette-card.show { opacity: 1; transform: translate(0,-50%); }
.vignette-card .vc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--ink-600); background: var(--ink-700);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-300);
}
.vignette-card .vc-body { padding: 16px; }
@media (max-width: 900px) { .vignette-card { display: none; } }

.rec-dot { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.rec-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1.3s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------------- cards / callouts ---------------- */
.card {
  border: 1px solid var(--ink-600); border-radius: 3px; padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent);
}
.on-paper .card { border-color: var(--paper-3); background: linear-gradient(180deg,#fff,var(--paper-2)); }
.card .idx { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; color: var(--blue-lift); display: block; margin-bottom: 11px; }
.on-paper .card .idx { color: var(--blue); }
.card h3 { margin-bottom: 7px; }
.card p { font-size: 14.5px; }

.callout { border-left: 2px solid var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); padding: 13px 17px; font-size: 14.5px; border-radius: 0 3px 3px 0; }
.callout.warn { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.callout p { max-width: none; }

.tbd {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--red); border: 1px dashed color-mix(in srgb, var(--red) 55%, transparent);
  padding: 3px 8px; border-radius: 2px;
}

/* ---------------- footage ---------------- */
.reel { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 900px) { .reel { grid-template-columns: 1fr; } }
.film-frame {
  position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: 2px;
  border: 1px solid var(--ink-600); display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.018) 0 10px, transparent 10px 20px), var(--ink-700);
}
.film-frame::before, .film-frame::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 19px; background-color: var(--ink-800);
  background-image: repeating-linear-gradient(to bottom, transparent 0 9px, var(--ink-900) 9px 22px, transparent 22px 34px);
}
.film-frame::before { left: 0; border-right: 1px solid var(--ink-600); }
.film-frame::after { right: 0; border-left: 1px solid var(--ink-600); }
.film-frame .ph { text-align: center; z-index: 2; padding: 0 26px; }
.film-frame .ph .ico { font-size: 20px; color: var(--ink-400); }
.film-frame .ph .t { margin-top: 7px; font-size: 14px; }
.film-frame .ph .s { margin-top: 3px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-400); }
.film-frame video, .film-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }

/* ---------------- schematic ---------------- */
.sch-shell { display: grid; grid-template-columns: 260px 1fr; gap: 0; border: 1px solid var(--ink-600); border-radius: 4px; overflow: hidden; background: var(--ink-800); }
@media (max-width: 900px) { .sch-shell { grid-template-columns: 1fr; } }
.sch-controls { border-right: 1px solid var(--ink-600); padding: 18px; background: var(--ink-700); }
@media (max-width: 900px) { .sch-controls { border-right: 0; border-bottom: 1px solid var(--ink-600); } }
.sch-controls .grp + .grp { margin-top: 22px; }
.sch-controls .glabel { font-family: var(--mono); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 10px; }

.big-switch {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--ink-500); background: var(--ink-800); color: inherit; font: inherit;
  padding: 13px 15px; border-radius: 3px; cursor: pointer; transition: .2s;
}
.big-switch:hover { border-color: var(--blue-lift); }
.big-switch .lb { font-variation-settings: 'wght' 600, 'cnct' 1000; text-transform: uppercase; font-size: 14px; letter-spacing: -.01em; }
.big-switch .knob { width: 44px; height: 24px; border-radius: 12px; background: var(--ink-500); position: relative; flex: none; transition: background .2s; }
.big-switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--offwhite); transition: left .2s; }
.big-switch.on { border-color: var(--green); }
.big-switch.on .knob { background: var(--green); }
.big-switch.on .knob::after { left: 23px; }
.big-switch:disabled { opacity: .4; cursor: not-allowed; }

.trigger-btn {
  width: 100%; margin-top: 10px; border: 1px solid var(--ink-500); background: var(--ink-800);
  color: inherit; font: inherit; padding: 15px; border-radius: 3px; cursor: pointer;
  font-variation-settings: 'wght' 700, 'cnct' 1000; text-transform: uppercase; font-size: 14px;
  transition: .15s; letter-spacing: -.01em;
}
.trigger-btn:hover:not(:disabled) { border-color: var(--blue-lift); background: color-mix(in srgb, var(--blue) 22%, transparent); }
.trigger-btn.held { background: var(--blue); border-color: var(--blue); }
.trigger-btn:disabled { opacity: .4; cursor: not-allowed; }
.hint { font-family: var(--mono); font-size: 10px; color: var(--ink-400); margin-top: 9px; line-height: 1.5; }

.readout { display: flex; flex-direction: column; gap: 7px; }
.ro-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; }
.ro-row .k { color: var(--ink-300); }
.ro-row .v { padding: 3px 8px; border-radius: 2px; background: var(--ink-600); color: var(--ink-300); font-size: 9.5px; letter-spacing: .12em; }
.ro-row .v.hi { background: var(--green); color: var(--ink-900); }
.ro-row .v.lo { background: var(--ink-600); color: var(--ink-300); }
.ro-row .v.rec { background: var(--red); color: #fff; animation: blink 1.1s infinite; }
.ro-row .v.on { background: var(--blue); color: #fff; }

.sch-canvas { position: relative; background: var(--ink-800); min-height: 460px; }
.sch-canvas svg { display: block; width: 100%; height: auto; }
.sch-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 18px; border-top: 1px solid var(--ink-600); background: var(--ink-700); }
.sch-legend span { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-300); }
.sch-legend i { width: 16px; height: 3px; border-radius: 2px; display: block; }

/* ---------------- parts / shopping ---------------- */
.parts-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.parts-group { display: flex; flex-direction: column; gap: 3px; }
.pg-head {
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-400); margin-bottom: 4px;
}
.part-row {
  display: grid; grid-template-columns: 20px 1fr auto; gap: 11px; align-items: baseline;
  padding: 7px 11px; border: 1px solid transparent; border-radius: 3px;
  background: rgba(12,14,22,.66); backdrop-filter: blur(8px);
  cursor: pointer; transition: border-color .18s, background .18s, transform .18s; text-align: left;
  font: inherit; color: inherit; width: 100%;
}
.part-row:hover, .part-row.on { border-color: var(--blue-lift); background: rgba(47,84,221,.2); transform: translateX(4px); }
.part-row .n { font-family: var(--mono); font-size: 10px; color: var(--ink-400); }
.part-row:hover .n, .part-row.on .n { color: var(--blue-lift); }
.part-row .nm { font-size: 14.5px; font-variation-settings: 'wght' 500, 'cnct' 500; }
.part-row .nm .meta { margin-left: 7px; }
.part-row .meta { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-400); }
.pill {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 2px; white-space: nowrap;
}
.pill.print { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--green); }
.pill.buy   { background: color-mix(in srgb, var(--blue) 30%, transparent); color: var(--blue-lift); }

/* ---------------- build wizard ---------------- */
.wiz { border: 1px solid var(--paper-3); border-radius: 5px; overflow: hidden; background: #fff; }
.wiz-top { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--paper-3); background: var(--paper-2); }
.wiz-dots { display: flex; gap: 6px; flex: 1; }
.wiz-dots button {
  flex: 1; height: 4px; border: 0; padding: 0; border-radius: 2px; background: var(--paper-3);
  cursor: pointer; transition: background .25s;
}
.wiz-dots button.done { background: color-mix(in srgb, var(--blue) 45%, transparent); }
.wiz-dots button.on { background: var(--blue); }
.wiz-count { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--ink-400); white-space: nowrap; }
.wiz-body { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 400px; }
@media (max-width: 860px) { .wiz-body { grid-template-columns: 1fr; } }
.wiz-text { padding: clamp(24px,4vw,44px); display: flex; flex-direction: column; justify-content: center; }
.wiz-text .stepno { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--blue); margin-bottom: 12px; }
.wiz-text h3 { font-size: clamp(24px,3vw,36px); margin-bottom: 14px; }
.wiz-text p { color: var(--ink-500); font-size: 15.5px; }
.wiz-text pre {
  margin-top: 16px; background: var(--ink-900); color: #dbe0ee; border-radius: 3px; padding: 13px 15px;
  font-family: var(--mono); font-size: 12px; line-height: 1.6; overflow-x: auto;
}
.wiz-text pre .c { color: var(--ink-300); }
.wiz-art { background: var(--paper-2); border-left: 1px solid var(--paper-3); display: grid; place-items: center; padding: 24px; }
@media (max-width: 860px) { .wiz-art { border-left: 0; border-top: 1px solid var(--paper-3); order: -1; min-height: 260px; } }
.wiz-art svg { width: 100%; max-width: 380px; height: auto; }
.wiz-nav { display: flex; gap: 10px; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--paper-3); background: var(--paper-2); }
.wiz-btn {
  border: 1px solid var(--ink-800); background: var(--ink-800); color: var(--paper);
  font: inherit; font-variation-settings: 'wght' 600, 'cnct' 1000; text-transform: uppercase;
  font-size: 12.5px; letter-spacing: .04em; padding: 11px 20px; border-radius: 3px; cursor: pointer;
  transition: .18s; display: inline-flex; align-items: center; gap: 9px;
}
.wiz-btn.ghost { background: transparent; color: var(--ink-800); border-color: var(--paper-3); }
.wiz-btn:hover { transform: translateY(-1px); }
.wiz-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.wiz-step { animation: wizin .35s cubic-bezier(.2,.7,.2,1); }
@keyframes wizin { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .wiz-step { animation: none; } }

/* ---------------- CTA / footer ---------------- */
.cta-band { background: var(--ink-900); overflow: hidden; }
/* the closing section drives the 3D stage, so it keeps .band's stacking and,
   unlike the other acts, still takes clicks — the download buttons live in it */
#act-outro { z-index: 3; pointer-events: auto; }
/* The canvas is transparent, so over an opaque band it comes forward instead
   of being scrolled over. Nothing is clickable in the outro, and this sits
   after #stage.interactive on purpose — equal specificity, so it wins and the
   canvas can never eat the download buttons underneath it. */
#stage.over { z-index: 4; pointer-events: none; }
.cta-band .big { font-variation-settings: 'wght' 880, 'cnct' 1000; font-size: clamp(44px,8.6vw,124px); line-height: .86; letter-spacing: -.04em; text-transform: uppercase; }
.btn {
  display: inline-flex; align-items: center; gap: 11px; text-decoration: none;
  font-family: var(--mono); font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  padding: 15px 24px; border-radius: 2px; border: 1px solid var(--offwhite);
  background: var(--offwhite); color: var(--ink-900); transition: transform .18s, background .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--offwhite); border-color: var(--ink-500); }
.btn.ghost:hover { border-color: var(--offwhite); }
.btn.disabled { opacity: .45; cursor: not-allowed; }
.btn .arrow { transition: transform .18s; }
.btn:hover .arrow { transform: translateX(4px); }

/* above #stage.over (4), so the closing turntable scrolls away behind the
   footer the way every other section covers the canvas */
footer.site { background: var(--ink-900); border-top: 1px solid var(--ink-700); padding: 50px 0 32px; position: relative; z-index: 5; }
footer.site .row { display: flex; flex-wrap: wrap; gap: 22px; justify-content: space-between; align-items: flex-end; }
footer.site img { height: 25px; opacity: .9; }
footer.site .fine { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-400); }
footer.site a { color: var(--ink-200); text-decoration: none; border-bottom: 1px solid var(--ink-500); }
footer.site a:hover { color: #fff; }

/* ---------------- reveal ---------------- */
.rv { opacity: 0; transform: translateY(20px); transition: opacity .65s cubic-bezier(.2,.7,.2,1), transform .65s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; } }

.ticker { overflow: hidden; border-block: 1px solid var(--ink-700); background: var(--ink-800); padding: 10px 0; position: relative; z-index: 3; }
.ticker .track { display: flex; gap: 38px; width: max-content; animation: slide 40s linear infinite; }
.ticker span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-300); display: inline-flex; align-items: center; gap: 38px; white-space: nowrap; }
.ticker span::after { content: '◆'; color: var(--blue-lift); font-size: 7px; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker .track { animation: none; } }


/* ---------------- anchors for the nav ---------------- */
.anchor { display: block; position: relative; top: -70px; height: 0; visibility: hidden; }

/* ---------------- manifest sub-line ---------------- */
.manifest .hd.sub { margin-top: -6px; color: var(--ink-500); letter-spacing: .1em; }

/* ---------------- shutter toggle in the system panel ---------------- */
.shutter-toggle { margin-top: 14px; max-width: 230px; }
.big-switch.small { padding: 9px 12px; }
.big-switch.small .lb { font-size: 12.5px; }
.big-switch.small .knob { width: 38px; height: 21px; }
.big-switch.small .knob::after { width: 15px; height: 15px; }
.big-switch.small.on .knob::after { left: 20px; }

/* ---------------- part inspector ---------------- */
.inspect {
  position: fixed; inset: 0; z-index: 6; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .3s;
}
.inspect.show { opacity: 1; visibility: visible; }
.inspect::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 55% at 50% 45%, transparent 30%, rgba(7,8,13,.72) 100%);
}
.ins-card {
  position: absolute; left: 50%; bottom: clamp(36px, 8vh, 90px); transform: translateX(-50%);
  min-width: min(360px, 86vw); text-align: center;
  border: 1px solid var(--ink-600); border-radius: 4px; padding: 16px 20px;
  background: rgba(7,8,13,.86); backdrop-filter: blur(10px);
  pointer-events: auto;
}
.ins-top { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ins-top .data { color: var(--offwhite); font-size: 13px; letter-spacing: .16em; }
.ins-close {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: transparent; color: var(--ink-300); font-size: 14px; cursor: pointer; line-height: 1;
}
.ins-close:hover { color: #fff; }
.ins-spec { margin-top: 6px; font-size: 14px; color: var(--ink-200); }
.ins-hint { margin-top: 10px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-400); }
body.inspecting #stage { cursor: grab; }
body.inspecting #stage:active { cursor: grabbing; }

/* the last moment of the viewfinder dive, fading into the footage below */
#dive-fade {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: #07080d; opacity: 0;
}


/* ---------------- hero atmosphere ----------------
   Two brand glows breathing behind the cartridge, and a film strip creeping up
   each edge. Sits above #glow and below the canvas, and fades out on scroll. */
/* ---------------- hero photograph ----------------
   Full bleed behind the type. The scrim is not decoration: SUPER 8 lands on
   the window, which is luminance .94, and white type on that is 1.01:1 —
   invisible. The horizontal ramp crushes the left hard so the window reads as
   a glow behind the word, stays almost clear across the middle where the
   cartridge is, and comes back up on the right under DIGITAL. Measured: all
   four text zones clear WCAG (3:1 for the display words, 4.5:1 for the mono).
   Retune the ramp and you have to recheck those. */
/* Absolute inside .hero, not fixed: it travels up with the scroll and uncovers
   the fixed 3D canvas beneath, so the photo and the render never have to match.
   z-index -1 keeps it behind the words but still inside .hero's stacking
   context, which sits above #stage. */
#hero-photo {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url('../img/hero.jpg') center center / cover no-repeat;
}
#hero-photo::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg,
      rgba(7,8,13,.90) 0%,  rgba(7,8,13,.84) 18%, rgba(7,8,13,.40) 32%,
      rgba(7,8,13,.12) 46%, rgba(7,8,13,.14) 62%, rgba(7,8,13,.50) 78%,
      rgba(7,8,13,.58) 100%),
    linear-gradient(180deg,
      rgba(7,8,13,.40) 0%,  rgba(7,8,13,.05) 26%, rgba(7,8,13,.22) 58%,
      rgba(7,8,13,.15) 80%, rgba(7,8,13,.74) 100%);
}
/* narrow screens crop to the middle of the frame and the type stacks over it,
   so the shaped ramp stops applying — go simple and darker instead */
@media (max-width: 780px) {
  #hero-photo::after {
    background: linear-gradient(180deg,
      rgba(7,8,13,.80) 0%, rgba(7,8,13,.48) 34%,
      rgba(7,8,13,.52) 62%, rgba(7,8,13,.88) 100%);
  }
}

#hero-atmos {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  transition: opacity .25s linear;
}
#hero-atmos::before, #hero-atmos::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(90px);
}
#hero-atmos::before {
  width: 66vw; height: 66vw; left: 0vw; top: -20vw;
  background: radial-gradient(circle, rgba(47,84,221,.15), transparent 66%);
  animation: drift1 26s ease-in-out infinite;
}
#hero-atmos::after {
  width: 58vw; height: 58vw; right: -4vw; bottom: -24vw;
  background: radial-gradient(circle, rgba(111,139,255,.11), transparent 68%);
  animation: drift2 34s ease-in-out infinite;
}
@keyframes drift1 {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50%     { transform: translate3d(6vw,5vw,0) scale(1.12); }
}
@keyframes drift2 {
  0%,100% { transform: translate3d(0,0,0) scale(1.06); }
  50%     { transform: translate3d(-7vw,-4vw,0) scale(1); }
}
#hero-atmos .sprk {
  position: absolute; top: -30%; height: 160%; width: 30px; opacity: .55;
  background-image:
    repeating-linear-gradient(to bottom,
      transparent 0 15px,
      rgba(148,160,200,.13) 15px 17px,
      rgba(120,134,180,.19) 17px 33px,
      rgba(148,160,200,.13) 33px 35px,
      transparent 35px 54px),
    linear-gradient(rgba(20,23,38,.55), rgba(20,23,38,.55));
  background-size: 100% 54px, 100% 100%;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  animation: creep 22s linear infinite;
}
#hero-atmos .sprk.l { left: 0; }
#hero-atmos .sprk.r { right: 0; animation-duration: 27s; }
@keyframes creep { to { background-position: 0 0, 0 -540px; } }
@media (max-width: 780px) { #hero-atmos .sprk { display: none; } }
@media (prefers-reduced-motion: reduce) {
  #hero-atmos::before, #hero-atmos::after, #hero-atmos .sprk { animation: none; }
}
