/* ────────────────────────────────────────────────────────────
   LoopKernel — design system
   Dark kernel/terminal aesthetic. Task-graph status colors are
   the core visual language, reused across pills, nodes, and log.
   ──────────────────────────────────────────────────────────── */

:root {
  --bg: #070b12;
  --bg-raise: #0b111c;
  --bg-panel: #0d1420;
  --line: #1a2434;
  --line-bright: #263650;
  --ink: #e8eef7;
  --ink-dim: #93a3ba;
  --ink-faint: #5b6b84;

  --accent: #3dffa0;        /* SUCCESS / brand */
  --accent-dim: #1fd382;
  --cyan: #5bd1ff;          /* edges / links */
  --amber: #ffc95c;         /* RUNNING */
  --red: #ff5c7a;           /* CANCELLED / FAILED */

  --glow-green: 0 0 24px rgba(61, 255, 160, 0.35);
  --font-display: "Clash Display", "Instrument Sans", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, monospace;

  --radius: 10px;
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

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

::selection { background: rgba(61, 255, 160, 0.25); }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Longhand is deliberate: `.wrap` outranks `section { padding: 96px 0 }`, so a
   shorthand here would zero out every section's vertical rhythm. */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: 28px; padding-right: 28px; }

/* ── dot-grid atmosphere ─────────────────────────────────── */
.grid-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: radial-gradient(rgba(91, 209, 255, 0.10) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
}
.glow-bg {
  position: fixed; z-index: -1; pointer-events: none;
  width: 900px; height: 900px; top: -420px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle,
    rgba(61, 255, 160, 0.09) 0%,
    rgba(91, 209, 255, 0.05) 40%,
    transparent 70%);
}

/* ── nav ─────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  height: 64px; display: flex; align-items: center; gap: 32px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-display); font-weight: 600;
  font-size: 20px; letter-spacing: 0.01em; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.nav-links {
  margin-left: auto; display: flex; align-items: center; gap: 26px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em;
}
.nav-links a { color: var(--ink-dim); }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-cta {
  border: 1px solid var(--line-bright); border-radius: 7px;
  padding: 7px 14px; color: var(--ink) !important; white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { border-color: var(--accent); box-shadow: var(--glow-green); }

/* ── status pills — the shared visual language ───────────── */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--line-bright); border-radius: 100px;
  padding: 5px 13px; color: var(--ink-dim);
}
.pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}
.pill.amber::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.pill.red::before   { background: var(--red);   box-shadow: 0 0 8px var(--red); }
.pill.cyan::before  { background: var(--cyan);  box-shadow: 0 0 8px var(--cyan); }

/* ── hero ────────────────────────────────────────────────── */
.hero {
  padding-top: 158px; padding-bottom: 90px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px; align-items: center;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(42px, 5.4vw, 68px);
  line-height: 1.04; letter-spacing: -0.015em;
  margin: 22px 0 20px;
}
.hero h1 .accent {
  color: var(--accent);
  text-shadow: 0 0 40px rgba(61, 255, 160, 0.45);
}
.hero .sub {
  color: var(--ink-dim); font-size: 18.5px; max-width: 52ch;
  margin-bottom: 34px;
}
.hero .sub code {
  font-family: var(--font-mono); font-size: 15px; color: var(--cyan);
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.02em;
  padding: 13px 22px; border-radius: 8px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: #05130c !important; font-weight: 500;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.btn-primary:hover { box-shadow: var(--glow-green); }
.btn-ghost {
  border: 1px solid var(--line-bright); color: var(--ink) !important;
}
.btn-ghost:hover { border-color: var(--cyan); box-shadow: 0 0 20px rgba(91, 209, 255, 0.18); }

/* ── terminal window chrome (hero graph + code blocks) ───── */
.term {
  border: 1px solid var(--line-bright); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-raise));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint);
}
.term-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-bright); }
.term-bar .dot:first-child { background: rgba(255, 92, 122, 0.7); }
.term-bar .dot:nth-child(2) { background: rgba(255, 201, 92, 0.7); }
.term-bar .dot:nth-child(3) { background: rgba(61, 255, 160, 0.7); }
.term-bar .title { margin-left: 10px; }

.hero-term canvas { display: block; width: 100%; height: 292px; }
.run-log {
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px; min-height: 148px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.85;
  color: var(--ink-dim);
}
.run-log .ln { opacity: 0; animation: logline 0.35s ease forwards; }
@keyframes logline { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.run-log .ok    { color: var(--accent); }
.run-log .patch { color: var(--cyan); }
.run-log .kill  { color: var(--red); }
.run-log .meta  { color: var(--ink-faint); }

/* ── section scaffolding ─────────────────────────────────── */
section { padding: 96px 0; position: relative; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12.5px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(30px, 3.6vw, 44px); line-height: 1.12;
  letter-spacing: -0.01em; max-width: 22ch;
}
.section-sub { color: var(--ink-dim); max-width: 62ch; margin-top: 16px; }
.hr { border: 0; border-top: 1px solid var(--line); }

/* ── one-sentence positioning ────────────────────────────── */
.statement {
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 30px; max-width: 900px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(22px, 2.6vw, 31px); line-height: 1.35;
}
.statement em { font-style: normal; color: var(--accent); }
.statement .who {
  display: block; margin-top: 18px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 400;
  letter-spacing: 0.08em; color: var(--ink-faint);
}

/* ── pillars — staggered 2×2 ─────────────────────────────── */
.pillars {
  margin-top: 56px; display: grid;
  grid-template-columns: 1fr 1fr; gap: 26px;
}
.pillar {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise); padding: 34px 32px 30px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.pillar:nth-child(2) { transform: translateY(26px); }
.pillar:nth-child(4) { transform: translateY(26px); }
.pillar:hover { border-color: var(--accent-dim); box-shadow: var(--glow-green); }
.pillar:nth-child(2):hover, .pillar:nth-child(4):hover { transform: translateY(22px); }
.pillar .num {
  position: absolute; top: -18px; right: 6px;
  font-family: var(--font-mono); font-size: 104px; line-height: 1;
  color: rgba(91, 209, 255, 0.07); user-select: none;
}
.pillar h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 22.5px;
  margin: 14px 0 10px; letter-spacing: 0;
}
.pillar p { color: var(--ink-dim); font-size: 15.5px; }
.pillar code { font-family: var(--font-mono); font-size: 13.5px; color: var(--cyan); }

/* ── feature grid ────────────────────────────────────────── */
.features {
  margin-top: 52px; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.feature {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise); padding: 24px 22px;
  transition: border-color 0.25s;
}
.feature:hover { border-color: var(--line-bright); }
.feature .tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 10px;
}
.feature h4 { font-size: 16.5px; font-weight: 600; margin-bottom: 7px; }
.feature p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.55; }

/* ── code block ──────────────────────────────────────────── */
.code-split {
  display: grid; grid-template-columns: 0.9fr 1.1fr;
  gap: 52px; align-items: center; margin-top: 8px;
}
pre {
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75;
  padding: 20px 22px; overflow-x: auto; color: var(--ink-dim);
}
pre .c  { color: var(--ink-faint); }         /* comment  */
pre .k  { color: var(--cyan); }              /* key/verb */
pre .s  { color: var(--accent); }            /* success  */
pre .r  { color: var(--red); }               /* cancel   */
pre .a  { color: var(--amber); }             /* ids      */
.code-note {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint);
  border-top: 1px solid var(--line); padding: 10px 22px;
}

/* ── "for engineers" audience boundary ───────────────────── */
.tech-divider {
  border-top: 1px solid var(--line);
  padding-top: 26px; margin-bottom: 52px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.tech-divider p {
  color: var(--ink-faint); font-family: var(--font-mono);
  font-size: 13px; margin: 0;
}

/* ── comparison teaser table ─────────────────────────────── */
.mini-table { margin-top: 48px; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 15px;
}
th, td {
  text-align: left; padding: 16px 18px; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
th {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 400;
}
td:first-child, th:first-child { padding-left: 0; }
td .dim { color: var(--ink-dim); }
td strong { color: var(--accent); font-weight: 500; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 760px; }

/* ── footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line); padding: 44px 0 56px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint);
}
footer .links { margin-left: auto; display: flex; gap: 22px; }
footer a { color: var(--ink-dim); }
footer a:hover { color: var(--accent); text-decoration: none; }

/* ── comparison page ─────────────────────────────────────── */
.page-head { padding-top: 150px; padding-bottom: 30px; }
.page-head h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(34px, 4.4vw, 56px); line-height: 1.08;
  letter-spacing: -0.012em; margin: 20px 0 18px; max-width: 20ch;
}
.page-head .sub { color: var(--ink-dim); max-width: 64ch; font-size: 18px; }

.prose { max-width: 780px; }
.prose h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 30px;
  margin: 70px 0 18px; letter-spacing: -0.005em;
}
.prose h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 21.5px;
  margin: 44px 0 12px;
}
.prose p { color: var(--ink-dim); margin: 14px 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code {
  font-family: var(--font-mono); font-size: 14px; color: var(--cyan);
  background: rgba(91, 209, 255, 0.07); padding: 1.5px 6px; border-radius: 5px;
}
.prose ul { margin: 14px 0 14px 22px; color: var(--ink-dim); }
.prose li { margin: 8px 0; }

.insight {
  border: 1px solid var(--line-bright); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-raise); padding: 20px 24px; margin: 26px 0;
}
.insight .label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.insight p { color: var(--ink-dim); margin: 0; font-size: 15.5px; }

.vs-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin: 34px 0;
}
.vs-col {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise); padding: 28px;
}
.vs-col h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 20px; }
.vs-col.lk { border-color: rgba(61, 255, 160, 0.35); }
.vs-col ul { margin: 0 0 0 20px; color: var(--ink-dim); font-size: 15px; }
.vs-col li { margin: 8px 0; }

/* ── scroll reveal ───────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.pillar.reveal.visible:nth-child(2), .pillar.reveal.visible:nth-child(4) { transform: translateY(26px); }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 128px; gap: 44px; }
  .code-split { grid-template-columns: 1fr; gap: 30px; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .pill { font-size: 10px; letter-spacing: 0.09em; padding: 4px 11px; }
  .pillars { grid-template-columns: 1fr; }
  .pillar:nth-child(2), .pillar:nth-child(4),
  .pillar.reveal.visible:nth-child(2), .pillar.reveal.visible:nth-child(4) { transform: none; }
  .features { grid-template-columns: 1fr; }
  .vs-cols { grid-template-columns: 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
  section { padding: 68px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
