/* Shared stylesheet for the /proposals subtree.
   Mirrors the site-wide tokens in index.html — change both together. */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@300;400;500;600&display=swap');

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

:root {
  --bg: #0D1117;
  --bg-surface: #161B22;
  --blue: #58A6FF;
  --blue-dim: #1F6FEB;
  --gray: #6E7681;
  --text: #C9D1D9;
  --text-dim: #8B949E;
  --border: #21262D;
  --purple: #BC8CFF;
  --gold: #D29922;
  --green: #3FB950;
  --red: #F85149;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeUp 0.6s ease-out both;
}

.fade-in:nth-child(2) {
  animation-delay: 0.1s;
}

.fade-in:nth-child(3) {
  animation-delay: 0.2s;
}

/* ---- Nav ---- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.nav .home {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  text-decoration: none;
}

.nav .home .bracket {
  color: var(--gray);
}

.nav .home .mark {
  color: var(--blue);
  font-weight: 700;
}

.nav .crumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
}

.nav .crumb:hover {
  color: var(--blue);
}

.nav .cta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--blue);
  text-decoration: none;
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 6px;
  padding: 0.4rem 1rem;
  transition: all 0.2s;
}

.nav .cta:hover {
  background: rgba(88, 166, 255, 0.08);
}

/* ---- Hero ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(88, 166, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero.compact {
  min-height: 38vh;
  padding: 3rem 2rem;
}

.tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  margin-bottom: 1.75rem;
  font-weight: 400;
  opacity: 0.85;
}

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 760px;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--blue);
}

.subtitle {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-dim);
  max-width: 600px;
  font-weight: 300;
  line-height: 1.8;
}

.subtitle a {
  color: var(--blue);
  text-decoration: none;
}

/* ---- Sections ---- */
section {
  padding: 4rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

section.tight {
  padding: 2.5rem 2rem;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-bottom: 2rem;
}

section h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

section h2 em {
  font-style: normal;
  color: var(--blue);
}

/* ---- Long-form prose ---- */
.prose {
  max-width: 720px;
}

.prose p {
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--text-dim);
  margin-bottom: 1.4rem;
}

.prose p strong {
  color: var(--text);
  font-weight: 500;
}

.prose p em {
  color: var(--text);
}

.prose h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--blue);
  font-weight: 600;
  margin: 2.75rem 0 1rem;
  letter-spacing: 0.02em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.4rem 1.4rem;
  color: var(--text-dim);
  font-size: 1.02rem;
  line-height: 1.85;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose a {
  color: var(--blue);
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
}

.prose .aside {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--gray);
  margin: 1.75rem 0;
  line-height: 1.75;
}

.open-decision {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.75;
}

.open-decision .od-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: block;
  margin-bottom: 0.5rem;
}

/* ---- Aside boxes: named vignettes pulled out of the argument ---- */
.box {
  background: rgba(88, 166, 255, 0.03);
  border: 1px solid var(--border);
  border-left: 2px solid var(--blue-dim);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  margin: 2.25rem 0;
}

.box-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 0.65rem;
}

.box h4 {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.prose .box p {
  font-size: 0.93rem;
  line-height: 1.78;
  margin-bottom: 0.85rem;
}

.prose .box p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .box {
    padding: 1.15rem 1.25rem;
  }
}

/* ---- Thesis ---- */
.thesis {
  border-left: 2px solid var(--blue-dim);
  padding-left: 2rem;
  margin-top: 0.5rem;
}

.thesis p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.thesis p:last-child {
  margin-bottom: 0;
}

.thesis strong {
  color: var(--text);
  font-weight: 500;
}

/* ---- Cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: border-color 0.25s, transform 0.25s;
}

.card:hover {
  border-color: var(--blue-dim);
  transform: translateY(-2px);
}

.card h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--blue);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.card h3 a {
  color: var(--blue);
  text-decoration: none;
}

.card h3 a:hover {
  text-decoration: underline;
}

.card p {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.card p a {
  color: var(--blue);
  text-decoration: none;
}

.card p a:hover {
  text-decoration: underline;
}

.card .step {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--gray);
  display: block;
  margin-bottom: 0.75rem;
  letter-spacing: 0.15em;
}

.tags {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--gray);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.2rem 0.6rem;
  font-family: 'JetBrains Mono', monospace;
}

.tag.status {
  color: var(--blue);
  border-color: rgba(88, 166, 255, 0.2);
  font-weight: 500;
}

/* ---- Chapter TOC ---- */
.toc {
  display: grid;
  gap: 0.35rem;
  max-width: 720px;
}

.toc a {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  text-decoration: none;
  padding: 0.85rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s;
}

.toc a:hover {
  background: var(--bg-surface);
  border-color: var(--blue-dim);
}

.toc .toc-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--gray);
  letter-spacing: 0.12em;
}

.toc .toc-title {
  font-size: 0.98rem;
  color: var(--text);
  font-weight: 500;
}

.toc .toc-hook {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--gray);
  text-align: right;
}

@media (max-width: 640px) {
  .toc .toc-hook {
    display: none;
  }
}

/* ---- Chapter prev/next ---- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.chapter-nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1.25rem;
  max-width: 46%;
  transition: all 0.2s;
  line-height: 1.5;
}

.chapter-nav a:hover {
  color: var(--blue);
  border-color: var(--blue-dim);
  background: rgba(88, 166, 255, 0.04);
}

.chapter-nav .dir {
  display: block;
  font-size: 0.65rem;
  color: var(--gray);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.chapter-nav .next {
  margin-left: auto;
  text-align: right;
}

/* ---- Diagrams ---- */
.diagram {
  margin: 2rem 0 1rem;
  overflow-x: auto;
}

.diagram svg {
  width: 100%;
  min-width: 720px;
  height: auto;
  display: block;
}

.flow-node {
  fill: var(--bg-surface);
  stroke: var(--border);
  stroke-width: 1.5;
}

.flow-line {
  stroke: var(--blue-dim);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  animation: flow 1.4s linear infinite;
  opacity: 0.8;
}

.flow-solid {
  stroke: var(--blue-dim);
  stroke-width: 1.5;
}

.flow-arrowhead {
  stroke: var(--blue-dim);
  stroke-width: 1.5;
}

@keyframes flow {
  to {
    stroke-dashoffset: -10;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-line {
    animation: none;
  }
}

.flow-title {
  fill: var(--blue);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
}

.flow-sub {
  fill: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
}

.flow-step {
  fill: var(--gray);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.flow-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.t-gold { fill: var(--gold); }
.t-purple { fill: var(--purple); }
.t-blue { fill: var(--blue); }
.t-green { fill: var(--green); }
.t-red { fill: var(--red); }
.t-text { fill: var(--text); }

.diagram-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.7;
  border-left: 2px solid var(--blue-dim);
  padding-left: 1.25rem;
}

.diagram-note strong {
  color: var(--text);
  font-weight: 500;
}

/* ---- Dials ---- */
.dial {
  margin: 2.25rem 0;
}

.dial-ends {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 0.6rem;
}

.dial-ends .active {
  color: var(--blue);
}

.dial-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--border), var(--blue-dim));
}

.dial-mark {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--bg);
  border: 2.5px solid var(--blue);
  border-radius: 3px;
}

.dial-note {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-top: 0.85rem;
}

.dial-note strong {
  color: var(--text);
  font-weight: 500;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.25rem 0.7rem;
  background: var(--bg-surface);
}

/* ---- Table ---- */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  margin-top: 0.5rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 660px;
  font-size: 0.85rem;
}

th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: var(--gray);
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--blue-dim);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-dim);
  line-height: 1.55;
}

tr:last-child td {
  border-bottom: none;
}

td.lead {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
}

.col-this {
  background: rgba(88, 166, 255, 0.05);
  color: var(--text);
}

/* ---- Pull quote ---- */
.pull-quote {
  text-align: center;
  padding: 4rem 2rem;
}

.pull-quote blockquote {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 300;
  color: var(--text);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

.pull-quote blockquote em {
  font-style: normal;
  color: var(--blue);
}

/* ---- Steps list ---- */
.steps-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.steps-list p {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
}

.steps-list span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--gray);
  letter-spacing: 0.15em;
  margin-right: 0.9rem;
}

/* ---- Signup ---- */
.signup {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
}

.signup h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.signup>p {
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 2rem;
  font-weight: 300;
}

.signup .embed {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.signup iframe {
  border: none;
  background: transparent;
  max-width: 100%;
}

.signup .or {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-bottom: 1.5rem;
}

.button {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 6px;
  padding: 0.7rem 1.5rem;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.button-ghost {
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.button-ghost:hover {
  color: var(--blue);
  border-color: var(--blue-dim);
}

/* ---- Footer ---- */
.links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 2rem 2rem 4rem;
}

.links a {
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.links a:hover {
  color: var(--blue);
  border-color: var(--blue-dim);
  background: rgba(88, 166, 255, 0.04);
}

footer {
  text-align: center;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--gray);
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
}

footer a {
  color: var(--blue);
  text-decoration: none;
}

footer .copyright {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  margin-top: 0.75rem;
  opacity: 0.6;
}

@media (max-width: 640px) {
  .hero {
    min-height: 45vh;
    padding: 3rem 1.5rem;
  }

  section {
    padding: 3rem 1.5rem;
  }

  .thesis {
    padding-left: 1.25rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .chapter-nav a {
    max-width: 48%;
  }
}
