/* inpath.io — site styles */

/* ---------- Tokens ---------- */
:root {
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --max: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 14px;

  /* Light */
  --surface: #ffffff;
  --surface-alt: #f5f8f6;
  --surface-raised: #ffffff;
  --ink: #0b0f0c;
  --ink-muted: #4a554e;
  --line: #dde5df;
  --line-strong: #8a988f;
  --brand: #0a7a3d;
  --brand-hover: #07612f;
  --brand-tint: #e3f4ea;
  --highlight: #b8e8cc;
  --warn: #b45309;
  --warn-tint: #fdf1e3;
  --on-brand: #ffffff;
  --shadow: 0 1px 2px rgb(11 15 12 / 0.04), 0 8px 24px rgb(11 15 12 / 0.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0b120e;
    --surface-alt: #0e1712;
    --surface-raised: #111b15;
    --ink: #f2f6f3;
    --ink-muted: #a6b4aa;
    --line: #213027;
    --line-strong: #70827a;
    --brand: #3ddc84;
    --brand-hover: #6ae8a3;
    --brand-tint: #12281b;
    --highlight: #1d4d33;
    --warn: #f0a04b;
    --warn-tint: #2a1c0d;
    --on-brand: #04140a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --surface: #0b120e;
  --surface-alt: #0e1712;
  --surface-raised: #111b15;
  --ink: #f2f6f3;
  --ink-muted: #a6b4aa;
  --line: #213027;
  --line-strong: #70827a;
  --brand: #3ddc84;
  --brand-hover: #6ae8a3;
  --brand-tint: #12281b;
  --highlight: #1d4d33;
  --warn: #f0a04b;
  --warn-tint: #2a1c0d;
  --on-brand: #04140a;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

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

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

img, svg { max-width: 100%; }

kbd {
  font: 600 0.85em var(--font-mono);
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-alt);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 600 17px var(--font-mono);
  letter-spacing: -0.01em;
}
.mark svg { width: 32px; height: 20px; flex: none; }
.mark .trail {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 0.5 5;
}
.mark .end { fill: var(--brand); }
.mark .io { color: var(--brand); }

.header-right { display: flex; align-items: center; gap: 4px; }

.site-nav { display: flex; gap: 2px; }
.site-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-alt); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.theme-toggle:hover { border-color: var(--line-strong); background: var(--surface-alt); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

@media (max-width: 520px) {
  .mark { font-size: 15px; }
  .site-nav a { padding: 8px; font-size: 14px; }
}

/* ---------- Shared pieces ---------- */
.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  font: 600 12px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.lead {
  font-size: clamp(18px, 2vw, 20px);
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 34em;
}

.section { padding-block: clamp(64px, 9vw, 112px); }
.section + .section { border-top: 1px solid var(--line); }
.section.alt { background: var(--surface-alt); }

.section-head { margin-bottom: 40px; max-width: 40em; }
.section-head h2 { font-size: clamp(30px, 4vw, 40px); }
.section-head p { margin-top: 12px; color: var(--ink-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 15px/1 var(--font-body);
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-alt); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
  color: var(--brand);
  text-decoration: none;
}
.arrow-link span { transition: transform 0.15s; }
.arrow-link:hover span { transform: translateX(3px); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 11px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.chips li {
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  font: 500 12.5px/1.5 var(--font-mono);
  font-variant-ligatures: none; /* keep "C++" from becoming an arrow */
  color: var(--ink-muted);
}

/* ---------- Home: hero ---------- */
.hero { padding-block: clamp(56px, 10vw, 120px) clamp(56px, 8vw, 96px); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
}
.hero h1 { font-size: clamp(40px, 6.4vw, 72px); }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--highlight) 62%);
}
.hero .lead { margin-top: 24px; }

.route-map { margin: 0; }
.route-map svg { display: block; width: 100%; max-width: 440px; height: auto; margin-left: auto; }
.route-map .trl { fill: none; stroke: var(--line-strong); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0.5 9; }
.route-map .stop { fill: var(--brand); }
.route-map .ring { fill: none; stroke: var(--brand); stroke-width: 2; opacity: 0.35; }
.route-map text { font: 600 12px var(--font-mono); letter-spacing: 0.08em; fill: var(--ink-muted); text-anchor: middle; }

.route-map .lost { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 3 3; }
.not-found { min-height: calc(100vh - 64px - 120px); display: grid; align-items: center; }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .route-map svg { margin-inline: 0 auto; max-width: 380px; }
}

/* ---------- Home: projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 760px) { .project-grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.card-num { font: 600 13px var(--font-mono); color: var(--ink-muted); }
.card h3 { font-size: 28px; margin-bottom: 10px; }
.card h3 a { text-decoration: none; }
/* Whole card is clickable via the title link */
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card p { color: var(--ink-muted); }
.card .chips { margin-top: 20px; }
.card .arrow-link { margin-top: auto; padding-top: 24px; }


/* ---------- Also by me (home) ---------- */
/* Other work, kept visibly apart from the main projects. */
.also { margin-top: 48px; padding-top: 32px; border-top: 1px dashed var(--line-strong); }
.also .eyebrow { margin-bottom: 12px; color: var(--ink-muted); }
.also-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
}
.also-body > div { flex: 1 1 26em; }
.also h3 { font-size: 22px; margin-bottom: 6px; }
.also h3 a { text-decoration: none; }
.also h3 a:hover { color: var(--brand); }
.also p { color: var(--ink-muted); font-size: 16px; }

/* ---------- Principles ---------- */
.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding: 0;
  margin: 0;
  list-style: none;
}
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; gap: 28px; } }
.principles li { border-top: 2px solid var(--brand); padding-top: 20px; }
.principles h3 { font-size: 21px; margin-bottom: 8px; }
.principles p { color: var(--ink-muted); font-size: 16px; }

/* ---------- Call-out band ---------- */
.band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  padding: clamp(28px, 4vw, 44px);
  border-radius: calc(var(--radius) + 4px);
  background: var(--brand-tint);
  border: 1px solid var(--line);
}
.band h2 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 8px; }
.band p { color: var(--ink-muted); max-width: 36em; }

/* ---------- Page intro (about + projects) ---------- */
.page-intro { padding-block: clamp(56px, 9vw, 104px) clamp(48px, 7vw, 80px); border-bottom: 1px solid var(--line); }
.page-intro .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.page-intro h1 { font-size: clamp(44px, 6.4vw, 68px); margin-bottom: 18px; }
/* A whole sentence as the heading (About page) reads better a size down. */
.page-intro h1.intro-statement { font-size: clamp(32px, 4.2vw, 48px); line-height: 1.15; }
.page-intro .tag { margin-bottom: 24px; }
.page-intro h1:has(+ .pronounce) { margin-bottom: 10px; }
.pronounce {
  margin: 0 0 20px;
  font: 500 14px/1.5 var(--font-mono);
  color: var(--ink-muted);
}
.page-intro .sub { margin-top: 14px; font-size: 16px; color: var(--ink-muted); }
@media (max-width: 860px) { .page-intro .wrap { grid-template-columns: 1fr; } }

/* ---------- Figures ---------- */
.fig { margin: 0; }
.fig svg { display: block; width: 100%; max-width: 460px; height: auto; margin-left: auto; }
.fig figcaption {
  margin-top: 12px;
  font: 600 12px/16px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: right;
}
@media (max-width: 860px) {
  .fig svg { margin-left: 0; }
  .fig figcaption { text-align: left; }
}
.fig .trl { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 9; }
.fig .lbl { font: 600 12px var(--font-mono); letter-spacing: 0.08em; fill: var(--ink); text-anchor: middle; }
.fig .lbl.muted { fill: var(--ink-muted); }
.fig .lbl.start { text-anchor: start; }
.fig .room { fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-dasharray: 7 7; }
.fig .dev { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
.fig .pic { fill: var(--brand); }
.fig .stand { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.fig .wave { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; }
.fig .dotp { fill: var(--line-strong); }
.fig .pend { stroke: var(--line-strong); stroke-width: 1.5; }
.fig .flip { fill: var(--brand); }
.fig .pen { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Two-column content layout ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 24px 64px;
}
.split > h2 { font-size: clamp(26px, 3vw, 32px); }
.split .prose { max-width: 40em; }
.split .prose p { color: var(--ink-muted); }
.split .prose p strong { color: var(--ink); }
/* minmax(0, …) lets the column shrink below wide content (long commands scroll in their own box). */
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- At a glance ---------- */
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 4px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  padding-top: 3px;
  font: 600 12px/1.6 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.facts dd { margin: 0; }
.facts .tbd { color: var(--ink-muted); font-style: italic; }
@media (max-width: 560px) { .facts > div { grid-template-columns: 1fr; } }

/* ---------- Feature grids ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.feature-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .feature-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .feature-grid, .feature-grid.three { grid-template-columns: 1fr; } }

.feature {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}
.feature h3 { font-size: 19px; margin-bottom: 8px; letter-spacing: -0.01em; }
.feature p { font-size: 15.5px; color: var(--ink-muted); }
.feature.highlight { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--brand-tint); }

/* ---------- Roadmap ---------- */
.roadmap { padding: 0; margin: 0; list-style: none; max-width: 44em; }
.roadmap li {
  position: relative;
  padding: 0 0 22px 32px;
  color: var(--ink-muted);
}
.roadmap li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  background: var(--surface);
}
.roadmap li::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 24px;
  bottom: 2px;
  border-left: 2px dotted var(--line-strong);
}
.roadmap li:last-child { padding-bottom: 0; }
.roadmap li:last-child::after { display: none; }

/* ---------- Links + pager ---------- */
.link-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pager a {
  display: block;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s;
}
.pager a:hover { border-color: var(--brand); }
.pager small {
  display: block;
  margin-bottom: 4px;
  font: 600 11px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.pager strong { font: 700 20px var(--font-display); }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: auto; }
}

/* ---------- Screenshots ---------- */
.shots-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 32px;
}
.shots-head .section-head { margin-bottom: 0; }

.shot-tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.shot-tabs button {
  padding: 8px 18px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  font: 600 14px/1 var(--font-body);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.shot-tabs button:hover { color: var(--ink); }
.shot-tabs button[aria-selected="true"] { background: var(--brand); color: var(--on-brand); }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}
@media (max-width: 760px) { .shot-grid { grid-template-columns: 1fr; } }

.shot { margin: 0; }
.shot a {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: border-color 0.2s, transform 0.2s;
}
.shot a:hover { border-color: var(--brand); transform: translateY(-2px); }
.shot img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
}
.shot figcaption { margin-top: 12px; font-size: 15px; color: var(--ink-muted); }
.shot figcaption strong { display: block; color: var(--ink); font-weight: 600; }

.viewer {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 56px 72px 24px;
  border: 0;
  background: transparent;
  color: #f2f6f3;
}
.viewer::backdrop { background: rgb(4 8 6 / 0.94); }
.viewer figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  margin: 0;
  pointer-events: none;
}
.viewer img {
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  pointer-events: auto;
}
.viewer figcaption { max-width: 48em; text-align: center; font-size: 15px; color: #a6b4aa; }
.viewer figcaption strong { color: #f2f6f3; }
.viewer-btn {
  position: fixed;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: #f2f6f3;
  font-size: 18px;
  cursor: pointer;
}
.viewer-btn:hover { background: rgb(255 255 255 / 0.18); }
.viewer-close { top: 12px; right: 16px; }
.viewer-prev, .viewer-next { top: 50%; transform: translateY(-50%); }
.viewer-prev { left: 16px; }
.viewer-next { right: 16px; }
@media (max-width: 640px) {
  .viewer { padding: 64px 12px 84px; }
  .viewer-prev, .viewer-next { top: auto; bottom: 20px; transform: none; }
  .viewer-prev { left: calc(50% - 56px); }
  .viewer-next { right: calc(50% - 56px); }
}

/* ---------- Code ---------- */
:not(pre) > code {
  font: 500 0.88em var(--font-mono);
  font-variant-ligatures: none;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.patch-facts { margin: 40px 0; }

.code-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.code-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  font: 500 13px var(--font-mono);
  color: var(--ink-muted);
}
.code-name { overflow-wrap: anywhere; }
.code-actions { display: flex; gap: 8px; }
.code-btn {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 600 13px/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.code-btn:hover { border-color: var(--brand); }

pre.diff {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: 14px 0;
  font: 500 13px/1.6 var(--font-mono);
  font-variant-ligatures: none;
  tab-size: 4;
}
/* Each line is a block so its colour runs the full width, even when scrolled. */
pre.diff code { display: block; min-width: max-content; padding-inline: 18px; }
pre.diff code > span { display: block; margin-inline: -18px; padding-inline: 18px; }
pre.diff .meta { color: var(--ink-muted); font-weight: 600; }
pre.diff .hunk { color: var(--brand); background: var(--brand-tint); }
pre.diff .add { background: color-mix(in srgb, #2ea043 18%, transparent); }
pre.diff .del { background: color-mix(in srgb, #e5534b 18%, transparent); }
.code-bar .add { color: var(--brand); }
.code-bar .del { color: #d1453b; }

.note {
  margin-top: 24px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  background: var(--warn-tint);
}
.note h3 { font-size: 18px; margin-bottom: 6px; letter-spacing: -0.01em; color: var(--warn); }
.note p { font-size: 15.5px; color: var(--ink-muted); max-width: 52em; }

/* ---------- Test-build download page ---------- */
.test-note { margin: 0 0 32px; }

.download {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}
.download > p { color: var(--ink-muted); margin-top: 20px; }
.download-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.download-head h2 { font-size: clamp(26px, 3vw, 32px); }
.download-head .btn-row { margin-top: 0; }
.download-meta { margin-top: 6px; font: 500 13px/1.5 var(--font-mono); color: var(--ink-muted); }
.btn-note { font-weight: 500; opacity: 0.75; }

.hash { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.hash-label {
  margin-bottom: 8px;
  font: 600 12px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.hash-row { display: flex; align-items: flex-start; gap: 12px; }
.hash-row code { flex: 1; min-width: 0; padding: 8px 12px; font-size: 13.5px; line-height: 1.6; }
.download .small { font-size: 14px; }

pre.cmd {
  margin: 10px 0 16px;
  padding: 10px 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
  font: 500 14px/1.5 var(--font-mono);
  font-variant-ligatures: none;
}
.steps { margin: 0 0 20px; padding-left: 22px; }
.steps li { margin-bottom: 12px; color: var(--ink-muted); }
.steps li::marker { color: var(--brand); font-weight: 700; }
.plain-list { margin: 0 0 16px; padding-left: 20px; color: var(--ink-muted); }
.plain-list li { margin-bottom: 8px; }

/* ---------- On this page (project pages) ---------- */
/* Sections land below the sticky header when jumped to. */
[data-toc] { scroll-margin-top: 64px; }

.toc-title {
  margin: 0 0 12px;
  font: 600 11px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px dotted var(--line-strong);
}
.toc a {
  position: relative;
  display: block;
  padding: 6px 0 6px 18px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.toc a:hover { color: var(--ink); }
.toc ol + .toc-title { margin-top: 28px; }
.toc-projects { margin: 0; padding: 0; list-style: none; }
.toc-projects a { padding-left: 0; }
.toc-projects a[aria-current="page"] { color: var(--ink); font-weight: 600; }.toc a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.toc a[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

/* Wide screens: a sidebar in a column to the left of the content. */
@media (min-width: 1180px) {
  .has-toc main .wrap { padding-left: calc(var(--gutter) + 230px); }
  .toc {
    position: fixed;
    top: 112px;
    left: calc((100vw - var(--max)) / 2 + var(--gutter));
    width: 190px;
    z-index: 10;
  }
  .toc-fab { display: none; }
}

/* Narrower screens: a floating button that opens the list. */
@media (max-width: 1179px) {
  .toc {
    position: fixed;
    right: 16px;
    bottom: 84px;
    z-index: 60;
    width: min(260px, calc(100vw - 32px));
    padding: 18px 20px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-raised);
    box-shadow: var(--shadow);
  }
  .toc:not(.open) { display: none; }
  .toc-fab {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 60;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: var(--shadow);
    cursor: pointer;
  }
  .toc-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
}

/* ---------- About ---------- */
.portrait {
  justify-self: end;
  display: grid;
  place-items: center;
  width: min(100%, 320px);
  aspect-ratio: 1;
  border-radius: 24px;
  background: var(--brand-tint);
  border: 1px solid var(--line);
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait svg { width: 55%; height: auto; }
.portrait .trail { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 0.3 3.2; }
.portrait .end { fill: var(--brand); }
@media (max-width: 860px) { .portrait { justify-self: start; width: 200px; } }

.stack-groups { display: grid; gap: 20px; }
.stack-groups h3 {
  font: 600 12px/1.6 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.contact-list { padding: 0; margin: 0; list-style: none; display: grid; gap: 10px; }
.contact-list a { font-weight: 600; color: var(--brand); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
.contact-list span {
  display: inline-block;
  min-width: 90px;
  font: 600 12px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 40px;
  font-size: 14px;
  color: var(--ink-muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--ink); }
.site-footer .mono { font: 500 12px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }

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

/* ---------- Forms (feedback, sign-in) ---------- */
.narrow { max-width: 640px; }
.small { font-size: 14px; color: var(--ink-muted); }

.form-card {
  display: grid;
  gap: 22px;
  max-width: 760px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 620px) { .field-row { grid-template-columns: minmax(0, 1fr); } }
.field label { font-weight: 600; font-size: 15px; }
.field .optional {
  margin-left: 6px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.field .hint { margin: 0; font-size: 14px; color: var(--ink-muted); }

.field input[type="text"], .field input[type="email"], .field select, .field textarea,
.filters select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-body);
}
.field textarea { resize: vertical; min-height: 7em; }
.field textarea.mono { font: 500 13px/1.55 var(--font-mono); }
.field input[type="file"] { font: 400 14px/1.5 var(--font-body); color: var(--ink-muted); }
.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 600 13px/1.2 var(--font-body);
  cursor: pointer;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .filters select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
.field ::placeholder { color: var(--line-strong); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form-actions .small { flex: 1 1 260px; margin: 0; }
.btn { cursor: pointer; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.form-errors {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  background: var(--warn-tint);
  color: var(--ink);
}
.form-errors ul { margin: 6px 0 0; padding-left: 20px; color: var(--ink-muted); }
.form-message {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--brand-tint);
  color: var(--ink);
  font-size: 15px;
}
.form-message.is-error { background: var(--warn-tint); }
.form-actions .form-message, .page-intro .form-message { margin: 16px 0 0; }
.form-actions .form-message { margin: 0; }

/* Left empty by people, filled in by bots: off-screen, not display:none (some bots skip those). */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.passkey-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.passkey-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.passkey-list li > div { display: grid; gap: 2px; }

/* ---------- Admin ---------- */
.admin-intro .wrap { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px; }
.admin-intro h1 { font-size: clamp(30px, 4vw, 44px); }
.admin-intro .eyebrow a { color: inherit; }
.admin-actions { display: flex; gap: 8px; }
.admin .section, .section.admin { padding-top: 32px; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 24px; }
.filters label { display: grid; gap: 4px; font: 600 12px/1.2 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.filters select { width: auto; padding: 7px 10px; font-size: 14px; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.reports { width: 100%; border-collapse: collapse; font-size: 15px; }
.reports th, .reports td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.reports th { font: 600 11px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface-alt); }
.reports tr:last-child td { border-bottom: 0; }
.reports td a { color: var(--ink); font-weight: 600; text-decoration-color: var(--line-strong); }
.reports td a:hover { color: var(--brand); }
.mono { font-family: var(--font-mono); }
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 11px/1.6 var(--font-mono);
  color: var(--ink-muted);
  white-space: nowrap;
}
.status { white-space: nowrap; font-weight: 600; }
.status-new { color: var(--brand); }
.status-looking, .status-planned { color: var(--warn); }
.status-fixed, .status-closed { color: var(--ink-muted); }
.empty { color: var(--ink-muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
.pagination [aria-disabled="true"] { opacity: 0.45; }

.report { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .report { grid-template-columns: minmax(0, 1fr); } }
.report-main h2 { margin: 32px 0 12px; font-size: 20px; }
.report-main .facts { margin-top: 0; }
.report-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.report-logs { max-height: 420px; overflow: auto; white-space: pre; }
.report-shots { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.report-side { display: grid; gap: 16px; position: sticky; top: 88px; }
.report-side .form-card { gap: 16px; padding: 20px; }
.delete-form { justify-self: start; }
.code-btn.danger { border-color: var(--warn); color: var(--warn); }
.reports .pick { width: 1%; padding-right: 0; }
.reports input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.bulk-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
