/* ==========================================================
   nullzoro — menu  ·  v2 "metalheart"
   dark chrome tubes, hud rings, hard bevels, violet only
   ========================================================== */
body.menu { min-height: 100vh; }
body.menu::before { display: none; }          /* blueprint grid: the hud layer replaces it */
body.menu::after { opacity: .28; }

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ---------- system bar: hard dark metal rail ---------- */
.sysbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 22px;
  background:
    repeating-linear-gradient(0deg, rgba(196, 181, 253, .035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(26, 16, 46, .94), rgba(8, 4, 16, .9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 24px -12px #000;
}
.sysbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, #2a1650, #e9e2ff 18%, #0e0719 19%, #6d58b8 50%, #0e0719 81%, #e9e2ff 82%, #2a1650);
}
.sys-l, .sys-r { display: flex; gap: 14px; align-items: center; }
.dot {
  width: 7px; height: 7px;
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
  animation: nl-blink 2.4s steps(1) infinite;
}

/* ---------- stage ---------- */
.stage {
  width: 100%;
  max-width: min(1560px, 94vw);
  margin: 0 auto;
  padding: 30px 22px 34px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
/* dark plate behind the type so it reads over the metal */
.hero::before {
  content: "";
  position: absolute; left: 50%; top: 70%;
  width: min(1240px, 100vw); height: 64%;
  translate: -50% -50%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(4, 2, 9, .92), rgba(4, 2, 9, .72) 55%, transparent);
}

/* the chrome core (webgl draws the machined null mark here) */
.core {
  --cs: clamp(118px, 10.5vw, 176px);
  width: var(--cs);
  height: var(--cs);
  position: relative;
}
.core-fb { display: none; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 14px rgba(139, 92, 246, .5)); }
.no-gl .core-fb { display: block; }

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: .95;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  gap: .28em;
  font-size: clamp(46px, 9vw, 150px);
  letter-spacing: -.01em;
  text-transform: lowercase;
}

.tagline { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.tagline .nl-label { color: var(--lilac); }
/* tech rules: line, end tick, block */
.tagline .rule-l, .tagline .rule-r {
  width: 84px; height: 7px;
  background:
    linear-gradient(#ddd6fe, #ddd6fe) right 50% / 5px 5px no-repeat,
    linear-gradient(#ddd6fe, #ddd6fe) calc(100% - 9px) 50% / 1px 7px no-repeat,
    linear-gradient(90deg, transparent, #8b5cf6 40%, #ddd6fe) left 50% / calc(100% - 12px) 1px no-repeat;
}
.tagline .rule-r { transform: scaleX(-1); }

/* ---------- rack ---------- */
.rack-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.rack-head .nl-label { color: var(--lilac); }
.rack-head .rule {
  flex: 1; height: 7px;
  background:
    linear-gradient(#c4b5fd, #c4b5fd) left 50% / 1px 7px no-repeat,
    linear-gradient(#c4b5fd, #c4b5fd) right 50% / 1px 7px no-repeat,
    repeating-linear-gradient(90deg, rgba(196, 181, 253, .7) 0 14px, transparent 14px 18px, rgba(196, 181, 253, .7) 18px 20px, transparent 20px 26px) 0 50% / 100% 1px no-repeat;
}

.rack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(240px, 16.5vw, 340px), 1fr));
  gap: clamp(18px, 1.6vw, 30px);
  perspective: 1100px;
}

/* ---------- cartridge: hard chrome bevel + targeting brackets ---------- */
.mod {
  --accent: var(--violet-2);
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 3px;
  border: 2px solid transparent;
  background:
    repeating-linear-gradient(0deg, rgba(196, 181, 253, .03) 0 1px, transparent 1px 3px) padding-box,
    linear-gradient(180deg, rgba(24, 14, 44, .94), rgba(6, 3, 12, .97)) padding-box,
    linear-gradient(180deg, #f3eeff 0%, #9d8ce0 20%, #0e0719 21%, #3a2466 48%, #d9d0f7 49%, #2a1650 76%, #0e0719 77%, #b9a8f5 100%) border-box;
  box-shadow:
    0 0 0 1px #05020a,
    inset 0 0 0 1px #05020a,
    inset 0 1px 0 1px rgba(255, 255, 255, .1),
    0 18px 30px -18px #000;
  transition: transform .28s cubic-bezier(.2, 1.5, .35, 1), box-shadow .25s;
  outline: none;
  cursor: pointer;
  transform-style: preserve-3d;
  animation: modIn .6s cubic-bezier(.2, 1.3, .4, 1) both;
}
@keyframes modIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
/* corner brackets sitting just outside the frame */
.mod::before {
  content: "";
  position: absolute; inset: -7px;
  pointer-events: none;
  opacity: .45;
  transition: opacity .2s, inset .25s cubic-bezier(.2, 1.5, .35, 1);
  --b: #c4b5fd;
  background:
    linear-gradient(var(--b), var(--b)) left top / 12px 1px,
    linear-gradient(var(--b), var(--b)) left top / 1px 12px,
    linear-gradient(var(--b), var(--b)) right top / 12px 1px,
    linear-gradient(var(--b), var(--b)) right top / 1px 12px,
    linear-gradient(var(--b), var(--b)) left bottom / 12px 1px,
    linear-gradient(var(--b), var(--b)) left bottom / 1px 12px,
    linear-gradient(var(--b), var(--b)) right bottom / 12px 1px,
    linear-gradient(var(--b), var(--b)) right bottom / 1px 12px;
  background-repeat: no-repeat;
}

.mod:hover, .mod:focus-visible {
  transform: translateY(-7px);
  box-shadow:
    0 0 0 1px #05020a,
    inset 0 0 0 1px #05020a,
    inset 0 1px 0 1px rgba(255, 255, 255, .16),
    0 0 0 3px rgba(196, 181, 253, .35),
    0 0 26px -6px var(--violet),
    0 22px 40px -18px #000;
}
.mod:hover::before, .mod:focus-visible::before { opacity: 1; inset: -11px; }
.mod:focus-visible::before { --b: #ffffff; }
.mod.locked { cursor: default; }
.mod.locked:hover, .mod.locked:focus-visible { transform: translateY(-3px); }
.mod.shake { animation: modShake .35s; }
@keyframes modShake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

.mod.tilt {
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(-8px) scale(1.02);
  transition: transform .08s linear, box-shadow .25s;
}

.mod-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: linear-gradient(90deg, rgba(139, 92, 246, .16), transparent 70%);
  box-shadow: inset 0 -1px 0 #05020a, 0 1px 0 rgba(196, 181, 253, .12);
}
.mod-bar .nl-label { color: var(--silver); }
/* square chrome studs */
.win { display: flex; gap: 4px; }
.win i {
  width: 8px; height: 8px; border-radius: 1px;
  background: linear-gradient(180deg, #fff 0, #b9a8f5 45%, #140a24 50%, #6d58b8 100%);
  box-shadow: 0 0 0 1px #05020a;
}
.win i:first-child { background: linear-gradient(180deg, #fff 0, var(--accent) 45%, #140a24 55%, var(--accent)); }

.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--pixel); font-size: 9px; letter-spacing: .12em; color: var(--good); }
.status i { width: 5px; height: 5px; background: currentColor; box-shadow: 0 0 8px currentColor; animation: nl-blink 1.6s steps(1) infinite; }
.locked .status { color: var(--faint); }
.locked .status i { animation: none; box-shadow: none; }

/* screen in a machined bezel */
.mod-screen {
  position: relative;
  margin: 14px 14px 12px;
  aspect-ratio: 16 / 10;
  border-radius: 2px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 50%, #120a22, #06030c);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, .9),
    0 0 0 1px #05020a,
    0 0 0 3px #8f7fd0,
    0 -1px 0 3px #ffffff,
    0 1px 0 3px #1a0f2e,
    0 0 0 4px #05020a,
    0 6px 14px 2px rgba(0, 0, 0, .6);
  transform: translateZ(30px);
}
.mod-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .12), transparent 34%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .3) 0 1px, transparent 1px 3px);
}
.mod-screen.paper { background: #f1e8d4; }
.mod-screen canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; opacity: .75; }
.mod-screen.petri { background: #08040f; }
.mod-screen.petri canvas { filter: blur(1.4px) contrast(1.35) saturate(1.5); }
.mod-screen.dark { background: #050505; }
.nosig {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--lilac);
  text-shadow: 0 0 10px var(--violet);
}
.nosig span { padding: 4px 10px; background: rgba(10, 6, 18, .75); border: 1px solid var(--line-2); }

/* mini flood preview — riso tide almanac */
.mini {
  position: absolute;
  top: 50%; left: 50%;
  height: 84%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 5px;
  border: 2px solid #1d2743;
  background:
    radial-gradient(circle, rgba(255, 255, 255, .22) .8px, transparent 1.2px) 0 0 / 5px 5px,
    #0078bf;
}
.mini i { border-radius: 1px; background: #e4d3ab; transition: background .5s, box-shadow .5s, transform .5s; }
.mini i.w { background: transparent; }
.mini i.d { background: #b8a58a; }
.mini i.b1 { background: #ff48b0; }
.mini i.b2 { background: #ff6c2f; }
.mini i.b3 { background: #00a95c; }
.mini i.b4 { background: #ffe800; }
.mini i.d, .mini i.b1, .mini i.b2, .mini i.b3, .mini i.b4 { box-shadow: inset 0 0 0 1px #1d2743, 1px 1px 0 #1d2743; }

.mod-body { padding: 0 14px 10px; }
.mod-body .num { font-family: var(--pixel); font-size: 10px; color: var(--accent); letter-spacing: .1em; }
.mod-body h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(17px, 1.3vw, 23px);
  margin: 6px 0 4px; letter-spacing: .03em;
  background: linear-gradient(180deg, #ffffff 0%, #e4dcff 48%, #8f7fd0 52%, #f3eeff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transform: translateZ(20px);
}
.locked .mod-body h2 { background: none; color: var(--faint); }
.blurb { font-size: clamp(12px, .8vw, 14px); color: var(--dim); line-height: 1.55; margin: 10px 0 0; min-height: 56px; }
.locked .blurb { color: var(--faint); }

.mod-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 #05020a, inset 0 2px 0 rgba(196, 181, 253, .08);
}
.mod-foot .nl-btn.ghost { background: transparent; box-shadow: none; color: var(--faint); border: 1px dashed var(--line-2); text-shadow: none; }

/* chrome cartridge contacts */
.pins {
  height: 6px;
  margin: 0 26px -2px;
  background: repeating-linear-gradient(90deg, #e9e2ff 0 1px, #8f7fd0 1px 4px, #1a0f2e 4px 6px, transparent 6px 10px);
  opacity: .5;
  transition: opacity .2s;
}
.mod:hover .pins, .mod:focus-visible .pins { opacity: 1; }

/* specular sweep (violet-white only) */
.mod::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity .35s;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(221, 214, 254, .22), transparent 40%),
    linear-gradient(115deg, transparent 30%, rgba(196, 181, 253, .16) 44%, rgba(255, 255, 255, .22) 50%, rgba(196, 181, 253, .16) 56%, transparent 70%);
  background-size: 100% 100%, 260% 260%;
  background-position: 0 0, var(--mx) var(--my);
}
.mod.ready:hover::after, .mod.ready.tilt::after { opacity: 1; }
.mod.locked:hover::after { opacity: .3; }

.hint {
  width: fit-content;
  margin: 22px auto 0;
  padding: 7px 16px;
  text-align: center;
  background: rgba(6, 3, 12, .8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(196, 181, 253, .2);
}

/* ---------- ticker: chrome rail ---------- */
.ticker {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--silver);
  background:
    repeating-linear-gradient(0deg, rgba(196, 181, 253, .03) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(20, 12, 36, .94), rgba(6, 3, 12, .96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.ticker::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, #2a1650, #e9e2ff 18%, #0e0719 19%, #6d58b8 50%, #0e0719 81%, #e9e2ff 82%, #2a1650);
}
.track { display: inline-block; animation: marquee 48s linear infinite; }
.track b { color: var(--violet-2); font-weight: 400; margin: 0 18px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================
   backdrop — webgl chrome tubes + hud, lightning, tech text
   ========================================================== */
.cosmos { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: #05020a; }
#chrome-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1s ease; }
#chrome-bg.on { opacity: 1; }
#arcs { position: absolute; inset: 0; width: 100%; height: 100%; display: block; mix-blend-mode: screen; }

/* fallback hud without webgl: rings + a tinted band */
.no-gl .cosmos {
  background:
    repeating-radial-gradient(circle at 50% 18vh, transparent 0 62px, rgba(167, 139, 250, .16) 62px 63px, transparent 63px 110px),
    linear-gradient(180deg, transparent 8vh, rgba(76, 42, 150, .22) 8vh 34vh, transparent 34vh),
    #05020a;
}

/* tiny credit / telemetry text, like an old desktop wallpaper */
.tech {
  position: absolute;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, .42);
  white-space: nowrap;
}
.tech b { font-weight: 400; color: rgba(221, 214, 254, .7); }
.tech em { font-style: normal; font-family: var(--display); font-size: 15px; letter-spacing: .08em; color: rgba(221, 214, 254, .55); }
.t1 { left: 3.2vw; top: calc(var(--ny, 20vh) - 2vh); }
.t2 { right: 3.2vw; top: calc(var(--ny, 20vh) - 4vh); text-align: right; }

/* ---------- wordmark: hard chrome "null", scanline-filled outline "games" ---------- */
.wordmark .w1 {
  background:
    linear-gradient(105deg, transparent 44%, rgba(255, 255, 255, .9) 50%, transparent 56%) 0 0 / 260% 100% no-repeat,
    var(--chrome);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 1px rgba(5, 2, 10, .55);
  filter: drop-shadow(0 2px 0 #0e0719) drop-shadow(0 0 20px rgba(139, 92, 246, .45));
  animation: shine 6s ease-in-out infinite;
}
@keyframes shine { 0%, 62% { background-position: 130% 0, 0 0; } 100% { background-position: -40% 0, 0 0; } }
.wordmark .w2 {
  position: relative;
  color: transparent;
  background: repeating-linear-gradient(0deg, rgba(196, 181, 253, .55) 0 1px, rgba(196, 181, 253, .08) 1px 4px);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 1.5px #c4b5fd;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, .55));
}

.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  background: none;
  -webkit-text-stroke: 0;
  opacity: 0;
  pointer-events: none;
}
.glitch::before { color: #8b5cf6; -webkit-text-fill-color: #8b5cf6; }
.glitch::after { color: #fff; -webkit-text-fill-color: #ede9fe; }
.wordmark:hover .glitch::before, .wordmark.glitching .glitch::before { opacity: .85; animation: gl1 .45s steps(2) infinite; }
.wordmark:hover .glitch::after, .wordmark.glitching .glitch::after { opacity: .7; animation: gl2 .38s steps(2) infinite; }
@keyframes gl1 {
  0% { clip-path: inset(10% 0 70% 0); transform: translate(-6px, 0); }
  33% { clip-path: inset(55% 0 20% 0); transform: translate(5px, 2px); }
  66% { clip-path: inset(30% 0 45% 0); transform: translate(-3px, -1px); }
  100% { clip-path: inset(80% 0 5% 0); transform: translate(4px, 0); }
}
@keyframes gl2 {
  0% { clip-path: inset(65% 0 10% 0); transform: translate(6px, 0); }
  33% { clip-path: inset(15% 0 60% 0); transform: translate(-5px, -2px); }
  66% { clip-path: inset(40% 0 35% 0); transform: translate(3px, 1px); }
  100% { clip-path: inset(5% 0 80% 0); transform: translate(-4px, 0); }
}

/* ---------- cursor spark trail (hard specular glints) ---------- */
.trail {
  position: fixed; z-index: 900; pointer-events: none;
  font-style: normal; line-height: 1;
  color: #fff; text-shadow: 0 0 8px var(--c, #a78bfa), 0 0 2px var(--c, #a78bfa);
  transform: translate(-50%, -50%);
  animation: trail .7s ease-out forwards;
}
@keyframes trail { to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(90deg) scale(.2); } }

/* ---------- boot sequence ---------- */
.boot {
  position: fixed; inset: 0; z-index: 1500;
  background: radial-gradient(ellipse at 50% 45%, #110822, #030106 70%);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity .45s;
}
.boot.on { opacity: 1; pointer-events: auto; }
.boot pre {
  margin: 0; width: min(560px, 90vw);
  font-family: var(--pixel); font-size: 12px; line-height: 1.9; letter-spacing: .08em;
  color: #c4b5fd; text-shadow: 0 0 8px rgba(167, 139, 250, .8);
  white-space: pre-wrap;
}
.boot pre b { color: #86efac; font-weight: 400; }
.boot pre::after { content: "█"; animation: nl-blink .7s steps(1) infinite; }

@media (max-width: 1100px) { .tech { display: none; } }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .hide-sm, .tech { display: none; }
  .sysbar { padding: 10px 14px; }
  .sys-l, .sys-r { gap: 10px; }
  .stage { padding: 20px 16px 28px; gap: 28px; }
  .core { --cs: 104px; }
  .tagline { gap: 8px; }
  .tagline .rule-l, .tagline .rule-r { width: 30px; }
  .tagline .nl-label { font-size: 8px; letter-spacing: .1em; white-space: nowrap; }
}

/* very narrow screens: keep the system bar on one line with no sideways scroll */
@media (max-width: 380px) {
  .sysbar { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .sys-l .nl-label.faint, #clock, .hide-sm { display: none; }
  .mod { min-width: 0; }
  .rack { grid-template-columns: minmax(0, 1fr); }
}
