/* =========================================================================
   Lea — site styles
   Structure: tokens → base → chrome → components → pages → responsive
   ========================================================================= */

/* ------------------------------------------------------------------- fonts */

/* IBM Plex Mono SemiBold, subsetted to the three letters of the wordmark —
   788 bytes, so it costs less than the request to fetch it would suggest.
   `swap` because the fallback mono is close enough that a flash beats a
   blank brand. IBM Plex Mono is licensed under the SIL Open Font License. */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-600-lea.woff2") format("woff2");
}

/* ------------------------------------------------------------------ tokens */

:root {
  /* Warm paper, ink, and one accent: the green the app uses for "proved". */
  --paper: #fbfaf7;
  --paper-raised: #ffffff;
  --paper-sunken: #f3f1ec;
  --ink: #191814;
  --ink-muted: #6a675f;
  --ink-faint: #8f8b81;
  --line: #e4e0d7;
  --line-strong: #cec9bc;

  --accent: #16733d;
  --accent-hover: #115d31;
  --accent-soft: #e8f2ea;
  --accent-line: #b7d8c3;

  --amber: #8a6300;
  --amber-soft: #f7efdb;
  --blue: #2f5aa8;
  --blue-soft: #e8eef8;
  --danger: #a83232;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --font-wordmark: "IBM Plex Mono", var(--font-mono);

  /* The brand ramp: blue into teal into the green the app uses for "proved". */
  --ramp: linear-gradient(118deg, #2f5aa8 0%, #128a8a 32%, #16733d 62%, #0d4f2b 100%);

  --wrap: 1120px;
  --prose: 42rem;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(25, 24, 20, 0.05);
  --shadow: 0 1px 3px rgba(25, 24, 20, 0.06), 0 12px 32px -18px rgba(25, 24, 20, 0.35);

  color-scheme: light;
}

/* Token overrides for dark. Defined for the system default and for the
   explicit toggle, so both directions win over the light values above. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121210;
    --paper-raised: #1a1a17;
    --paper-sunken: #0d0d0b;
    --ink: #ece9e1;
    --ink-muted: #9b978c;
    --ink-faint: #7b776d;
    --line: #2a2925;
    --line-strong: #3d3b35;

    --accent: #4fb37b;
    --accent-hover: #6cc593;
    --accent-soft: #14261c;
    --accent-line: #27492f;
    --ramp: linear-gradient(118deg, #9dbcf0 0%, #74d3c9 32%, #7cc79c 62%, #b5e3c6 100%);

    --amber: #d4a24c;
    --amber-soft: #2a2214;
    --blue: #7ea6e8;
    --blue-soft: #172230;
    --danger: #e08b8b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 12px 32px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #121210;
  --paper-raised: #1a1a17;
  --paper-sunken: #0d0d0b;
  --ink: #ece9e1;
  --ink-muted: #9b978c;
  --ink-faint: #7b776d;
  --line: #2a2925;
  --line-strong: #3d3b35;

  --accent: #4fb37b;
  --accent-hover: #6cc593;
  --accent-soft: #14261c;
  --accent-line: #27492f;
  --ramp: linear-gradient(118deg, #9dbcf0 0%, #74d3c9 32%, #7cc79c 62%, #b5e3c6 100%);

  --amber: #d4a24c;
  --amber-soft: #2a2214;
  --blue: #7ea6e8;
  --blue-soft: #172230;
  --danger: #e08b8b;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 12px 32px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* -------------------------------------------------------------------- base */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.2rem);
}
h2 {
  font-size: clamp(1.55rem, 1.2rem + 1.3vw, 2.1rem);
}
h3 {
  font-size: 1.2rem;
}
h4 {
  font-size: 1.02rem;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-variant-ligatures: none;
}

:not(pre) > code {
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.36em;
  white-space: nowrap;
}

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

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

.mono {
  font-family: var(--font-mono);
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: inherit;
}

/* The wordmark proper: IBM Plex Mono carrying the brand ramp. The colour is
   set first so the text stays legible if background-clip: text is unavailable
   — without it, transparent text over no background is invisible. */
.brand-text {
  font-family: var(--font-wordmark);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--accent);
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .brand-text {
    background-image: var(--ramp);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}

.nav a::before,
.nav a::after {
  opacity: 0;
  transition: opacity 0.15s ease;
  color: var(--accent);
}

.nav a::before {
  content: "[";
  margin-right: 1px;
}

.nav a::after {
  content: "]";
  margin-left: 1px;
}

.nav a:hover,
.nav a.active {
  color: var(--ink);
}

.nav a:hover::before,
.nav a:hover::after,
.nav a.active::before,
.nav a.active::after {
  opacity: 1;
}

.theme-toggle {
  margin-left: 0.35rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-muted);
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.theme-icon {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--paper-raised);
}

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

/* -------------------------------------------------------------------- code */

figure.code {
  position: relative;
  margin: 1.5rem 0;
}

pre {
  margin: 0;
  padding: 1.1rem 1.2rem;
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.6;
  tab-size: 2;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  white-space: pre;
  font-size: 0.83rem;
}

.copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

figure.code:hover .copy,
.copy:focus-visible {
  opacity: 1;
}

.copy:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

.tok-comment {
  color: var(--ink-faint);
  font-style: italic;
}
.tok-keyword {
  color: var(--blue);
  font-weight: 600;
}
.tok-tactic {
  color: var(--accent);
}
.tok-string {
  color: var(--amber);
}
.tok-number {
  color: var(--amber);
}
.tok-type {
  color: var(--ink);
  font-weight: 600;
}
.tok-operator {
  color: var(--ink-muted);
}
.tok-flag {
  color: var(--accent);
}
.tok-variable {
  color: var(--blue);
}
.tok-danger {
  color: var(--danger);
  font-weight: 600;
  text-decoration: underline wavy var(--danger);
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------- table */

.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background: var(--paper-sunken);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* -------------------------------------------------------------- blockquote */

blockquote {
  margin: 1.5rem 0;
  padding: 0.1rem 0 0.1rem 1.15rem;
  border-left: 2px solid var(--line-strong);
  color: var(--ink-muted);
}

blockquote.callout {
  border-left-width: 3px;
  border-left-color: var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.15rem 0.1rem;
  color: var(--ink);
}

blockquote.callout-warning,
blockquote.callout-caution {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

/* ------------------------------------------------------------------ shared */

.section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--line);
}

.section-alt {
  background: var(--paper-sunken);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.section-head {
  max-width: 46rem;
  margin-bottom: 2.5rem;
}

.section-head p {
  color: var(--ink-muted);
  font-size: 1.05rem;
  margin-bottom: 0;
}

.lead {
  font-size: 1.15rem;
  color: var(--ink-muted);
}

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  padding: 5rem 0 3.5rem;
  overflow: hidden;
}

/* Faint graph paper — a nod to the medium, kept below the noise floor. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 0%, transparent 75%);
  opacity: 0.5;
  pointer-events: none;
}

/* The grid reads much louder against a dark ground. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero::before {
    opacity: 0.3;
  }
}

:root[data-theme="dark"] .hero::before {
  opacity: 0.3;
}

.hero > .wrap {
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 1.2rem + 2.2vw, 2.85rem);
}

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

.hero-sub {
  max-width: 40rem;
  font-size: 1.18rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2.5rem;
}

/* Install block with package-manager style tabs. */
.install {
  max-width: 40rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.install-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper-sunken);
}

.install-tab {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.55rem 0.95rem;
  background: none;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--ink-muted);
  cursor: pointer;
}

.install-tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--paper-raised);
  box-shadow: inset 0 -1px 0 var(--paper-raised);
}

.install-panel[hidden] {
  display: none;
}

.install-panel figure.code {
  margin: 0;
}

.install-panel pre {
  border: 0;
  border-radius: 0;
  background: var(--paper-raised);
  padding: 1rem 1.1rem;
}

.install-note {
  padding: 0.6rem 1.1rem 0.75rem;
  border-top: 1px dashed var(--line);
  font-size: 0.83rem;
  color: var(--ink-faint);
  margin: 0;
}

/* -------------------------------------------------------------- thesis row */

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

.thesis-quote {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.45;
  margin: 0 0 0.9rem;
}

.thesis-cite {
  font-size: 0.86rem;
  color: var(--ink-faint);
  margin: 0;
}

.thesis-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.15rem;
}

.thesis-points li {
  padding-left: 1.6rem;
  position: relative;
  color: var(--ink-muted);
}

.thesis-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border: 2px solid var(--accent);
  border-radius: 2px;
}

.thesis-points strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------------------------------------------------------------- carousel */

/* The hero carousel carries the feature tour. Its base state is a horizontally
   scrollable, snapping strip — so it works with no JavaScript at all, and on
   touch it is simply swipeable. The script adds arrows, dots and auto-advance. */

.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  /* Slides' offsetLeft is read against this element. */
  position: relative;
  padding-bottom: 0.25rem;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    scroll-behavior: auto;
  }
}

.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
}

/* Screenshot or vignette presented in a restrained window frame. */
.shot {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-sunken);
  box-shadow: var(--shadow);
}

.shot-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
}

.shot-bar .dots {
  display: inline-flex;
  gap: 4px;
  margin-right: 0.3rem;
}

.shot-bar .dots i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-strong);
}

/* Every slide's visual occupies the same box, so the carousel never jumps.
   Its contents are clipped, so a mockup can never push the slide out of shape. */
.slide-canvas {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
  background: var(--paper-sunken);
}

/* ------------------------------------------------------------ slide mockups */

/* Each slide's visual is drawn in HTML/SVG rather than screenshotted: crisp at
   any size, theme-aware, and no image bytes. Sizes are absolute rather than
   container-relative — the canvas only ranges from about 330px to 640px wide,
   and one small step down at the narrow end (below) is enough to fit. */

.mock {
  display: grid;
  align-content: center;
  /* Rows take their content height, so align-content actually has slack to
     centre with. Mockups that want to fill set grid-template-rows instead. */
  grid-auto-rows: max-content;
  padding: 0.9rem;
  gap: 0.75rem;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-muted);
  height: 100%;
}

.mock p {
  margin: 0;
}

.mock code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 10px;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}

.mock-pane {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  overflow: hidden;
  min-width: 0;
}

/* --- LeaChat proof canvas ------------------------------------------------- */

.mock-proof {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 0.6rem;
}

.mock-who {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 10px;
  color: var(--ink-faint);
  margin-bottom: 0.5rem !important;
}

.mock-avatar {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  font-weight: 700;
}

.mock-heading {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.45rem !important;
}

.mock-tick {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
}

:root[data-theme="dark"] .mock-tick {
  color: #0d1a12;
}

.mock-sub {
  font-weight: 600;
  color: var(--ink);
  margin: 0.6rem 0 0.3rem !important;
}

.mock-text {
  margin-bottom: 0.3rem !important;
}

.mock-code-pane {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mock-filetab {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink);
  background: var(--paper-sunken);
}

.mock-step {
  color: var(--ink-faint);
  white-space: nowrap;
}

.mock-code-pane pre {
  flex: 1;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 0.5rem 0.55rem;
  overflow: hidden;
}

.mock-code-pane code {
  font-size: 8px;
  line-height: 1.65;
  white-space: pre;
  color: var(--ink);
}

.mock-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.mock-ok {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.mock-action {
  color: var(--ink-faint);
}

/* --- Blueprint graph ------------------------------------------------------ */

/* The SVG scales with its viewBox, so this one needs no size stepping. The
   single 1fr row keeps it inside the padding rather than 100% + padding. */
.mock-blueprint {
  padding: 0.6rem;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
}

.mock-blueprint svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bp-edge {
  stroke: var(--line-strong);
  fill: none;
  stroke-width: 1.2;
}

.bp-node ellipse {
  fill: var(--paper-raised);
  stroke: var(--line-strong);
  stroke-width: 1.2;
}

.bp-pending ellipse {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-dasharray: 3 3;
}

.bp-ready ellipse {
  fill: var(--accent-soft);
  stroke: var(--accent);
}

.bp-stated ellipse {
  fill: var(--blue-soft);
  stroke: var(--blue);
}

.bp-name {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
}

.bp-meta {
  fill: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 7.5px;
}

/* --- Project documents ---------------------------------------------------- */

.mock-project-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mock-ns {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-faint);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

/* Title sits above; the three documents fill what is left. */
.mock-project {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
}

.mock-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.mock-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
}

.mock-card-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem !important;
}

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

/* A long document blurb must never push the card out of the canvas. */
.mock-card p {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- What ships wired in -------------------------------------------------- */

.mock-tooling {
  padding: 1.5rem;
  gap: 1rem;
  font-size: 12px;
}

.mock-tooling-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mock-tooling ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.mock-tooling li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  line-height: 1.4;
}

.mock-tooling li > span:last-child {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
}

.mock-tooling b {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}

.mock-gloss {
  color: var(--ink-faint);
}

.mock-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8px;
}

/* --- Code-only vignettes -------------------------------------------------- */

.slide-canvas.vignette {
  display: grid;
  align-content: center;
  padding: 0.9rem;
}

.slide-canvas.vignette figure.code {
  margin: 0;
}

.slide-canvas.vignette pre {
  background: var(--paper-raised);
  padding: 1.1rem 1rem;
  border-radius: 8px;
  overflow: hidden;
}

.slide-canvas.vignette code {
  font-size: 12px;
  line-height: 1.85;
  white-space: pre;
}

/* One step down where the carousel is narrowest. */
@media (max-width: 620px) {
  .mock {
    padding: 0.6rem;
    gap: 0.5rem;
    font-size: 9.5px;
  }

  .mock-pane {
    padding: 0.5rem;
  }

  .mock code {
    font-size: 9px;
  }

  .mock-heading {
    font-size: 12.5px;
  }

  .mock-code-pane code {
    font-size: 7px;
  }

  .mock-project-title {
    font-size: 13px;
  }

  .mock-cards {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .mock-card p {
    display: none;
  }

  .mock-tooling {
    padding: 0.75rem;
  }

  .mock-tooling ul {
    gap: 0.3rem;
  }

  .mock-tooling b {
    font-size: 9px;
  }

  .slide-canvas.vignette code {
    font-size: 8.5px;
  }

  .slide-canvas.vignette pre {
    padding: 0.7rem;
  }
}

.slide-body {
  padding: 1.15rem 0.15rem 0;
  /* Reserve the tallest body so changing slides does not resize the hero. */
  min-height: 9.5rem;
}

.slide-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.slide-body p {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin: 0;
}

.slide-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.slide-link:hover {
  text-decoration: underline;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.carousel-arrow {
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding-bottom: 2px;
}

.carousel-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dots-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
  transition:
    width 0.2s ease,
    background 0.2s ease;
}

.dot[aria-current="true"] {
  width: 20px;
  background: var(--accent);
}

/* ------------------------------------------------------------- how it works */

.pipeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stage {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
}

.stage-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.stage h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.stage p {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin: 0;
}

.diagram {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  padding: 1.5rem;
}

.diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram .d-box {
  fill: var(--paper-sunken);
  stroke: var(--line-strong);
}

.diagram .d-box-accent {
  fill: var(--accent-soft);
  stroke: var(--accent-line);
}

/* The dashed boundary around the backbone — outline only. */
.diagram .d-frame {
  fill: none;
  stroke: var(--line-strong);
}

.diagram .d-label {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
}

.diagram .d-sub {
  fill: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.diagram .d-edge {
  stroke: var(--line-strong);
  fill: none;
  stroke-width: 1.5;
}

.diagram .d-edge-label {
  fill: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10px;
}

.diagram .d-arrow {
  fill: var(--line-strong);
}

/* -------------------------------------------------------------------- blog */

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

.post-item {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1.5rem;
}

.post-item:first-child {
  padding-top: 0;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  padding-top: 0.35rem;
}

.post-item h2 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.post-item h2 a {
  text-decoration: none;
}

.post-item p {
  color: var(--ink-muted);
  font-size: 0.97rem;
  margin: 0 0 0.6rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.post-header {
  max-width: var(--prose);
  margin: 0 auto 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.post-header .post-meta {
  padding-top: 0;
  margin-bottom: 0.9rem;
}

.post-header p.lead {
  margin-bottom: 0;
}

.page-narrow {
  padding: 3.5rem 0 5rem;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.post-nav p {
  margin: 0;
  font-size: 0.97rem;
}

.post-nav a {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  text-decoration: none;
}

/* ------------------------------------------------------------------- prose */

.prose {
  max-width: var(--prose);
  margin-inline: auto;
}

.prose h2 {
  margin-top: 2.6rem;
  padding-top: 0.4rem;
}

.prose h3 {
  margin-top: 2rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin: 0 0 1.1em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose li > ul,
.prose li > ol {
  margin-top: 0.4em;
}

.prose img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.prose figure.code,
.prose .table-scroll {
  /* Code and tables may exceed the measure — they read better slightly wider. */
  width: min(calc(100% + 6rem), calc(100vw - 3rem));
  margin-inline: auto;
}

.anchor {
  margin-left: 0.4rem;
  color: var(--line-strong);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.15s ease;
}

h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

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

.task.done::before {
  content: "✓ ";
  color: var(--accent);
}

.task.todo::before {
  content: "○ ";
  color: var(--ink-faint);
}

/* ------------------------------------------------------------ guide layout */

.guide {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
  padding: 3rem 0 5rem;
}

.toc {
  position: sticky;
  top: 5rem;
  font-size: 0.87rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}

.toc h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-bottom: 0.8rem;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.toc li a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.9rem;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--ink-muted);
  text-decoration: none;
  line-height: 1.4;
}

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

.toc li a.current {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc .lvl-3 a {
  padding-left: 1.7rem;
  font-size: 0.83rem;
}

.guide-body {
  max-width: 46rem;
}

.guide-body > h1 {
  margin-bottom: 0.6rem;
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-sunken);
  padding: 3rem 0 1.5rem;
  margin-top: 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 3rem;
}

.footer-tagline {
  color: var(--ink-muted);
  font-size: 0.92rem;
  margin: 0.8rem 0 0;
  max-width: 22rem;
}

.lab {
  font-size: 0.87rem;
  color: var(--ink-faint);
  margin: 0.5rem 0 0;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.footer-cols h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 0.7rem;
}

.footer-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.footer-cols a {
  color: var(--ink-muted);
  text-decoration: none;
}

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

.footer-legal {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------- responsive */

/* The hero splits into one column well before the rest of the page does — the
   carousel needs its width more than the headline does. */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-media {
    max-width: 40rem;
  }

  .slide-body {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .thesis,
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Shrinking the diagram to phone width makes its labels unreadable —
     let it keep a legible size and scroll instead. */
  .diagram {
    overflow-x: auto;
    padding: 1rem;
  }

  .diagram svg {
    min-width: 620px;
  }

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

  .guide {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .toc {
    position: static;
    max-height: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    background: var(--paper-raised);
  }

}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .wrap {
    padding-inline: 1.15rem;
  }

  .section {
    padding: 3rem 0;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .post-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .nav a {
    padding: 0.35rem 0.4rem;
    font-size: 0.75rem;
  }

  .prose figure.code,
  .prose .table-scroll {
    width: 100%;
  }

  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .copy,
  .theme-toggle {
    display: none;
  }
}
