  *, *::before, *::after { box-sizing: border-box; }

  html, body { height: 100%; }

  body {
    margin: 0;
    background: #000;
    overflow: hidden;
    font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    color: var(--c);
    --c: #00ff7a;
    --c-soft: rgba(0, 255, 122, .58);
    --c-dim: rgba(0, 255, 122, .18);
    --glow: 0 0 24px rgba(0, 255, 122, .45);
    -webkit-font-smoothing: antialiased;
  }


  /* ── canvas ─────────────────────────────────────────────── */
  #rain { position: fixed; inset: 0; z-index: 0; display: block; background: #000; }

  /* ── CRT overlays ───────────────────────────────────────── */
  .fx { position: fixed; inset: 0; z-index: 2; pointer-events: none; }

  .crt {
    background-image: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .055) 0 1px, transparent 1px 3px);
    opacity: .32;
    mix-blend-mode: screen;
    overflow: hidden;
  }
  .crt::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 22vh;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, .05), transparent);
    animation: sweep 7.5s linear infinite;
  }
  @keyframes sweep { from { transform: translateY(-25vh); } to { transform: translateY(108vh); } }

  .vignette {
    background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(0, 0, 0, .55) 76%, rgba(0, 0, 0, .93) 100%);
  }


  /* ── HUD ────────────────────────────────────────────────── */
  .hud {
    position: fixed; inset: 0 0 auto 0;
    z-index: 4;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(14px, 3vw, 30px);
    font-size: 10.5px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--c-soft);
    pointer-events: none;
    text-shadow: 0 0 12px rgba(0, 0, 0, .9);
    transition: opacity .3s ease;
  }
  .hud .sep { opacity: .35; }
  .brand { color: var(--c); font-weight: 700; letter-spacing: .3em; }
  .led {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--c); box-shadow: 0 0 10px var(--c);
    margin-right: 8px; vertical-align: 1px;
    animation: blink 1.8s steps(1) infinite;
  }
  @keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .15; } }

  /* ── stage ──────────────────────────────────────────────── */
  .stage {
    position: fixed; inset: 0; z-index: 3;
    display: grid; place-items: center;
    padding: clamp(16px, 5vw, 56px);
    pointer-events: none;
  }
  .stage::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 58% 42% at 50% 50%, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .72) 45%, rgba(0, 0, 0, .3) 68%, transparent 82%);
    opacity: 0;
    transition: opacity .9s ease;
    pointer-events: none;
  }
  body.hero-on .stage::before { opacity: 1; }

  /* ── boot terminal ──────────────────────────────────────── */
  .cmd {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 32px));
    border: 1px solid var(--c-dim);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(0, 24, 12, .55), rgba(0, 8, 4, .8));
    box-shadow: 0 30px 90px rgba(0, 0, 0, .85), inset 0 0 70px rgba(0, 255, 122, .05), 0 0 0 1px rgba(0, 0, 0, .6);
    backdrop-filter: blur(3px);
    overflow: hidden;
    pointer-events: auto;
    transition: opacity .5s ease, filter .5s ease, transform .5s ease;
  }
  .cmd.gone {
    opacity: 0;
    visibility: hidden;
    filter: blur(8px);
    transform: translate(-50%, -50%) scale(.96);
    pointer-events: none;
    transition: opacity .5s ease, filter .5s ease, transform .5s ease, visibility 0s .5s;
  }
  .cmd-bar {
    display: flex; align-items: center; gap: 7px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-dim);
    font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
    color: var(--c-soft);
  }
  .cmd-bar .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--c-dim);
    box-shadow: inset 0 0 0 1px var(--c-dim);
  }
  .cmd-bar .dot:first-child { background: var(--c); box-shadow: 0 0 10px var(--c); }
  .cmd-title { margin-left: 8px; opacity: .65; }
  .cmd-body {
    padding: 24px clamp(18px, 3vw, 30px) 28px;
    min-height: 210px;
    font-size: clamp(13px, 2vw, 18px);
    line-height: 1.75;
    color: #d8ffe6;
    text-shadow: 0 0 14px rgba(0, 255, 122, .35);
  }
  .line { white-space: pre-wrap; word-break: break-word; }
  .prompt { color: var(--c-soft); margin-right: 10px; opacity: .75; }
  .caret {
    display: inline-block;
    width: .58em; height: 1.02em;
    margin-left: 2px;
    vertical-align: -.16em;
    background: var(--c);
    box-shadow: 0 0 12px var(--c);
    animation: blink 1s steps(1) infinite;
  }

  /* ── hero ───────────────────────────────────────────────── */
  .hero {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(.985);
    width: min(1000px, calc(100vw - 28px));
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .7s ease, transform .7s ease;
  }
  .hero.in { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }

  .kicker {
    margin: 0 0 18px;
    font-size: 10px; letter-spacing: .45em; text-transform: uppercase;
    color: var(--c-soft);
  }

  .title {
    margin: 0;
    font-size: clamp(34px, 9vw, 100px);
    line-height: .95;
    letter-spacing: -.02em;
    text-transform: uppercase;
    color: #effff5;
    text-shadow: var(--glow), 0 0 2px rgba(255, 255, 255, .9);
  }

  .punch {
    margin: .08em 0 0;
    font-size: clamp(24px, 6.4vw, 66px);
    line-height: 1.05;
    letter-spacing: .04em;
    color: var(--c);
    text-shadow: var(--glow);
  }

  .glitch { position: relative; display: inline-block; }
  .glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute; inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
  }
  .glitch::before { color: #ff2d55; animation: gl-a 4.2s steps(1) infinite; }
  .glitch::after  { color: #2de1ff; animation: gl-b 3.4s steps(1) infinite; }
  .glitch.decoding::before, .glitch.decoding::after { opacity: 0; animation: none; }

  @keyframes gl-a {
    0%, 90%, 100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
    91% { clip-path: inset(8% 0 62% 0); transform: translate(-5px, -1px); }
    93% { clip-path: inset(42% 0 32% 0); transform: translate(5px, 1px); }
    95% { clip-path: inset(72% 0 4% 0);  transform: translate(-3px, 2px); }
    97% { clip-path: inset(24% 0 52% 0); transform: translate(3px, -2px); }
  }
  @keyframes gl-b {
    0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
    89% { clip-path: inset(30% 0 40% 0); transform: translate(4px, 1px); }
    92% { clip-path: inset(62% 0 12% 0); transform: translate(-4px, -2px); }
    96% { clip-path: inset(6% 0 74% 0);  transform: translate(2px, 2px); }
  }

  /* ── misc ───────────────────────────────────────────────── */
  .flash-msg {
    position: fixed; left: 50%; top: 50%;
    z-index: 7;
    transform: translate(-50%, -50%);
    font-size: clamp(18px, 4.4vw, 44px);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 30px var(--c), 0 0 80px var(--c);
    pointer-events: none;
    white-space: nowrap;
    animation: flashpop 2.6s ease forwards;
  }
  @keyframes flashpop {
    0%   { opacity: 0; filter: blur(14px); transform: translate(-50%, -50%) scale(.92); }
    12%  { opacity: 1; filter: blur(0);   transform: translate(-50%, -50%) scale(1); }
    75%  { opacity: 1; }
    100% { opacity: 0; filter: blur(6px); transform: translate(-50%, -50%) scale(1.05); }
  }

  .stage.glitch-out { animation: shake .1s linear 3; }
  .stage.glitch-out .cmd { filter: invert(1) hue-rotate(90deg) blur(1px); }
  @keyframes shake {
    0%, 100% { transform: translate(0); }
    25% { transform: translate(-4px, 2px); }
    50% { transform: translate(4px, -3px); }
    75% { transform: translate(-2px, -1px); }
  }


  @media (max-width: 620px) {
    .hud { font-size: 9px; letter-spacing: .16em; }
    .hud .hide-sm { display: none; }
  }


  @media (prefers-reduced-motion: reduce) {
    .crt::after, .led, .caret { animation: none; }
    .glitch::before, .glitch::after { animation: none; opacity: .35; }
  }

.noscript-message {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: #0f0;
  background: #000;
  z-index: 9;
  margin: 0;
}
