/* ==========================================================================
   AE4Play — sections
   ========================================================================== */

/* =========================== HERO =========================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 3rem) var(--gutter) clamp(4.5rem, 9vh, 7rem);
  overflow: hidden;
  isolation: isolate;
}

.hero__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }

/* CSS fallback: visible when WebGL is missing or slow to boot */
.hero__fallback {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(38% 42% at 72% 30%, rgba(255, 46, 136, .55), transparent 70%),
    radial-gradient(34% 40% at 22% 62%, rgba(61, 245, 255, .38), transparent 70%),
    radial-gradient(30% 30% at 55% 80%, rgba(198, 255, 61, .28), transparent 70%),
    radial-gradient(60% 60% at 50% 40%, var(--ink-3), var(--ink) 75%);
  filter: blur(10px) saturate(1.2);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(-3%, 2%, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(3%, -2%, 0) rotate(8deg) scale(1.08); }
  100% { transform: translate3d(-1%, 3%, 0) rotate(-6deg) scale(1.03); }
}

/* Retro perspective floor grid (fallback flavour) */
.hero__floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 55%;
  background-image:
    linear-gradient(rgba(198, 255, 61, .55) 2px, transparent 2px),
    linear-gradient(90deg, rgba(198, 255, 61, .55) 2px, transparent 2px);
  background-size: 64px 64px;
  transform: perspective(380px) rotateX(62deg);
  transform-origin: 50% 0;
  mask-image: linear-gradient(to bottom, transparent, #000 60%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 60%);
  opacity: .5;
  animation: floor 1.6s linear infinite;
}
@keyframes floor { to { background-position: 0 64px, 0 0; } }

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero.has-webgl .hero__canvas { opacity: 1; }
.hero.has-webgl .hero__floor { opacity: .18; }

.hero__vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--ink) 0%, rgba(7, 6, 11, .55) 28%, transparent 60%),
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(7, 6, 11, .75));
  pointer-events: none;
}

.hero__content {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 11.9vw, 12.2rem);
  line-height: .86;
  letter-spacing: -.055em;
  color: var(--paper);
}
.hero__line {
  display: block;
  /* room for descenders while clipping the reveal */
  padding-bottom: .1em;
  margin-bottom: -.1em;
  overflow: hidden;
  white-space: nowrap;
}
.hero__line--indent { padding-left: 1.1em; }

.hero__title .word { display: inline-block; white-space: nowrap; }
.hero__title .char { display: inline-block; will-change: transform; }

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem 3rem;
  margin-top: clamp(1.8rem, 4vh, 3rem);
}
.hero__sub {
  max-width: 38ch;
  font-size: var(--fs-md);
  line-height: 1.4;
  color: var(--paper-dim);
}
.hero__sub strong { color: var(--paper); font-weight: 700; }

@media (max-width: 600px) {
  .hero__line--indent { padding-left: .5em; }
}

/* PRESS START button: chunky arcade key */
.btn-start {
  --press: 0px;
  position: relative;
  display: inline-block;
  border-radius: 999px;
  background: #5f8a00;
  padding-bottom: 7px;
  transition: padding .15s ease;
  will-change: transform;
}
.btn-start__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: 1.15rem 2.3rem 1rem;
  border-radius: 999px;
  background: var(--acid);
  color: var(--ink);
  transform: translateY(var(--press));
  transition: transform .15s ease, background-color .3s ease;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55);
}
.btn-start__label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.05rem, 1rem + .6vw, 1.45rem);
  letter-spacing: .02em;
}
.btn-start__hint {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  opacity: .7;
}
.btn-start:hover .btn-start__inner { background: #d6ff6e; }
.btn-start:active { --press: 5px; }
.btn-start::after {
  /* halo */
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 2px solid var(--acid);
  opacity: 0;
  animation: halo 2.4s var(--ease-out) infinite;
  pointer-events: none;
}
@keyframes halo {
  0% { opacity: .7; transform: scale(.92); }
  70%, 100% { opacity: 0; transform: scale(1.18); }
}

/* HUD corners */
.hud {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .9rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--paper-dim);
  pointer-events: none;
}
.hud b { color: var(--paper); font-weight: 500; font-variant-numeric: tabular-nums; }
.hud::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid var(--acid);
}
.hud--tl { top: calc(var(--header-h) + 1rem); left: var(--gutter); padding: .4rem .7rem; }
.hud--tl::before { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.hud--tr { top: calc(var(--header-h) + 1rem); right: calc(var(--gutter) + 1.2rem); padding: .4rem .7rem; }
.hud--tr::before { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.hud--bl { bottom: 1.4rem; left: var(--gutter); padding: .4rem .7rem; color: var(--acid); }
.hud--bl::before { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.hud--br { bottom: 1.4rem; right: calc(var(--gutter) + 1.2rem); padding: .4rem .7rem; }
.hud--br::before { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.hud__blink { animation: blink 1.1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hud__scroll-line {
  position: relative;
  width: 44px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.hud__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--acid);
  animation: scan 1.8s var(--ease-snap) infinite;
}
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (max-width: 600px) {
  .hud--tr, .hud--br { right: var(--gutter); }
  .hud--tl { display: none; }
}

/* =========================== TICKER =========================== */
.ticker {
  position: relative;
  z-index: 2;
  padding-block: clamp(2.5rem, 6vw, 5rem);
  overflow: hidden;
}
.ticker__row {
  display: flex;
  overflow: hidden;
  padding-block: .9rem;
  width: 110%;
  margin-left: -5%;
}
.ticker__row--a {
  background: var(--acid);
  color: var(--ink);
  transform: rotate(-2.4deg);
  position: relative;
  z-index: 2;
}
.ticker__row--b {
  background: var(--ink-2);
  color: var(--paper);
  border-block: 1px solid var(--line);
  transform: rotate(1.6deg);
  margin-top: -.6rem;
}
.ticker__track {
  display: flex;
  flex-shrink: 0;
  will-change: transform;
}
.ticker__list {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}
.ticker__list li {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, .9rem + 2.4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: skewX(var(--skew, 0deg));
}
.ticker__row--b .ticker__list li { font-weight: 600; text-transform: none; color: transparent; -webkit-text-stroke: 1.2px var(--paper); }
.ticker__list li::after {
  /* pixel star separator */
  content: "";
  flex-shrink: 0;
  width: .55em;
  height: .55em;
  margin-inline: .7em;
  background: currentColor;
  clip-path: polygon(40% 0, 60% 0, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);
}
.ticker__row--b .ticker__list li::after { background: var(--hot); }

/* =========================== MANIFESTO =========================== */
.manifesto { padding-block: var(--section-y); }
.manifesto__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.manifesto__text {
  max-width: 21em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.55rem, .9rem + 3.1vw, 4.3rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  text-wrap: pretty;
}
.manifesto__text .w { opacity: .14; transition: color .3s ease; }
.manifesto__text .w.is-lit-hot { color: var(--hot); }
.no-motion .manifesto__text .w,
.no-gsap .manifesto__text .w { opacity: 1; }
.manifesto__sign {
  margin-top: 2.2rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--paper-dim);
}

/* =========================== GAMES =========================== */
.games { padding-block: clamp(3rem, 6vw, 5rem) 0; }
.games__pin {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.5rem, 4vh, 3rem);
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--header-h) + .5rem) 2rem;
}
.games__head .section-title { font-size: clamp(2.1rem, 1.2rem + 3.4vw, 4.4rem); }
.games__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}
.games__meta { display: flex; align-items: flex-end; gap: 2rem; max-width: 560px; color: var(--paper-dim); }
.games__meta p:first-child { max-width: 36ch; }
.games__counter {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--paper-dim);
  white-space: nowrap;
}
.games__counter span { color: var(--acid); font-size: 2.2em; font-weight: 700; vertical-align: -.12em; }

.games__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--acid) transparent;
  -webkit-overflow-scrolling: touch;
}
.games__track {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  width: max-content;
  padding: .75rem var(--gutter) 1.5rem;
}
.games.is-pinned .games__viewport { overflow: visible; scroll-snap-type: none; }
.games.is-pinned .games__track { will-change: transform; }

.game-card {
  --card-w: clamp(272px, min(64vw, (100svh - 590px) * 1.6), 780px);
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  scroll-snap-align: center;
  perspective: 1100px;
  container-type: inline-size;
}
.game-card__inner {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 50%; --glare: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 22px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  overflow: hidden;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .6s var(--ease-out), border-color .4s ease, box-shadow .6s var(--ease-out);
}
.game-card__inner.is-tilting { transition: transform .12s linear, border-color .4s ease, box-shadow .6s var(--ease-out); }
.game-card__inner:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 40px 80px -30px color-mix(in srgb, var(--accent) 45%, transparent);
}
.game-card__media { border-radius: 0; }
.game-card__media img { transition: transform 1.2s var(--ease-out); }
.game-card__inner:hover .game-card__media img { transform: scale(1.05); }
.game-card__glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 45%);
  mix-blend-mode: overlay;
  opacity: var(--glare);
  transition: opacity .4s ease;
}
.game-card__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: 0 clamp(1.1rem, 2vw, 1.8rem) clamp(1.2rem, 2vw, 1.7rem);
  transform: translateZ(40px);
}
.game-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
  margin-top: -1.05rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  box-shadow: 0 0 0 4px var(--ink-2);
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--ink);
  border-radius: 1px;
  animation: blink 1.4s steps(2, jump-none) infinite;
}
.game-card__genre { font-family: var(--font-mono); font-size: .78rem; color: var(--paper-dim); }
.game-card__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.45rem, 8.6cqi, 3.4rem);
  line-height: .9;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.game-card__desc { max-width: 44ch; color: var(--paper-dim); font-size: var(--fs-base); }
.platforms { display: flex; flex-wrap: wrap; gap: .4rem; }
.platforms li {
  padding: .25rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--paper);
}

/* "Next slot" card */
.game-card--next { --accent: var(--acid); }
.game-card__next {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1rem;
  height: 100%;
  min-height: 320px;
  padding: clamp(1.4rem, 3vw, 2.6rem);
  border: 2px dashed rgba(198, 255, 61, .45);
  border-radius: 22px;
  overflow: hidden;
  transition: background-color .5s ease, border-color .5s ease;
}
.game-card__next:hover { background: rgba(198, 255, 61, .06); border-color: var(--acid); }
.game-card__slot {
  position: absolute;
  top: -.12em;
  right: .1em;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(7rem, 22vw, 18rem);
  line-height: 1;
  letter-spacing: -.06em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(198, 255, 61, .4);
}
.game-card__next-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 9cqi, 3.2rem);
  line-height: .98;
  letter-spacing: -.035em;
}
.game-card__next-cta {
  align-self: flex-start;
  padding: .7rem 1.2rem;
  border-radius: 999px;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .82rem;
}

@media (min-width: 768px) and (max-width: 1199px) and (max-height: 860px) {
  .games__meta p:first-child { display: none; }
  .game-card__desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

/* Wide screens: landscape cards, cover left, info right */
@media (min-width: 1200px) {
  .game-card { --card-w: clamp(760px, min(72vw, (100svh - 400px) * 2.76), 1080px); }
  .game-card__inner { flex-direction: row; }
  .game-card__media { flex: 0 0 58%; aspect-ratio: 16 / 10; }
  .game-card__body {
    flex: 1;
    justify-content: flex-end;
    padding: clamp(1.2rem, 2vw, 2rem);
    transform: translateZ(30px);
  }
  .game-card__top { margin-top: 0; }
  .game-card__title { font-size: clamp(1.6rem, 5.2cqi, 3.4rem); }
  .game-card__desc { font-size: clamp(.95rem, 1.75cqi, 1.125rem); }
  .badge { box-shadow: none; }
  .game-card--next { --card-w: clamp(320px, 30vw, 460px); }
}

.games__progress {
  margin-inline: var(--gutter);
  height: 2px;
  background: var(--line);
  overflow: hidden;
}
.games__progress span {
  display: block;
  height: 100%;
  background: var(--acid);
  transform-origin: left;
  transform: scaleX(.25);
}

/* =========================== FACTORY =========================== */
.factory { padding-top: clamp(2rem, 4vw, 4rem); }
.factory__pin {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.5rem, 4vh, 3.5rem);
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--header-h) + .5rem) clamp(1.5rem, 4vh, 3rem);
  overflow: hidden;
}
.factory__top {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: end;
  gap: 2rem clamp(2rem, 5vw, 5rem);
}
.factory__intro p { margin-top: 1.4rem; max-width: 40ch; color: var(--paper-dim); }
.factory__figure { position: relative; }
.factory__figure .media {
  border-radius: 18px;
  max-height: 42vh;
  width: 100%;
  border: 1px solid var(--line);
}
.factory__readout {
  position: absolute;
  left: clamp(.8rem, 2vw, 1.4rem);
  right: clamp(.8rem, 2vw, 1.4rem);
  bottom: clamp(.8rem, 2vw, 1.4rem);
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .9rem 1.1rem;
  border-radius: 12px;
  background: rgba(7, 6, 11, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
}
.factory__readout-step { font-family: var(--font-mono); font-size: .72rem; color: var(--acid); }
.factory__readout-text { font-size: var(--fs-base); line-height: 1.35; }
.factory:not(.is-pinned) .factory__readout { display: none; }

/* Assembly line */
.line { position: relative; padding-inline: var(--gutter); max-width: var(--max); width: 100%; margin-inline: auto; }
.line__stations {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(.4rem, 1.5vw, 1.4rem);
  counter-reset: station;
}
.station {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "num name"
    "desc desc"
    "machine machine";
  align-items: baseline;
  gap: .35rem .55rem;
}
.station__machine {
  grid-area: machine;
  position: relative;
  height: clamp(38px, 6vh, 64px);
  margin-top: .5rem;
  border-radius: 10px 10px 4px 4px;
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(244, 241, 234, .04) 10px 20px),
    var(--ink-3);
  border: 1px solid var(--line);
  transition: border-color .4s ease, box-shadow .4s ease, background-color .4s ease;
}
.station__machine::after {
  /* the press arm that comes down to the belt */
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 6px;
  height: 46px;
  background: linear-gradient(var(--ink-3) 80%, #6d6884 80%);
  border-inline: 1px solid var(--line);
  transform: translateX(-50%) scaleY(.3);
  transform-origin: top;
  transition: transform .45s var(--ease-out);
}
.factory.is-pinned .station.is-active .station__machine::after { transform: translateX(-50%) scaleY(1); }
.station__lamp {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2b283a;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.station__num { grid-area: num; font-family: var(--font-mono); font-size: .75rem; color: var(--paper-dim); }
.station__name {
  grid-area: name;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.8rem, .5rem + .9vw, 1.25rem);
  letter-spacing: -.02em;
  color: var(--paper-dim);
  transition: color .3s ease;
  overflow-wrap: anywhere;
}
.station__desc { grid-area: desc; font-size: var(--fs-sm); color: var(--paper-dim); line-height: 1.4; }
.factory.is-pinned .station__desc { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.station.is-active .station__machine,
.station.is-done .station__machine { border-color: rgba(198, 255, 61, .5); }
.station.is-active .station__machine { box-shadow: 0 0 0 1px var(--acid), 0 18px 50px -12px rgba(198, 255, 61, .5); }
.station.is-active .station__lamp,
.station.is-done .station__lamp { background: var(--acid); box-shadow: 0 0 12px var(--acid); }
.station.is-active .station__name { color: var(--acid); }
.station.is-done .station__name { color: var(--paper); }
.station.is-active .station__lamp { animation: blink .5s steps(2, jump-none) infinite; }

.line__belt {
  --belt: 0px;
  position: relative;
  height: 44px;
  margin-top: 108px;
  border-radius: 22px;
  background:
    repeating-linear-gradient(90deg, #26233a 0 18px, #1a1828 18px 36px);
  background-position: var(--belt) 0;
  border: 1px solid var(--line);
  box-shadow: inset 0 6px 10px rgba(0, 0, 0, .5);
}
.line__rollers {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -16px;
  height: 12px;
  background: radial-gradient(circle at 6px 6px, #3a3650 5px, transparent 6px) 0 0 / 36px 12px repeat-x;
}
.line__item {
  --p: 0;
  position: absolute;
  bottom: 18px;
  left: calc(var(--p) * (100% - 112px));
  width: 112px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 8px 8px 4px 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .68rem;
  color: var(--paper);
  transition: background .4s ease, border-color .4s ease, color .4s ease, box-shadow .4s ease, border-radius .4s ease;
}
.line__item-label { position: relative; z-index: 1; padding: .2rem .4rem; }
/* Stage looks: sketch → greybox → beta → gold → shipped cartridge */
.line__item[data-stage="0"] { border: 2px dashed var(--paper-dim); background: transparent; }
.line__item[data-stage="1"] { border: 2px solid #6d6884; background: #3a3650; }
.line__item[data-stage="2"] {
  border: 2px solid var(--volt);
  background: repeating-linear-gradient(45deg, #1f3a44 0 8px, #172b33 8px 16px);
  color: var(--volt);
}
.line__item[data-stage="3"] {
  border: 2px solid var(--sun);
  background: linear-gradient(160deg, #ffcf7a, var(--sun) 50%, #b8741c);
  color: var(--ink);
  box-shadow: 0 0 30px rgba(255, 177, 61, .45);
}
.line__item[data-stage="4"] {
  border: 2px solid var(--acid);
  border-radius: 6px 6px 14px 14px;
  background: linear-gradient(var(--ink) 0 22%, var(--acid) 22%);
  color: var(--ink);
  box-shadow: 0 0 40px rgba(198, 255, 61, .55);
}
.line__item[data-stage="4"]::before {
  /* cartridge contacts */
  content: "";
  position: absolute;
  top: 4px;
  left: 14px;
  right: 14px;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--sun) 0 4px, transparent 4px 8px);
}

@media (max-width: 860px) {
  .factory__top { grid-template-columns: minmax(0, 1fr); }
  .factory__readout { position: relative; inset: auto; margin-top: .6rem; }
  .factory__figure .media { max-height: 30vh; }
}
@media (max-width: 700px) {
  .factory.is-pinned .station__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .factory.is-pinned .station { grid-template-columns: 1fr; grid-template-areas: "num" "machine"; justify-items: center; }
  .factory.is-pinned .station__machine { width: 100%; }
  .factory:not(.is-pinned) .line__stations { grid-template-columns: 1fr; gap: 1.2rem; }
  .factory:not(.is-pinned) .station {
    grid-template-columns: auto auto 1fr;
    grid-template-areas: "machine num name" "machine desc desc";
    align-items: start;
  }
  .factory:not(.is-pinned) .station__machine { width: 46px; height: 46px; margin: 0; }
  .factory:not(.is-pinned) .station__machine::after { display: none; }
  .factory__intro p { margin-top: .8rem; }
  .line__item { width: 84px; height: 58px; left: calc(var(--p) * (100% - 84px)); font-size: .6rem; }
  .line__belt { margin-top: 88px; }
  .factory:not(.is-pinned) .line__belt { margin-top: 84px; }
}
@media (max-width: 700px) and (max-height: 760px) {
  .factory.is-pinned .factory__intro p { display: none; }
}

/* =========================== SCORES =========================== */
.scores { padding-block: var(--section-y); }
.scores__layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 3rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.scores__intro p { margin-top: 1.4rem; max-width: 34ch; color: var(--paper-dim); }
.scoreboard {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
.scoreboard th {
  padding: 0 .6rem .8rem 0;
  text-align: left;
  font-weight: 500;
  font-size: .72rem;
  color: var(--paper-dim);
  border-bottom: 1px solid var(--line);
}
.scoreboard td {
  padding: clamp(.8rem, 1.6vw, 1.3rem) .8rem clamp(.8rem, 1.6vw, 1.3rem) 0;
  border-bottom: 1px dashed var(--line);
  vertical-align: middle;
}
.scoreboard td:first-child { color: var(--acid); font-weight: 700; width: 3.5ch; }
.scoreboard__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 1rem + 3.2vw, 4.2rem);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.scoreboard tbody tr:first-child .scoreboard__value { color: var(--sun); }
.scoreboard tbody tr:nth-child(2) .scoreboard__value { color: var(--paper); }
.scoreboard td:nth-child(3) { color: var(--paper-dim); max-width: 22ch; }
.scoreboard__ini { text-align: right; color: var(--hot); font-weight: 700; letter-spacing: .1em; padding-right: 0 !important; }
.scoreboard tbody tr { transition: background-color .3s ease; }
.scoreboard tbody tr:hover { background: rgba(244, 241, 234, .03); }
.scoreboard tbody tr:hover .scoreboard__ini { animation: blink .5s steps(2, jump-none) infinite; }

@media (max-width: 860px) {
  .scores__layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .scoreboard th:last-child, .scoreboard__ini { display: none; }
  .scoreboard td:nth-child(3) { font-size: .75rem; }
}

/* =========================== ARCADE =========================== */
.arcade {
  padding-block: var(--section-y);
  background:
    radial-gradient(70% 60% at 75% 45%, rgba(255, 46, 136, .12), transparent 70%),
    radial-gradient(50% 50% at 20% 80%, rgba(61, 245, 255, .08), transparent 70%);
}
.arcade__layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: 3rem clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.arcade__intro p { margin-top: 1.4rem; max-width: 36ch; color: var(--paper-dim); }
.arcade__keys { display: grid; gap: .7rem; margin-top: 2rem; font-size: var(--fs-sm); }
.arcade__keys div { display: flex; align-items: center; gap: 1rem; }
.arcade__keys dt { width: 5.5rem; font-family: var(--font-mono); font-size: .75rem; color: var(--paper-dim); }

.cabinet {
  position: relative;
  width: 100%;
  max-width: 640px;
  justify-self: center;
  filter: drop-shadow(0 50px 70px rgba(0, 0, 0, .6));
}
.cabinet__marquee {
  position: relative;
  margin-inline: 6%;
  padding: .95rem 1rem .8rem;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 46, 136, .25), rgba(255, 46, 136, 0)),
    var(--ink-3);
  border: 1px solid rgba(255, 46, 136, .5);
  border-bottom: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.1rem, 2.6vw, 1.7rem);
  letter-spacing: .08em;
  color: #ffd2e6;
  text-shadow: 0 0 8px var(--hot), 0 0 24px var(--hot);
  animation: neon 5s linear infinite;
}
.cabinet__marquee span { color: var(--acid); text-shadow: 0 0 8px var(--acid), 0 0 24px rgba(198, 255, 61, .7); }
@keyframes neon {
  0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; }
  20%, 63% { opacity: .55; }
}
.cabinet__bezel {
  padding: clamp(.8rem, 2.2vw, 1.4rem);
  border-radius: 26px;
  background: linear-gradient(160deg, #24203a, #121020 60%);
  border: 1px solid rgba(244, 241, 234, .1);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .06), inset 0 -10px 30px rgba(0, 0, 0, .5);
}
.cabinet__hud {
  display: flex;
  justify-content: space-between;
  padding: 0 .3rem .7rem;
  font-family: var(--font-mono);
  font-size: clamp(.68rem, 1.6vw, .85rem);
  color: var(--paper-dim);
}
.cabinet__hud b { color: var(--acid); font-weight: 700; font-variant-numeric: tabular-nums; margin-left: .35rem; }
.cabinet__hud span:last-child b { color: var(--sun); }
.cabinet__screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 16px / 20px;
  overflow: hidden;
  background:
    radial-gradient(80% 80% at 50% 50%, #12122a, #000);
  box-shadow: 0 0 0 3px #000, 0 0 0 4px rgba(244, 241, 234, .08), inset 0 0 60px rgba(0, 0, 0, .9);
}
.cabinet__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}
.cabinet__canvas:focus-visible { outline-offset: -4px; border-radius: 14px; }
.cabinet__glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px),
    linear-gradient(125deg, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, 0) 32%),
    radial-gradient(120% 100% at 50% 50%, transparent 60%, rgba(0, 0, 0, .55));
  mix-blend-mode: normal;
}
.cabinet__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 1.2rem;
  text-align: center;
  background: rgba(5, 4, 12, .72);
  transition: opacity .35s ease, visibility .35s;
}
.cabinet__overlay.is-hidden { opacity: 0; visibility: hidden; }
.cabinet__overlay.is-idle { justify-content: flex-end; padding-bottom: 22%; background: linear-gradient(to top, rgba(5, 4, 12, .7), transparent 60%); }
.cabinet__state:empty { display: none; }
.cabinet__state {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.4rem, 5vw, 2.8rem);
  line-height: .95;
  letter-spacing: -.02em;
  color: var(--paper);
  text-shadow: 3px 0 0 var(--hot), -3px 0 0 var(--volt);
}
.cabinet__start {
  padding: .8rem 1.4rem;
  border: 2px solid var(--acid);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(.85rem, 2vw, 1.05rem);
  letter-spacing: .14em;
  color: var(--acid);
  background: rgba(198, 255, 61, .06);
  animation: blink 1s steps(2, jump-none) infinite;
  transition: background-color .2s ease, color .2s ease;
}
.cabinet__start:hover,
.cabinet__start:focus-visible { animation: none; background: var(--acid); color: var(--ink); }
.cabinet__start:disabled { animation: none; opacity: .4; cursor: not-allowed; }
.cabinet__note { font-family: var(--font-mono); font-size: .72rem; color: var(--paper-dim); max-width: 30ch; }

.cabinet__panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-inline: 3%;
  padding: 1.1rem clamp(1rem, 4vw, 2.2rem) 1.3rem;
  background: linear-gradient(180deg, #2a2540, #17142a);
  border: 1px solid rgba(244, 241, 234, .08);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  clip-path: polygon(0 0, 100% 0, 97% 100%, 3% 100%);
}
.cabinet__stick {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #0d0b16;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .7);
}
.cabinet__stick i {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff7fb5, var(--hot) 55%, #8a0d44);
  transform: translateY(-6px);
  box-shadow: 0 6px 0 -2px #0d0b16;
}
.cabinet__buttons { display: flex; gap: .7rem; }
.cabinet__buttons i {
  width: clamp(22px, 5vw, 30px);
  height: clamp(22px, 5vw, 30px);
  border-radius: 50%;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .35), 0 3px 0 #0d0b16;
}
.cabinet__buttons i:nth-child(1) { background: var(--acid); }
.cabinet__buttons i:nth-child(2) { background: var(--volt); }
.cabinet__buttons i:nth-child(3) { background: var(--sun); }
.cabinet__slot {
  padding: .35rem .5rem;
  border-radius: 4px;
  background: #0d0b16;
  border: 1px solid rgba(255, 46, 136, .4);
  font-family: var(--font-mono);
  font-size: .66rem;
  color: var(--hot);
  text-shadow: 0 0 6px var(--hot);
}
.cabinet.is-playing .cabinet__stick i { animation: wiggle .5s ease-in-out infinite alternate; }
@keyframes wiggle { from { transform: translateY(-6px) rotate(-14deg); } to { transform: translateY(-6px) rotate(14deg); } }

@media (max-width: 860px) {
  .arcade__layout { grid-template-columns: minmax(0, 1fr); }
}

/* =========================== CONTACT =========================== */
.contact {
  padding-block: var(--section-y) clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
}
.contact__layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem clamp(2rem, 6vw, 6rem);
  align-items: end;
}
.contact__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 1rem + 7.2vw, 8.6rem);
  line-height: .88;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.contact__title .w { display: inline-block; }
.contact__lead { margin-top: 1.8rem; max-width: 46ch; color: var(--paper-dim); font-size: var(--fs-md); line-height: 1.45; }
.contact__mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.4rem;
  margin-top: 2.4rem;
}
.mail-link {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, .8rem + 2.4vw, 2.8rem);
  letter-spacing: -.03em;
  color: var(--acid);
  overflow-wrap: anywhere;
}
.mail-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -.12em;
  height: 3px;
  background: currentColor;
  transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.mail-link:hover::after { transform: scaleX(.3); }
.copy-btn {
  padding: .5rem .95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .78rem;
  transition: border-color .3s ease, color .3s ease;
}
.copy-btn:hover { border-color: var(--acid); color: var(--acid); }
.copy-btn.is-done { border-color: var(--acid); color: var(--ink); background: var(--acid); }

.newsletter {
  position: relative;
  padding: clamp(1.3rem, 3vw, 2rem);
  border-radius: 22px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.newsletter__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: -.02em;
}
.newsletter__hint { margin-top: .5rem; color: var(--paper-dim); font-size: var(--fs-sm); }
.newsletter__field {
  display: flex;
  gap: .5rem;
  margin-top: 1.3rem;
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.newsletter__field:focus-within { border-color: var(--acid); box-shadow: 0 0 0 4px rgba(198, 255, 61, .15); }
.newsletter.has-error .newsletter__field { border-color: var(--hot); box-shadow: 0 0 0 4px rgba(255, 46, 136, .18); animation: shake .4s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.newsletter__field input {
  flex: 1;
  min-width: 0;
  padding: .7rem .9rem;
  border: 0;
  background: transparent;
  font-size: 1rem;
}
.newsletter__field input:focus-visible { outline: none; }
.newsletter__field input::placeholder { color: rgba(244, 241, 234, .35); }
.newsletter__submit {
  flex-shrink: 0;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .85rem;
  transition: transform .2s ease, background-color .2s ease;
}
.newsletter__submit:hover { background: #d6ff6e; }
.newsletter__submit:active { transform: scale(.96); }
.newsletter__error { min-height: 1.4em; margin-top: .6rem; font-family: var(--font-mono); font-size: .75rem; color: var(--hot); }
.newsletter__success {
  margin-top: .6rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--acid);
  color: var(--ink);
}
.newsletter__success:focus { outline: none; }
.newsletter__success-big { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-md); letter-spacing: -.02em; }
.newsletter.is-done .newsletter__field,
.newsletter.is-done .newsletter__error { display: none; }

.socials { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.socials a {
  display: inline-block;
  padding: .55rem .95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .78rem;
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.socials a:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

@media (max-width: 860px) {
  .contact__layout { grid-template-columns: minmax(0, 1fr); }
}
