:root {
  --paper: #f3eee4;
  --ink: #1b1916;
  --muted: #6a645c;
  --rule: #d4cdc0;
  --surface: #fffdf8;
  --accent: #8c3b2a;
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Source Sans 3", "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 200ms ease;
}

a:hover {
  color: var(--ink);
}

code {
  font-family: "Source Sans 3", ui-monospace, monospace;
  font-size: 0.92em;
  color: var(--ink);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.7rem;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.55rem);
  max-width: 18ch;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1rem;
}

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

.wrap {
  width: min(1080px, calc(100% - 3rem));
  margin: 0 auto;
}

.quiet {
  color: var(--muted);
  font-size: 0.98rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  gap: 1.5rem;
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.05rem;
  white-space: nowrap;
}

.wordmark:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 1.15rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
}

.hero {
  padding: 6.5rem 0 5.5rem;
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  margin: 0 0 1.1rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.deck {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.2rem;
  margin-bottom: 1.75rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 2.1rem;
}

.meta-row span:not(:last-child)::after {
  content: "·";
  margin: 0 0.7rem;
  color: var(--rule);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 1.05rem;
  border: 1px solid var(--ink);
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.section {
  padding: 5.25rem 0;
}

.section-tint {
  background: color-mix(in srgb, var(--surface) 72%, var(--paper));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.section-kicker,
.loop-label,
.loop-detail-kicker,
.package-id,
.system-detail-kicker,
.limits-kicker,
.idea-num {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-intro {
  max-width: 38rem;
  margin-bottom: 2.4rem;
}

.section-intro p {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.loop-panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.35rem 1.35rem 1.2rem;
}

.loop-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.loop-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.loop-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin: 0 0 1.15rem;
  padding: 0;
  list-style: none;
}

.loop-node {
  width: 100%;
  min-height: 4.4rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.loop-node:hover,
.loop-node:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.loop-node.is-current {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.loop-node.is-current .loop-index {
  color: color-mix(in srgb, var(--paper) 72%, var(--accent));
}

.loop-index {
  display: block;
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.loop-name {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--serif);
  font-size: 1rem;
}

.loop-detail {
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
}

.loop-detail p:last-child {
  color: var(--muted);
}

.package-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.75rem;
}

.package {
  padding: 0.2rem 0 1rem;
  border-top: 1px solid var(--rule);
}

.package h3,
.idea h3,
.metric h3,
.system-detail h3 {
  margin-bottom: 0.45rem;
}

.package p,
.idea p,
.metric p,
.system-detail p {
  color: var(--muted);
}

.package-primary {
  padding: 1.15rem 1.2rem 1.2rem;
  border: 1px solid var(--ink);
  background: var(--surface);
}

.package-primary h3 {
  font-size: 1.45rem;
}

.supporting {
  margin-top: 2rem;
}

.system-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.75rem 2.5rem;
  margin-bottom: 2.75rem;
}

.system-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

.system-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.85rem 0.15rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: color 200ms ease;
}

.system-item:hover,
.system-item:focus-visible {
  color: var(--accent);
  outline: none;
}

.system-item.is-active {
  color: var(--accent);
}

.system-id {
  font-family: var(--serif);
  font-size: 1.05rem;
}

.system-role {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.system-detail {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.4rem 1.35rem;
  align-self: stretch;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.metric {
  padding: 1rem 1.25rem 1.1rem 0;
  border-top: 1px solid var(--rule);
}

.metric h3 {
  font-size: 1.05rem;
}

.idea-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.75rem;
}

.idea {
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
}

.limits {
  max-width: 46rem;
  padding: 1.3rem 0 0;
  border-top: 1px solid var(--rule);
}

.limits p:last-child {
  color: var(--muted);
}

.site-footer {
  padding: 2rem 0 2.4rem;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 720px) {
  .wrap {
    width: min(1080px, calc(100% - 2rem));
  }

  .header-inner,
  .footer-inner,
  .split,
  .package-grid,
  .system-layout,
  .metrics,
  .idea-list {
    display: block;
  }

  .hero {
    padding: 4.25rem 0 3.5rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .loop-panel,
  .package,
  .package-primary,
  .system-detail,
  .metric,
  .idea,
  .supporting {
    margin-bottom: 1.15rem;
  }

  .system-item {
    display: block;
  }

  .system-role {
    display: block;
    margin-top: 0.2rem;
  }
}
