/* ClawP2P.ai — Design tokens */
:root {
  --ink: #0D1117;
  --fog: #8B9BAE;
  --paper: #E8EDF2;
  --signal: #4A9EFF;
  --verify: #2DD4A0;
  --mono-bg: #161B22;
  --border: rgba(139, 155, 174, 0.15);
  --border-strong: rgba(139, 155, 174, 0.3);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --max-w: 860px;
  --section-gap: 6rem;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Container */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Nav */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo-dot { color: var(--signal); }

.nav-link {
  color: var(--fog);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--paper); }

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }

p { color: var(--fog); }
p + p { margin-top: 0.75rem; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--mono-bg);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--signal);
}

.section-sub {
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  max-width: 640px;
}

/* Hero */
.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--signal);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero h1 {
  color: var(--paper);
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.1rem;
  max-width: 600px;
  margin-bottom: 1rem;
}

.hero-kicker {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--paper);
  max-width: 520px;
  margin-bottom: 2rem;
  font-style: italic;
}

.hero-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3em 0.75em;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  color: var(--fog);
}

/* Sections */
section {
  padding: var(--section-gap) 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type { border-bottom: none; }

/* Hop animation section */
.hop-section { background: var(--mono-bg); }

/* Static fallback (default visible, hidden when JS runs animation) */
.hop-static {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .has-animation .hop-static { display: none; }
  .hop-animated { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .hop-animated { display: none !important; }
  .hop-static { display: flex !important; }
}

.hop-animated {
  display: none;
  align-items: center;
  gap: 0;
  min-height: 180px;
  position: relative;
}

.hop-node {
  flex: 1;
  min-width: 180px;
  background: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 1.25rem;
}

.node-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fog);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hop-phase { }

.phase-name {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--signal);
  display: block;
  margin-bottom: 0.5rem;
}

.verify-phase { color: var(--verify); }
.resume-phase { color: var(--verify); }

.agent-bundle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.bundle-icon { font-size: 1.25rem; }

.bundle-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--paper);
}

.phase-desc {
  font-size: 0.8rem;
  color: var(--fog);
  line-height: 1.4;
}

.hop-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.5rem;
  padding-top: 2.5rem;
}

.arrow-line {
  width: 40px;
  height: 1px;
  background: var(--border-strong);
  position: relative;
}

.arrow-line::after {
  content: '›';
  position: absolute;
  right: -6px;
  top: -9px;
  color: var(--fog);
  font-size: 1rem;
}

.arrow-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--fog);
  margin-top: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Animated hop */
.anim-node {
  flex: 1;
}

.anim-node-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fog);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  text-align: center;
}

.anim-node-box {
  background: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 1.25rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s;
}

.anim-node-box.active { border-color: var(--signal); }
.anim-node-box.verifying { border-color: var(--verify); }

.anim-agent {
  text-align: center;
}

.anim-count {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--paper);
  margin-bottom: 0.25rem;
}

.anim-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fog);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.anim-transit {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding-top: 1.5rem;
}

.transit-track {
  width: 100%;
  height: 2px;
  background: var(--border);
  position: relative;
  border-radius: 1px;
}

.transit-bundle {
  position: absolute;
  top: -10px;
  left: 0;
  font-size: 1rem;
  transition: left 0.8s ease-in-out;
}

.transit-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--fog);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* File tree */
.bundle-section {}

.file-tree-wrap {
  margin-bottom: 2.5rem;
}

.file-tree {
  background: var(--mono-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--paper);
}

.tree-comment { color: var(--fog); }

.manifest-detail {}

.manifest-detail p {
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.manifest-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.field-group {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.field-group:last-child { border-bottom: none; }

.field-key {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--signal);
  flex-shrink: 0;
}

.field-desc {
  font-size: 0.9rem;
  color: var(--fog);
  line-height: 1.5;
}

/* Hop steps */
.hop-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.hop-steps li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.hop-steps li:last-child { border-bottom: none; }

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--signal);
  padding-top: 0.15rem;
  font-weight: 500;
}

.step-body strong {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--paper);
  display: block;
  margin-bottom: 0.35rem;
}

.step-body p {
  font-size: 0.9rem;
  margin: 0;
}

/* Operators */
.operator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .operator-grid { grid-template-columns: 1fr; }
}

.op-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.op-card.accept { border-top: 2px solid var(--verify); }
.op-card.reject { border-top: 2px solid #EF4444; }

.op-card h3 { color: var(--paper); margin-bottom: 1rem; }

.op-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.op-card ul li {
  font-size: 0.9rem;
  color: var(--fog);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.4;
}

.op-card.accept li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--verify);
  font-size: 0.8rem;
}

.op-card.reject li::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: #EF4444;
  font-size: 0.8rem;
}

.sandbox-note {
  background: var(--mono-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.sandbox-note p {
  font-size: 0.9rem;
  color: var(--fog);
  margin: 0;
}

/* Status / roadmap */
.roadmap {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.roadmap-item:last-child { border-bottom: none; }

.roadmap-marker {
  font-family: var(--font-mono);
  color: var(--fog);
  font-size: 0.85rem;
  padding-top: 0.15rem;
}

.roadmap-item.active .roadmap-marker { color: var(--signal); }
.roadmap-item.done .roadmap-marker { color: var(--verify); }
.done-marker { font-size: 1rem; }

.roadmap-item strong {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--paper);
  display: block;
  margin-bottom: 0.35rem;
}

.roadmap-item p {
  font-size: 0.9rem;
  margin: 0;
}

.cta-block { text-align: center; }

.cta-link {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--signal);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: opacity 0.15s;
}

.cta-link:hover { opacity: 0.85; }

/* Footer */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-links {
  text-align: center;
  margin-bottom: 0.75rem;
}

.footer-gh {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--signal);
  text-decoration: none;
  transition: opacity 0.15s;
}

.footer-gh:hover { opacity: 0.75; }

footer p {
  font-size: 0.85rem;
  text-align: center;
}

/* Mobile */
@media (max-width: 600px) {
  :root { --section-gap: 3.5rem; }

  .hop-static { flex-direction: column; }
  .hop-arrow { flex-direction: row; padding-top: 0; padding: 0 1rem; }

  .field-group { grid-template-columns: 1fr; gap: 0.25rem; }

  .hop-steps li { grid-template-columns: 2.5rem 1fr; }
}
