:root {
  color-scheme: light;
  --ink: #0c281e;
  --body: #294238;
  --muted: #64776e;
  --paper: #f1f4ee;
  --surface: #fafcf8;
  --soft: #e2e9e3;
  --line: #c8d3cc;
  --accent: #006647;
  --green: #004d35;
  --lime: #91bd28;
  --on-green: #f6fbf7;
  --shadow: rgba(5, 54, 37, .12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf6f0;
  --body: #cbdad1;
  --muted: #91a89c;
  --paper: #0a1611;
  --surface: #10221a;
  --soft: #183127;
  --line: #29453a;
  --accent: #69c69e;
  --green: #006647;
  --lime: #a1ce38;
  --on-green: #f3faf5;
  --shadow: rgba(0, 0, 0, .28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #edf6f0;
    --body: #cbdad1;
    --muted: #91a89c;
    --paper: #0a1611;
    --surface: #10221a;
    --soft: #183127;
    --line: #29453a;
    --accent: #69c69e;
    --green: #006647;
    --lime: #a1ce38;
    --on-green: #f3faf5;
    --shadow: rgba(0, 0, 0, .28);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  transition: color .2s ease, background-color .2s ease;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
img, video { display: block; width: 100%; }

.site-header, .site-footer {
  width: min(1440px, calc(100% - 56px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header { min-height: 96px; border-bottom: 1px solid var(--line); }
.site-mark {
  font: 600 34px/1 "Newsreader", serif;
  text-decoration: none;
  letter-spacing: -.06em;
}
.site-mark span { color: var(--accent); }
.site-header nav { display: flex; align-items: center; gap: 30px; font-size: 14px; font-weight: 600; }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover, .read-link:hover { color: var(--accent); }
.theme-toggle {
  width: 38px;
  height: 38px;
  padding: 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
:root[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-moon { display: none; }
}

.home-hero {
  width: min(1180px, calc(100% - 56px));
  min-height: 570px;
  margin: 0 auto;
  display: grid;
  align-content: center;
  border-bottom: 1px solid var(--line);
}
.eyebrow, .post-kicker, .card-copy > p:first-child, .post-aside, .section-heading span {
  color: var(--accent);
  font: 500 12px/1.3 "DM Mono", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.home-hero h1 {
  max-width: 1080px;
  margin: 24px 0 22px;
  font: 500 clamp(54px, 7.2vw, 108px)/.94 "Newsreader", serif;
  letter-spacing: -.045em;
}
.home-hero h1 em { color: var(--accent); font-weight: inherit; }
.home-hero .intro { max-width: 620px; color: var(--muted); font-size: 20px; }

.articles { width: min(1180px, calc(100% - 56px)); margin: 0 auto 130px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; padding: 38px 0; }
.section-heading h2 { margin: 0; font: 500 20px/1 "Newsreader", serif; }
.article-card { display: grid; grid-template-columns: 1.35fr 1fr; gap: 58px; padding-top: 54px; border-top: 1px solid var(--line); }
.card-image { overflow: hidden; background: var(--soft); aspect-ratio: 16/10; }
.card-image img { height: 100%; object-fit: cover; transition: transform .5s ease; }
.card-image:hover img { transform: scale(1.015); }
.card-copy { align-self: center; }
.card-copy h3 { margin: 18px 0; font: 500 clamp(38px, 4vw, 58px)/1 "Newsreader", serif; letter-spacing: -.03em; }
.card-copy h3 a { text-decoration: none; }
.card-copy > p:not(:first-child) { color: var(--muted); }
.read-link { display: inline-block; margin-top: 22px; font-size: 14px; font-weight: 700; text-decoration: none; }
.read-link span { margin-left: 8px; }

.post { padding-bottom: 100px; }
.post-hero { width: min(980px, calc(100% - 56px)); margin: 0 auto; padding: 92px 0 60px; }
.post-hero h1 { max-width: 940px; margin: 24px 0; font: 500 clamp(56px, 6.3vw, 92px)/.97 "Newsreader", serif; letter-spacing: -.04em; }
.post-deck { max-width: 770px; color: var(--muted); font-size: 22px; line-height: 1.5; }
.post-meta { display: flex; gap: 28px; margin-top: 42px; font-size: 13px; font-weight: 600; }
.post-meta span + span::before { content: "·"; margin-right: 28px; color: var(--accent); }
.hero-media { width: min(1180px, calc(100% - 56px)); margin: 0 auto 84px; }
.hero-media img { aspect-ratio: 16/8.5; object-fit: cover; object-position: center top; }
figcaption { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.post-grid { width: min(980px, calc(100% - 56px)); margin: 0 auto; display: grid; grid-template-columns: 120px minmax(0, 760px); gap: 48px; }
.post-aside { position: sticky; top: 32px; align-self: start; display: grid; gap: 18px; color: var(--muted); }
.post-aside div { width: 40px; height: 1px; background: var(--line); }
.post-aside a { text-decoration: none; }
.prose > p:first-child { margin-top: 0; font: 500 30px/1.48 "Newsreader", serif; }
.prose h2 { margin: 2.2em 0 .7em; font: 500 clamp(38px, 5vw, 54px)/1.05 "Newsreader", serif; letter-spacing: -.035em; }
.prose h3 { margin-top: 2em; font: 600 24px/1.2 "Newsreader", serif; }
.prose p, .prose li { color: var(--body); }
.prose blockquote { margin: 42px 0; padding: 8px 0 8px 28px; border-left: 3px solid var(--accent); }
.prose blockquote p { margin: 0; color: var(--ink); font: 500 27px/1.45 "Newsreader", serif; }
.prose figure {
  width: 100%;
  margin: 58px 0;
}
.prose figure img, .prose figure video { background: var(--soft); border-radius: 4px; box-shadow: 0 12px 34px var(--shadow); }
.prose .media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.prose .media-grid img { aspect-ratio: 16/9; object-fit: cover; }
.benchmark { margin: 52px 0; padding: 34px; color: var(--on-green); background: var(--green); border-radius: 4px; }
.benchmark h3 { margin: 0 0 28px; font: 500 30px/1.15 "Newsreader", serif; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 14px; margin: 18px 0; font-size: 13px; }
.bar-track { height: 18px; background: rgba(255,255,255,.13); }
.bar { height: 100%; background: #91bd28; }
.bar.typsastra { width: 15.5%; background: #8fc9a6; }
.bar.vscode { width: 100%; }
.benchmark small { color: #bdd0c5; }
.cta { margin-top: 60px; padding: 38px; background: var(--soft); border-top: 3px solid var(--accent); }
.cta h3 { margin-top: 0; }

.site-footer { min-height: 140px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-footer a { text-decoration: none; }
.not-found { width: min(900px, calc(100% - 56px)); min-height: 65vh; margin: auto; display: grid; align-content: center; }
.not-found h1 { font: 500 clamp(54px, 8vw, 96px)/1 "Newsreader", serif; }

@media (max-width: 820px) {
  .site-header, .site-footer, .home-hero, .articles, .post-hero, .hero-media, .post-grid { width: min(100% - 32px, 720px); }
  .site-header { min-height: 76px; }
  .home-hero { min-height: 480px; }
  .article-card { grid-template-columns: 1fr; gap: 28px; }
  .post-hero { padding-top: 70px; }
  .post-meta { flex-wrap: wrap; gap: 8px 18px; }
  .post-meta span + span::before { margin-right: 18px; }
  .hero-media { margin-bottom: 60px; }
  .post-grid { display: block; }
  .post-aside { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-header nav a:first-child { display: none; }
  .home-hero h1, .post-hero h1 { font-size: 50px; }
  .post-deck { font-size: 19px; }
  .post-meta { display: grid; }
  .post-meta span + span::before { display: none; }
  .prose .media-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr 60px; }
  .bar-track { grid-row: 2; grid-column: 1 / 3; }
}
