/* ==========================================================================
   KOS Terminal — site styles
   ========================================================================== */

:root {
  --bg: #0d0d0f;
  --bg2: #141417;
  --panel: #17171b;
  --panel2: #1f1f24;
  --line: #2e2e36;
  --text: #e8e8ec;
  --muted: #9a9aa4;
  --violet: #9aa3af;
  --violet2: #6b7280;
  --violet-soft: rgba(154, 163, 175, 0.12);
  --cyan: #67e8f9;
  --red: #f87171;
  --amber: #fbbf24;
  --green: #4ade80;
  --mono: "JetBrains Mono", Consolas, monospace;
  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(154, 163, 175, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 163, 175, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}

::selection { background: rgba(154, 163, 175, 0.45); color: #fff; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
code { font-family: var(--mono); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2e2e36; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #4a4a55; }

/* ============================================================ navigation */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(13, 13, 15, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(46, 46, 54, 0.8);
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 18px; letter-spacing: -0.02em; }
.brand-text small { font-size: 8.5px; letter-spacing: 0.22em; color: var(--muted); }

.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 16px; margin-left: 8px; }

.hud {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(31, 31, 36, 0.6);
  white-space: nowrap;
}
.hud b { color: var(--violet); font-weight: 700; }
.hud span { margin: 0 7px; opacity: 0.5; }

/* ================================================================ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 10px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--violet2), #a9b2bf);
  border: 1px solid rgba(154, 163, 175, 0.55);
  box-shadow: 0 8px 28px rgba(107, 114, 128, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(107, 114, 128, 0.42); }
.btn:active { transform: translateY(0); }

.btn .arrow { font-size: 12px; opacity: 0.8; }

.btn-ghost {
  background: rgba(31, 31, 36, 0.6);
  border-color: var(--line);
  box-shadow: none;
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--violet); box-shadow: 0 0 0 1px rgba(154, 163, 175, 0.25); }

.btn-sm { padding: 9px 16px; font-size: 12.5px; border-radius: 8px; }

.btn-danger {
  width: 100%;
  background: linear-gradient(135deg, #7f1d1d, #7f1d1d);
  border-color: rgba(248, 113, 113, 0.65);
  box-shadow: 0 8px 28px rgba(127, 29, 37, 0.3);
}
.btn-danger:hover { box-shadow: 0 12px 34px rgba(220, 38, 38, 0.45); }

.btn-wide { width: 100%; }

/* =================================================================== hero */

.hero {
  position: relative;
  padding: 132px clamp(16px, 4vw, 40px) 0;
  overflow: hidden;
}

#embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  top: 40px;
  right: 4%;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107, 114, 128, 0.22), rgba(103, 232, 249, 0.06) 45%, transparent 70%);
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
  animation: orb 14s ease-in-out infinite alternate;
}

@keyframes orb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-40px, 40px, 0) scale(1.12); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
}
.eyebrow.red { color: rgba(252, 165, 165, 0.85); }

.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.glitch {
  position: relative;
  display: inline-block;
  margin: 14px 0 4px;
  font-size: clamp(74px, 11.5vw, 152px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.92;
  color: #f2f2f6;
  text-shadow: 0 0 70px rgba(154, 163, 175, 0.45);
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.glitch::before {
  color: var(--cyan);
  transform: translate(3px, -2px);
  clip-path: inset(0 0 62% 0);
  opacity: 0.6;
  mix-blend-mode: screen;
  animation: glitch-a 5s infinite steps(1);
}
.glitch::after {
  color: var(--red);
  transform: translate(-3px, 2px);
  clip-path: inset(58% 0 0 0);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: glitch-b 5s infinite steps(1);
}
@keyframes glitch-a {
  0%, 91%, 100% { clip-path: inset(0 0 62% 0); transform: translate(3px, -2px); }
  92% { clip-path: inset(10% 0 72% 0); transform: translate(-7px, 0); }
  95% { clip-path: inset(38% 0 34% 0); transform: translate(6px, 1px); }
}
@keyframes glitch-b {
  0%, 90%, 100% { clip-path: inset(58% 0 0 0); transform: translate(-3px, 2px); }
  93% { clip-path: inset(70% 0 6% 0); transform: translate(7px, -1px); }
  96% { clip-path: inset(30% 0 52% 0); transform: translate(-5px, 2px); }
}

.tagline {
  margin-top: 18px;
  font-size: clamp(18px, 2.1vw, 23px);
  color: #cacad4;
  max-width: 560px;
}
.tagline em {
  font-style: normal;
  color: var(--violet);
  text-shadow: 0 0 30px rgba(154, 163, 175, 0.35);
}

.lede {
  margin-top: 16px;
  max-width: 570px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
.lede strong { color: #dedee4; font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #c4c4ce;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(23, 23, 27, 0.72);
}
.chips .chip-safe { color: var(--green); border-color: rgba(74, 222, 128, 0.28); }

/* terminal */

.hero-term {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(154, 163, 175, 0.3);
  background: linear-gradient(170deg, rgba(20, 20, 23, 0.96), rgba(13, 13, 15, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.02) inset,
              0 0 60px rgba(107, 114, 128, 0.12);
  overflow: hidden;
  min-height: 342px;
  display: flex;
  flex-direction: column;
}
.hero-term::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(103, 232, 249, 0.08), transparent 55%);
  pointer-events: none;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(46, 46, 54, 0.9);
  background: rgba(13, 13, 15, 0.6);
}
.t-dot { width: 10px; height: 10px; border-radius: 50%; }
.t-dot.red { background: #ff5f57; }
.t-dot.amber { background: #febc2e; }
.t-dot.green { background: #4ade80; }
.t-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.term-body {
  flex: 1;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12.2px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  color: #b4b4be;
  min-height: 260px;
}
.term-body .line { display: block; }
.term-body .ok { color: var(--green); }
.term-body .dim { color: #6b7280; }
.term-body .warn { color: var(--amber); }
.term-body .err { color: #f87171; }
.term-body .prompt { color: #e8e8ec; }
.term-body .prompt::before { content: ""; }

.caret {
  display: inline-block;
  width: 7px; height: 14px;
  background: var(--violet);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.term-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-top: 1px solid rgba(46, 46, 54, 0.55);
}
.term-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
}

/* stats strip */

.stats {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 72px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid rgba(46, 46, 54, 0.65);
}
.stat:last-child { border-right: 0; }
.stat b {
  font-family: var(--mono);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  color: var(--violet);
  letter-spacing: -0.03em;
}
.stat span { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }

/* ================================================================ sections */

.section {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(70px, 9vw, 116px) clamp(16px, 4vw, 40px) 0;
}

section[id] { scroll-margin-top: 86px; }

.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head h2 {
  margin-top: 12px;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.section-head p:last-child {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 640px;
}
.accent { color: var(--violet); }

/* ============================================================= app shot */

.screenshot {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #141417;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(154, 163, 175, 0.08);
}

.shot-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  background: #17171b;
}

.shot-bar .t-title { margin-left: 8px; }

.screenshot img { width: 100%; display: block; }

.screenshot figcaption {
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 10px;
  color: #6b7280;
  border-top: 1px solid rgba(46, 46, 54, 0.6);
}

/* ================================================================ modules */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.module {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(155deg, rgba(154, 163, 175, 0.09), rgba(23, 23, 27, 0.92) 42%),
    var(--panel);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.module::after {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  top: -130px; right: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(154, 163, 175, 0.16), transparent 70%);
  pointer-events: none;
}
.module:hover {
  transform: translateY(-3px);
  border-color: rgba(154, 163, 175, 0.5);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

.module-top { display: flex; align-items: center; justify-content: space-between; }

.mod-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 11px;
  font-size: 19px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.mod-icon.violet { color: var(--violet); background: rgba(154, 163, 175, 0.13); }
.mod-icon.cyan { color: var(--cyan); background: rgba(103, 232, 249, 0.1); }
.mod-icon.amber { color: var(--amber); background: rgba(251, 191, 36, 0.1); }
.mod-icon.red { color: #f87171; background: rgba(248, 113, 113, 0.1); }

.mod-badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
}

.module h3 { margin-top: 18px; font-size: 22px; letter-spacing: -0.02em; }
.mod-desc { margin-top: 4px; color: #b4b4be; font-size: 13.5px; }

.feature-list {
  list-style: none;
  margin: 16px 0 18px;
  display: grid;
  gap: 8px;
}
.feature-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.feature-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--violet);
}

.mod-code {
  display: block;
  font-size: 10.5px;
  color: #8a8a94;
  background: rgba(13, 13, 15, 0.6);
  border: 1px solid rgba(46, 46, 54, 0.8);
  border-radius: 8px;
  padding: 9px 12px;
  overflow-x: auto;
  white-space: nowrap;
}

/* =================================================================== loop */

.loop-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: clamp(70px, 9vw, 116px);
  padding-top: clamp(60px, 8vw, 96px);
  padding-bottom: clamp(60px, 8vw, 96px);
  max-width: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(127, 29, 29, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(23, 23, 27, 0.55), transparent);
}
.loop-section > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.loop-section .section-head { margin-left: auto; margin-right: auto; }

.loop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.loop-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(31, 31, 36, 0.92), rgba(20, 20, 23, 0.96));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.loop-card.death {
  border-color: rgba(248, 113, 113, 0.4);
  background:
    radial-gradient(circle at 50% 0%, rgba(127, 29, 37, 0.16), transparent 60%),
    linear-gradient(165deg, rgba(31, 31, 36, 0.95), rgba(20, 20, 23, 0.97));
  box-shadow: 0 0 50px rgba(127, 29, 37, 0.08);
}
.loop-card h3 { font-size: 19px; letter-spacing: -0.02em; }
.loop-card p { color: var(--muted); font-size: 13.5px; }
.loop-card strong { color: #ededf2; }
.loop-card .btn { margin-top: 4px; }

.loop-tag {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--violet);
  border: 1px solid rgba(154, 163, 175, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
}
.loop-tag.red { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }
.loop-tag.cyan { color: var(--cyan); border-color: rgba(103, 232, 249, 0.35); }

.loop-points { list-style: none; display: grid; gap: 6px; margin-top: 2px; }
.loop-points li {
  font-family: var(--mono);
  font-size: 11px;
  color: #9a9aa4;
  padding-left: 14px;
  position: relative;
}
.loop-points li::before { content: "·"; position: absolute; left: 2px; color: var(--violet); }

.hint { font-size: 11px !important; color: #74747e !important; text-align: center; }

.timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 44px;
  opacity: 0.9;
}
.tl-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tl-node span {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  background: var(--bg2);
}
.tl-node small {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: #6b7280;
}
.tl-node.death span { border-color: rgba(248, 113, 113, 0.55); color: #fca5a5; }
.tl-node.active span {
  border-color: var(--violet);
  color: #fff;
  background: linear-gradient(135deg, var(--violet2), #9aa3af);
  box-shadow: 0 0 28px rgba(154, 163, 175, 0.55);
}
.tl-node.active small { color: #c2c9d2; }
.tl-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), rgba(154, 163, 175, 0.5), var(--line)); }

/* ================================================================== stack */

.arch {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 20px;
}

.arch-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(31, 31, 36, 0.85), rgba(20, 20, 23, 0.9));
}
.arch-kicker {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: var(--violet);
  margin-bottom: 4px;
}
.arch-box strong { font-size: 17px; letter-spacing: -0.01em; }
.arch-box small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.arch-box em {
  font-style: normal;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: #74747e;
  border-top: 1px solid rgba(46, 46, 54, 0.6);
  padding-top: 8px;
}

.arch-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 74px;
}
.arch-link span {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: #74747e;
}
.arch-link i {
  position: relative;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(154, 163, 175, 0.6), transparent);
}
.arch-link i::after {
  content: "▸";
  position: absolute;
  right: -3px;
  top: -10px;
  color: var(--violet);
  font-size: 13px;
}

.code-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.code-card { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #111114; }

.code-head {
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #8a8a94;
  background: rgba(31, 31, 36, 0.75);
  border-bottom: 1px solid var(--line);
}

.code-card pre { margin: 0; padding: 18px; overflow-x: auto; }
.code-card code { font-size: 11.8px; line-height: 1.8; color: #c4c4ce; }
.code-card .kw { color: #b6bfca; }
.code-card .str { color: #67e8f9; }
.code-card .fn { color: #fbbf24; }
.code-card .cm { color: #6b7280; }

/* ==================================================================== bot */

.bot-wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; align-items: start; }

.bot-table {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: rgba(23, 23, 27, 0.65);
}
.bot-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(46, 46, 54, 0.55);
  font-size: 13px;
  align-items: center;
}
.bot-row:last-child { border-bottom: 0; }
.bot-row.head {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #74747e;
  background: rgba(31, 31, 36, 0.75);
}
.bot-row code { color: var(--cyan); font-size: 12px; }
.bot-row span { color: var(--muted); }
.bot-row.head span { color: #74747e; }

.bot-setup { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #111114; }
.bot-setup pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.bot-setup code { font-size: 11.4px; line-height: 1.85; color: #c4c4ce; }
.bot-note {
  padding: 12px 18px 16px;
  font-size: 11.5px;
  color: #74747e;
  border-top: 1px solid rgba(46, 46, 54, 0.5);
}
.bot-note code { color: #aeb8c6; }

/* ================================================================== build */

.build-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px; align-items: start; }

.build-steps ol { list-style: none; counter-reset: step; display: grid; gap: 12px; }
.build-steps li {
  counter-increment: step;
  position: relative;
  padding: 18px 20px 16px 58px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(23, 23, 27, 0.55);
}
.build-steps li::before {
  content: "0" counter(step);
  position: absolute;
  left: 18px;
  top: 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--violet);
  border: 1px solid rgba(154, 163, 175, 0.35);
  border-radius: 7px;
  padding: 2px 6px;
}
.build-steps strong { display: block; font-size: 14.5px; margin-bottom: 7px; }
.build-steps code {
  display: block;
  font-size: 11px;
  color: #b4b4be;
  background: #111114;
  border: 1px solid rgba(46, 46, 54, 0.8);
  border-radius: 7px;
  padding: 8px 11px;
  overflow-x: auto;
  margin-bottom: 7px;
}
.build-steps small { color: #74747e; font-size: 11px; line-height: 1.5; }
.build-steps small code { display: inline; padding: 1px 5px; margin: 0; }

.download-card {
  padding: 24px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(103, 232, 249, 0.1), transparent 55%),
    linear-gradient(165deg, rgba(31, 31, 36, 0.95), rgba(13, 13, 15, 0.98));
  position: sticky;
  top: 92px;
}
.download-card h3 { margin-top: 14px; font-size: 23px; letter-spacing: -0.02em; }
.download-card > p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.download-card .btn { margin-top: 18px; }
.dl-list { list-style: none; margin: 18px 0 12px; display: grid; gap: 0; }
.dl-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(46, 46, 54, 0.55);
  font-size: 12px;
}
.dl-list span { color: #74747e; }
.dl-list b { font-family: var(--mono); font-weight: 500; font-size: 11px; color: #cacad4; }

.legal {
  margin-top: 34px;
  padding: 22px 24px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.04);
}
.legal strong { font-size: 14px; color: #fde68a; }
.legal p { margin-top: 8px; color: #a5a5af; font-size: 12.5px; line-height: 1.7; }

/* ================================================================= footer */

footer {
  position: relative;
  z-index: 1;
  margin-top: 80px;
  padding: 26px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--line);
  background: rgba(13, 13, 15, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.foot-left { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #74747e; }
.foot-right { display: flex; align-items: center; gap: 18px; font-size: 11.5px; color: #6b7280; font-style: italic; }
.hud-foot { font-style: normal; }

/* =================================================================== fx */

.flash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 50%, rgba(127, 29, 29, 0.65), rgba(10, 10, 12, 0.97) 68%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}
.flash.on { opacity: 1; animation: shake 0.5s ease; }
.flash-text {
  font-size: clamp(40px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #ff4d4d;
  text-shadow: 0 0 50px rgba(248, 113, 113, 0.9), 0 0 18px rgba(255, 0, 0, 0.7);
  animation: deathPulse 0.8s ease;
}
.flash-sub { font-family: var(--mono); font-size: 12px; color: #fecaca; letter-spacing: 0.08em; }

@keyframes deathPulse {
  0% { transform: scale(0.85); opacity: 0; }
  35% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -1px); }
  80% { transform: translate(3px, 1px); }
}

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 200;
  max-width: 360px;
  padding: 12px 16px;
  border: 1px solid rgba(154, 163, 175, 0.45);
  border-radius: 9px;
  background: rgba(23, 23, 27, 0.96);
  color: #dedee4;
  font-family: var(--mono);
  font-size: 11.5px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* reveal on scroll */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================ responsive */

@media (max-width: 1040px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-term { max-width: 640px; }
  .bot-wrap, .build-grid { grid-template-columns: 1fr; }
  .download-card { position: static; }
  .arch { grid-template-columns: 1fr; }
  .arch-link { flex-direction: row; min-width: 0; padding: 2px 0; }
  .arch-link i { width: 1px; height: 26px; background: linear-gradient(180deg, transparent, rgba(154, 163, 175, 0.6), transparent); }
  .arch-link i::after { content: "▾"; right: auto; left: -5px; top: auto; bottom: -8px; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .module-grid, .loop-grid, .code-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid rgba(46, 46, 54, 0.65); }
  .glitch { font-size: clamp(64px, 16vw, 110px); }
  .timeline { display: none; }
}

@media (max-width: 560px) {
  .nav { gap: 12px; height: 62px; }
  .brand-text small { display: none; }
  .hud { display: none; }
  .hero { padding-top: 110px; }
  .term-body { font-size: 11px; }
  .section-head h2 { font-size: 30px; }
  .bot-row { grid-template-columns: 1fr; gap: 2px; padding: 11px 14px; }
  .bot-row.head { display: none; }
  .foot-right { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ── 404 ─────────────────────────────────────────────────────────────── */
.notfound {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(255, 92, 92, .10), transparent 60%),
    radial-gradient(800px 500px at 90% 10%, rgba(120, 180, 255, .08), transparent 60%),
    var(--bg, #0d0d0f);
  color: var(--text, #e8e8ec);
}

.nf-wrap {
  width: min(680px, 92vw);
  padding: 48px 8px;
}

.nf-code {
  margin: 40px 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(64px, 14vw, 132px);
  line-height: 1;
  letter-spacing: -.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 92, 92, .55);
}

.nf-title {
  margin: 8px 0 12px;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -.02em;
}

.nf-copy {
  margin: 0 0 28px;
  max-width: 52ch;
  line-height: 1.7;
  color: var(--muted, #a5a5b0);
}

.nf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nf-foot {
  margin-top: 40px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #7c7c88);
}