:root {
  --bg: #030806;
  --ink: #e8f3ee;
  --muted: #5f7c70;
  --brand: #038d4f;
  --accent: #2fd17f;
  --mint: #b0d9d1;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgb(47 209 127 / .35); }

/* Background layers */
#rain { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .55; }
.term {
  position: fixed; inset: 0; padding: 4.5rem 2.5rem;
  font-size: 12px; line-height: 1.65; color: var(--accent);
  opacity: .16; white-space: pre; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}
.term .ok { color: var(--mint); }
.term .warn { color: #f5c35b; }
.term .bad { color: #f87171; }
.term .cmd { color: var(--ink); }
.grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgb(47 209 127 / .05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(47 209 127 / .05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
          mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}
.vignette {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 50%, rgb(3 141 79 / .22), transparent 70%),
    radial-gradient(ellipse at center, transparent 40%, rgb(0 0 0 / .85) 100%);
}
.scanlines {
  position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / .45) 0 1px, transparent 1px 3px);
  animation: flicker 6s infinite steps(1);
}
@keyframes flicker { 0%, 96%, 100% { opacity: .35; } 97% { opacity: .55; } 98% { opacity: .25; } }

/* Center brand */
.center { position: fixed; inset: 0; display: grid; place-items: center; z-index: 5; pointer-events: none; }
.center::before {
  content: ''; position: absolute; width: min(1100px, 92vw); height: min(340px, 40vh);
  background: radial-gradient(ellipse at center, rgb(3 8 6 / .92) 0%, rgb(3 8 6 / .7) 45%, transparent 72%);
}
.brand {
  position: relative;
  font-family: 'Sora', 'JetBrains Mono', sans-serif; font-weight: 800;
  font-size: clamp(2rem, 7.6vw, 7.25rem);
  letter-spacing: .14em; padding-left: .14em;
  line-height: 1; white-space: nowrap;
  /* Solid brand green with "matrix" data lines streaming down inside the letters (brand-flow)
     and a periodic CRT wash-out surge (brand-wash). Both are animated, not a static gradient. */
  background:
    repeating-linear-gradient(90deg, transparent 0 11px, rgb(2 60 34 / .22) 11px 12px),
    repeating-linear-gradient(180deg, transparent 0 7px, rgb(214 255 233 / .55) 7px 8px, transparent 8px 13px, rgb(3 141 79 / .55) 13px 14px, transparent 14px 26px),
    var(--accent);
  background-size: 12px 100%, 100% 26px, 100% 100%;
  animation: brand-flow 1.1s linear infinite, brand-wash 7s ease-in-out infinite;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgb(47 209 127 / .35)) drop-shadow(0 0 60px rgb(3 141 79 / .35));
}
@keyframes brand-flow { to { background-position: 0 0, 0 26px, 0 0; } }
@keyframes brand-wash {
  0%, 68%, 100% { filter: drop-shadow(0 0 18px rgb(47 209 127 / .35)) drop-shadow(0 0 60px rgb(3 141 79 / .35)); }
  74% { filter: brightness(1.9) saturate(.35) drop-shadow(0 0 26px rgb(176 217 209 / .8)) drop-shadow(0 0 80px rgb(47 209 127 / .6)); }
  76% { filter: brightness(1.1) saturate(.9) drop-shadow(0 0 18px rgb(47 209 127 / .45)) drop-shadow(0 0 60px rgb(3 141 79 / .35)); }
  78% { filter: brightness(1.7) saturate(.4) drop-shadow(0 0 24px rgb(176 217 209 / .7)) drop-shadow(0 0 70px rgb(47 209 127 / .5)); }
  86% { filter: brightness(1) saturate(1) drop-shadow(0 0 18px rgb(47 209 127 / .35)) drop-shadow(0 0 60px rgb(3 141 79 / .35)); }
}
.brand::before, .brand::after {
  content: attr(data-text); position: absolute; left: .14em; top: 0;
  background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0;
}
.brand.glitch::before { opacity: .8; transform: translate(-3px, 0); clip-path: inset(10% 0 55% 0); filter: hue-rotate(-40deg); animation: g1 .35s steps(2) 1; }
.brand.glitch::after { opacity: .8; transform: translate(3px, 0); clip-path: inset(60% 0 8% 0); filter: hue-rotate(60deg); animation: g2 .35s steps(2) 1; }
@keyframes g1 { 0% { clip-path: inset(15% 0 60% 0); } 50% { clip-path: inset(40% 0 30% 0); transform: translate(-6px, 1px); } 100% { clip-path: inset(70% 0 5% 0); } }
@keyframes g2 { 0% { clip-path: inset(65% 0 10% 0); } 50% { clip-path: inset(20% 0 55% 0); transform: translate(5px, -1px); } 100% { clip-path: inset(5% 0 80% 0); } }
.caret {
  position: absolute; left: 100%; top: .09em; width: .09em; height: .82em; margin-left: -.04em;
  background: var(--accent); box-shadow: 0 0 14px var(--accent);
  animation: blink 1.05s steps(1) infinite;
  -webkit-text-fill-color: initial;
}
@keyframes blink { 50% { opacity: 0; } }

/* HUD */
.hud {
  position: fixed; z-index: 6; font-size: 11px; letter-spacing: .18em;
  color: var(--muted); text-transform: uppercase; display: flex; align-items: center; gap: .6rem;
}
.hud-tl { top: 1.6rem; left: 2rem; } .hud-tr { top: 1.6rem; right: 2rem; }
.hud-bl { bottom: 1.6rem; left: 2rem; } .hud-br { bottom: 1.6rem; right: 2rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.corner { position: fixed; z-index: 6; width: 22px; height: 22px; border-color: rgb(47 209 127 / .45); border-style: solid; }
.c1 { top: .8rem; left: .8rem; border-width: 1px 0 0 1px; } .c2 { top: .8rem; right: .8rem; border-width: 1px 1px 0 0; }
.c3 { bottom: .8rem; left: .8rem; border-width: 0 0 1px 1px; } .c4 { bottom: .8rem; right: .8rem; border-width: 0 1px 1px 0; }

@media (max-width: 640px) {
  .term { font-size: 10px; padding: 3.5rem 1rem; }
  .hud { font-size: 9px; letter-spacing: .12em; }
  .hud-tl, .hud-bl { left: 1.2rem; } .hud-tr, .hud-br { right: 1.2rem; }
  .hud-bl, .hud-br { bottom: 1.2rem; } .hud-tl, .hud-tr { top: 1.2rem; }
  .hud-br { display: none; }
  .brand { font-size: 10.2vw; letter-spacing: .1em; padding-left: .1em; }
  .brand::before, .brand::after { left: .1em; }
}
@media (prefers-reduced-motion: reduce) {
  .scanlines, .caret, .dot, .brand { animation: none; }
}

/* Code-rain fill inside the letters (public/js/brand-fill.js). The canvas sits exactly on top of the
   <h1> (same grid cell, centered); the <h1> keeps the layout, the caret and screen-reader text. */
.center > .brand, .center > .brand-canvas { grid-area: 1 / 1; }
.brand-canvas { position: relative; pointer-events: none; animation: brand-wash 7s ease-in-out infinite; }
.brand.has-fill { background: none; color: transparent; -webkit-text-fill-color: transparent; animation: none; filter: none; }
.brand.has-fill::before, .brand.has-fill::after { display: none; }
.brand.has-fill.glitch + .brand-canvas { animation: canvas-glitch .35s steps(2) 1, brand-wash 7s ease-in-out infinite; }
@keyframes canvas-glitch {
  0% { transform: translate(-4px, 0); clip-path: inset(0 0 55% 0); }
  50% { transform: translate(5px, 1px); clip-path: inset(40% 0 0 0); }
  100% { transform: none; clip-path: none; }
}
@media (prefers-reduced-motion: reduce) { .brand-canvas { animation: none; } }
