/* ═══════════════════════════════════════════════════════════════
   PROJECT CHIMERA — NEO NOIR GLITCHWAVE
   palette: void #05060F / cyan #00F0FF / magenta #FF2BD6 / green #39FF14
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #05060F;
  --bg-2: #0A0D1F;
  --bg-3: #10142B;
  --cyan: #00F0FF;
  --pink: #FF2BD6;
  --green: #39FF14;
  --yellow: #FFE600;
  --text: #D7E4F2;
  --text-dim: #8B9BB4;
  --line: rgba(0, 240, 255, 0.18);
  --line-strong: rgba(0, 240, 255, 0.45);
  --font-display: "Orbitron", "Noto Sans JP", sans-serif;
  --font-tech: "Rajdhani", "Noto Sans JP", sans-serif;
  --font-mono: "Share Tech Mono", "Noto Sans JP", monospace;
  --font-jp: "Noto Sans JP", sans-serif;
  --glow-cyan: 0 0 8px rgba(0, 240, 255, .8), 0 0 24px rgba(0, 240, 255, .45);
  --glow-pink: 0 0 8px rgba(255, 43, 214, .8), 0 0 24px rgba(255, 43, 214, .45);
  --header-h: 76px;
}

/* ── reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.9;
  overflow-x: hidden;
  min-height: 100vh;
}
body.is-booting { overflow: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--pink); color: #05060F; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--cyan), var(--pink)); border-radius: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 3000;
  padding: 10px 18px; background: var(--cyan); color: #05060F;
  font-family: var(--font-mono); transition: top .2s;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

.accent-cyan  { color: var(--cyan);  text-shadow: var(--glow-cyan); }
.accent-pink  { color: var(--pink);  text-shadow: var(--glow-pink); }
.accent-green { color: var(--green); text-shadow: 0 0 8px rgba(57,255,20,.7); }

/* ── ambient layers ────────────────────────────────── */
#particle-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.grid-floor {
  position: fixed; left: -25vw; right: -25vw; bottom: -12vh; height: 46vh;
  z-index: 0; pointer-events: none; opacity: .35;
  background:
    linear-gradient(transparent 0%, rgba(0,240,255,.12) 100%),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 48px);
  transform: perspective(420px) rotateX(62deg);
  transform-origin: bottom center;
  animation: gridScroll 9s linear infinite;
  mask-image: linear-gradient(to top, #000 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent 100%);
}
@keyframes gridScroll {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: 0 0, 0 0, 0 48px; }
}
.scanlines {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.scanlines::after {
  content: ""; position: absolute; left: 0; right: 0; height: 120px; top: -140px;
  background: linear-gradient(to bottom, transparent, rgba(0,240,255,.05), transparent);
  animation: scanSweep 7s linear infinite;
}
@keyframes scanSweep { to { transform: translateY(calc(100vh + 280px)); } }
.noise {
  position: fixed; inset: -50%; z-index: 91; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseShift .45s steps(4) infinite;
}
@keyframes noiseShift {
  0% { transform: translate(0,0); } 25% { transform: translate(-2%,1%); }
  50% { transform: translate(1%,-2%); } 75% { transform: translate(-1%,2%); }
  100% { transform: translate(2%,-1%); }
}
.vignette {
  position: fixed; inset: 0; z-index: 89; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(2,3,10,.75) 100%);
}
#cursor-glow {
  position: fixed; width: 340px; height: 340px; z-index: 1; pointer-events: none;
  left: 0; top: 0; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0,240,255,.07) 0%, rgba(255,43,214,.04) 40%, transparent 70%);
  opacity: 0; transition: opacity .4s;
}
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  z-index: 1200; background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: var(--glow-cyan);
}

/* ── boot loader ───────────────────────────────────── */
#boot-loader {
  position: fixed; inset: 0; z-index: 2000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s, visibility .6s;
}
#boot-loader.done { opacity: 0; visibility: hidden; }
.boot-frame {
  width: min(560px, 88vw);
  border: 1px solid var(--line-strong);
  background: rgba(5, 8, 20, .9);
  box-shadow: 0 0 40px rgba(0,240,255,.12), inset 0 0 60px rgba(0,240,255,.04);
  padding: 22px 26px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.boot-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-display); font-size: 15px; letter-spacing: .18em;
  color: var(--cyan); text-shadow: var(--glow-cyan);
  border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px;
}
.boot-logo-accent { color: var(--pink); }
.boot-ver { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.boot-log {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75;
  color: var(--green); min-height: 172px; white-space: pre-wrap; word-break: break-all;
}
.boot-bar {
  height: 10px; border: 1px solid var(--line-strong); margin-top: 14px; padding: 2px;
}
.boot-bar-fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, var(--cyan) 0 6px, transparent 6px 9px);
  box-shadow: var(--glow-cyan); transition: width .15s linear;
}
.boot-foot {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
}
#boot-skip { color: var(--text-dim); letter-spacing: .12em; }
#boot-skip:hover, #boot-skip:focus-visible { color: var(--cyan); text-shadow: var(--glow-cyan); }

/* ── HUD header ────────────────────────────────────── */
.hud-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(to bottom, rgba(5,6,15,.92), rgba(5,6,15,.78));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform .5s ease;
}
body.booted .hud-header { transform: translateY(0); }
.hud-inner {
  max-width: 1280px; margin: 0 auto; height: 56px;
  display: flex; align-items: center; gap: 24px; padding: 0 22px;
}
.hud-brand {
  display: flex; align-items: center; gap: 10px; color: var(--cyan);
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .14em;
}
.brand-mark { filter: drop-shadow(0 0 6px rgba(0,240,255,.7)); }
.brand-accent { color: var(--pink); }
.hud-nav { display: flex; gap: 4px; margin-left: auto; }
.hud-link {
  position: relative; font-family: var(--font-mono); font-size: 13px;
  letter-spacing: .12em; color: var(--text-dim); padding: 8px 14px;
  transition: color .2s, text-shadow .2s;
}
.hud-idx { color: var(--pink); font-size: 10px; margin-right: 6px; opacity: .8; }
.hud-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 1px;
  background: var(--cyan); transform: scaleX(0); transform-origin: left;
  transition: transform .25s; box-shadow: var(--glow-cyan);
}
.hud-link:hover, .hud-link:focus-visible, .hud-link.active { color: var(--cyan); text-shadow: var(--glow-cyan); }
.hud-link:hover::after, .hud-link.active::after { transform: scaleX(1); }
.hud-link--cta {
  border: 1px solid var(--pink); color: var(--pink); margin-left: 10px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.hud-link--cta:hover { background: rgba(255,43,214,.12); text-shadow: var(--glow-pink); }
.hud-link--cta::after { display: none; }
.hud-tools { display: flex; gap: 10px; align-items: center; }
.hud-tool {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  border: 1px solid var(--line); padding: 6px 10px; color: var(--text-dim);
  display: flex; gap: 6px; align-items: center;
}
.hud-tool:hover { border-color: var(--line-strong); color: var(--cyan); }
.sfx-state { color: var(--pink); }
#sfx-toggle[aria-pressed="true"] .sfx-state { color: var(--green); text-shadow: 0 0 8px rgba(57,255,20,.8); }
.nav-toggle { display: none; flex-direction: column; gap: 4px; padding: 9px 8px; }
.nav-toggle-bar { width: 20px; height: 2px; background: var(--cyan); box-shadow: var(--glow-cyan); transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.hud-statusline {
  display: flex; gap: 12px; align-items: center; justify-content: flex-end;
  max-width: 1280px; margin: 0 auto; padding: 3px 22px 5px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em;
  color: rgba(139,155,180,.75); border-top: 1px dashed rgba(0,240,255,.1);
}
.hud-sep { opacity: .35; }
.sig-dot {
  display: inline-block; width: 4px; height: 8px; margin-left: 2px;
  background: var(--green); box-shadow: 0 0 5px rgba(57,255,20,.8);
  animation: sigPulse 1.6s ease-in-out infinite;
}
.sig-dot:nth-child(2) { animation-delay: .2s; } .sig-dot:nth-child(3) { animation-delay: .4s; }
.sig-dim { background: var(--text-dim); box-shadow: none; animation: none; opacity: .4; }
@keyframes sigPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ── sections base ─────────────────────────────────── */
main { position: relative; z-index: 2; }
.section {
  max-width: 1200px; margin: 0 auto; padding: 110px 24px;
  position: relative;
}
.section-full { min-height: 100svh; }
.sec-head { margin-bottom: 56px; }
.sec-code {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .28em;
  color: var(--pink); display: block; margin-bottom: 12px;
}
.sec-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(26px, 4.2vw, 44px); letter-spacing: .06em;
  color: #fff; line-height: 1.4;
}
.sec-rule { margin-top: 18px; height: 1px; background: var(--line); position: relative; }
.sec-rule i {
  position: absolute; left: 0; top: -2px; width: 120px; height: 5px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  box-shadow: var(--glow-cyan);
}

/* ── glitch text ───────────────────────────────────── */
.glitch, .glitch-sub { position: relative; display: inline-block; }
.glitch::before, .glitch::after,
.glitch-sub::before, .glitch-sub::after {
  content: attr(data-text);
  position: absolute; inset: 0; overflow: hidden;
  clip-path: inset(0 0 100% 0); opacity: 0; pointer-events: none;
}
.glitch::before, .glitch-sub::before { color: var(--cyan); z-index: -1; }
.glitch::after, .glitch-sub::after { color: var(--pink); z-index: -2; }
.glitch::before { animation: glitchA 3.4s infinite steps(1); }
.glitch::after  { animation: glitchB 3.4s infinite steps(1); }
.glitch-sub::before { animation: glitchA 5.2s infinite steps(1); }
.glitch-sub::after  { animation: glitchB 5.2s infinite steps(1); }
@keyframes glitchA {
  0%, 91%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: none; }
  92% { opacity: .9; clip-path: inset(12% 0 58% 0); transform: translate(-6px, -2px); }
  94% { opacity: .9; clip-path: inset(62% 0 8% 0);  transform: translate(5px, 1px); }
  96% { opacity: .9; clip-path: inset(30% 0 42% 0); transform: translate(-3px, 0); }
  98% { opacity: 0; }
}
@keyframes glitchB {
  0%, 91%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: none; }
  93% { opacity: .9; clip-path: inset(70% 0 4% 0);  transform: translate(6px, 2px); }
  95% { opacity: .9; clip-path: inset(8% 0 74% 0);  transform: translate(-5px, -1px); }
  97% { opacity: .9; clip-path: inset(45% 0 30% 0); transform: translate(4px, 1px); }
  99% { opacity: 0; }
}
/* JS-triggered burst */
.glitching::before { animation: glitchA .35s steps(1) 2 !important; }
.glitching::after  { animation: glitchB .35s steps(1) 2 !important; }

/* ── reveal on scroll ──────────────────────────────── */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s ease, transform .8s cubic-bezier(.16,1,.3,1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }

/* ── hero ──────────────────────────────────────────── */
.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: calc(var(--header-h) + 40px) 24px 80px;
  position: relative;
}
.hero-frame { position: absolute; inset: calc(var(--header-h) + 14px) 20px 20px; pointer-events: none; }
.corner { position: absolute; width: 34px; height: 34px; border: 2px solid var(--line-strong); }
.corner-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.corner-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.corner-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.corner-br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.hero-warning {
  font-family: var(--font-mono); font-size: clamp(11px, 1.5vw, 14px);
  letter-spacing: .22em; color: var(--yellow);
  border: 1px solid rgba(255,230,0,.4); padding: 8px 20px; margin-bottom: 34px;
  background: repeating-linear-gradient(-45deg, rgba(255,230,0,.06) 0 10px, transparent 10px 20px);
  animation: warnBlink 2.6s ease-in-out infinite;
}
.warn-icon { font-size: .8em; margin: 0 6px; }
@keyframes warnBlink { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.hero-title {
  font-family: var(--font-jp); font-weight: 900;
  font-size: clamp(38px, 8.4vw, 96px); line-height: 1.25; letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 0 14px rgba(0,240,255,.55), 0 0 60px rgba(255,43,214,.3);
}
.hero-sub {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(15px, 2.4vw, 24px); letter-spacing: .34em;
  color: var(--text-dim); margin-top: 22px;
}
.hero-lead {
  font-family: var(--font-mono); font-size: clamp(13px, 1.8vw, 17px);
  color: var(--text); margin-top: 26px; min-height: 1.9em; letter-spacing: .06em;
}
.type-caret { color: var(--green); animation: caretBlink .9s steps(1) infinite; }
@keyframes caretBlink { 50% { opacity: 0; } }
.hero-cta { display: flex; gap: 22px; margin-top: 44px; flex-wrap: wrap; justify-content: center; }

/* ── buttons ───────────────────────────────────────── */
.btn {
  position: relative; display: inline-block;
  font-family: var(--font-tech); font-weight: 700; font-size: 17px;
  letter-spacing: .14em; padding: 16px 36px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  transition: transform .15s, box-shadow .25s, background .25s, color .25s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(120deg, rgba(0,240,255,.16), rgba(255,43,214,.16));
  border: 1px solid var(--cyan); color: #fff;
  box-shadow: 0 0 18px rgba(0,240,255,.25), inset 0 0 18px rgba(0,240,255,.08);
  text-shadow: var(--glow-cyan);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: linear-gradient(120deg, rgba(0,240,255,.32), rgba(255,43,214,.32));
  box-shadow: 0 0 34px rgba(0,240,255,.55), inset 0 0 26px rgba(0,240,255,.15);
  transform: translateY(-2px);
}
.btn-ghost {
  border: 1px solid var(--line-strong); color: var(--text-dim);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  color: var(--pink); border-color: var(--pink);
  box-shadow: 0 0 24px rgba(255,43,214,.35); text-shadow: var(--glow-pink);
  transform: translateY(-2px);
}
.btn-slash { color: var(--pink); }
.btn-glitch::before, .btn-glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  clip-path: inset(0 0 100% 0); opacity: 0; pointer-events: none;
}
.btn-glitch::before { color: var(--cyan); }
.btn-glitch::after { color: var(--pink); }
.btn-glitch:hover::before { animation: glitchA .5s steps(1) infinite; }
.btn-glitch:hover::after { animation: glitchB .5s steps(1) infinite; }

/* ── hero stats ────────────────────────────────────── */
.hero-stats {
  display: flex; gap: clamp(20px, 5vw, 64px); margin-top: 64px; flex-wrap: wrap; justify-content: center;
}
.stat { display: flex; flex-direction: column; align-items: center; min-width: 96px; }
.stat-num {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3.4vw, 36px);
  color: var(--cyan); text-shadow: var(--glow-cyan); line-height: 1.2;
}
.stat-unit { font-family: var(--font-mono); font-size: 12px; color: var(--pink); }
.stat-label { font-size: 12px; color: var(--text-dim); letter-spacing: .18em; margin-top: 4px; }
.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .3em; color: var(--text-dim);
}
.scroll-hint:hover { color: var(--cyan); }
.scroll-hint-line { width: 1px; height: 44px; background: linear-gradient(var(--cyan), transparent); position: relative; overflow: hidden; }
.scroll-hint-line::after {
  content: ""; position: absolute; top: -12px; left: 0; width: 1px; height: 12px;
  background: #fff; box-shadow: var(--glow-cyan); animation: hintDrop 1.8s ease-in infinite;
}
@keyframes hintDrop { to { transform: translateY(60px); } }

/* ── genesis ───────────────────────────────────────── */
.genesis-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: start; }
.genesis-copy p { margin-bottom: 22px; color: var(--text); }
.genesis-copy p:first-child::first-letter { color: var(--cyan); font-size: 1.4em; font-weight: 900; }
.genesis-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  color: var(--yellow); border: 1px dashed rgba(255,230,0,.45); padding: 5px 12px;
}
.terminal {
  border: 1px solid var(--line-strong); background: rgba(4,7,16,.92);
  box-shadow: 0 0 40px rgba(0,240,255,.1), inset 0 0 40px rgba(0,0,0,.5);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: rgba(0,240,255,.05);
}
.t-dot { width: 9px; height: 9px; border-radius: 50%; }
.t-red { background: #FF3B5C; } .t-yellow { background: var(--yellow); } .t-green { background: var(--green); }
.terminal-title { margin-left: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); letter-spacing: .1em; }
.terminal-body {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.85;
  padding: 18px; min-height: 300px; color: var(--text-dim); white-space: pre-wrap; word-break: break-all;
}
.terminal-body .t-err { color: #FF3B5C; }
.terminal-body .t-warn { color: var(--yellow); }
.terminal-body .t-ok { color: var(--green); }
.terminal-body .t-cy { color: var(--cyan); }

/* ── module cards ──────────────────────────────────── */
.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.mod-card {
  position: relative; border: 1px solid var(--line); padding: 30px 24px 26px;
  background: linear-gradient(160deg, rgba(10,13,31,.9), rgba(5,6,15,.9));
  transition: border-color .3s, box-shadow .3s, transform .2s;
  transform-style: preserve-3d; will-change: transform;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.mod-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(0,240,255,.12), transparent 60%);
  transition: opacity .3s;
}
.mod-card:hover { border-color: var(--line-strong); box-shadow: 0 0 34px rgba(0,240,255,.18); }
.mod-card:hover::before { opacity: 1; }
.mod-icon { width: 52px; height: 52px; color: var(--cyan); margin-bottom: 18px; filter: drop-shadow(0 0 8px rgba(0,240,255,.5)); }
.mod-card:hover .mod-icon { animation: iconJitter .4s steps(2) 1; }
@keyframes iconJitter { 25% { transform: translate(-2px,1px); } 75% { transform: translate(2px,-1px); } }
.mod-index { font-family: var(--font-mono); font-size: 10px; letter-spacing: .26em; color: var(--pink); display: block; margin-bottom: 8px; }
.mod-title { font-family: var(--font-jp); font-weight: 700; font-size: 18px; color: #fff; line-height: 1.5; }
.mod-sub { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 11px; color: var(--cyan); letter-spacing: .08em; margin-top: 4px; }
.mod-desc { font-size: 13.5px; color: var(--text-dim); margin-top: 14px; line-height: 1.95; }
.mod-meter { height: 3px; background: rgba(0,240,255,.12); margin-top: 20px; }
.mod-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: var(--glow-cyan); transition: width 1.2s cubic-bezier(.16,1,.3,1) .3s; }
.mod-card.visible .mod-meter i { width: var(--w); }

/* ── architecture ──────────────────────────────────── */
.arch-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.arch-diagram { display: flex; flex-direction: column; align-items: stretch; }
.arch-node {
  border: 1px solid var(--line-strong); padding: 18px 22px;
  background: rgba(10,13,31,.85); display: flex; flex-direction: column; gap: 2px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: box-shadow .3s;
}
.arch-node:hover { box-shadow: 0 0 26px rgba(0,240,255,.25); }
.arch-node--core { border-color: var(--pink); box-shadow: 0 0 26px rgba(255,43,214,.2); }
.arch-node-code { font-family: var(--font-mono); font-size: 10px; letter-spacing: .26em; color: var(--pink); }
.arch-node-name { font-weight: 700; font-size: 17px; color: #fff; }
.arch-node-en { font-family: var(--font-mono); font-size: 11px; color: var(--cyan); letter-spacing: .12em; }
.arch-wire { height: 34px; display: flex; justify-content: center; position: relative; }
.arch-wire::before { content: ""; width: 1px; height: 100%; background: var(--line-strong); }
.arch-wire i {
  position: absolute; top: 0; left: 50%; width: 5px; height: 5px; margin-left: -2px;
  background: var(--green); border-radius: 50%; box-shadow: 0 0 8px rgba(57,255,20,.9);
  animation: wireFlow 1.6s linear infinite;
}
@keyframes wireFlow { from { transform: translateY(0); opacity: 1; } to { transform: translateY(30px); opacity: 0; } }
.arch-panels { display: flex; flex-direction: column; gap: 12px; }
.panel { border: 1px solid var(--line); background: rgba(10,13,31,.7); }
.panel-head {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; transition: background .25s;
}
.panel-head:hover { background: rgba(0,240,255,.06); }
.panel-id { font-family: var(--font-mono); font-size: 11px; color: var(--pink); letter-spacing: .1em; flex-shrink: 0; }
.panel-title { font-size: 14.5px; font-weight: 500; color: var(--text); flex: 1; }
.panel-chevron { font-family: var(--font-mono); color: var(--cyan); transition: transform .3s; flex-shrink: 0; }
.panel-head[aria-expanded="true"] .panel-chevron { transform: rotate(45deg); }
.panel-head[aria-expanded="true"] .panel-title { color: var(--cyan); }
.panel-body {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s cubic-bezier(.16,1,.3,1);
}
.panel-body > p {
  overflow: hidden; font-size: 13.5px; color: var(--text-dim);
  padding: 0 18px; line-height: 2;
}
.panel-head[aria-expanded="true"] + .panel-body { grid-template-rows: 1fr; }
.panel-head[aria-expanded="true"] + .panel-body > p { padding: 0 18px 18px; }

/* ── timeline ──────────────────────────────────────── */
.timeline { list-style: none; position: relative; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 1px;
  background: linear-gradient(var(--cyan), var(--pink), transparent);
  box-shadow: var(--glow-cyan);
}
.tl-item { position: relative; padding-bottom: 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-node {
  position: absolute; left: -34px; top: 8px; width: 17px; height: 17px;
  border: 2px solid var(--cyan); background: var(--bg); transform: rotate(45deg);
  box-shadow: var(--glow-cyan);
}
.tl-item:first-child .tl-node { border-color: var(--green); box-shadow: 0 0 12px rgba(57,255,20,.8); animation: nodePulse 2s ease-in-out infinite; }
@keyframes nodePulse { 50% { box-shadow: 0 0 22px rgba(57,255,20,1); } }
.tl-card {
  border: 1px solid var(--line); background: rgba(10,13,31,.75);
  padding: 22px 26px; margin-left: 12px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: border-color .3s, box-shadow .3s;
}
.tl-card:hover { border-color: var(--line-strong); box-shadow: 0 0 26px rgba(0,240,255,.15); }
.tl-phase { font-family: var(--font-mono); font-size: 11px; letter-spacing: .24em; color: var(--pink); }
.tl-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-left: 16px; }
.tl-title { font-size: 19px; font-weight: 700; color: #fff; margin: 8px 0 6px; }
.tl-card p { font-size: 13.5px; color: var(--text-dim); }
.tl-status { display: inline-block; margin-top: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; color: var(--text-dim); }
.tl-status--live { color: var(--green); text-shadow: 0 0 8px rgba(57,255,20,.7); }
.tl-status--unknown { color: var(--pink); text-shadow: var(--glow-pink); }

/* ── connect / CTA ─────────────────────────────────── */
.section-connect { padding-bottom: 140px; }
.connect-frame {
  position: relative; text-align: center; padding: clamp(40px, 7vw, 80px) clamp(20px, 5vw, 70px);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,43,214,.08), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(0,240,255,.08), transparent 60%),
    rgba(6,8,20,.9);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
  box-shadow: 0 0 60px rgba(0,240,255,.1);
}
.connect-frame .sec-title { font-size: clamp(30px, 5vw, 52px); margin: 14px 0 20px; }
.connect-lead { color: var(--text-dim); max-width: 620px; margin: 0 auto; font-size: 15px; }
.countdown { margin: 44px auto 8px; }
.cd-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .3em; color: var(--yellow); display: block; margin-bottom: 16px; }
.cd-grid { display: flex; justify-content: center; align-items: center; gap: 10px; }
.cd-cell {
  display: flex; flex-direction: column; align-items: center; min-width: 78px;
  border: 1px solid var(--line); padding: 14px 10px 10px; background: rgba(0,0,0,.4);
}
.cd-num {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4.6vw, 42px);
  color: var(--cyan); text-shadow: var(--glow-cyan); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-unit { font-family: var(--font-mono); font-size: 10px; letter-spacing: .24em; color: var(--text-dim); margin-top: 8px; }
.cd-colon { font-family: var(--font-display); font-size: 28px; color: var(--pink); animation: caretBlink 1s steps(1) infinite; }
.register-form {
  display: flex; gap: 14px; justify-content: center; align-items: stretch;
  margin-top: 40px; flex-wrap: wrap;
}
.input-shell {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 260px; max-width: 420px;
  border: 1px solid var(--line-strong); background: rgba(0,0,0,.5); padding: 0 16px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: box-shadow .25s, border-color .25s;
}
.input-shell:focus-within { border-color: var(--cyan); box-shadow: 0 0 22px rgba(0,240,255,.3); }
.input-prefix { font-family: var(--font-mono); color: var(--green); }
#reg-email {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--font-mono); font-size: 15px; color: var(--text);
  padding: 15px 0; letter-spacing: .04em;
}
#reg-email::placeholder { color: rgba(139,155,180,.5); }
.form-msg { min-height: 1.8em; margin-top: 16px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; }
.form-msg.ok { color: var(--green); text-shadow: 0 0 8px rgba(57,255,20,.6); }
.form-msg.err { color: #FF3B5C; }
.connect-note { margin-top: 10px; font-size: 12px; color: rgba(139,155,180,.7); }
.register-form.success .input-shell, .register-form.success .btn { opacity: .45; pointer-events: none; }

/* ── footer ────────────────────────────────────────── */
.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); background: rgba(4,5,13,.94); }
.footer-grid {
  max-width: 1200px; margin: 0 auto; padding: 56px 24px 40px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand .brand-text { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--cyan); letter-spacing: .14em; text-shadow: var(--glow-cyan); }
.footer-tagline { font-size: 12.5px; color: var(--text-dim); margin-top: 12px; }
.barcode {
  margin-top: 18px; height: 30px; width: 150px; opacity: .55;
  background: repeating-linear-gradient(90deg,
    var(--text) 0 2px, transparent 2px 5px, var(--text) 5px 6px, transparent 6px 11px,
    var(--text) 11px 14px, transparent 14px 16px, var(--text) 16px 17px, transparent 17px 22px);
}
.footer-head { font-family: var(--font-mono); font-size: 11px; letter-spacing: .26em; color: var(--pink); display: block; margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); transition: color .2s, text-shadow .2s, transform .2s; width: fit-content; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--cyan); text-shadow: var(--glow-cyan); transform: translateX(4px); }
.footer-contact p { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); line-height: 2; }
.footer-bottom {
  border-top: 1px dashed rgba(0,240,255,.12);
  max-width: 1200px; margin: 0 auto; padding: 18px 24px 26px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; color: rgba(139,155,180,.7);
}

/* ── responsive ────────────────────────────────────── */
@media (max-width: 1080px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .arch-grid { grid-template-columns: 1fr; gap: 44px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  :root { --header-h: 60px; }
  .hud-statusline { display: none; }
  .nav-toggle { display: flex; }
  .hud-nav {
    position: fixed; top: 56px; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    background: rgba(4,6,15,.97); border-bottom: 1px solid var(--line-strong);
    padding: 10px 0 16px;
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path .35s cubic-bezier(.16,1,.3,1), visibility .35s;
  }
  .hud-nav.open { clip-path: inset(0 0 0 0); visibility: visible; }
  .hud-link { padding: 14px 26px; font-size: 15px; }
  .hud-link--cta { margin: 12px 26px 0; text-align: center; }
  .genesis-grid { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 80px 20px; }
}
@media (max-width: 560px) {
  .module-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; text-align: center; }
  .hero-stats { gap: 22px; }
  .stat { min-width: 72px; }
  .cd-cell { min-width: 62px; padding: 10px 6px 8px; }
  .cd-colon { font-size: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; }
  .register-form .btn { width: 100%; }
  .input-shell { max-width: none; }
}

/* ── reduced motion ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .grid-floor, .noise, .scanlines::after { animation: none !important; }
  #cursor-glow { display: none; }
  .mod-card.visible .mod-meter i { width: var(--w); }
}
