:root {
  color-scheme: dark;
  --ink: #10120f;
  --ink-2: #171b16;
  --panel: rgba(26, 30, 24, 0.88);
  --panel-2: rgba(248, 242, 231, 0.07);
  --paper: #fff7eb;
  --paper-2: #e9dfcf;
  --muted: #aab5a8;
  --line: rgba(255, 247, 235, 0.15);
  --line-strong: rgba(255, 247, 235, 0.3);
  --acid: #b9fb62;
  --cyan: #4cd5cf;
  --coral: #ff7469;
  --amber: #ffc65d;
  --blue: #84b7ff;
  --shadow: 0 28px 88px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(rgba(255, 247, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 247, 235, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #10120f 0%, #13201d 44%, #231713 100%);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

button,
.primary-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  color: var(--paper);
  background: rgba(255, 247, 235, 0.07);
}

.primary-action {
  border-color: rgba(185, 251, 98, 0.6);
  color: #121510;
  font-weight: 900;
  background: var(--acid);
}

a:hover,
a:focus-visible,
button:hover,
button:focus-visible {
  outline: 2px solid rgba(76, 213, 207, 0.58);
  outline-offset: 2px;
}

code {
  color: var(--paper-2);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.patreon-shell {
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 2.6vw, 44px) 64px;
}

.lab-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 16px;
}

.brand-link { font-weight: 950; }

.lab-focus-strip {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(76, 213, 207, 0.34);
  border-radius: 8px;
  margin: 0 0 16px;
  padding: clamp(14px, 2vw, 20px);
  background:
    linear-gradient(135deg, rgba(76, 213, 207, 0.11), rgba(255, 198, 93, 0.06)),
    rgba(16, 18, 15, 0.86);
}

.focus-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.focus-heading span {
  flex: 0 0 auto;
  color: var(--acid);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.focus-heading strong {
  color: var(--paper);
  font-size: clamp(1.1rem, 2.2vw, 1.62rem);
  line-height: 1.12;
  text-align: right;
}

.current-gate-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.current-gate-facts div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: rgba(255, 247, 235, 0.055);
}

.current-gate-facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.current-gate-facts dd {
  margin: 4px 0 0;
  color: var(--paper);
  font-size: 0.9rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.lab-focus-strip p {
  margin-bottom: 0;
  color: var(--paper-2);
  line-height: 1.5;
}

.command-line code {
  overflow-wrap: anywhere;
}

.tracker-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 16px;
  align-items: stretch;
  border-top: 1px solid var(--line);
  padding: clamp(18px, 3vw, 32px) 0 18px;
}

.hero-copy,
.hero-score,
.kpi-grid article,
.goal-card,
.evidence-card,
.completion-card,
.risk-panel,
.flow-grid article,
.launch-grid article,
.source-section,
.audit-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 247, 235, 0.055), rgba(76, 213, 207, 0.035)),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  align-content: end;
  gap: 14px;
  min-width: 0;
  padding: clamp(18px, 4vw, 34px);
}

.eyebrow,
.kpi-grid span,
.goal-meta dt,
.audit-table th,
.flow-grid span,
.source-grid a::before {
  color: var(--acid);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 4px;
  font-size: clamp(2.45rem, 5.4vw, 5.9rem);
  line-height: 0.91;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 2.7vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
  line-height: 1.18;
}

.hero-copy p,
.section-intro p,
.kpi-grid p,
.goal-card p,
.risk-panel li,
.flow-grid p,
.launch-grid p,
.audit-table td {
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy p {
  max-width: 920px;
  margin-bottom: 0;
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

#copy-status {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.hero-score {
  display: grid;
  align-content: center;
  gap: 20px;
  padding: clamp(18px, 3vw, 28px);
}

.score-meter {
  position: relative;
  width: min(260px, 72vw);
  aspect-ratio: 1;
  margin: 0 auto;
}

.score-meter svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-meter circle {
  fill: none;
  stroke: rgba(255, 247, 235, 0.13);
  stroke-width: 12;
}

.score-meter circle[data-score-ring] {
  stroke: var(--acid);
  stroke-linecap: round;
  stroke-dasharray: 301.59;
  stroke-dashoffset: 301.59;
}

.score-meter strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--paper);
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.score-facts,
.goal-meta,
.evidence-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.score-facts div,
.goal-meta div,
.evidence-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.score-facts dt,
.goal-meta dt,
.evidence-meta dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.score-facts dd,
.goal-meta dd,
.evidence-meta dd {
  margin: 0;
  color: var(--paper);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: right;
}

.evidence-meta dd {
  border-radius: 4px;
  padding: 2px 4px;
  color: #fffaf0;
  background: #10120f;
}

.evidence-meta dd code {
  color: #fffaf0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 clamp(34px, 5vw, 58px);
}

.kpi-grid article {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 16px;
}

.kpi-grid strong {
  color: var(--paper);
  font-size: clamp(1.55rem, 3vw, 2.7rem);
  line-height: 1;
}

.kpi-grid p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.section-intro {
  max-width: 980px;
  margin-bottom: 16px;
}

.goal-section,
.evidence-section,
.completion-section,
.audit-section,
.architecture-section,
.launch-section,
.source-section {
  margin-top: clamp(34px, 5vw, 62px);
}

.goal-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.completion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.goal-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

.goal-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.evidence-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

.evidence-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.score-facts div > *,
.goal-meta div > *,
.evidence-meta div > *,
.evidence-card header > *,
.completion-card header > *,
.flow-grid article > *,
.launch-grid article > * {
  min-width: 0;
}

.completion-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

.completion-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.score-facts dd,
.goal-meta dd,
.evidence-meta dd,
.evidence-card h3,
.completion-card h3,
.flow-grid article > *,
.launch-grid article > * {
  overflow-wrap: anywhere;
}

.evidence-card code,
.completion-card code {
  overflow-wrap: anywhere;
}

.goal-card h3 {
  margin-bottom: 0;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 950;
  white-space: nowrap;
}

.status-done { border-color: rgba(185, 251, 98, 0.58); color: var(--acid); }
.status-satisfied { border-color: rgba(185, 251, 98, 0.58); color: var(--acid); }
.status-passed { border-color: rgba(185, 251, 98, 0.58); color: var(--acid); }
.status-active { border-color: rgba(76, 213, 207, 0.58); color: var(--cyan); }
.status-blocked { border-color: rgba(255, 116, 105, 0.62); color: var(--coral); }
.status-failed { border-color: rgba(255, 116, 105, 0.62); color: var(--coral); }
.status-planned { border-color: rgba(255, 198, 93, 0.54); color: var(--amber); }
.status-unproven { border-color: rgba(255, 198, 93, 0.54); color: var(--amber); }
.status-not-run { border-color: rgba(255, 198, 93, 0.54); color: var(--amber); }

.missing-line {
  overflow-wrap: anywhere;
  border-left: 3px solid rgba(255, 116, 105, 0.76);
  padding-left: 10px;
  color: var(--paper-2);
  font-size: 0.86rem;
}

.progress-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 247, 235, 0.1);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--acid));
}

.audit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 12px;
  align-items: start;
}

.audit-table-wrap {
  overflow: auto;
}

.audit-table-wrap:focus-visible {
  outline: 2px solid rgba(76, 213, 207, 0.74);
  outline-offset: 3px;
}

.audit-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.audit-table th,
.audit-table td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

.audit-table td:first-child {
  color: var(--paper);
  font-weight: 900;
}

.risk-panel {
  padding: 18px;
}

.risk-panel ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.flow-grid,
.launch-grid,
.source-grid {
  display: grid;
  gap: 12px;
}

.flow-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.launch-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow-grid article,
.launch-grid article {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
}

.flow-grid strong,
.launch-grid strong {
  font-size: 1.04rem;
}

.flow-grid code,
.launch-grid code {
  overflow-wrap: anywhere;
}

.source-section {
  padding: 18px;
}

.source-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.source-grid a {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  color: var(--paper-2);
  font-weight: 840;
  line-height: 1.35;
  background: rgba(255, 247, 235, 0.055);
}

.source-grid a::before {
  content: "Source";
  display: block;
  margin-bottom: 5px;
}

@media (max-width: 1060px) {
  .tracker-hero,
  .audit-layout {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .current-gate-facts,
  .goal-board,
  .evidence-grid,
  .completion-grid,
  .flow-grid,
  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .patreon-shell {
    padding-inline: 12px;
  }

  .lab-topbar,
  .focus-heading,
  .goal-card header,
  .evidence-card header,
  .completion-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .focus-heading strong {
    text-align: left;
  }

  .kpi-grid,
  .current-gate-facts,
  .goal-board,
  .evidence-grid,
  .completion-grid,
  .flow-grid,
  .launch-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-score,
  .kpi-grid article,
  .goal-card,
  .evidence-card,
  .completion-card,
  .risk-panel,
  .flow-grid article,
  .launch-grid article,
  .source-section {
    padding: 14px;
  }
}
