/* ──────────────────────────────────────────────────────────────────────────
   claude-bridge landing
   Trends noted (May 2026): warm editorial dark, mono-display headlines,
   hand-sketched SVG, generous negative space, italic-serif accents,
   one unexpected acid hue. Vibe refs: pretext.dev (text scramble),
   variant.so (motion-mono), risograph-inspired palettes.
   Palette: warm-black + bone + acid-yellow + terracotta + dusty teal.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --bg:           #0d0c0a;   /* warm black, not slate */
  --bg-2:         #161412;
  --ink:          #f4ede1;   /* bone */
  --ink-soft:     #d8cfbe;
  --ink-faint:    #6e6759;
  --rule:         #2a2620;

  --accent:       #e8ff3a;   /* acid yellow — the unexpected hue */
  --warm:         #d97757;   /* terracotta (an Anthropic wink) */
  --teal:         #5ba89f;   /* dusty teal */

  --wire:         #4a4438;

  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif:   'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-body:    'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: clip;
  /* Paper grain — inline SVG noise, very faint. */
  background-image:
    radial-gradient(1200px 600px at 70% -10%, rgba(217,119,87,0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 90%, rgba(91,168,159,0.05), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.92 0 0 0 0 0.85 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed, fixed, fixed;
}

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

::selection { background: var(--accent); color: var(--bg); }

/* Accessibility helpers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
  background: var(--accent); color: var(--bg);
  padding: 10px 14px; font-family: var(--font-mono); font-size: 13px;
  text-decoration: none; z-index: 100;
}
.skip-link:focus {
  left: 12px; top: 12px; width: auto; height: auto; overflow: visible;
  outline: 2px solid var(--ink); outline-offset: 2px;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* About / SEO content block */
.about {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(24px, 4vw, 48px);
}
.about-copy {
  font-family: var(--font-serif);
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 68ch;
  margin: 0 auto;
  text-align: center;
}
.about-copy a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.about-copy a:hover { color: var(--ink); }
.about-copy code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-2);
  padding: 1px 5px;
  color: var(--warm);
  border-radius: 2px;
}
.about-copy strong { color: var(--ink); font-weight: 600; }

/* ── NAV ─────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-name { font-weight: 500; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { text-decoration: none; opacity: 0.8; transition: opacity .2s, color .2s; }
.nav-links a:hover { opacity: 1; color: var(--accent); }

/* ── HERO ────────────────────────────────────────────────────────────────── */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) var(--gutter) clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-copy { min-width: 0; }

.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  margin: 0 0 22px;
}

.title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(34px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: var(--ink);
}
.title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.01em;
  padding: 0 2px;
}
.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.05s steps(1) infinite;
  margin-left: 2px;
  font-weight: 300;
}
@keyframes blink { 50% { opacity: 0; } }

.lede {
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0 0 36px;
}
.lede [data-scramble] {
  font-style: italic;
  color: var(--warm);
  display: inline-block;
  min-width: 5ch;
}

/* CTAs */
.cta-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  min-height: 44px;
  border-radius: 2px;
  text-decoration: none;
  border: 1px solid var(--rule);
  transition: border-color .2s, color .2s, background .2s, transform .2s;
}
.cta:hover { border-color: var(--ink); transform: translateY(-1px); }
.cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cta-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 500;
}
.cta-primary:hover { background: var(--ink); border-color: var(--ink); }
.cta-copy {
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  max-width: 100%;
}
.cta-copy .prompt { color: var(--accent); margin-right: 6px; }
.cta-copy .copy-state { color: var(--teal); font-size: 11px; min-width: 1ch; }
.cta-copy .copy-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50vw;
}

/* ── STAGE (the animation) ──────────────────────────────────────────────── */
.stage {
  position: relative;
  min-width: 0;
}
.graph {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 40px rgba(0,0,0,0.45));
}

.node-ring   { fill: none; stroke: var(--wire); stroke-width: 1.1; }
.node-ring-2 { fill: none; stroke: var(--ink-faint); stroke-width: 0.6; stroke-dasharray: 2 4; transform-origin: center; animation: spin 40s linear infinite; transform-box: fill-box; }
.node-dot    { fill: var(--ink-soft); }
.node-label {
  font-family: var(--font-mono);
  font-size: 13px;
  fill: var(--ink);
  letter-spacing: 0.02em;
}
.node-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.node[data-active="true"] .node-dot { fill: var(--accent); }
.node[data-active="true"] .node-ring { stroke: var(--accent); }
.node[data-active="receive"] .node-dot { fill: var(--teal); }
.node[data-active="receive"] .node-ring { stroke: var(--teal); }
.node .node-ring, .node .node-dot { transition: fill .2s, stroke .2s; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Wires get a low base opacity; JS will brighten the one being traversed */
.wire { opacity: 0.55; transition: opacity .35s, stroke .35s; }
.wire[data-hot="true"] { opacity: 1; stroke: var(--ink-soft); }

/* Message packets */
.packet rect {
  fill: var(--bg-2);
  stroke: var(--accent);
  stroke-width: 0.8;
}
.packet.reply rect {
  stroke: var(--teal);
}
.packet text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--ink);
  dominant-baseline: middle;
  text-anchor: middle;
}

/* Transcript */
.transcript {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  border-top: 1px dashed var(--rule);
  padding-top: 14px;
  max-height: 7em;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
}
.transcript-list { list-style: none; padding: 0; margin: 0; }
.transcript-list li {
  padding: 3px 0;
  opacity: 0;
  transform: translateY(6px);
  animation: line-in .45s ease forwards;
}
.transcript-list li .arrow { color: var(--accent); margin: 0 6px; }
.transcript-list li .reply-arrow { color: var(--teal); margin: 0 6px; }
.transcript-list li .who { color: var(--ink-soft); }
@keyframes line-in { to { opacity: 1; transform: none; } }

/* ── HOW ─────────────────────────────────────────────────────────────────── */
.how {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  border-top: 1px solid var(--rule);
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  list-style: none;
  padding: 0;
  margin: 0;
}
.how-step {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}
.step-n {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.how-step h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 18px;
  margin: 10px 0 8px;
  color: var(--ink);
}
.how-step h3::before { content: ''; }
.how-step p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.how-step code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-2);
  padding: 1px 5px;
  color: var(--warm);
  border-radius: 2px;
}
.footnote {
  margin: 56px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.8;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px var(--gutter) 36px;
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .how-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-copy .copy-text { max-width: 70vw; }
}
@media (max-width: 640px) {
  .nav { padding: 14px 20px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 12px; }
  .hero { padding-top: 32px; }
  .title { font-size: clamp(32px, 9vw, 48px); }
  .lede { font-size: 17px; }
  .how-grid { grid-template-columns: 1fr; }
  .foot { flex-direction: column; gap: 6px; }
  .cta-copy .copy-text { max-width: 75vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .cursor { animation: none; }
  .node-ring-2 { animation: none; }
}
