:root {
  --void: #020101;
  --void2: #070303;
  --panel: rgba(6, 2, 2, .9);
  --red: #ff2424;
  --red-deep: #9d0808;
  --ember: #ff6a3d;
  --bone: #f6e9e6;
  --ash: #7c5350;
  --line: rgba(255, 46, 46, .20);
  --glow: rgba(255, 30, 30, .6);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Anton", "JetBrains Mono", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; position: fixed; inset: 0;
  width: 100%; height: 100%; overflow: hidden;
  overscroll-behavior: none;
  background: var(--void); color: var(--bone);
  font-family: var(--mono); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 3D canvas */
#bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; display: block;
}

/* Static red atmosphere */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 18%, rgba(255, 25, 25, .08), transparent 55%),
    radial-gradient(140% 120% at 50% 120%, rgba(120, 6, 6, .25), transparent 60%);
}

/* Card */
#card {
  position: fixed; inset: 0; z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow: auto;
  padding: clamp(16px, 5vh, 56px) 20px;
}

.term {
  width: min(600px, 100%);
  display: flex; flex-direction: column; gap: 22px;
  padding: clamp(24px, 3.5vw, 42px);
  background: linear-gradient(180deg, rgba(9, 3, 3, .9), rgba(2, 1, 1, .94));
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(0,0,0,.85), 0 50px 140px rgba(0,0,0,.92),
              inset 0 0 90px rgba(255,20,20,.04);
  position: relative;
  animation: boot-in .9s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes boot-in {
  from { opacity: 0; transform: translateY(14px) scale(.99); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* Rail */
.rail {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 4px;
  font-size: 10px; letter-spacing: .26em; color: var(--ash); text-transform: uppercase;
}
.rail span { white-space: nowrap; }

/* Hero / wordmark */
.hero { text-align: center; margin: 6px 0 2px; }

#wordmark {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(64px, 18vw, 150px); line-height: .82; margin: 0;
  letter-spacing: .04em; color: var(--red);
  text-shadow: 0 0 2px var(--red), 0 0 22px var(--glow), 0 0 60px rgba(255,20,20,.35);
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.55) 3px 4px);
  -webkit-background-clip: text; background-clip: text;
  position: relative;
}

#wordmark::after {
  content: attr(data-word); position: absolute; left: 0; top: 0; right: 0;
  color: var(--ember); mix-blend-mode: screen; opacity: 0;
  transform: translateX(2px);
  animation: chroma 5.5s ease-in-out infinite;
}

@keyframes chroma {
  0%, 92%, 100% { opacity: 0; transform: translateX(0); }
  94% { opacity: .6; transform: translateX(-3px); }
  96% { opacity: .4; transform: translateX(3px); }
}

.tagline {
  margin: 14px 0 0; font-size: clamp(9px, 2.4vw, 11px); letter-spacing: .42em;
  color: var(--ash); text-transform: uppercase;
}
.tagline .sep { color: var(--red-deep); }

/* Boot log */
#boot {
  margin: 0; font-family: var(--mono); font-size: 14px; line-height: 1.15;
  color: #cf5a4a; white-space: pre; min-height: 3.4em;
  border-left: 2px solid var(--red-deep); padding-left: 12px;
}
#boot::after { content: "\2588"; color: var(--red); animation: caret 1s steps(1) infinite; }

@keyframes caret { 50% { opacity: 0; } }

/* FX overlay */
#fx {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--line), inset 0 0 220px rgba(0,0,0,.98),
              inset 0 0 60px rgba(0,0,0,.85), inset 0 0 40px rgba(255,15,15,.05);
}

#fx::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply; opacity: .32;
}

#fx::after {
  content: ""; position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: .05; animation: grain 1.1s steps(3) infinite;
}

@keyframes grain {
  0% { transform: translate(0,0); }
  33% { transform: translate(-3%,2%); }
  66% { transform: translate(2%,-3%); }
  100% { transform: translate(0,0); }
}

.tick {
  position: absolute; width: 14px; height: 14px;
  border: 2px solid var(--red); opacity: .55;
}
.tick.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.tick.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.tick.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.tick.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

/* Responsive */
@media (max-width: 640px) {
  .rail { font-size: 9px; letter-spacing: .18em; }
  .rail span:nth-child(2) { display: none; }
  .tick { width: 11px; height: 11px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  #wordmark { font-size: clamp(40px, 11vw, 70px); }
  .term { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}

/* Prevent hero spill */
.hero {
  overflow: hidden;
}
