/* ====================================================
   Operator's Console — shared stylesheet
   kierancharnock.io
   ==================================================== */

/* ---------- tokens ---------- */
:root {
  --bg: #0c0c0d;
  --fg: #e6e6e1;
  --muted: #6b6b66;
  --accent: #c8ff00;
  --amber: #d9a441;
  --blue: #7aa6c2;
  --hairline: rgba(230, 230, 225, 0.08);
  --hairline-strong: rgba(230, 230, 225, 0.14);
  --surface: rgba(230, 230, 225, 0.03);
  --surface-hover: rgba(230, 230, 225, 0.05);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
  --sans: "Switzer", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --sidebar-w: 260px;
  --pad-x: clamp(20px, 4vw, 56px);
  --shell-max: 1280px;
  --ease: cubic-bezier(.2,.6,.2,1);
  color-scheme: dark;
}

/* ---------- light mode (time-of-day, set by inline <head> script) ----------
   Token override only. Electric lime (#c8ff00) is unreadable as text on
   paper, so the accent darkens to an olive-lime that stays legible while
   keeping the same family. Every accent background is a <=3px decorative
   marker, so it reads fine in the darker tone. */
html[data-theme="light"] {
  --bg: #f1efe7;            /* warm paper, lower luminance than #faf9f5 — less glare */
  --fg: #16161a;            /* ~16:1 on paper */
  --muted: #54514a;         /* was #6f6f66 (4.4:1, hard to read); now ~6.8:1 */
  --accent: #556a00;        /* slightly deeper olive — ~5:1 on the warmer paper */
  --hairline: rgba(20, 20, 18, 0.12);
  --hairline-strong: rgba(20, 20, 18, 0.20);
  --surface: rgba(20, 20, 18, 0.03);
  --surface-hover: rgba(20, 20, 18, 0.06);
  color-scheme: light;
}
/* keep the LIVE markers' faint halo visible on paper (was hardcoded lime) */
html[data-theme="light"] .dot.live,
html[data-theme="light"] .build-card .pill.live::before,
html[data-theme="light"] .status-tag.live::before {
  box-shadow: 0 0 0 2px rgba(85, 106, 0, 0.20);
}
/* topbar background is hardcoded dark + blur; flip to translucent paper */
html[data-theme="light"] .topbar {
  background: rgba(241, 239, 231, 0.84);
}
/* .video-hero placeholder is hardcoded-dark (#060607 + black vignette +
   white scanlines), tuned to glow on black. On paper it reads as an
   unfinished slab — recast it as a light inset media well. The overlay
   text/brackets already adapt (they use --fg/--muted/--accent). When real
   <video> replaces the placeholder, dark footage on light is fine. */
html[data-theme="light"] .video-hero {
  background: #e9e7dd;                 /* a shade deeper than --bg — inset well */
}
html[data-theme="light"] .video-hero::before {
  background:
    conic-gradient(
      from 0deg,
      rgba(85, 106, 0, 0.07),
      rgba(122, 166, 194, 0.05),
      rgba(20, 20, 18, 0.03),
      rgba(85, 106, 0, 0.06),
      rgba(122, 166, 194, 0.04),
      rgba(85, 106, 0, 0.07)
    );
}
html[data-theme="light"] .video-hero::after {
  background:
    radial-gradient(ellipse at center, transparent 42%, rgba(20,20,18,0.05) 80%, rgba(20,20,18,0.11) 100%),
    repeating-linear-gradient(
      0deg,
      rgba(20,20,18,0.03) 0px,
      rgba(20,20,18,0.03) 1px,
      transparent 1px,
      transparent 3px
    );
}
html[data-theme="light"] .video-overlay .play {
  text-shadow: 0 0 12px rgba(85, 106, 0, 0.25);
}

/* ---------- reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
html,body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
html { scroll-behavior: smooth; }
body {
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  min-height: 100vh;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- type helpers ---------- */
.mono { font-family: var(--mono); }
.sans { font-family: var(--sans); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.upper { text-transform: uppercase; letter-spacing: 0.06em; }
.small { font-size: 12px; }
.micro { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- skip link ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--fg);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------- shell ---------- */
.shell {
  display: flex;
  min-height: calc(100vh - 47px);
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}
.shell.no-side .main { max-width: var(--shell-max); margin: 0 auto; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(12, 12, 13, 0.84);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px var(--pad-x);
  font-family: var(--mono);
  font-size: 12.5px;
  max-width: 1680px;
  margin: 0 auto;
}
.prompt {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--fg);
  text-decoration: none;
  transition: opacity 120ms var(--ease);
}
.prompt:hover { opacity: 0.78; }
.prompt:hover .path { color: var(--fg); }
.prompt .who { color: var(--muted); }
.prompt .host { color: var(--fg); }
.prompt .path { color: var(--muted); transition: color 120ms var(--ease); }
.prompt .dollar { color: var(--accent); margin-left: 6px; }
.cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--accent);
  margin-left: 6px;
  transform: translateY(2px);
  animation: blink 1.05s steps(2, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  background: var(--surface);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(200,255,0,0.12);
}
.topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 11.5px;
}
.topbar-meta a { transition: color 120ms var(--ease); }
.topbar-meta a:hover { color: var(--fg); }
.topbar-meta a[aria-current="page"] { color: var(--fg); }

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--hairline);
  position: sticky;
  top: 47px;
  align-self: flex-start;
  height: calc(100vh - 47px);
  overflow-y: auto;
  padding: 22px 0 28px;
  background: var(--bg);
}
.sidebar-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 18px 14px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 12px;
}
.sidebar-hd .label {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar-hd .count { color: var(--fg); }

.sidebar-filter {
  padding: 0 18px 14px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 6px;
}
.sidebar-filter select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 14px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 9px) 50% / 5px 5px no-repeat,
    var(--surface);
  color: var(--fg);
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  padding: 8px 28px 8px 10px;
  font: 12px/1 var(--mono);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.sidebar-filter select:hover { border-color: rgba(230,230,225,0.22); }

.side-list { list-style: none; margin: 4px 0 0; padding: 0; }
.side-row {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr 14px;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 22px;
  font-size: 12.5px;
  color: var(--fg);
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}
.side-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 120ms var(--ease);
}
.side-row:hover, .side-row[aria-current="true"] {
  background: var(--surface-hover);
}
.side-row[aria-current="true"]::before,
.side-row:hover::before {
  background: var(--accent);
}
.side-row .num { color: var(--muted); font-size: 11.5px; }
.side-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-row .dot {
  width: 6px; height: 6px; border-radius: 50%; justify-self: end;
}
.dot.live { background: var(--accent); box-shadow: 0 0 0 2px rgba(200,255,0,0.12); }
.dot.dev  { background: var(--amber); }
.dot.tag  { background: var(--blue); }

.sidebar-foot {
  margin-top: 14px;
  padding: 12px 18px 0;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

/* ---------- main ---------- */
.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 36px var(--pad-x) 80px;
  max-width: var(--shell-max);
}

/* ---------- apex ---------- */
.apex-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.apex-id .big-num {
  font-size: 56px;
  line-height: 1;
  color: var(--fg);
  letter-spacing: -0.03em;
  font-weight: 400;
}
.apex-id .slash { color: var(--muted); }
.apex-id .of { color: var(--muted); font-size: 13px; }

.apex-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 0 4px;
}
.apex-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  object-fit: cover;
  flex: 0 0 92px;
  filter: saturate(0.92) contrast(1.02);
  position: relative;
}
.apex-headline { min-width: 0; }

.apex-title {
  font-family: var(--mono);
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  font-weight: 400;
}
.apex-role {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.apex-role .em { color: var(--fg); white-space: nowrap; }
.apex-role .div { color: var(--hairline-strong); }
@media (max-width: 560px) {
  .apex-role { gap: 4px; }
  .apex-role .div { display: none; }
  .apex-role .em { display: block; width: 100%; }
}

.status-line {
  margin-top: 26px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.status-line .cell {
  padding: 12px 18px 12px 0;
  border-right: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 12px;
}
.status-line .cell:last-child { border-right: 0; padding-right: 0; }
.status-line .cell + .cell { padding-left: 18px; }
.status-line .k {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.status-line .v { color: var(--fg); }
.status-line .cell.accent .v { color: var(--accent); }

.self-desc {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--fg);
  margin: 28px 0 0;
  font-weight: 400;
}
.self-desc::before {
  content: "▸ ";
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
}

/* ---------- section heads ---------- */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 56px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono);
}
.sec-head .h {
  font-size: 13.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  padding-left: 14px;
}
.sec-head .h::before {
  content: "##";
  position: absolute;
  left: 0;
  color: var(--muted);
}
.sec-head .h.with-marker::before {
  content: "";
  width: 3px;
  height: 14px;
  background: var(--accent);
  top: 3px;
  left: 0;
  border-radius: 1px;
}
.sec-head .right { color: var(--muted); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- recent builds ---------- */
.builds-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.build-card {
  position: relative;
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 18px 18px 16px;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 168px;
}
.build-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: transparent;
  transition: background 120ms var(--ease);
}
.build-card:hover {
  background: var(--surface-hover);
  border-color: var(--hairline-strong);
}
.build-card:hover::before { background: var(--accent); }
.build-card .head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.build-card .id { font-size: 11.5px; color: var(--muted); letter-spacing: 0.08em; }
.build-card .pill {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.build-card .pill.live::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(200,255,0,0.12);
}
.build-card .name {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 2px 0 8px;
}
.build-card .teaser {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--fg);
  line-height: 1.5;
  margin: 0 0 14px;
  opacity: 0.85;
}
.build-card .foot {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  display: flex;
  justify-content: space-between;
}

/* ---------- apex footer ---------- */
.apex-foot {
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}
.apex-foot a {
  color: var(--fg);
  transition: color 120ms var(--ease);
}
.apex-foot a:hover { color: var(--accent); }
.apex-foot .bracket { color: var(--muted); }

/* ---------- projects index ---------- */
.proj-hed-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.proj-hed {
  font-family: var(--mono);
  font-size: clamp(28px, 4.5vw, 44px);
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0;
  display: inline-block;
  position: relative;
}
.proj-hed .slash { color: var(--muted); position: relative; padding: 0 2px; }
.proj-hed .slash::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; bottom: -7px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.proj-hed .count { color: var(--muted); font-size: 0.65em; letter-spacing: 0.06em; }
.proj-meta {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.proj-sub {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--fg);
  opacity: 0.78;
  margin: 18px 0 28px;
  max-width: 68ch;
  line-height: 1.55;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 14px;
}
.chip {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 2px;
  position: relative;
  transition: color 120ms var(--ease), background 120ms var(--ease);
}
.chip:hover { color: var(--fg); background: var(--surface); }
.chip[aria-pressed="true"] { color: var(--fg); }
.chip[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 1px;
}

/* projects table */
.ptable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.ptable thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--hairline-strong);
  font-weight: 400;
}
.ptable thead th:first-child { padding-left: 0; }
.ptable tbody tr {
  border-bottom: 1px solid var(--hairline);
  position: relative;
  cursor: pointer;
  transition: background 120ms var(--ease);
}
.ptable tbody tr:hover { background: var(--surface-hover); }
.ptable tbody tr td:first-child {
  position: relative;
  border-left: 2px solid transparent;
  transition: border-color 120ms var(--ease);
  padding-left: 8px;
}
.ptable tbody tr:hover td:first-child { border-left-color: var(--accent); }
.ptable tbody td {
  padding: 14px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg);
  vertical-align: middle;
}
.ptable td.id { color: var(--muted); width: 64px; letter-spacing: 0.06em; }
.ptable td.status {
  width: 130px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ptable td.status .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  transform: translateY(-1px);
  vertical-align: middle;
}
.ptable td.status.live { color: var(--fg); }
.ptable td.name {
  color: var(--fg);
  font-size: 13.5px;
  letter-spacing: -0.005em;
}
.ptable td.category {
  width: 140px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ptable td.stack {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ptable td.stack b { color: var(--fg); font-weight: 400; }
.ptable td.date {
  width: 110px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: right;
  white-space: nowrap;
}
.ptable col.id { width: 56px; }
.ptable col.status { width: 130px; }
.ptable col.cat { width: 150px; }
.ptable col.date { width: 116px; }
.ptable tr.hidden { display: none; }

/* ---------- project detail ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin: 4px 0 22px;
}
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb .seg.curr { color: var(--fg); }
.breadcrumb .sep { color: var(--hairline-strong); }
.cp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--hairline-strong);
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 120ms var(--ease), border-color 120ms var(--ease);
}
.cp-btn:hover { color: var(--fg); border-color: rgba(230,230,225,0.22); }
.cp-btn svg { width: 9px; height: 9px; }

.detail-id-row {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  padding-bottom: 14px;
}
.detail-id {
  font-family: var(--mono);
  font-size: 72px;
  line-height: 0.95;
  color: var(--fg);
  letter-spacing: -0.04em;
  font-weight: 400;
  flex: 0 0 auto;
}
.detail-id .of { color: var(--muted); font-size: 26px; letter-spacing: 0; vertical-align: super; }

.detail-title {
  font-family: var(--mono);
  font-size: clamp(28px, 4.4vw, 42px);
  letter-spacing: -0.022em;
  font-weight: 400;
  margin: 0 0 12px;
  line-height: 1.06;
}

.detail-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin: 6px 0 28px;
}
.status-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.status-tag.live, .status-tag.dev, .status-tag.tag {
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  background: var(--surface);
}
.status-tag.live::before, .status-tag.dev::before, .status-tag.tag::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
}
.status-tag.live::before { background: var(--accent); box-shadow: 0 0 0 2px rgba(200,255,0,0.12); }
.status-tag.dev::before  { background: var(--amber); }
.status-tag.tag::before  { background: var(--blue); }

/* video hero */
.video-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--hairline-strong);
  background: #060607;
  overflow: hidden;
  margin: 8px 0 8px;
}
.video-hero::before {
  content: "";
  position: absolute;
  inset: -25%;
  background:
    conic-gradient(
      from 0deg,
      rgba(200, 255, 0, 0.10),
      rgba(122, 166, 194, 0.04),
      rgba(230, 230, 225, 0.05),
      rgba(200, 255, 0, 0.08),
      rgba(122, 166, 194, 0.03),
      rgba(200, 255, 0, 0.10)
    );
  filter: blur(40px);
  animation: spin 8s linear infinite;
}
.video-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(12,12,13,0.65) 78%, rgba(12,12,13,0.92) 100%),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.012) 0px,
      rgba(255,255,255,0.012) 1px,
      transparent 1px,
      transparent 3px
    );
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .video-hero::before { animation: none; } }

.video-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--fg);
  font-family: var(--mono);
}
.video-overlay .play {
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(200,255,0,0.35);
}
.video-overlay .cap {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.video-overlay .cap .br { color: var(--fg); }
.video-tl, .video-tr, .video-bl, .video-br {
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--accent);
  opacity: 0.55;
  z-index: 3;
}
.video-tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.video-tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.video-bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.video-br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.video-meta {
  position: absolute;
  bottom: 10px; right: 18px;
  z-index: 3;
  font: 10px/1 var(--mono);
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* hero screenshot (in place of video for projects with existing screenshots) */
.screenshot-hero {
  position: relative;
  width: 100%;
  border: 1px solid var(--hairline-strong);
  background: #060607;
  overflow: hidden;
  margin: 8px 0 8px;
}
.screenshot-hero img {
  display: block;
  width: 100%;
  height: auto;
}
.screenshot-hero .video-tl,
.screenshot-hero .video-tr,
.screenshot-hero .video-bl,
.screenshot-hero .video-br {
  pointer-events: none;
}

/* prose */
.prose {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--fg);
  max-width: 68ch;
  margin: 0 0 8px;
  opacity: 0.92;
}
.prose + .prose { margin-top: 12px; }

/* side-by-side detail sections */
.dual-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 56px;
}
.dual-col > section { min-width: 0; }
.dual-col > section > .sec-head:first-child { margin-top: 36px; }
.dual-col .prose { max-width: none; }
@media (max-width: 900px) {
  .dual-col { grid-template-columns: 1fr; gap: 0; }
  .dual-col > section > .sec-head:first-child { margin-top: 48px; }
}

/* tech list */
.tech-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 28px;
}
.tech-list li {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg);
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
  position: relative;
  padding-left: 22px;
}
.tech-list li::before {
  content: "▸";
  position: absolute;
  left: 0; top: 6px;
  color: var(--accent);
  font-size: 11px;
}

/* metrics */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric {
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 120ms var(--ease);
}
.metric:hover { border-color: var(--hairline-strong); }
.metric .v {
  font-family: var(--mono);
  font-size: 32px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.metric .v small {
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-left: 2px;
}
.metric .k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

/* detail footer nav */
.detail-foot {
  margin-top: 60px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--mono);
}
.detail-foot a {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
  min-width: 240px;
}
.detail-foot a:hover { background: var(--surface); border-color: var(--hairline-strong); }
.detail-foot a.next { text-align: right; align-items: flex-end; }
.detail-foot .k {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-foot .v { color: var(--fg); font-size: 13px; }

/* HA addons mini-grid (project page section) */
.addon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}
.addon-item {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 12px 14px;
  transition: border-color 120ms var(--ease), background 120ms var(--ease);
}
.addon-item:hover {
  background: var(--surface-hover);
  border-color: var(--hairline-strong);
}
.addon-name {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg);
  margin-bottom: 4px;
}
.addon-desc {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* external project link */
.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  background: var(--surface);
  margin-top: 14px;
  transition: border-color 120ms var(--ease), color 120ms var(--ease);
}
.ext-link:hover { color: var(--accent); border-color: var(--accent); }
.ext-link::before { content: "→"; color: var(--accent); }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    top: 0;
    padding: 16px 0 10px;
  }
  .side-list { display: grid; grid-template-columns: 1fr 1fr; }
  .topbar-meta { display: none; }
  .apex-hero { gap: 16px; }
  .apex-avatar { width: 72px; height: 72px; flex-basis: 72px; }
  .status-line { grid-template-columns: 1fr 1fr; }
  .status-line .cell { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 10px 0; }
  .status-line .cell + .cell { padding-left: 0; }
  .builds-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .tech-list { grid-template-columns: 1fr; }
  /* drop secondary columns — hide header + body together, collapse the col box */
  .ptable .category, .ptable .date { display: none; }
  .ptable col.cat, .ptable col.date { width: 0; }
  .detail-foot { flex-direction: column; }
  .detail-foot a { min-width: 0; }
  .main { padding: 24px 18px 60px; }
}

@media (max-width: 560px) {
  /* phone: ID · status dot · name only */
  .ptable .stack { display: none; }
  .ptable td.status .label { display: none; }   /* dot only */
  .ptable th.status { font-size: 0; }            /* keep cell for column alignment, drop the "STATUS" label */
  .ptable col.id { width: 38px; }
  .ptable col.status { width: 30px; }
  .ptable th.id, .ptable td.id { width: 38px; }
  .ptable th.status, .ptable td.status { width: 30px; }
  .ptable thead th, .ptable tbody td { padding-left: 8px; padding-right: 8px; }
  .ptable thead th:first-child, .ptable tbody tr td:first-child { padding-left: 4px; }
  .detail-id { font-size: 52px; }
  .topbar-inner { padding: 12px 16px; }
}
