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

html { background: var(--surface-void); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--surface-void); color: var(--text-body);
  font-family: var(--font-core); font-size: 16px; line-height: var(--leading-body);
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--starfield), var(--grid-field); background-size: auto, var(--grid-size);
  opacity: .55;
}

a { color: inherit; }
.mail { text-transform: none; text-decoration: none; }
.mail:hover { color: var(--text-body); }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.stencil {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-medium);
  letter-spacing: var(--track-stencil); text-transform: uppercase; color: var(--text-mute);
}

.top {
  position: sticky; top: 0; z-index: 10; height: var(--h-topbar);
  display: flex; align-items: center; gap: var(--space-12); padding: 0 16px;
  background: var(--surface-shell); border-bottom: 1px solid var(--line-hair);
}
.brand { display: flex; align-items: center; gap: var(--space-4); text-decoration: none; flex: none; }
.brand .glyph { width: 15px; height: 16px; clip-path: var(--hex-clip); background: var(--accent); }
.brand b { font-size: 15px; font-weight: var(--weight-bold); letter-spacing: var(--track-tight); }
.nav { display: flex; gap: var(--space-10); margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; padding: 4px 0; text-decoration: none;
  font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: var(--track-stencil);
  text-transform: uppercase; color: var(--text-dim);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text-body); }
.nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--accent); }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px 96px; }

.hero { padding: 96px 0 56px; }
.hero h1 {
  max-width: 17ch; margin: 16px 0 20px; font-size: clamp(34px, 6vw, 60px);
  line-height: 1.04; letter-spacing: -.02em; font-weight: var(--weight-bold); text-wrap: balance;
}
.hero p { max-width: 60ch; margin: 0; font-size: 18px; color: var(--text-dim); }
.strip { height: 2px; width: 160px; margin-top: 40px; background: var(--band-strip); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 48px 0 16px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 340px;
  padding: 24px; text-decoration: none; clip-path: var(--chamfer-lg);
  background: var(--surface-shell); box-shadow: inset 0 0 0 1px var(--line-hair);
  transition: background var(--dur-fast) var(--ease-out);
}
.card:hover { background: var(--surface-panel); }
.card:hover .go { color: var(--text-body); }
.card .idx { display: flex; align-items: center; justify-content: space-between; }
.card .dot { width: 7px; height: 7px; transform: var(--diamond); background: var(--dot, var(--accent)); }
.card h3 { margin: 0; font-size: var(--text-2xl); line-height: var(--leading-tight); letter-spacing: var(--track-tight); }
.card p { margin: 0; color: var(--text-dim); font-size: 15px; }
.card .figs { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-hair); }
.fig { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 12px; }
.fig span { color: var(--text-mute); }
.go { font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: var(--track-stencil); text-transform: uppercase; color: var(--text-dim); }

.page-head { padding: 72px 0 32px; }
.page-head h1 { margin: 12px 0 16px; font-size: clamp(36px, 6vw, 56px); line-height: 1.04; letter-spacing: -.02em; }
.page-head .lede { max-width: 62ch; margin: 0; font-size: 18px; color: var(--text-dim); }

.meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px;
  margin: 32px 0 0; background: var(--line-hair); border: 1px solid var(--line-hair);
}
.meta div { padding: 14px 16px; background: var(--surface-shell); }
.meta dt { margin-bottom: 4px; }
.meta dd { margin: 0; font-family: var(--font-mono); font-size: 13px; }

.shot { margin: 40px 0; }
.shot .frame {
  position: relative; overflow: hidden; clip-path: var(--chamfer-lg);
  background: var(--surface-shell); box-shadow: inset 0 0 0 1px var(--line-hair);
}
.shot img { width: 100%; }
.shot.missing img { display: none; }
.shot .empty { display: none; }
.shot.missing .empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  aspect-ratio: 16 / 9; padding: 24px; text-align: center;
  background: var(--starfield), var(--grid-field); background-size: auto, var(--grid-size);
}
.shot.missing .empty code { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); word-break: break-all; }
.shot figcaption { margin-top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); }
.shots-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
.shots-2 .shot { margin: 0; }

.prose { max-width: 70ch; }
.prose h2 { margin: 56px 0 12px; font-size: var(--text-2xl); letter-spacing: var(--track-tight); line-height: var(--leading-tight); }
.prose h2 + .stencil { display: block; margin: -4px 0 12px; }
.prose p, .prose li { color: var(--text-dim); font-size: 16px; }
.prose strong { color: var(--text-body); font-weight: var(--weight-semibold); }
.prose ul { padding-left: 18px; }
.prose li { margin: 6px 0; }
.prose li::marker { content: "▸  "; color: var(--text-mute); font-size: 12px; }
code { font-family: var(--font-mono); font-size: .88em; color: var(--text-body); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 32px 0; }
.kpi { padding: 20px; clip-path: var(--chamfer); background: var(--surface-shell); box-shadow: inset 0 0 0 1px var(--line-hair); }
.kpi strong { display: block; margin: 8px 0 4px; font-family: var(--font-mono); font-size: var(--text-3xl); font-weight: var(--weight-semibold); line-height: 1; letter-spacing: var(--track-tight); }
.kpi p { margin: 0; font-size: 13px; color: var(--text-dim); }

.table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line-hair); }
table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; }
th, td { padding: 10px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-hair); }
th:first-child, td:first-child { text-align: left; }
th { background: var(--surface-shell); font-size: var(--text-xs); font-weight: var(--weight-medium); letter-spacing: var(--track-stencil); text-transform: uppercase; color: var(--text-mute); }
td { color: var(--text-dim); }
tr.hl td { color: var(--text-body); background: var(--accent-soft); }
tr.claude td:first-child::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; transform: var(--diamond); background: var(--signal-warn); vertical-align: 1px; }
tr.local td:first-child::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; transform: var(--diamond); background: var(--signal-work); vertical-align: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; }
.legend i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; transform: var(--diamond); vertical-align: 1px; }

.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; margin: 24px 0; background: var(--line-hair); border: 1px solid var(--line-hair); }
.flow div { padding: 16px; background: var(--surface-shell); }
.flow b { display: block; margin: 6px 0 4px; font-family: var(--font-mono); font-size: 13px; }
.flow p { margin: 0; font-size: 13px; color: var(--text-dim); }

.next {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 80px; padding: 24px;
  text-decoration: none; clip-path: var(--chamfer); background: var(--surface-shell); box-shadow: inset 0 0 0 1px var(--line-hair);
}
.next:hover { background: var(--surface-panel); }
.next b { font-size: var(--text-xl); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line-hair);
}

@media (max-width: 640px) {
  .hero { padding: 56px 0 32px; }
  .hero p, .page-head .lede { font-size: 16px; }
  .page-head { padding: 48px 0 24px; }
  .card { min-height: 0; }
  .shots-2 { grid-template-columns: 1fr; }
  .nav { gap: var(--space-8); }
}

.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 20px; }
.mod {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 18px;
  clip-path: var(--chamfer); background: var(--surface-shell); box-shadow: inset 0 0 0 1px var(--line-hair);
}
.mod img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.mod h3 { margin: 4px 4px 0; font-size: var(--text-lg); letter-spacing: var(--track-tight); }
.mod p { margin: 0 4px; font-size: 14px; color: var(--text-dim); }
.mod-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 20px; }
.mod-wide img { aspect-ratio: 16 / 9; }
.mod-wide h3 { font-size: var(--text-xl); margin-bottom: 8px; }

@media (max-width: 640px) {
  .mod-wide { grid-template-columns: 1fr; gap: 10px; }
  .mod-wide h3 { font-size: var(--text-lg); margin-bottom: 0; }
}
