:root {
  --bg: #0b0b0b;
  --ink: #f3f3f3;
  --muted: #9a9a9a;
  --line: #2a2a2a;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  /* Color split exactly at viewport center; the divider column sits on the seam. */
  background: linear-gradient(to right, var(--bg) 50%, #fff 50%);
}

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

a:hover {
  color: #fff;
}

.wrap {
  width: min(720px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 80px;
}

h1 {
  font-family: "Times New Roman", Times, serif;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 0 20px;
}

p,
li {
  font-size: 17px;
  color: #d6d6d6;
}

.lede {
  font-size: 20px;
  color: var(--ink);
}

/* Horizontal menu under the site title. */
.menu {
  display: flex;
  gap: 22px;
  margin: -6px 0 26px;
}

.menu a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
}

.menu a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Holds shared SVG symbols. Inline SVG ignores the hidden attribute and would
   otherwise take up a 300x150 block at the top of the page. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Two-sided layout: philosophy left, results right, signal plot between. */
.split {
  display: grid;
  grid-template-columns: 1fr 112px 1fr;
  align-items: stretch;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 80px;
}

.side {
  min-width: 0;
}

.side:first-of-type {
  grid-column: 1;
  padding-right: 52px;
}

/* Right half: white comes from the body gradient; dark text here. */
.side:last-of-type {
  --ink: #1b1b1b;
  --muted: #6f6f6f;
  --line: #e3e3e3;
  grid-column: 3;
  padding-left: 52px;
  color: var(--ink);
}

.side:last-of-type p,
.side:last-of-type li {
  color: #2b2b2b;
}

.side:last-of-type a:hover {
  color: #000;
}

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 18px;
}

.side .kicker ~ .kicker {
  margin-top: 52px;
}

.pillars {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
}

.pillars li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  transition: color 0.25s, padding-left 0.25s;
}

.pillars li:hover {
  color: #fff;
  padding-left: 8px;
}

.pillars i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.cta {
  margin-top: 32px;
}

.cta a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-underline-offset: 5px;
}

/* Fixed overlay: the plot spans the full viewport height, above the split's padding. */
.divider {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -56px;
  width: 112px;
  z-index: 2;
}

.scope {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -56px;
  width: 112px;
  height: 100%;
}

.axis {
  stroke: #585858;
  stroke-width: 1;
  transition: stroke 0.6s ease;
}

.rail {
  stroke: #2e2e2e;
  stroke-width: 1;
  stroke-dasharray: 2 7;
  transition: stroke 0.6s ease;
}

.tick {
  stroke: #363636;
  stroke-width: 1;
  transition: stroke 0.6s ease;
}

.tick-major {
  stroke: #565656;
}

.trace {
  fill: none;
  stroke: #8c8c8c;
  stroke-width: 1.4;
  transition: stroke 0.6s ease;
}

.divider:hover .trace {
  /* Mid gray: reads on both the dark and the white half. */
  stroke: #9a9a9a;
}

.divider:hover .axis {
  stroke: #7a7a7a;
}

.divider:hover .rail {
  stroke: #3a3a3a;
}

.divider:hover .tick-major {
  stroke: #6a6a6a;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  min-width: 0;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #5cff8a;
  box-shadow: 0 0 8px #5cff8a;
  animation: live-flash 2.4s ease-in-out infinite;
}

.stat-logo {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--ink);
}

.stat-logo-x {
  width: 13px;
  height: 13px;
}

.stat b {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.stat > span,
.note {
  display: block;
  margin-top: 4px;
  padding-left: 42px;
  color: var(--muted);
  font-size: 13px;
}

@keyframes live-flash {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px #5cff8a;
  }
  50% {
    opacity: 0.25;
    box-shadow: 0 0 2px #5cff8a;
  }
}

.projects {
  list-style: none;
  padding: 0;
  margin: 0;
}

.projects li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

/* The name is the link. The URL is not shown; browsers reveal it on hover. */
.projects a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  text-underline-offset: 3px;
}

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

/* Small muted mark after each name so the row reads as a link before hover. */
.link-mark {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: color 0.2s ease;
}

.projects a:hover .link-mark {
  color: var(--ink);
}

.repo-stars,
.projects .site-link {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.projects .site-link:hover {
  color: var(--ink);
}

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

.article p {
  max-width: 62ch;
}

.article h1 {
  margin-top: 0;
}

.article h2,
.article h3 {
  font-weight: 500;
  margin: 32px 0 8px;
}

.article blockquote {
  margin: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.article pre {
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  font-size: 14px;
}

.article code {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* Single-column pages (articles, article index): dark only, no color split. */
.page {
  background: var(--bg);
}

.crumbs {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 40px;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.articles {
  list-style: none;
  padding: 0;
  margin: 0;
}

.articles li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.articles a {
  min-width: 0;
  text-decoration: none;
  text-underline-offset: 3px;
}

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

.articles time {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 1000px) {
  body {
    background: var(--bg);
  }

  .split {
    grid-template-columns: 1fr;
    padding: 40px 0 64px;
  }

  .side:first-of-type,
  .side:last-of-type {
    grid-column: auto;
    padding: 0;
  }

  /* Stacked: white becomes a full-width band. */
  .side:last-of-type {
    margin-top: 48px;
    padding: 32px 0;
    background: #fff;
    box-shadow: 0 0 0 100vmax #fff;
    clip-path: inset(0 -100vmax);
  }

  /* One full signal period reads as a divider when the columns stack. */
  .divider {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: auto;
    height: 240px;
    margin: 40px 0 0;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 32px;
  }

  .stats {
    display: block;
  }

  .stat + .stat {
    margin-top: 16px;
  }
}

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