/* QUID microsite — dark editorial */
:root {
  --bg: #07090f;
  --surface: #0f1525;
  --surface2: #151d32;
  --border: #1e2b4a;
  --text: #e8eeff;
  --muted: #6b7fa3;
  --accent: #00c8f0;
  --win: #00d48a;
  --loss: #ff5757;
  --neutral: #f0a500;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-ui: Inter, system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body {
  min-height: 100vh;
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Screen chrome */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(7, 9, 15, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.site-nav-brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav-links a {
  color: var(--muted);
}
.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

.wrap {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 80px;
}
.wrap-wide {
  width: min(1100px, calc(100% - 40px));
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 16px;
}
.hero-title span {
  color: var(--accent);
}
.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 62ch;
  line-height: 1.7;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 36px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.chip.accent {
  border-color: rgba(0, 200, 240, 0.35);
  color: var(--accent);
  background: rgba(0, 200, 240, 0.08);
}
.chip.win {
  border-color: rgba(0, 212, 138, 0.35);
  color: var(--win);
  background: rgba(0, 212, 138, 0.08);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 28px 0;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  transition: border-color 0.2s;
  color: inherit;
  text-decoration: none;
}
.card:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.card-body {
  font-size: 0.9rem;
  color: var(--muted);
}

.section {
  margin: 48px 0;
}
.sec-eye {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sec-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.sec-rule {
  width: 28px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 18px;
}

.credits {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 24px;
  margin: 36px 0;
}
.credits h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.credits p,
.credits li {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.65;
}
.credits ul {
  list-style: none;
  margin: 10px 0;
}
.credits strong {
  color: var(--text);
  font-weight: 500;
}

.mermaid-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  margin: 20px 0 28px;
  overflow-x: auto;
}
.mermaid {
  display: flex;
  justify-content: center;
}

/* Prose / thesis */
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 40px 0 12px;
  letter-spacing: -0.02em;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 28px 0 10px;
}
.prose p {
  margin: 0 0 14px;
  color: var(--text);
  max-width: 72ch;
}
.prose li {
  margin: 0 0 8px;
  color: var(--text);
  max-width: 72ch;
}
.prose ul,
.prose ol {
  margin: 0 0 16px 1.2rem;
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 14px 18px;
  margin: 16px 0;
  color: var(--muted);
  font-style: italic;
}
.prose code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #9db4d8;
}
.prose pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 14px 0 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #9db4d8;
  line-height: 1.55;
  white-space: pre-wrap;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 16px 0 24px;
  border: 1px solid var(--border);
}
.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--surface2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 400;
}
.prose tr:last-child td {
  border-bottom: none;
}
.prose strong {
  font-weight: 600;
}

.week-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 40px 0 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.week-nav a {
  color: var(--muted);
}
.week-nav a:hover {
  color: var(--accent);
}

.footer-note {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

/* Printable week pages */
@media screen {
  .print-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .page {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 36px 40px;
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.page-header-left {
  color: var(--accent);
}
.page-header-right {
  color: var(--muted);
}

.cover-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 12px 0 16px;
}
.cover-title span {
  color: var(--accent);
}
.cover-desc {
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.65;
}
.cover-meta {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.cover-week-big {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--surface2);
  line-height: 1;
}
.team-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.team-member {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-bottom: 4px;
}
.team-member span {
  color: var(--muted);
  margin-right: 10px;
}

.blist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 20px;
}
.bitem {
  display: flex;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.55;
}
.bitem::before {
  content: "—";
  color: var(--accent);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.explain {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 16px;
  max-width: 70ch;
}

.week-list {
  display: grid;
  gap: 8px;
}
.week-list a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.week-list a:hover {
  border-color: var(--accent);
}
.week-list .wnum {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}
.week-list .wtitle {
  font-family: var(--font-display);
  font-weight: 500;
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  html,
  body {
    background: var(--bg) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .site-nav,
  .week-nav,
  .no-print {
    display: none !important;
  }
  .wrap,
  .wrap-wide {
    width: 210mm;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .print-stack {
    gap: 0;
  }
  .page {
    width: 210mm;
    min-height: 297mm;
    padding: 16mm 16mm 14mm;
    border: none;
    page-break-after: always;
    break-after: page;
  }
  .page:last-child {
    page-break-after: avoid;
    break-after: avoid;
  }
  .prose {
    font-size: 12px;
  }
}
