:root {
  color-scheme: dark;
  --background: #110d10;
  --text: #f5edeb;
  --muted: #c8b5ba;
  --subtle: #af979e;
  --line: #52343e;
  --surface: #1b1318;
  --card: #21161c;
  --soft: #281920;
  --accent: #ff8d9d;
  --accent-strong: #d5445f;
  --accent-hover: #f05c76;
  --button-text: #fff;
  --glow: rgba(151, 24, 51, 0.18);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  line-height: 1.6;
  background: var(--background);
  color: var(--text);
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #fcf8f5;
  --text: #291b20;
  --muted: #594c50;
  --subtle: #665459;
  --line: #d5c4c8;
  --surface: #f5eeec;
  --card: #fffdfb;
  --soft: #f4e4e7;
  --accent: #951d36;
  --accent-strong: #a7233d;
  --accent-hover: #7e142b;
  --button-text: #fff;
  --glow: rgba(186, 45, 72, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(circle at 88% 4%, var(--glow), transparent 32rem), var(--background); color: var(--text); }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover, a:focus { color: var(--accent-hover); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
header, main, footer { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
header { padding: 1.7rem 0 1.2rem; border-bottom: 1px solid var(--line); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
header a { text-decoration: none; }
.site-name { font: 800 1rem/1.3 system-ui, sans-serif; letter-spacing: 0.08em; color: var(--text); }
.site-name:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.8rem 1.5rem; }
nav { display: flex; gap: 0.5rem 1.3rem; flex-wrap: wrap; font: 0.88rem/1.5 system-ui, sans-serif; }
nav a { color: var(--muted); }
nav a[aria-current] { color: var(--text); font-weight: 700; }
.theme-toggle { min-height: 40px; padding: 0.4rem 0.8rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font: 700 0.8rem/1.3 system-ui, sans-serif; white-space: nowrap; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
main { padding: 2.5rem 0 5rem; }
main > article { max-width: 48rem; }
h1, h2, h3 { line-height: 1.18; font-weight: 600; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.45rem, 6vw, 4.7rem); max-width: 16ch; margin: 0 0 1.2rem; }
h2 { font-size: clamp(1.65rem, 3vw, 2.15rem); margin: 0.15rem 0 1.3rem; }
h3 { font-size: 1.2rem; }
p, li { font-size: 1.1rem; }
.eyebrow, .meta, .small { font: 0.84rem/1.5 system-ui, sans-serif; color: var(--subtle); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--accent); }
.lede { font-size: clamp(1.2rem, 2.3vw, 1.5rem); color: var(--muted); max-width: 51rem; }
.hero { padding: 2.5rem 0 3.5rem; border-bottom: 1px solid var(--line); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }
.button { display: inline-block; padding: 0.75rem 1.15rem; color: var(--button-text); background: var(--accent-strong); border: 1px solid var(--accent-strong); border-radius: 0.35rem; font: 700 0.94rem/1.4 system-ui, sans-serif; text-decoration: none; }
.button:hover, .button:focus { color: var(--button-text); background: var(--accent-hover); border-color: var(--accent-hover); }
.text-link { font: 700 0.94rem/1.4 system-ui, sans-serif; }
.section { padding: 3.5rem 0 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.2rem; }
.section-heading h2 { margin-bottom: 0; }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.story-grid > div { border-top: 2px solid var(--accent-strong); padding-top: 1.05rem; }
.step, .work-kind { font: 700 0.75rem/1.5 system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.story-grid h3 { margin: 0.45rem 0; }
.story-grid p { margin: 0; font-size: 1rem; color: var(--muted); }
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.work-card { padding: 1.3rem 1.5rem; border: 1px solid var(--line); border-radius: 0.45rem; background: var(--card); box-shadow: 0 12px 30px rgba(0,0,0,0.08); }
.work-card:hover { border-color: var(--accent-strong); }
.work-card .work-kind { margin: 0 0 0.7rem; }
.work-card h3 { margin: 0 0 0.8rem; font-size: 1.35rem; }
.work-card p:last-child { margin: 0; font-size: 1rem; color: var(--muted); }
.connect { margin-top: 3rem; padding: 2rem; background: var(--soft); border: 1px solid var(--line); border-radius: 0.5rem; }
.connect p:last-child { margin-bottom: 0; }
.post-card { border-top: 1px solid var(--line); padding: 1.35rem 0; }
.post-card h2, .post-card h3 { margin: 0 0 0.4rem; }
.post-card p { margin: 0.4rem 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.9em; }
code { overflow-wrap: anywhere; }
pre { padding: 1rem; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 0.4rem; }
blockquote { margin: 2rem 0; padding: 0.2rem 1.4rem; border-left: 3px solid var(--accent-strong); color: var(--muted); }
table { border-collapse: collapse; width: 100%; font: 0.92rem/1.5 system-ui, sans-serif; }
th, td { padding: 0.65rem; text-align: left; border-bottom: 1px solid var(--line); }
footer { padding: 1.5rem 0 3rem; border-top: 1px solid var(--line); }
@media (max-width: 45rem) {
  header, main, footer { width: min(100% - 2rem, 68rem); }
  .header-actions { justify-content: flex-start; }
  .story-grid, .work-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 1.5rem; }
  .section { padding-top: 2.7rem; }
  .connect { padding: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
