/* project.css — shared styles for project detail pages */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #faf8f4;
  --card: #ffffff;
  --border: rgba(0,0,0,0.08);
  --text: #1a1714;
  --text-muted: #7a6e63;
  --text-dim: #c4b8aa;
  --accent: oklch(52% 0.14 50);
  --live: oklch(58% 0.16 145);
  --wip: oklch(62% 0.17 60);
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}
body { background: var(--bg); color: var(--text); font-family: var(--font-display); min-height: 100vh; }
a { color: inherit; }
a.link { color: var(--accent); text-decoration: none; }
a.link:hover { text-decoration: underline; }

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot.live { background: var(--live); box-shadow: 0 0 0 3px oklch(58% 0.16 145 / 0.12); }
.status-dot.wip { background: var(--wip); box-shadow: 0 0 0 3px oklch(62% 0.17 60 / 0.12); }
.status-dot.archived { background: var(--text-dim); }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; padding: 4px 10px;
  border-radius: 999px; border: 1px solid currentColor;
}
.status-pill.live { color: var(--live); background: oklch(58% 0.16 145 / 0.08); }
.status-pill.wip { color: var(--wip); background: oklch(62% 0.17 60 / 0.08); }
.status-pill.archived { color: var(--text-dim); background: rgba(0,0,0,0.02); }

.page { max-width: 880px; margin: 0 auto; padding: 32px clamp(20px, 4vw, 48px) 80px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.topbar a { text-decoration: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em; }
.topbar a:hover { color: var(--accent); }

.proj-header { margin-bottom: 28px; }
.proj-index { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.16em; margin-bottom: 12px; }
.proj-title { font-size: clamp(36px, 5vw, 52px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; margin-bottom: 12px; }
.proj-subtitle { font-size: 17px; color: var(--text-muted); font-weight: 300; line-height: 1.55; margin-bottom: 18px; max-width: 640px; }
.proj-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.proj-tag {
  font-family: var(--font-mono); font-size: 10px; padding: 3px 9px;
  background: rgba(0,0,0,0.04); border-radius: 3px; color: var(--text-muted);
  letter-spacing: 0.04em;
}

.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin: 32px 0 28px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  padding: 12px 18px; cursor: pointer; background: none; border: none;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color 0.15s, border-color 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.footnav {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap;
  margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 12px;
}
.footnav a { color: var(--text-muted); transition: color 0.15s; }
.footnav a:hover { color: var(--accent); }

article { font-size: 16px; line-height: 1.7; color: var(--text); }
article h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 36px 0 14px; }
article h2:first-child { margin-top: 0; }
article h3 { font-size: 18px; font-weight: 600; margin: 24px 0 10px; }
article p { margin-bottom: 14px; color: var(--text); }
article ul, article ol { margin: 0 0 14px 22px; }
article li { margin-bottom: 6px; }
article a { color: var(--accent); text-decoration: none; }
article a:hover { text-decoration: underline; }
article code {
  font-family: var(--font-mono); font-size: 13px;
  background: rgba(0,0,0,0.04); padding: 2px 6px; border-radius: 3px;
}
article pre {
  background: rgba(0,0,0,0.03); border-left: 3px solid var(--accent);
  padding: 16px 20px; border-radius: 4px; overflow-x: auto;
  margin: 16px 0 22px;
}
article pre code {
  background: none; padding: 0; font-size: 13px; line-height: 1.65;
}
article pre.tree code { white-space: pre; }
article blockquote {
  border-left: 3px solid var(--text-dim); padding: 4px 0 4px 18px;
  color: var(--text-muted); font-style: italic; margin: 16px 0;
}
article img { max-width: 100%; border-radius: 6px; border: 1px solid var(--border); }

/* ─── Case-study overview: evidence first, detail on demand ─────────── */
.case-lead {
  border: 1px solid var(--border); border-radius: 14px;
  padding: clamp(22px, 4vw, 34px); margin: 0 0 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.94), color-mix(in oklch, var(--accent) 6%, var(--bg)));
}
.case-kicker {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 10px;
}
.case-lead h2 {
  max-width: 710px; margin: 0 0 12px; font-size: clamp(28px, 4vw, 38px);
  line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance;
}
.case-lead p { max-width: 690px; margin: 0; color: var(--text-muted); font-size: 16px; }
.evidence-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin: 14px 0 30px;
}
.evidence-card {
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  padding: 17px 18px; min-height: 112px;
}
.evidence-num {
  font-family: var(--font-mono); font-size: 25px; font-weight: 600;
  line-height: 1.1; color: var(--accent); margin-bottom: 7px;
}
.evidence-label { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }
.case-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin: 14px 0 24px;
}
.case-card {
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  padding: 17px 18px;
}
.case-card .eyebrow {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.case-card strong { display: block; font-size: 17px; line-height: 1.2; margin-bottom: 7px; }
.case-card p { margin: 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }
.figure-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; margin: 18px 0 26px;
}
.figure-grid figure.fig { margin: 0; }
.figure-grid figure.fig img { height: 100%; max-height: 340px; object-fit: contain; background: var(--card); }
.case-takeaway {
  border-left: 3px solid var(--accent); padding: 14px 17px;
  margin: 22px 0; background: color-mix(in oklch, var(--accent) 5%, transparent);
}
.case-takeaway strong { display: block; margin-bottom: 5px; }
.case-takeaway p { margin: 0; color: var(--text-muted); }

.app-coming-soon {
  text-align: center; padding: 80px 20px;
  border: 1px dashed var(--border); border-radius: 10px;
  background: rgba(0,0,0,0.015);
}
.app-coming-soon h2 { font-size: 22px; margin-bottom: 8px; }
.app-coming-soon p { color: var(--text-muted); font-size: 14px; }

/* ─── Worked-examples tab ─────────────────────────────────────────────── */
.run {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 22px 24px; margin: 0 0 26px; background: var(--card);
}
.run h3 { margin-top: 0; display: flex; align-items: baseline; gap: 10px; }
.run h3 .run-mode {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  padding: 3px 9px; border-radius: 3px; background: rgba(0,0,0,0.05);
  color: var(--accent); text-transform: uppercase;
}
.run > p { color: var(--text-muted); font-size: 15px; }
.io-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--text-dim); text-transform: uppercase; margin: 14px 0 6px;
}
.anon-in, .anon-out {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  padding: 14px 16px; border-radius: 4px; white-space: pre-wrap;
  background: rgba(0,0,0,0.03);
}
.anon-in { border-left: 3px solid var(--text-dim); color: var(--text-muted); }
.anon-out { border-left: 3px solid var(--live); }
.tok {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  background: oklch(58% 0.16 145 / 0.14); color: oklch(40% 0.12 145);
  padding: 1px 5px; border-radius: 3px;
}
.ladder {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.9;
  margin: 8px 0 0; list-style: none; padding-left: 0;
}
.ladder li { margin-bottom: 2px; }
.ladder .lt { color: var(--text-dim); }   /* the type tag */
.vault {
  width: 100%; border-collapse: collapse; font-family: var(--font-mono);
  font-size: 13px; margin-top: 6px;
}
.vault td { padding: 5px 10px; border-bottom: 1px solid var(--border); }
.vault td:first-child { color: oklch(40% 0.12 145); white-space: nowrap; }
.run-note {
  font-size: 13.5px; color: var(--text-muted); font-style: italic;
  border-left: 3px solid var(--text-dim); padding-left: 14px; margin-top: 16px;
}

/* ─── Results tab ─────────────────────────────────────────────────────── */
.statrow {
  display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 28px;
}
.stat {
  flex: 1 1 140px; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; background: var(--card);
}
.stat .num {
  font-family: var(--font-mono); font-size: 26px; font-weight: 600;
  color: oklch(40% 0.12 145); line-height: 1.1;
}
.stat .lbl {
  font-size: 12.5px; color: var(--text-muted); margin-top: 6px;
}
.metrics {
  width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 8px;
}
.metrics th, .metrics td { padding: 7px 10px; text-align: right; }
.metrics th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); border-bottom: 1px solid var(--border); }
.metrics td:first-child, .metrics th:first-child {
  text-align: left; font-family: var(--font-mono); }
.metrics tbody tr { border-bottom: 1px solid var(--border); }
.metrics tbody tr.overall { font-weight: 600; background: rgba(0,0,0,0.02); }
.metrics tbody tr.overall td { border-top: 2px solid var(--border); }
.metrics .f1 { color: oklch(40% 0.12 145); font-family: var(--font-mono); }
figure.fig { margin: 22px 0; }
figure.fig img { width: 100%; border: 1px solid var(--border); border-radius: 8px; }
figure.fig figcaption {
  font-size: 13px; color: var(--text-muted); margin-top: 8px; font-style: italic;
}
.leak { background: oklch(62% 0.17 60 / 0.16); color: oklch(45% 0.13 50);
  padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.anon-out.lite { border-left-color: var(--wip); }
.defs { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 8px; }
.defs th, .defs td { padding: 9px 12px; text-align: left; vertical-align: top; }
.defs th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); border-bottom: 1px solid var(--border); }
.defs tbody tr { border-bottom: 1px solid var(--border); }
.defs td:first-child { font-family: var(--font-mono); font-weight: 600;
  color: oklch(40% 0.12 145); white-space: nowrap; }
.defs .eg { color: var(--text-muted); }
.defs .role { font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.defs .role.direct { color: oklch(45% 0.13 50); }
.defs .role.quasi { color: var(--text-dim); }
/* Subtle "go deeper" cross-tab nudge — quiet enough to glide past, there if wanted */
.deeper {
  display: block; font-size: 13px; color: var(--text-dim);
  margin: 8px 0 4px; text-decoration: none; transition: color 0.15s;
}
.deeper:hover { color: var(--accent); }
.deeper::before { content: "↳ "; opacity: 0.6; }

/* ─── Blackjack project visuals ───────────────────────────────────────── */
.blackjack-writeup h2 + .punch {
  color: var(--text-muted);
  max-width: 720px;
}
.thesis-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(0,0,0,0.025));
  padding: 28px;
  margin: 0 0 28px;
}
.thesis-kicker {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 10px;
}
.thesis-title {
  font-size: 40px; line-height: 1.05; letter-spacing: -0.02em;
  font-weight: 700; max-width: 720px; margin-bottom: 14px;
}
.thesis-panel p {
  color: var(--text-muted); max-width: 680px; margin-bottom: 0;
}
.visual-grid, .format-grid, .rule-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; margin: 18px 0 26px;
}
.finding-card, .format-card, .rule-card {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); padding: 18px;
}
.finding-card strong, .format-card strong, .rule-card strong {
  display: block; font-size: 18px; line-height: 1.15; margin-bottom: 8px;
}
.finding-card p, .format-card p, .rule-card p {
  color: var(--text-muted); font-size: 14px; line-height: 1.55; margin-bottom: 0;
}
.mini-rule {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--accent); text-transform: uppercase; margin-top: 12px;
}
.result-section {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 28px;
}
.impact-bars {
  display: grid; gap: 12px; margin: 16px 0 20px;
}
.impact-row {
  display: grid; grid-template-columns: 155px 1fr 130px;
  gap: 12px; align-items: center;
}
.impact-row span, .impact-row b {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.impact-row span { color: var(--text-muted); }
.impact-row b { color: var(--text); text-align: right; }
.impact-track {
  height: 12px; border-radius: 999px; background: rgba(0,0,0,0.06);
  overflow: hidden; border: 1px solid var(--border);
}
.impact-fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--accent);
}
.impact-fill.warn { background: var(--wip); }
.impact-fill.bad { background: oklch(55% 0.18 25); }
.result-note {
  color: var(--text-muted); font-size: 14px; border-left: 3px solid var(--accent);
  padding-left: 14px; margin: 14px 0 0;
}
.detail-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; margin: 18px 0 26px;
}
.detail-card {
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  padding: 18px;
}
.detail-card .eyebrow {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 8px;
}
.detail-card strong {
  display: block; font-size: 17px; line-height: 1.2; margin-bottom: 8px;
}
.detail-card p {
  color: var(--text-muted); font-size: 14px; line-height: 1.55; margin-bottom: 0;
}
.takeaway {
  border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,0.72);
  padding: 18px 20px; margin: 18px 0 24px;
}
.takeaway strong {
  display: block; font-size: 18px; margin-bottom: 6px;
}
.takeaway p {
  color: var(--text-muted); margin-bottom: 0;
}
.evidence-table {
  width: 100%; border-collapse: collapse; font-size: 14px; margin: 14px 0 22px;
}
.evidence-table th, .evidence-table td {
  padding: 10px 12px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.evidence-table th {
  color: var(--text-dim); font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.evidence-table td:first-child {
  font-family: var(--font-mono); font-weight: 600; color: var(--accent);
  white-space: nowrap;
}
.evidence-table td { color: var(--text-muted); }
.evidence-table b { color: var(--text); }
.app-shell {
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  overflow: hidden;
}
.app-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
}
.app-toolbar p {
  flex: 1; min-width: 260px;
  margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.35;
}
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.app-action {
  border: 1px solid var(--border); border-radius: 6px; background: transparent;
  color: var(--text-muted); cursor: pointer; text-decoration: none;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  padding: 8px 12px; text-transform: uppercase;
}
.app-action.primary {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
.app-action:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.app-action.primary:hover { color: #fff; filter: brightness(0.94); }
.app-shell iframe {
  display: block; width: 100%; height: 760px; border: 0; background: #faf8f4;
}
.app-shell:fullscreen {
  background: #faf8f4;
}
.app-shell:fullscreen iframe {
  height: calc(100vh - 58px);
}

@media (max-width: 720px) {
  .evidence-grid, .figure-grid { grid-template-columns: 1fr; }
  .evidence-card { min-height: 0; }
  .thesis-panel { padding: 22px; }
  .thesis-title { font-size: 32px; }
  .visual-grid, .format-grid, .rule-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .evidence-table { display: block; overflow-x: auto; }
  .impact-row { grid-template-columns: 1fr; gap: 6px; }
  .impact-row b { text-align: left; }
  .app-toolbar { align-items: flex-start; flex-direction: column; }
  .app-shell iframe { height: 680px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ─── Project journey / timeline ──────────────────────────────────────────
   Vertical decision-spine used by the anonymiser JOURNEY tab. Each stage
   carries the question it was answering and the call that was made, so the
   timeline reads as a chain of decisions rather than a chronology.        */
.journey { margin: 4px 0 8px; }
.journey-stage {
  position: relative;
  padding: 0 0 34px 34px;
  border-left: 2px solid color-mix(in oklch, var(--accent) 20%, transparent);
}
.journey-stage:last-child { border-left-color: transparent; padding-bottom: 4px; }
.journey-marker {
  position: absolute; left: -9px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.journey-stage.is-open .journey-marker { border-color: var(--wip); border-style: dashed; }
.journey-head {
  display: flex; align-items: baseline; gap: 11px;
  flex-wrap: wrap; margin-bottom: 5px;
}
.journey-num {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--accent); text-transform: uppercase;
}
.journey-stage.is-open .journey-num { color: var(--wip); }
.journey-stage h3 {
  margin: 0; font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.15; letter-spacing: -0.02em;
}
.journey-q {
  margin: 0 0 11px; max-width: 660px; font-style: italic;
  color: var(--text-muted); font-size: 14.5px;
}
.journey-stage > p { max-width: 680px; font-size: 14.5px; }
.journey-decision {
  max-width: 680px; margin: 13px 0 0; padding: 13px 16px;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
}
.journey-stage.is-open .journey-decision { border-left-color: var(--wip); }
.journey-decision .eyebrow {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.journey-stage.is-open .journey-decision .eyebrow { color: var(--wip); }
.journey-decision p {
  margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-muted);
}
.journey-decision p + p { margin-top: 7px; }
.journey-decision strong { color: var(--text); font-weight: 500; }
.journey-evidence { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.journey-evidence span {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); padding: 4px 11px; border-radius: 999px;
  background: color-mix(in oklch, var(--accent) 7%, var(--card));
  border: 1px solid var(--border);
}
@media (max-width: 620px) {
  .journey-stage { padding-left: 22px; padding-bottom: 28px; }
  .journey-marker { left: -8px; width: 14px; height: 14px; top: 4px; }
}
