@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

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

:root {
  color-scheme: dark;
  --bg: #0f0306;
  --bg-2: #18060b;
  --surface: #1c080f;
  --surface-2: #260b14;
  --surface-3: #35101d;
  --text: #f5e6e8;
  --muted: #bd9da4;
  --faint: #80636a;
  --line: rgba(232, 197, 205, .13);
  --line-strong: rgba(232, 197, 205, .24);
  --brand: #d4435c;
  --brand-strong: #e85d73;
  --brand-ink: #fff7f8;
  --warm: #d4af37;
  --shadow: 0 28px 80px rgba(0, 0, 0, .42);
  --topbar: 72px;
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #fff5f7;
  --bg-2: #fae9ed;
  --surface: #fffafa;
  --surface-2: #ffffff;
  --surface-3: #f8dfe5;
  --text: #1a0508;
  --muted: #5d2734;
  --faint: #865766;
  --line: rgba(128, 0, 32, .13);
  --line-strong: rgba(128, 0, 32, .24);
  --brand: #a8002b;
  --brand-strong: #c41f49;
  --brand-ink: #ffffff;
  --shadow: 0 28px 70px rgba(128, 0, 32, .12);
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 24px); }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); line-height: 1.75; }
body::before {
  content: ''; position: fixed; z-index: -2; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 16% 0%, rgba(212, 67, 92, .15), transparent 31rem), radial-gradient(circle at 92% 28%, rgba(128, 0, 32, .11), transparent 35rem), var(--bg);
}
:root[data-theme='light'] body::before { background: radial-gradient(circle at 16% 0%, rgba(212, 67, 92, .14), transparent 31rem), radial-gradient(circle at 92% 28%, rgba(212, 175, 55, .08), transparent 35rem), var(--bg); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, a { font: inherit; }
button { cursor: pointer; }
code { font-family: 'DM Mono', monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.sitebar { position: sticky; z-index: 50; top: 0; min-height: var(--topbar); border-bottom: 1px solid var(--line); background: rgba(15, 3, 6, .86); backdrop-filter: blur(20px) saturate(1.3); }
:root[data-theme='light'] .sitebar { background: rgba(255, 245, 247, .88); }
.sitebar-inner { min-height: var(--topbar); max-width: 1340px; display: flex; align-items: center; justify-content: space-between; gap: 26px; margin: 0 auto; padding: 0 32px; }
.sitebrand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; font-size: 14px; font-weight: 800; letter-spacing: -.02em; }
.sitebrand-mark { width: 38px; height: 38px; overflow: hidden; border-radius: 11px; background: #000; box-shadow: 0 0 0 4px rgba(212, 67, 92, .11); }
.sitebrand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sitebrand small { display: block; margin-top: 2px; color: var(--faint); font: 500 8px 'DM Mono'; letter-spacing: .11em; text-transform: uppercase; }
.sitebar-actions { display: flex; align-items: center; gap: 18px; }
.sitebar nav { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 12px; font-weight: 700; }
.sitebar nav a { position: relative; padding: 8px 0; transition: color 150ms ease; }
.sitebar nav a:hover, .sitebar nav a[aria-current='page'] { color: var(--text); }
.sitebar nav a[aria-current='page']::after { content: ''; position: absolute; right: 0; bottom: 2px; left: 0; height: 2px; border-radius: 2px; background: var(--brand); }
.theme-toggle { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); transition: transform 150ms ease, color 150ms ease, border-color 150ms ease; }
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.theme-icon { font-size: 17px; line-height: 1; }

.research-article { max-width: 1120px; margin: 0 auto; padding: 72px 32px 0; border-radius: 0; background: transparent; box-shadow: none; }
.article-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); padding: clamp(40px, 6vw, 76px); overflow: hidden; border: 1px solid var(--line-strong); background: linear-gradient(145deg, var(--surface-2), var(--surface)); box-shadow: var(--shadow); }
.article-hero::before { content: ''; position: absolute; inset: 0; opacity: .38; pointer-events: none; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(ellipse at 86% 18%, black, transparent 62%); }
.article-hero-copy, .review-card { position: relative; z-index: 1; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--faint); font: 500 9px 'DM Mono'; letter-spacing: .08em; text-transform: uppercase; }
.day-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(212, 67, 92, .32); border-radius: 6px; color: var(--brand-strong); background: rgba(212, 67, 92, .08); }
.day-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #71d992; box-shadow: 0 0 10px rgba(113, 217, 146, .7); }
.article-hero h1 { max-width: 760px; margin: 0; font-size: clamp(44px, 6vw, 76px); font-weight: 600; line-height: .98; letter-spacing: -.065em; text-wrap: balance; }
.hero-lead { max-width: 720px; margin: 26px 0 0; color: var(--muted); font-size: 15px; line-height: 1.82; }
.review-card { width: max-content; max-width: 100%; display: inline-flex; align-items: center; gap: 11px; margin-top: 22px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .025); }
:root[data-theme='light'] .review-card { background: rgba(128, 0, 32, .025); }
.review-photo { width: 38px; height: 38px; flex: 0 0 auto; display: block; overflow: hidden; border-radius: 50%; border: 1px solid var(--line-strong); }
.review-photo img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 36%; }
.review-label { display: block; color: var(--brand-strong); font: 500 7px 'DM Mono'; letter-spacing: .11em; text-transform: uppercase; }
.review-card strong { display: block; margin-top: 3px; font-size: 10px; line-height: 1.35; }
.review-card small { display: block; margin-top: 2px; color: var(--faint); font-size: 8px; }

.scope-note { margin: 28px 0 0; padding: 20px 24px; border-left: 4px solid var(--brand); color: var(--muted); background: var(--surface); }
.scope-note p { margin: 0; font-size: 12px; line-height: 1.75; }

.github-panel { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 0; margin: 28px 0 78px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface); }
.github-copy { padding: 34px; border-right: 1px solid var(--line); }
.panel-kicker { display: block; color: var(--brand-strong); font: 500 9px 'DM Mono'; letter-spacing: .12em; text-transform: uppercase; }
.github-panel h2 { margin: 14px 0 14px; padding: 0; border: 0; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.github-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.github-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 26px; border: 1px solid var(--line); }
.github-facts span { min-width: 0; padding: 14px; border-right: 1px solid var(--line); color: var(--faint); font: 500 8px/1.5 'DM Mono'; text-transform: uppercase; }
.github-facts span:last-child { border-right: 0; }
.github-links { display: grid; align-content: stretch; }
.github-link { min-height: 82px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 17px 22px; border-bottom: 1px solid var(--line); background: rgba(212, 67, 92, .035); transition: background 150ms ease; }
.github-link:last-child { border-bottom: 0; }
.github-link:hover { background: rgba(212, 67, 92, .1); }
.github-link b { display: block; font-size: 11px; }
.github-link small { display: block; margin-top: 4px; color: var(--faint); font: 500 8px 'DM Mono'; }
.github-link > span:last-child { color: var(--brand-strong); font-size: 18px; }

.research-article > h2 { margin: 2.15em 0 .85em; padding-top: 1.05em; border-top: 1px solid var(--line); font-size: clamp(30px, 3.8vw, 44px); line-height: 1.1; letter-spacing: -.045em; }
.research-article > h3 { margin: 1.7em 0 .7em; font-size: 22px; letter-spacing: -.025em; }
.research-article > p, .research-article li { color: var(--muted); font-size: 15px; }
.research-article > p { margin: 1.15em 0; }
.research-article li { margin: .42em 0; }
.research-article strong { color: var(--text); }
.research-article a:not(.github-link) { color: var(--brand-strong); }
.research-article blockquote:not(.scope-note) { margin: 1.6em 0; padding: 22px 26px; border-left: 4px solid var(--brand); color: var(--text); background: var(--surface); }
.research-article blockquote p { margin: 0; color: inherit; }
.research-article table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 13px; }
.research-article th, .research-article td { padding: 12px; border: 1px solid var(--line); text-align: left; }
.research-article th { color: var(--text); background: var(--surface-3); }
.research-article td { color: var(--muted); background: var(--surface); }
.research-article code { padding: .16em .36em; border-radius: 4px; color: var(--text); background: var(--surface-3); }

.research-figure { margin: 44px 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 55px rgba(0, 0, 0, .16); }
.research-figure img { width: 100%; height: auto; display: block; margin: 0; padding: 12px; border: 0; border-radius: 0; background: transparent; }
.research-figure figcaption { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--faint); font: 500 8px/1.5 'DM Mono'; letter-spacing: .05em; text-transform: uppercase; }
.research-figure figcaption::before { content: 'TDGL · DAY 1'; flex: 0 0 auto; color: var(--brand-strong); }

.article-footer { position: relative; max-width: 1340px; min-height: 360px; display: flex; align-items: flex-end; margin: 108px auto 0; padding: 0; overflow: hidden; border-top: 1px solid var(--line); color: #bd9da4; background: #090609; font-size: 10px; text-align: left; }
.article-footer-art { position: absolute; inset: 0; }
.article-footer-art img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 44%; opacity: .86; }
.article-footer::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9, 6, 9, .92) 0%, rgba(9, 6, 9, .4) 28%, rgba(9, 6, 9, .08) 46%, rgba(9, 6, 9, .08) 62%, rgba(9, 6, 9, .72) 100%), linear-gradient(0deg, rgba(9, 6, 9, .92) 0%, rgba(9, 6, 9, .14) 48%, rgba(9, 6, 9, .18) 100%); }
.article-footer-content { position: relative; z-index: 1; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 38px; color: #bd9da4; }
.article-footer-brand b { display: block; color: #fff7f8; font-size: 15px; }
.article-footer-brand p { max-width: 620px; margin: 8px 0 0; font-size: 10px; line-height: 1.7; }
.article-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; color: #fff7f8; font-size: 10px; font-weight: 700; }
.article-footer nav a:hover { color: #e85d73; }

@media (max-width: 900px) {
  .sitebar nav a[aria-current='page'] { display: none; }
  .github-panel { grid-template-columns: 1fr; }
  .github-copy { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 660px) {
  :root { --topbar: 64px; }
  .sitebar-inner { padding-inline: 16px; }
  .sitebrand small, .sitebar nav a:first-child { display: none; }
  .sitebar-actions { gap: 10px; }
  .sitebar nav { gap: 13px; font-size: 10px; }
  .research-article { padding: 28px 16px 0; }
  .article-hero { padding: 30px 22px; }
  .article-hero h1 { font-size: clamp(38px, 12vw, 54px); }
  .hero-lead { font-size: 13px; }
  .review-card { gap: 9px; padding: 7px 10px 7px 7px; }
  .review-photo { width: 34px; height: 34px; }
  .scope-note { padding: 17px 18px; }
  .github-panel { margin-bottom: 60px; }
  .github-copy { padding: 25px 20px; }
  .github-facts { grid-template-columns: 1fr; }
  .github-facts span, .github-facts span:last-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .github-facts span:last-child { border-bottom: 0; }
  .github-link { min-height: 72px; padding-inline: 18px; }
  .research-article > h2 { font-size: 31px; }
  .research-article > p, .research-article li { font-size: 14px; }
  .research-figure { margin: 32px -4px; }
  .research-figure img { padding: 4px; }
  .research-figure figcaption { align-items: flex-start; flex-direction: column; gap: 4px; }
  .article-footer { min-height: 360px; margin-top: 78px; }
  .article-footer-content { align-items: flex-start; flex-direction: column; padding: 28px 22px; }
  .article-footer nav { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
