/* ============================================================
   spanview — landing
   Concept: instrument console × editorial verdict.
   Ink-black, single acid-lime signal, severity colors only
   where they carry meaning. Serif display / mono machinery.
   ============================================================ */

:root {
  --ink:    #0a0b0e;
  --ink-2:  #101217;
  --ink-3:  #161a21;
  --line:   #20252e;
  --line-2: #2b323d;
  --fg:     #e9ecf2;
  --fg-dim: #9aa3b2;
  --fg-mut: #5b6373;

  --signal: #cdfa50;   /* acid lime — the "live / it fired" color */
  --signal-ink: #0a0b0e;
  --warn:   #f5b942;
  --error:  #f0664f;
  --ok:     #57d98a;
  --llm:    #b89cff;
  --tool:   #6fd3f2;
  --agent:  #f7a85c;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* faint instrument grid + a contained signal glow up top */
  background-image:
    radial-gradient(900px 480px at 78% -6%, rgba(205,250,80,0.06), transparent 60%),
    linear-gradient(to right, rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
}

/* subtle film grain over everything */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
em { font-style: italic; }
code, .mono { font-family: var(--mono); }
.mono { font-size: 0.82em; letter-spacing: -0.01em; }
.dim { color: var(--fg-mut); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

::selection { background: var(--signal); color: var(--signal-ink); }

/* ───────── layout primitives ───────── */
.band { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 96px 28px; }
.band.alt { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent); }

.eyebrow {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--signal); margin-bottom: 18px;
}

h1, h2, h3 { font-weight: 400; }
.band h2 {
  font-family: var(--serif); font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.04; letter-spacing: -0.01em; max-width: 18ch; margin-bottom: 48px;
}

/* ───────── nav ───────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 16px 28px;
  backdrop-filter: blur(8px);
}
.nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 600; font-size: 16px; letter-spacing: -0.02em;
}
.wordmark-dim { color: var(--fg-mut); }
.glyph { width: 20px; height: 20px; color: var(--signal); flex: none; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 14.5px; }
.nav-links a { color: var(--fg-dim); transition: color 0.18s; }
.nav-links a:hover { color: var(--fg); }
.nav-cta {
  color: var(--signal) !important; border: 1px solid rgba(205,250,80,0.32);
  padding: 6px 14px; border-radius: 999px; transition: background 0.18s, border-color 0.18s;
}
.nav-cta:hover { background: rgba(205,250,80,0.1); border-color: var(--signal); }
@media (max-width: 640px) { .nav-links a:not(.nav-cta):not([href*="github"]) { display: none; } }

/* ───────── hero ───────── */
.hero {
  position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
  padding: 72px 28px 104px;
}
h1 {
  font-family: var(--serif); font-size: clamp(2.9rem, 6.4vw, 4.9rem);
  line-height: 0.98; letter-spacing: -0.015em; margin-bottom: 26px;
}
h1 em { color: var(--fg-dim); }
.lede { font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: var(--fg-dim); max-width: 46ch; }
.hero .lede { margin-bottom: 32px; }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  padding: 13px 22px; border-radius: 8px; border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.btn-primary { background: var(--signal); color: var(--signal-ink); box-shadow: 0 0 0 0 rgba(205,250,80,0.5); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(205,250,80,0.55); }
.btn-ghost { color: var(--fg); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--fg-dim); transform: translateY(-2px); }

.frameworks {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--fg-mut);
}
.frameworks span { color: var(--fg-mut); }
.frameworks b { color: var(--fg-dim); font-weight: 500; }
.frameworks i { color: var(--line-2); font-style: normal; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding-bottom: 72px; }
}

/* ───────── the scope (trace → verdict) ───────── */
.scope { position: relative; }
.scope-glow {
  position: absolute; inset: -10% -6% -16% -6%; z-index: 0;
  background: radial-gradient(60% 60% at 70% 30%, rgba(205,250,80,0.10), transparent 70%);
  filter: blur(8px);
}
.panel {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.03);
}
.trace { padding: 14px 16px 18px; overflow: hidden; }
.panel-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.live { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 rgba(205,250,80,0.6); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(205,250,80,0.5);} 70%{ box-shadow: 0 0 0 7px rgba(205,250,80,0);} 100%{ box-shadow:0 0 0 0 rgba(205,250,80,0);} }

.spans { list-style: none; }
.span {
  position: relative; display: grid;
  grid-template-columns: 14px 26px auto 1fr auto; align-items: center; gap: 10px;
  padding: 9px 6px; border-radius: 8px;
}
.span + .span { margin-top: 2px; }
.span .rail { justify-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); position: relative; }
.span .rail::before { content:""; position:absolute; left:50%; top:8px; width:1px; height:24px; background:var(--line); transform:translateX(-50%); }
.span:last-child .rail::before { display: none; }
.seq { font-family: var(--mono); font-size: 11px; color: var(--fg-mut); }
.k { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 5px; }
.k-agent { color: var(--agent); background: rgba(247,168,92,0.13); }
.k-llm   { color: var(--llm);   background: rgba(184,156,255,0.14); }
.k-tool  { color: var(--tool);  background: rgba(111,211,242,0.13); }
.sname { font-family: var(--mono); font-size: 13px; color: var(--fg); }
.lat { font-family: var(--mono); font-size: 11.5px; color: var(--fg-mut); }
.span-flag { background: rgba(240,102,79,0.07); box-shadow: inset 2px 0 0 var(--error); }
.span-flag .rail { background: var(--error); box-shadow: 0 0 10px rgba(240,102,79,0.7); }

.scanline {
  position: absolute; left: 0; right: 0; top: 56px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--signal), transparent);
  opacity: 0; pointer-events: none;
}

/* verdict card overlaps the trace, bottom-right — grid-breaking depth */
.verdict {
  position: relative; z-index: 2; margin: -28px -8px 0 64px; padding: 18px 20px;
  border-color: var(--line-2);
  background: linear-gradient(180deg, #181c24, #12151b);
}
.verdict-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sev { font-family: var(--mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px; }
.sev-error { color: var(--error); background: rgba(240,102,79,0.14); border: 1px solid rgba(240,102,79,0.3); }
.verdict h3 { font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; margin-bottom: 8px; }
.verdict p { font-size: 14px; color: var(--fg-dim); margin-bottom: 14px; }
.verdict code { color: var(--fg); background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.vnotes { list-style: none; display: grid; gap: 8px; }
.vnotes li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--fg-dim); }
.vnotes .mono { color: var(--fg-mut); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-warn { background: var(--warn); }
.dot-error { background: var(--error); }
@media (max-width: 880px) { .verdict { margin-left: 24px; margin-right: 0; } }
@media (max-width: 440px) { .verdict { margin-left: 0; } .span { grid-template-columns: 14px auto auto 1fr auto; } .seq { display:none; } }

/* ───────── problem ───────── */
.problems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.problem { background: var(--ink); padding: 30px 26px; }
.pnum { display: block; color: var(--signal); font-size: 12px; margin-bottom: 18px; }
.problem h3 { font-size: 1.18rem; margin-bottom: 8px; }
.problem p { color: var(--fg-dim); font-size: 14.5px; }
@media (max-width: 760px) { .problems { grid-template-columns: 1fr; } }

/* ───────── pipeline ───────── */
.pipeline { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.step { position: relative; }
.step::before { content: ""; position: absolute; top: 13px; left: 30px; right: -22px; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.step:last-child::before { display: none; }
.snum {
  display: inline-grid; place-items: center; width: 27px; height: 27px; margin-bottom: 16px;
  color: var(--signal); border: 1px solid rgba(205,250,80,0.34); border-radius: 50%;
  font-size: 11px; background: var(--ink); position: relative; z-index: 1;
}
.step h3 { font-size: 1.08rem; margin-bottom: 6px; }
.step p { color: var(--fg-dim); font-size: 14px; }
.code {
  margin-top: 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--ink-2); font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
  color: var(--fg-dim); white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
.code .c-kw { color: var(--signal); }
@media (max-width: 900px) { .pipeline { grid-template-columns: 1fr 1fr; } .step::before { display: none; } }
@media (max-width: 520px) { .pipeline { grid-template-columns: 1fr; } }

/* ───────── features ───────── */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.feature { background: var(--ink); padding: 28px 26px; transition: background 0.2s; }
.feature:hover { background: var(--ink-2); }
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; display: flex; align-items: center; gap: 9px; }
.feature h3::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--signal); transform: rotate(45deg); }
.feature p { color: var(--fg-dim); font-size: 14px; }
@media (max-width: 820px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }

/* ───────── signup ───────── */
.signup { text-align: center; }
.signup-inner { max-width: 560px; margin: 0 auto; }
.signup .eyebrow { display: inline-block; }
.signup h2 { margin: 0 auto 14px; }
.signup .lede { margin: 0 auto 28px; color: var(--fg-dim); }
.email-form { display: flex; gap: 10px; max-width: 440px; margin: 0 auto 14px; }
.email-form input {
  flex: 1; min-width: 0; padding: 13px 16px; font-family: var(--mono); font-size: 14px;
  color: var(--fg); background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 8px;
}
.email-form input::placeholder { color: var(--fg-mut); }
.email-form input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(205,250,80,0.12); }
.signup-alt { font-size: 14px; color: var(--fg-mut); }
.signup-alt a { color: var(--signal); border-bottom: 1px solid rgba(205,250,80,0.3); padding-bottom: 1px; }
.signup-alt a:hover { border-color: var(--signal); }
@media (max-width: 460px) { .email-form { flex-direction: column; } }

/* ───────── footer ───────── */
.foot {
  position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 30px 28px 48px; border-top: 1px solid var(--line);
}
.foot-links { display: flex; gap: 22px; font-size: 14px; }
.foot-links a { color: var(--fg-dim); transition: color 0.18s; }
.foot-links a:hover { color: var(--fg); }

/* ───────── motion: hero load + scroll reveal ───────── */
/* Hero pieces fade up on load (pure CSS — works without JS). */
.hero .reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s var(--ease) forwards; }
.hero-copy .reveal:nth-child(1) { animation-delay: 0.05s; }
.hero-copy .reveal:nth-child(2) { animation-delay: 0.13s; }
.hero-copy .reveal:nth-child(3) { animation-delay: 0.22s; }
.hero-copy .reveal:nth-child(4) { animation-delay: 0.31s; }
.hero-copy .reveal:nth-child(5) { animation-delay: 0.40s; }
.scope.reveal { animation-delay: 0.34s; }

/* Scope choreography: rows light up, scanline sweeps, verdict lifts in. */
.span { opacity: 0.35; animation: spanIn 0.5s var(--ease) forwards; animation-delay: calc(0.7s + var(--i) * 0.14s); }
@keyframes spanIn { to { opacity: 1; } }
.scanline { animation: sweep 1.1s var(--ease) 0.7s 1 forwards; }
@keyframes sweep { 0% { opacity: 0; top: 56px; } 15% { opacity: 0.9; } 100% { opacity: 0; top: 188px; } }
.verdict { opacity: 0; transform: translateY(16px) scale(0.99); animation: rise 0.7s var(--ease) 1.3s forwards; }

@keyframes rise { to { opacity: 1; transform: none; } }

/* Below-fold scroll reveal — only hide when JS is present, so no-JS shows all. */
.js .band .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .band .reveal.in { opacity: 1; transform: none; }
.js .problems .reveal.in:nth-child(2) { transition-delay: 0.07s; }
.js .problems .reveal.in:nth-child(3) { transition-delay: 0.14s; }
.js .pipeline .reveal.in:nth-child(2) { transition-delay: 0.06s; }
.js .pipeline .reveal.in:nth-child(3) { transition-delay: 0.12s; }
.js .pipeline .reveal.in:nth-child(4) { transition-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .hero .reveal, .scope.reveal, .span, .verdict, .js .band .reveal {
    opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important;
  }
  .scanline, .live-dot { animation: none !important; }
}
