/* ============================================================
   EXARYN — editorial paper, hairlines, one loud accent.
   ============================================================ */

:root {
  --paper: #f4f1ea;
  --paper-raise: #eeeae1;
  --ink: #171512;
  --muted: #57524b;
  --line: #d8d2c6;
  --grid: #ebe7dd;
  --accent: #ff4d00;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", -apple-system, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --pad: clamp(20px, 4vw, 48px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* faint plotter-grid, barely there */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 96px 96px;
  background-attachment: fixed;
}

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

.skip-link {
  position: absolute;
  left: var(--pad);
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-180%);
  transition: transform 0.15s ease;
}
.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

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

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

.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

a { color: inherit; text-decoration: none; }

em {
  font-style: italic;
  color: var(--accent);
}

/* ============ HEADER ============ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.wordmark {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.wordmark .mark {
  color: var(--accent);
  display: inline-block;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wordmark:hover .mark { transform: rotate(180deg); }

.site-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.site-nav a { position: relative; padding: 10px 0; min-height: 44px; display: inline-flex; align-items: center; }

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}

.site-nav a:hover::after { right: 0; }

.site-nav a.current { color: var(--accent); }
.site-nav a.current::after { right: 0; background: var(--accent); }

.clock { color: var(--muted); min-width: 110px; text-align: right; }

/* ============ HERO ============ */

.hero {
  padding: calc(96px + var(--pad)) var(--pad) var(--pad);
  border-bottom: 1px solid var(--line);
}

.kicker {
  color: var(--muted);
  margin-bottom: 28px;
}

.kicker::before {
  content: "✳ ";
  color: var(--accent);
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 8.5vw, 118px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  max-width: 14ch;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 56ch) 1fr;
  gap: 48px;
  align-items: end;
  margin-top: 48px;
}

.hero-lede {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--muted);
  max-width: 52ch;
}

.hero-meta {
  list-style: none;
  justify-self: end;
  min-width: 260px;
  border-top: 1px solid var(--line);
}

.hero-meta li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.hero-meta li span:first-child { color: var(--muted); }

/* ============ MARQUEE ============ */

.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  background: var(--ink);
  color: var(--paper);
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  width: max-content;
  animation: marquee 40s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ============ ABOUT ============ */

.about { border-bottom: 1px solid var(--line); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 64px;
  padding: var(--pad);
  align-items: start;
}

.about-prose p {
  font-size: clamp(16.5px, 1.7vw, 19px);
  line-height: 1.7;
  max-width: 58ch;
}

.about-prose p + p { margin-top: 22px; }

.about-prose strong { font-weight: 600; }

.inline-link {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  transition: background 0.15s ease, color 0.15s ease;
}

.inline-link:hover { background: var(--accent); color: var(--paper); }

.about-facts { max-width: 340px; justify-self: end; width: 100%; }

.off-clock { border-bottom: 1px solid var(--line); }

.interest-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.interest {
  padding: 36px var(--pad);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.18s ease, color 0.18s ease;
}

.interest:nth-child(3n) { border-right: none; }

.interest:hover { background: var(--ink); color: var(--paper); }

.interest-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(23px, 2.3vw, 32px);
  letter-spacing: -0.01em;
}

.interest-name::before { content: "✳ "; color: var(--accent); font-size: 0.6em; vertical-align: middle; }

.interest-desc {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 34ch;
  transition: color 0.18s ease;
}

.interest:hover .interest-desc { color: color-mix(in srgb, var(--paper) 78%, transparent); }

/* ============ TOKEN METER ============ */

.token-meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 16px var(--pad);
  border-bottom: 1px solid var(--line);
}

.meter-label { color: var(--muted); white-space: nowrap; }

.meter-label::before { content: "✳ "; color: var(--accent); }

.meter {
  display: flex;
  gap: 4px;
  height: 14px;
}

.meter i {
  flex: 1;
  background: var(--line);
  transition: background 0.3s ease;
}

.meter i.on { background: var(--accent); }

.meter-figures {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.meter-value { white-space: nowrap; }

.meter-value .meter-sub { color: var(--muted); }

.meter-dollars { white-space: nowrap; color: var(--accent); }

/* ============ SECTIONS ============ */

.page-hero {
  padding: calc(96px + var(--pad)) var(--pad) var(--pad);
  border-bottom: 1px solid var(--line);
}

.section-title.xl {
  font-size: clamp(44px, 7vw, 96px);
  margin-top: 20px;
}

.page-lede {
  margin-top: 24px;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--muted);
  max-width: 58ch;
}

.page-lede .hint { color: var(--ink); }

.more-link {
  padding: 8px 14px;
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.more-link:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.section-cta {
  display: block;
  padding: 18px var(--pad);
  border-top: 1px solid var(--line);
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.section-cta:hover { background: var(--ink); color: var(--paper); }

/* ============ SCREENING ROOM ============ */

.screening { border-bottom: 1px solid var(--line); }

.reel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.reel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 30px var(--pad);
  border-right: 1px solid var(--line);
  transition: background 0.18s ease, color 0.18s ease;
}

.reel:last-child { border-right: none; }

.reel-kicker { color: var(--accent); letter-spacing: 0.14em; }

.reel-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.reel-desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 38ch;
  transition: color 0.18s ease;
}

.reel-meta { margin-top: auto; padding-top: 6px; color: var(--muted); transition: color 0.18s ease; }

.reel:hover { background: var(--ink); color: var(--paper); }
.reel:hover .reel-desc { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.reel:hover .reel-meta { color: var(--accent); }

/* ============ PLAYGROUND ============ */

.playground { border-bottom: 1px solid var(--line); }

.toy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.toy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 36px var(--pad);
  border-right: 1px solid var(--line);
  transition: background 0.18s ease, color 0.18s ease;
}

.toy:last-child { border-right: none; }

.toy-kicker { color: var(--accent); letter-spacing: 0.14em; }

.toy-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.toy-desc {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 44ch;
  transition: color 0.18s ease;
}

.toy-cta {
  margin-top: auto;
  padding-top: 8px;
  color: var(--muted);
  transition: color 0.18s ease, padding-left 0.18s ease;
}

.toy:hover { background: var(--ink); color: var(--paper); }
.toy:hover .toy-desc { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.toy:hover .toy-cta { color: var(--accent); padding-left: 8px; }

/* play page — embedded game */

.play-main { padding-top: 57px; }

.play-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px var(--pad);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.play-bar .play-title { color: var(--muted); }

.play-links { display: flex; gap: 18px; }

.play-links a { color: var(--accent); }
.play-links a:hover { text-decoration: underline; }

.game-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 105px);
  min-height: 640px;
  border: none;
  background: #f0e6cf;
}

/* landing feed teaser */
.feed-teaser { border-bottom: 1px solid var(--line); }

.teaser-blurb {
  padding: 0 var(--pad) 24px;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 60ch;
}

.teaser-blurb .mono { color: var(--accent); margin-left: 12px; }

.feed-teaser .feed-list { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: var(--pad);
  padding-bottom: 24px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.5vw, 62px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.section-note {
  color: var(--muted);
  text-align: right;
  line-height: 1.8;
}

/* ============ PROJECT INDEX ============ */

.work { border-bottom: 1px solid var(--line); }

.project-index {
  list-style: none;
  border-top: 1px solid var(--line);
  counter-reset: proj;
}

.project-row {
  counter-increment: proj;
  border-bottom: 1px solid var(--line);
}

.row-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.3fr) auto 84px 32px;
  gap: 24px;
  align-items: baseline;
  padding: 26px var(--pad);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.project-row.compact .row-head {
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.3fr) auto 84px;
  cursor: default;
}

.project-row.compact a.row-head { cursor: pointer; }

.project-row .num {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.project-row .num::before { content: "0" counter(proj); }

.project-row:nth-child(n+10) .num::before { content: counter(proj); }

.project-name {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.project-desc {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.5;
  max-width: 52ch;
  transition: color 0.18s ease;
}

.project-tech {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  transition: color 0.18s ease;
}

.project-tech .status { display: block; margin-top: 4px; color: var(--accent); }
.project-tech .status[data-status="available"] { color: var(--accent); }
.project-tech .status[data-status="prototype"],
.project-tech .status[data-status="in development"] { color: var(--ink); }
.row-head:hover .project-tech .status,
.project-row.open .row-head .project-tech .status { color: var(--accent); }

.detail-copy { display: grid; gap: 16px; }
.detail-arch { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 62ch; }
.detail-highlights { padding-left: 18px; color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 62ch; }
.detail-highlights li + li { margin-top: 6px; }

.cases { border-bottom: 1px solid var(--line); }
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.case-card {
  padding: 32px var(--pad);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.case-card:last-child { border-right: none; }
.case-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.case-name {
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 36px);
  line-height: 1.05;
}
.case-status { color: var(--accent); }
.case-body { display: grid; gap: 14px; }
.case-body dt { color: var(--muted); margin-bottom: 4px; }
.case-body dd { font-size: 15px; line-height: 1.6; color: var(--ink); }
.case-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: auto; }
.case-links a { color: var(--accent); }
.case-links a:hover { text-decoration: underline; }

/* the side action — only this navigates away */
.row-head .visit {
  justify-self: end;
  padding: 6px 10px;
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.row-head .visit:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }

.row-head .visit.empty { border-color: transparent; color: var(--muted); }

.row-head .toggle {
  font-family: var(--mono);
  font-size: 18px;
  text-align: center;
  color: var(--muted);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.18s ease;
}

/* hover + open — row inverts to ink */
.row-head:hover,
.project-row.open .row-head {
  background: var(--ink);
  color: var(--paper);
}

.row-head:hover .project-desc,
.row-head:hover .project-tech,
.row-head:hover .num,
.row-head:hover .toggle,
.project-row.open .row-head .project-desc,
.project-row.open .row-head .project-tech,
.project-row.open .row-head .num {
  color: color-mix(in srgb, var(--paper) 75%, transparent);
}

.row-head:hover .visit:not(:hover),
.project-row.open .row-head .visit:not(:hover) {
  border-color: color-mix(in srgb, var(--paper) 40%, transparent);
  color: var(--paper);
}

.project-row.open .row-head .toggle { transform: rotate(45deg); color: var(--accent); }

/* the detail panel — 0fr → 1fr height animation */
.row-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-row.open .row-detail { grid-template-rows: 1fr; }

.detail-inner {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  gap: 0 48px;
  padding: 0 var(--pad) 0 calc(56px + 24px + var(--pad));
}

.project-row.open .detail-inner { padding-top: 28px; padding-bottom: 36px; }

.detail-desc {
  font-size: 16.5px;
  line-height: 1.65;
  max-width: 62ch;
}

.detail-meta { border-top: 1px solid var(--line); }

.detail-meta > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.detail-meta dt { color: var(--muted); padding-top: 2px; }

.detail-links {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
  margin-top: 28px;
}

.detail-links a {
  padding: 10px 18px;
  border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.detail-links a:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }

.index-empty, .feed-empty {
  padding: 32px var(--pad);
  color: var(--muted);
  list-style: none;
}

/* ============ FEED ============ */

.feed {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  border-bottom: 1px solid var(--line);
}

.feed-rail {
  padding: var(--pad);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 57px;
  align-self: start;
  max-height: calc(100vh - 57px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.feed-blurb {
  margin-top: 20px;
  color: var(--muted);
  font-size: 15px;
  max-width: 34ch;
}

.feed-updated {
  margin-top: 24px;
  color: var(--accent);
}

.feed-filters {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.filter-btn {
  all: unset;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.filter-btn:hover { color: var(--ink); padding-left: 10px; }

.filter-btn.active { color: var(--ink); }

.filter-btn.active::before { content: "● "; color: var(--accent); }

.filter-btn .count { color: var(--muted); }

.feed-archive { margin-top: 32px; }

.archive-head {
  color: var(--muted);
  padding-bottom: 8px;
}

.archive-head::before { content: "✳ "; color: var(--accent); }

.archive-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  max-height: 230px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.day-btn {
  all: unset;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.day-btn:hover { color: var(--ink); padding-left: 10px; }

.day-btn.active { color: var(--ink); }

.day-btn.active::before { content: "● "; color: var(--accent); }

.day-btn .count { color: var(--muted); }

.feed-pane {
  max-height: calc(100vh - 57px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.feed-list { list-style: none; }

.feed-item { border-bottom: 1px solid var(--line); }

.feed-item > a {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 40px;
  gap: 20px;
  padding: 18px var(--pad) 18px 24px;
  align-items: start;
  transition: background 0.15s ease;
}

.feed-item > a:hover { background: var(--paper-raise); }

.feed-item .when {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
  padding-top: 3px;
}

.feed-item .body { min-width: 0; }

.feed-item .src {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-item .src .tag { color: var(--accent); }

.feed-item .title {
  display: block;
  margin-top: 3px;
  font-size: 17.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.feed-item > a:hover .title { color: var(--accent); }

.feed-item .summary {
  margin-top: 5px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-item .thumb {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-top: 10px;
  border: 1px solid var(--line);
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.25s ease;
}

.feed-item > a:hover .thumb { filter: grayscale(0); }

.feed-item .go {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--muted);
  text-align: right;
  padding-top: 2px;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.15s ease;
}

.feed-item > a:hover .go { transform: translate(3px, -3px); color: var(--accent); }

/* ============ FOOTER ============ */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: calc(var(--pad) * 1.6) var(--pad) var(--pad);
}

.kicker.inverse { color: color-mix(in srgb, var(--paper) 55%, transparent); }

.footer-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.5vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.footer-title em { color: var(--accent); }

.footer-bio {
  margin-top: 32px;
  font-size: 17px;
  line-height: 1.65;
  max-width: 58ch;
  color: color-mix(in srgb, var(--paper) 78%, transparent);
}

.footer-tags {
  margin-top: 20px;
  color: var(--accent);
  letter-spacing: 0.14em;
}

.footer-more {
  color: var(--accent);
  transition: opacity 0.15s ease;
}

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

.footer-links {
  display: flex;
  gap: 32px;
  margin-top: 48px;
}

.footer-links a {
  padding: 12px 20px;
  border: 1px solid color-mix(in srgb, var(--paper) 30%, transparent);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.footer-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.footer-base {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--paper) 20%, transparent);
  color: color-mix(in srgb, var(--paper) 55%, transparent);
}

.footer-base a:hover { color: var(--accent); }

/* ============ REVEAL ============ */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-meta { justify-self: stretch; }

  .row-head,
  .project-row.compact .row-head {
    grid-template-columns: 36px 1fr auto;
    grid-template-areas:
      "num name  toggle"
      ".   desc  desc"
      ".   tech  tech"
      ".   visit visit";
    row-gap: 10px;
    align-items: start;
  }
  .project-row .num { grid-area: num; }
  .project-name { grid-area: name; }
  .project-desc { grid-area: desc; }
  .project-tech { grid-area: tech; text-align: left; }
  .row-head .visit { grid-area: visit; justify-self: start; }
  .row-head .toggle { grid-area: toggle; }
  .project-row.compact .row-head { grid-template-areas:
      "num name  visit"
      ".   desc  desc"
      ".   tech  tech"; }

  .detail-inner { grid-template-columns: 1fr; gap: 24px; padding-left: var(--pad); }

  .feed { grid-template-columns: 1fr; }
  .feed-rail {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .feed-filters { flex-direction: row; flex-wrap: wrap; border-top: none; }
  .filter-btn { border-bottom: none; padding: 8px 12px 8px 0; }
  .feed-pane { max-height: none; overflow: visible; }
  .feed-item > a { grid-template-columns: 1fr 32px; }
  .feed-item .when { grid-column: 1 / -1; padding-top: 0; }

  .token-meter { grid-template-columns: 1fr; gap: 12px; }

  .toy-grid { grid-template-columns: 1fr; }
  .toy { border-right: none; border-bottom: 1px solid var(--line); }
  .toy:last-child { border-bottom: none; }

  .reel-grid { grid-template-columns: 1fr; }
  .reel { border-right: none; border-bottom: 1px solid var(--line); }
  .reel:last-child { border-bottom: none; }

  .case-grid { grid-template-columns: 1fr; }
  .case-card { border-right: none; border-bottom: 1px solid var(--line); }
  .case-card:last-child { border-bottom: none; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-facts { justify-self: stretch; max-width: none; }
  .interest-grid { grid-template-columns: 1fr; }
  .interest { border-right: none; }

  .section-head { flex-direction: column; align-items: flex-start; }
  .section-note { text-align: left; }
  .clock { display: none; }
}

/* ============================================================
   AGENT STRUCT  (agents.html)
   ============================================================ */

.hint { color: var(--ink); }

/* ---- the door into the brain ---- */

.brain-door {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.door {
  display: block;
  padding: var(--pad);
  border-right: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  transition: background 0.25s ease;
}

.door:hover { background: #000; }

.door-kicker {
  display: block;
  color: var(--accent);
  letter-spacing: 0.14em;
}

.door-name {
  display: block;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1;
  margin: 14px 0 18px;
}

.door-desc {
  max-width: 46ch;
  color: color-mix(in srgb, var(--paper) 72%, transparent);
}

.door-meta {
  display: block;
  margin-top: 24px;
  color: color-mix(in srgb, var(--paper) 50%, transparent);
}

.door-cta {
  display: inline-block;
  margin-top: 20px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
}

.door:hover .door-cta { letter-spacing: 0.16em; }

.door-jumps {
  list-style: none;
  align-self: center;
  padding: var(--pad);
  columns: 2;
  column-gap: 32px;
}

.door-jumps li { break-inside: avoid; padding: 7px 0; }

.door-jumps a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.door-jumps a::before { content: "◈ "; color: var(--line); }
.door-jumps a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.door-jumps a:hover::before { color: var(--accent); }

/* ---- scoreboard ---- */

.scoreboard {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.score {
  padding: 26px var(--pad);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score:last-child { border-right: none; }
.score .mono { color: var(--muted); }

.score-num {
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
}

/* ---- tiers ---- */

.tier-grid { border-bottom: 1px solid var(--line); }

.tier {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.tier-head { padding: var(--pad); border-right: 1px solid var(--line); }

.tier-badge {
  display: inline-block;
  padding: 3px 8px;
  background: var(--accent);
  color: var(--paper);
}

.tier-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  margin: 12px 0 10px;
}

.tier-blurb { color: var(--muted); font-size: 14.5px; }
.tier-count { display: block; margin-top: 16px; color: var(--muted); }

.agent-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.agent-card { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.agent-card > a { display: block; padding: 22px var(--pad) 22px 24px; height: 100%; }
.agent-card > a:hover { background: var(--paper-raise); }

.agent-name {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.1;
}

.agent-project { display: block; margin-top: 6px; color: var(--accent); }

.agent-desc {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.agent-go { display: block; margin-top: 16px; color: var(--muted); }
.agent-card > a:hover .agent-go { color: var(--accent); }

/* ---- rules ---- */

.rule-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.rule-list li { padding: var(--pad); border-right: 1px solid var(--line); }
.rule-list li:last-child { border-right: none; }

.rule-num { color: var(--accent); }

.rule-list h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 27px;
  line-height: 1.1;
  margin: 10px 0 12px;
}

.rule-list p { color: var(--muted); font-size: 15px; }

.rule-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.rule-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- the repeating shape ---- */

.shape { border-bottom: 1px solid var(--line); }

.shape-diagram {
  margin: 0 var(--pad);
  padding: 22px 20px;
  border: 1px solid var(--line);
  background: var(--paper-raise);
  overflow-x: auto;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 12.5px;
  color: var(--ink);
}

.shape-note {
  padding: 24px var(--pad) 0;
  max-width: 70ch;
  color: var(--muted);
}

.shape-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 20px var(--pad) var(--pad);
}

.shape-links a { color: var(--muted); border-bottom: 1px solid var(--line); }
.shape-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- everything built ---- */

.everything { border-bottom: 1px solid var(--line); }
.everything-lede { padding: 0 var(--pad) 8px; margin-top: 0; }

.table-wrap { overflow-x: auto; }

.built-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.built-table th,
.built-table td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}

.built-table th { color: var(--muted); border-bottom-color: var(--ink); }
.built-table tbody tr:hover { background: var(--paper-raise); }

.built-name { font-weight: 500; }
.built-name a { border-bottom: 1px solid var(--line); }
.built-name a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.built-tech, .built-agents { color: var(--muted); }
.built-agents a { color: var(--muted); border-bottom: 1px solid var(--line); }
.built-agents a:hover { color: var(--accent); }

.built-table td.mono a:hover { color: var(--accent); }
.built-status[data-status="shipped"] { color: var(--accent); }
.built-status[data-status="archived"] { color: var(--line); }

/* ============================================================
   THE BRAIN  (brain.html) — Obsidian vault, rendered
   ============================================================ */

.brain-main { padding-top: 57px; }

.brain-bar {
  position: sticky;
  top: 57px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 11px var(--pad);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  color: var(--muted);
}

.brain-title { color: var(--ink); }
.brain-stats { display: flex; gap: 18px; margin-left: auto; }
.brain-stats b { color: var(--accent); font-weight: 500; }
.brain-actions { display: flex; gap: 10px; }

.ghost-btn {
  padding: 5px 11px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.brain-loading, .brain-error { padding: 60px var(--pad); color: var(--muted); }
.brain-error code { color: var(--accent); }

.brain-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 258px;
  align-items: start;
}

/* ---- left rail: search, tags, tree ---- */

.brain-rail {
  position: sticky;
  top: 105px;
  max-height: calc(100vh - 105px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.rail-search { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }

#brain-search {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: var(--paper-raise);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

#brain-search:focus { outline: none; border-color: var(--accent); }
.tree-count { display: block; margin-top: 8px; color: var(--muted); }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.tag {
  padding: 3px 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag span { color: var(--line); margin-left: 5px; }
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag.active { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.tag.active span { color: color-mix(in srgb, var(--paper) 70%, transparent); }

.tag.mini { border: none; padding: 2px 0; margin-right: 10px; }

.note-tree { padding-bottom: 40px; }
.tree-group { padding: 14px 0 6px; }
.tree-group ul { list-style: none; }

.tree-folder {
  display: flex;
  justify-content: space-between;
  padding: 0 18px 8px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tree-folder span { color: var(--line); }

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 18px;
  font-size: 13.5px;
  color: var(--muted);
  border-left: 2px solid transparent;
}

.tree-item:hover { background: var(--paper-raise); color: var(--ink); }
.tree-item.active { border-left-color: var(--accent); color: var(--ink); background: var(--paper-raise); }
.tree-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-empty { padding: 20px 18px; color: var(--muted); }

.dot {
  width: 7px; height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}

.dot.t-map { background: var(--accent); }
.dot.t-agent { background: var(--ink); }
.dot.t-project { background: #3d6b4a; }
.dot.t-repo { background: #8a8378; }
.dot.t-system { background: #8a5a2b; }
.dot.t-stack { background: #4a5b8a; }
.dot.t-note, .dot.t-meta { background: var(--muted); }

/* ---- centre: the note ---- */

.brain-pane {
  max-height: calc(100vh - 105px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.graph-wrap { border-bottom: 1px solid var(--line); background: var(--paper-raise); }
#graph { display: block; width: 100%; cursor: pointer; }

.graph-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px var(--pad);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.graph-legend .dot { margin-right: -8px; }
.graph-legend em { color: var(--accent); font-style: normal; }

.note { padding: var(--pad) var(--pad) 80px; max-width: 78ch; }

.note-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.note-crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.gen-flag {
  padding: 2px 6px;
  border: 1px solid var(--line);
  color: var(--accent);
}

.note-tags { display: flex; flex-wrap: wrap; }

/* rendered markdown */

.note-body { padding-top: 28px; }

.note-body h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.note-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  margin: 40px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.note-body h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  margin: 28px 0 10px;
}

.note-body p { margin-bottom: 16px; }
.note-body ul, .note-body ol { margin: 0 0 18px 20px; }
.note-body li { margin-bottom: 7px; }
.note-body hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }

.note-body ul.tasks { list-style: none; margin-left: 0; }

.note-body li.task {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.note-body li.task .box {
  display: inline-block;
  width: 15px; height: 15px;
  line-height: 13px;
  text-align: center;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
}

.note-body li.task.done { color: var(--muted); text-decoration: line-through; }
.note-body li.task.done .box { border-color: var(--accent); }

.note-body a { border-bottom: 1px solid var(--line); }
.note-body a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.note-body a .ext { color: var(--muted); }

.note-body .wl { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.note-body .wl:hover { border-bottom-color: var(--accent); }

.note-body .wl.broken {
  color: var(--muted);
  border-bottom: 1px dotted var(--line);
  cursor: help;
}

.note-body code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 1px 5px;
  background: var(--paper-raise);
  border: 1px solid var(--line);
}

.note-body pre.code {
  padding: 18px 20px;
  margin-bottom: 20px;
  background: var(--paper-raise);
  border: 1px solid var(--line);
  overflow-x: auto;
}

.note-body pre.code code {
  border: none;
  padding: 0;
  background: none;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}

.note-body blockquote {
  padding-left: 20px;
  margin-bottom: 18px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.note-body blockquote p:last-child { margin-bottom: 0; }

.note-body .callout {
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: var(--paper-raise);
}

.note-body .callout-title { color: var(--accent); margin-bottom: 8px; }
.note-body .callout p:last-child { margin-bottom: 0; }
.note-body .callout.warning { border-left-color: var(--muted); }
.note-body .callout.warning .callout-title { color: var(--muted); }

.note-body .table-wrap { margin-bottom: 22px; border: 1px solid var(--line); }

.note-body table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.note-body th,
.note-body td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.note-body thead th {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted);
  border-bottom-color: var(--ink);
}

.note-body tbody tr:last-child td { border-bottom: none; }
.note-body tbody tr:hover { background: var(--paper-raise); }

.note-foot {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.note-foot a:hover { color: var(--accent); }

/* ---- right rail: links ---- */

.brain-rel {
  position: sticky;
  top: 105px;
  max-height: calc(100vh - 105px);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.rel-block { padding: 18px 0; border-bottom: 1px solid var(--line); }

.rel-head {
  display: flex;
  justify-content: space-between;
  padding: 0 18px 10px;
  font-weight: 400;
  color: var(--muted);
}

.rel-head span { color: var(--accent); }

.rel-item {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 18px;
  font-size: 13px;
  color: var(--muted);
}

.rel-item:hover { background: var(--paper-raise); color: var(--ink); }
.rel-item > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rel-folder {
  grid-column: 2;
  font-size: 9.5px;
  color: var(--line);
}

.rel-empty { padding: 0 18px; color: var(--line); }

.rel-meta { padding: 0 18px; font-size: 13px; }
.rel-meta > div { display: flex; gap: 10px; padding: 3px 0; }
.rel-meta dt { color: var(--muted); flex: 0 0 78px; }
.rel-meta dd { color: var(--ink); overflow-wrap: anywhere; }

/* ============ RESPONSIVE — new surfaces ============ */

@media (max-width: 1100px) {
  .brain-shell { grid-template-columns: 232px minmax(0, 1fr); }
  .brain-rel { grid-column: 1 / -1; position: static; max-height: none; border-left: none; border-top: 1px solid var(--line); }
  .scoreboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .score:nth-child(3n) { border-right: none; }
  .score:nth-child(-n + 3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .brain-door { grid-template-columns: 1fr; }
  .door { border-right: none; border-bottom: 1px solid var(--line); }
  .door-jumps { columns: 1; }

  .tier { grid-template-columns: 1fr; }
  .tier-head { border-right: none; border-bottom: 1px solid var(--line); }
  .agent-card { border-right: none; }

  .rule-list { grid-template-columns: 1fr; }
  .rule-list li { border-right: none; border-bottom: 1px solid var(--line); }
  .rule-list li:last-child { border-bottom: none; }

  .brain-shell { grid-template-columns: 1fr; }
  .brain-rail {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .note-tree { max-height: 320px; overflow-y: auto; }
  .brain-pane { max-height: none; overflow: visible; }
  .brain-stats { margin-left: 0; }
  .brain-title { flex: 1 1 100%; }
}

/* ---- landing-page brain band ---- */

.brain-teaser { border-bottom: 1px solid var(--line); }

.brain-card {
  display: block;
  margin: 0 var(--pad) var(--pad);
  padding: 28px 30px;
  border: 1px solid var(--ink);
  background: var(--paper-raise);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.brain-card:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.brain-card-kicker { display: block; color: var(--accent); }

.brain-card-desc {
  margin: 14px 0 18px;
  max-width: 62ch;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--muted);
}

.brain-card:hover .brain-card-desc { color: color-mix(in srgb, var(--paper) 74%, transparent); }

.brain-card-meta { color: var(--muted); margin-right: 22px; }
.brain-card:hover .brain-card-meta { color: color-mix(in srgb, var(--paper) 50%, transparent); }
.brain-card-cta { color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: 2px; }

.page-lede b { font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---- header at narrow widths: five nav items need the room ---- */

@media (max-width: 620px) {
  .site-header { gap: 14px; padding: 12px 16px; }
  .wordmark { font-size: 21px; }
  .site-nav {
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }

  /* the brain bar can't be sticky under a header this tight */
  .brain-bar { position: static; }
  .brain-rail, .brain-rel { top: 0; }
}

/* ============ THE MACHINES ============ */

.machines {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.machines-label {
  display: flex;
  align-items: center;
  padding: 0 20px 0 var(--pad);
  color: var(--muted);
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.machine-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.machine {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "dot name" "dot val";
  column-gap: 10px;
  row-gap: 2px;
  align-content: center;
  padding: 12px 18px;
  border-right: 1px solid var(--line);
  transition: background 0.18s ease, color 0.18s ease;
}

.machine:last-child { border-right: none; }

.m-dot {
  grid-area: dot;
  align-self: center;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2e7d43;
  animation: machine-pulse 2.4s ease-in-out infinite;
}

.machine.dead .m-dot { background: var(--muted); animation: none; }
.machine.dead .m-val { color: var(--muted); }

@keyframes machine-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 125, 67, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(46, 125, 67, 0); }
}

.m-name { grid-area: name; color: var(--muted); font-size: 9.5px; }
.m-val { grid-area: val; font-size: 10.5px; color: var(--ink); }

.machine:hover { background: var(--ink); color: var(--paper); }
.machine:hover .m-name { color: color-mix(in srgb, var(--paper) 60%, transparent); }
.machine:hover .m-val { color: var(--accent); }

@media (max-width: 900px) {
  .machines { grid-template-columns: 1fr; }
  .machines-label { padding: 10px var(--pad); border-right: none; border-bottom: 1px solid var(--line); }
  .machine-grid { grid-template-columns: 1fr 1fr; }
  .machine:nth-child(2n) { border-right: none; }
  .machine { border-bottom: 1px solid var(--line); }
  .machine:nth-last-child(-n+2) { border-bottom: none; }
}

/* ============ ROADMAP ============ */

.roadmap { border-top: 1px solid var(--line); }

.roadmap-lede {
  padding: 0 var(--pad) 8px;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 60ch;
}

.roadmap-brain-link { color: var(--accent); }
.roadmap-brain-link:hover { text-decoration: underline; }

.roadmap-lanes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  margin-top: 18px;
}

.rm-lane { border-right: 1px solid var(--line); padding-bottom: 28px; }
.rm-lane:last-child { border-right: none; }

.rm-lane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.rm-lane-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.01em;
}

.rm-lane-name::before { content: "✳ "; color: var(--accent); font-size: 0.65em; vertical-align: middle; }

.rm-lane-note { color: var(--muted); font-size: 9px; text-align: right; }

.rm-item { padding: 16px 22px 4px; }

.rm-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name pct" "track track";
  align-items: baseline;
  column-gap: 12px;
  row-gap: 7px;
}

.rm-name {
  grid-area: name;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

a.rm-name:hover { color: var(--accent); }

.rm-pct { grid-area: pct; color: var(--accent); font-size: 10.5px; font-variant-numeric: tabular-nums; }

.rm-idea { grid-area: pct; color: var(--muted); font-size: 9.5px; border: 1px dashed var(--muted); padding: 2px 7px; }

.rm-track {
  grid-area: track;
  height: 8px;
  border: 1px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 10%);
}

.rm-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rm-track.go .rm-fill { width: var(--p); }

.rm-note {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 44ch;
}

@media (max-width: 900px) {
  .roadmap-lanes { grid-template-columns: 1fr; }
  .rm-lane { border-right: none; border-bottom: 1px solid var(--line); }
  .rm-lane:last-child { border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rm-fill { transition: none; }
  .rm-track .rm-fill { width: var(--p); }
}

/* ============ COMMAND PALETTE ============ */

.palette-hint {
  all: unset;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 5px 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.palette-hint:hover { border-color: var(--accent); color: var(--accent); }

/* the hidden attribute must beat the display:flex below, or the overlay
   can never actually close */
#palette-overlay[hidden] { display: none; }

#palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--ink) 32%, transparent);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  padding: 12vh 20px 20px;
}

.palette {
  width: min(600px, 100%);
  height: fit-content;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(23, 21, 18, 0.25);
}

.palette-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--sans);
  font-size: 17px;
  padding: 16px 18px;
  color: var(--ink);
  outline: none;
  box-sizing: border-box;
}

.palette-list {
  list-style: none;
  max-height: 46vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.palette-list button {
  all: unset;
  cursor: pointer;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-areas: "type title" "type sub";
  column-gap: 14px;
  width: 100%;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  box-sizing: border-box;
}

.palette-list .pk-type {
  grid-area: type;
  align-self: center;
  font-size: 9px;
  color: var(--accent);
}

.palette-list .pk-title { grid-area: title; font-weight: 500; font-size: 15.5px; }

.palette-list .pk-sub {
  grid-area: sub;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-list button:hover, .palette-list button.active { background: var(--ink); color: var(--paper); }
.palette-list button:hover .pk-sub, .palette-list button.active .pk-sub { color: color-mix(in srgb, var(--paper) 65%, transparent); }

.palette-empty { padding: 22px 18px; color: var(--muted); }

.palette-foot {
  display: flex;
  gap: 20px;
  padding: 9px 18px;
  color: var(--muted);
  font-size: 9.5px;
}

/* ============ FIELD NOTES ============ */

.notes-index { list-style: none; border-top: 1px solid var(--line); }

.notes-teaser { border-bottom: 1px solid var(--line); }
.notes-teaser .notes-index { border-top: 1px solid var(--line); }

.note-row { border-bottom: 1px solid var(--line); }

.note-row a {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 70px;
  grid-template-areas:
    "meta title go"
    "meta dek   go";
  column-gap: 28px;
  row-gap: 6px;
  padding: 26px var(--pad);
  align-items: start;
  transition: background 0.18s ease, color 0.18s ease;
}

.note-meta { grid-area: meta; color: var(--muted); line-height: 1.9; }
.note-meta .note-tag { display: block; color: var(--accent); }

.note-title {
  grid-area: title;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.note-dek {
  grid-area: dek;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 62ch;
  transition: color 0.18s ease;
}

.note-go { grid-area: go; justify-self: end; padding-top: 6px; color: var(--muted); transition: color 0.18s ease; }

.note-row a:hover { background: var(--ink); color: var(--paper); }
.note-row a:hover .note-dek, .note-row a:hover .note-meta { color: color-mix(in srgb, var(--paper) 72%, transparent); }
.note-row a:hover .note-go { color: var(--accent); }

/* article pages */

.article {
  max-width: 76ch;
  margin: 0 auto;
  padding: calc(96px + var(--pad)) var(--pad) calc(var(--pad) * 1.5);
}

.article-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-top: 18px;
}

.article-dek {
  margin-top: 18px;
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 58ch;
}

.article-body { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 32px; }

.article-body p { font-size: 17px; line-height: 1.75; max-width: 66ch; }
.article-body p + p { margin-top: 20px; }

.article-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.01em;
  margin: 44px 0 16px;
}

.article-body h2::before { content: "✳ "; color: var(--accent); font-size: 0.6em; vertical-align: middle; }

.article-body h3 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 30px 0 10px;
}

.article-body ul, .article-body ol { margin: 18px 0 18px 22px; max-width: 62ch; }
.article-body li { font-size: 16.5px; line-height: 1.7; margin-bottom: 8px; }

.article-body strong { font-weight: 600; }

.article-body a { color: var(--accent); border-bottom: 1px solid var(--accent); }
.article-body a:hover { background: var(--accent); color: var(--paper); }

.article-body pre {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 22px 0;
}

.article-body code { font-family: var(--mono); font-size: 0.88em; background: var(--paper-raise); padding: 1px 5px; border: 1px solid var(--line); }
.article-body pre code { background: none; border: none; padding: 0; font-size: inherit; }

.article-body blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.7;
  max-width: 60ch;
}

.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14.5px; }
.article-body th {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--ink);
}
.article-body td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.55; }

.table-scroll-x { overflow-x: auto; }

.article-foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--muted);
}

.article-foot a { color: var(--accent); }
.article-foot a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .note-row a {
    grid-template-columns: 1fr;
    grid-template-areas: "meta" "title" "dek" "go";
  }
  .note-meta { display: flex; gap: 10px; }
  .note-meta .note-tag { display: inline; }
  .note-go { justify-self: start; }
}
