:root {
  --bg: #0f0f12;
  --surface: #17171c;
  --surface-2: #1d1d24;
  --border: #2e2e3a;
  --border-subtle: #222230;
  --text: #f2f2f7;
  --text-2: #a8a8bf;
  --text-3: #9a9ab2;
  --blue: #5b8ef7;
  --blue-soft: rgba(91, 142, 247, 0.09);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Geist Mono', 'SFMono-Regular', monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: #83a9fa; }
a:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 28px;
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 15, 18, 0.96);
}
.brand { display: inline-flex; align-items: center; gap: 11px; justify-self: start; color: var(--text); font-size: 20px; font-weight: 750; letter-spacing: -0.025em; text-decoration: none; }
.brand img { display: block; }
.site-header nav { display: flex; align-items: center; gap: 34px; }
.site-header nav a { position: relative; padding: 27px 2px 24px; color: var(--text-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-header nav a[aria-current='page'] { color: var(--text); }
.site-header nav a[aria-current='page']::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--blue); content: ''; }
.sign-in { justify-self: end; border: 1px solid var(--blue); border-radius: 8px; padding: 8px 16px; font-weight: 650; text-decoration: none; white-space: nowrap; }

main { width: min(1320px, calc(100% - 48px)); margin: 0 auto; }
.page-intro { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; gap: 42px; align-items: end; padding: 42px 0 26px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font: 700 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.page-intro h1 { margin: 0; font-size: clamp(34px, 3vw, 44px); line-height: 1.04; letter-spacing: -0.045em; }
.page-intro div > p { max-width: 680px; margin: 12px 0 0; color: var(--text-2); font-size: 16px; }
.page-intro > a { margin-bottom: 8px; font-weight: 650; text-decoration: none; white-space: nowrap; }

.archive-note { margin: 0 0 34px 252px; border-left: 2px solid var(--blue); padding: 8px 14px; color: var(--text-2); background: var(--blue-soft); font-size: 12px; }
.timeline { position: relative; }
.timeline::before { position: absolute; top: 0; bottom: 0; left: 209px; width: 1px; background: var(--border); content: ''; }
.timeline-entry { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 42px; padding: 0 0 62px; }
.timeline-entry + .timeline-entry { padding-top: 46px; border-top: 1px solid var(--border-subtle); }
.entry-date { position: sticky; top: 105px; align-self: start; display: grid; gap: 5px; padding: 4px 28px 4px 0; color: var(--text-3); font: 600 12px/1.45 var(--mono); letter-spacing: 0.025em; text-transform: uppercase; }
.entry-date time { color: var(--text); font-weight: 700; }
.entry-body { min-width: 0; }
.entry-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 26px; align-items: start; }
.entry-heading h2, .entry-heading h1 { margin: 0; line-height: 1.16; letter-spacing: -0.03em; }
.entry-heading h2 { font-size: clamp(23px, 2.5vw, 34px); }
.entry-heading h1 { max-width: 900px; font-size: clamp(34px, 4.2vw, 58px); }
.entry-heading h2 a { color: var(--text); text-decoration: none; }
.entry-heading h2 a:hover { color: var(--blue); }
.summary { max-width: 780px; margin: 12px 0 0; color: var(--text-2); font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; max-width: 300px; }
.tags span { border: 1px solid var(--border); border-radius: 999px; padding: 5px 9px; color: var(--text-2); font: 600 11px/1 var(--mono); white-space: nowrap; }
.tags span:last-child { border-color: rgba(91, 142, 247, 0.46); color: var(--blue); }
.entry-image { margin: 30px 0 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.entry-image img { display: block; width: 100%; height: clamp(260px, 24vw, 340px); object-fit: cover; object-position: top; }
.entry-sections { display: grid; grid-template-columns: 1.15fr 1fr 1fr; margin-top: 28px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.entry-sections section { padding: 22px 24px 20px 0; }
.entry-sections section + section { border-left: 1px solid var(--border); padding-left: 24px; }
.entry-sections h3 { margin: 0 0 9px; font-size: 14px; }
.entry-sections p { margin: 0 0 10px; color: var(--text-2); font-size: 13px; line-height: 1.55; }
.entry-sections p:last-child { margin-bottom: 0; }
.permalink { display: inline-block; margin-top: 17px; font-weight: 650; text-decoration: none; }

.detail-main { max-width: 1320px; padding-top: 44px; }
.back-link { display: inline-block; margin: 0 0 34px 252px; font-weight: 650; text-decoration: none; }
.detail-timeline::before { display: none; }
.timeline-entry.is-detail { padding-bottom: 20px; }
.timeline-entry.is-detail .entry-date { position: static; }

.site-footer { width: min(1320px, calc(100% - 48px)); margin: 4px auto 0; padding: 30px 0 48px 252px; border-top: 1px solid var(--border-subtle); }
.archive-disclosure { max-width: 900px; margin: 0; color: var(--text-2); font-size: 13px; }
.archive-disclosure strong { display: block; margin-bottom: 5px; color: var(--text); font: 700 11px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.site-footer > div { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 18px; }
.site-footer a { font-weight: 600; text-decoration: none; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; min-height: 68px; }
  .site-header nav { grid-row: 2; grid-column: 1 / -1; justify-content: center; gap: 26px; margin: -4px 0 0; }
  .site-header nav a { padding: 12px 2px 14px; }
  .page-intro { grid-template-columns: 1fr; gap: 12px; padding-top: 42px; }
  .page-intro > a { justify-self: start; }
  .eyebrow { margin-bottom: 0; }
  .archive-note { margin-left: 0; }
  .timeline::before { display: none; }
  .timeline-entry { grid-template-columns: 1fr; gap: 18px; padding-bottom: 48px; }
  .timeline-entry + .timeline-entry { padding-top: 36px; }
  .entry-date { position: static; display: flex; gap: 12px; padding: 0; }
  .entry-image img { height: auto; max-height: 420px; }
  .back-link { margin-left: 0; }
  .site-footer { padding-left: 0; }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .site-header { gap: 12px; padding: 12px 18px 0; }
  .brand { font-size: 17px; }
  .brand img { width: 27px; height: 27px; }
  .sign-in { padding: 6px 10px; }
  .site-header nav { overflow-x: auto; justify-content: flex-start; gap: 16px; width: calc(100vw - 36px); font-size: 13px; }
  main, .site-footer { width: min(100% - 32px, 1320px); }
  .page-intro { padding-top: 34px; }
  .page-intro h1 { font-size: 36px; }
  .archive-note { margin-bottom: 34px; }
  .entry-heading { grid-template-columns: 1fr; gap: 14px; }
  .tags { justify-content: flex-start; max-width: none; }
  .entry-image { margin-top: 22px; border-radius: 8px; }
  .entry-sections { grid-template-columns: 1fr; }
  .entry-sections section { padding: 18px 0; }
  .entry-sections section + section { border-top: 1px solid var(--border); border-left: 0; padding-left: 0; }
  .site-footer > div { display: grid; gap: 11px; }
}

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