/* A Dev With Purpose - "The Network" identity.
   Deep-space base, signal-green accents, mono labels, node/edge motifs.
   Desktop gets the WebGL hero + pinned scenes; mobile/reduced-motion get this
   static layout only (no JS-driven state is required for readability). */

:root {
  --bg: #05080f;
  --bg-raised: #0b111c;
  --border: #16202f;
  --text: #e8f0f7;
  --text-dim: #8fa1b5;
  --accent: #4ade80;
  --accent-2: #22d3ee;
  --accent-dim: rgba(74, 222, 128, 0.14);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1100px;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: linear-gradient(rgba(5,8,15,.92), rgba(5,8,15,0));
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); font-weight: 700; }
.brand-name { font-size: 14px; letter-spacing: .02em; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--text-dim); font-size: 14px; font-family: var(--mono); }
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; z-index: 0; }
.hero-canvas canvas { display: block; width: 100%; height: 100%; }
/* static fallback node field (always under canvas; only thing visible on mobile/no-JS) */
.hero-static {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(2px 2px at 12% 30%, var(--accent) 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 18%, var(--accent-2) 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 66%, var(--accent) 50%, transparent 51%),
    radial-gradient(2px 2px at 30% 80%, var(--accent) 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 74%, var(--accent-2) 50%, transparent 51%),
    radial-gradient(2px 2px at 42% 22%, var(--accent) 50%, transparent 51%),
    radial-gradient(2px 2px at 66% 44%, var(--accent) 50%, transparent 51%),
    radial-gradient(2px 2px at 20% 55%, var(--accent-2) 50%, transparent 51%);
  opacity: .5;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px 20px 80px;
  width: 100%;
}
.kicker { font-family: var(--mono); color: var(--accent); font-size: 14px; margin-bottom: 20px; }
.hero h1 {
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
  max-width: 15ch;
}
.hero h1 .accent { color: var(--accent); }
.sub { color: var(--text-dim); font-size: 18px; max-width: 50ch; margin-bottom: 34px; }
.hero-hint {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .3em;
}
.hero-hint::after {
  content: "";
  display: block;
  width: 1px; height: 34px;
  margin: 8px auto 0;
  background: linear-gradient(var(--accent), transparent);
}

/* ---------- buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 15px;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #04120a; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { color: var(--text); background: rgba(11,17,28,.7); backdrop-filter: blur(4px); }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- pinned scenes ---------- */
.scene { position: relative; }
.scene-pin {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(300px, 44%) 1fr;
  gap: 40px;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 80px 20px;
}
.scene-num {
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 14px;
  margin-bottom: 14px;
}
.scene-copy h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 16px;
}
.scene-text { color: var(--text-dim); font-size: 17px; max-width: 40ch; }
.scene-visual {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 340px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

/* scene 1: memory fragments */
.memory-visual { display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.frag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(5,8,15,.6);
}
.frag.lit { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 18px var(--accent-dim); }
.memory-status {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: #f87171;
  letter-spacing: .04em;
}
.memory-status.ok { color: var(--accent); }

/* scene 2: pipeline */
.pipe-visual { display: flex; flex-direction: column; justify-content: center; gap: 34px; }
.pipe-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
}
.pipe-track::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--border);
}
.pipe-stage {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
}
.pipe-stage.lit { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 16px var(--accent-dim); }
.pipe-token {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px; height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 14px var(--accent-2);
  z-index: 2;
}
.pipe-log { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

/* scene 3: dev window */
.dev-visual { display: flex; align-items: center; justify-content: center; }
.dev-window {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.dev-titlebar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.dev-titlebar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.dev-lines { padding: 18px 16px; display: grid; gap: 10px; }
.dev-line { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.dev-line em { font-style: normal; color: var(--accent-2); margin-right: 8px; }
.dev-line.dev-pass { color: var(--accent); }
.dev-line.dev-guard { color: #fbbf24; }

/* ---------- how we work ---------- */
.how { max-width: var(--maxw); margin: 0 auto; padding: 110px 20px; }
.section-title {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 30px;
}
.section-title::before { content: "# "; color: var(--text-dim); }
.steps { list-style: none; display: grid; gap: 22px; }
.steps li { display: flex; gap: 18px; align-items: flex-start; }
.step-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 14px;
  border: 1px solid rgba(74,222,128,.3);
  border-radius: 6px;
  padding: 4px 8px;
  flex-shrink: 0;
}
.steps h3 { font-size: 17px; margin-bottom: 6px; }
.steps p { color: var(--text-dim); font-size: 15px; max-width: 56ch; }

/* ---------- chat finale ---------- */
.chat { max-width: 760px; margin: 0 auto; padding: 110px 20px; }
.chat-window {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.chat-scroll { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.msg {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.5;
}
.msg-bot { background: var(--bg); border: 1px solid var(--border); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-user { background: var(--accent); color: #04120a; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-cta a { font-weight: 600; }
.chat-input {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}
.chat-input input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--sans);
}
.chat-input input::placeholder { color: var(--text-dim); }
.chat-input button {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #04120a;
  font-size: 16px;
  padding: 0 18px;
  cursor: pointer;
}
.chat-note { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

/* ---------- about / footer ---------- */
.about { max-width: var(--maxw); margin: 0 auto; padding: 90px 20px; border-top: 1px solid var(--border); }
.about p { color: var(--text-dim); font-size: 17px; max-width: 56ch; margin-bottom: 26px; }
.site-footer { border-top: 1px solid var(--border); }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-dim); font-size: 14px; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-mail { font-family: var(--mono); font-size: 14px; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .scene-pin { grid-template-columns: 1fr; gap: 28px; min-height: 0; padding: 64px 20px; }
  .scene-visual { min-height: 280px; }
}
@media (max-width: 600px) {
  .brand-name { display: none; }
  .hero-content { padding-top: 100px; }
  .sub { font-size: 16px; }
  .how, .chat { padding: 70px 20px; }
  .msg { max-width: 88%; }
}
