:root {
  color-scheme: light dark;
  --background: #f7f9fb;
  --surface: #ffffff;
  --text: #20303c;
  --muted: #63727d;
  --border: #dce4e9;
  --accent: #268bd2;
  --accent-dark: #176aa3;
  --shadow: 0 12px 32px rgba(32, 48, 60, 0.08);
  --sidebar-width: clamp(17rem, 20vw, 25rem);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  font-size: 17px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #16232c;
    --surface: #1d303b;
    --text: #edf5f8;
    --muted: #b4c4cb;
    --border: #36505d;
    --accent: #63b7ed;
    --accent-dark: #9bd4f5;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); }
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -4rem; padding: .5rem .8rem; background: var(--surface); z-index: 4; }
.skip-link:focus { top: 1rem; }
.shell { width: min(100% - 2rem, 980px); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 3; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); }
.visual-sidebar { display: none; background: #202020; overflow: hidden; position: relative; }
.visual-sidebar img { display: block; height: 100%; object-fit: cover; width: 100%; }
.visual-sidebar::after { background: linear-gradient(135deg, rgba(10, 17, 22, .68), rgba(10, 17, 22, .38)); content: ""; inset: 0; pointer-events: none; position: absolute; }
.visual-sidebar.has-content { align-items: center; color: #f4f8fa; padding: clamp(2rem, 4vw, 3.5rem); }
.sidebar-content { max-width: 21rem; position: relative; z-index: 1; }
.sidebar-content .eyebrow { color: #8bd0f5; }
.sidebar-content h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); margin: 0 0 1.25rem; }
.sidebar-content p:not(.eyebrow) { color: #d4e1e7; margin-block: 0 1.5rem; }
.sidebar-content .button { background: transparent; border: 1px solid rgba(255, 255, 255, .55); color: #fff; }
.sidebar-content .button:hover { background: rgba(255, 255, 255, .12); }
.header-inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: nowrap; }
.site-name { flex: 0 1 auto; font-weight: 750; font-size: 1.2rem; text-decoration: none; color: var(--text); white-space: nowrap; }
nav { display: flex; flex: 0 0 auto; flex-wrap: nowrap; gap: clamp(.45rem, 2vw, 1rem); font-size: .92rem; white-space: nowrap; }
nav a { text-decoration: none; }
.page-shell { min-height: calc(100vh - 9rem); padding-block: clamp(3rem, 8vw, 7rem); }
.eyebrow { color: var(--accent-dark); font-size: .78rem; font-weight: 750; letter-spacing: .12em; margin: 0 0 .75rem; text-transform: uppercase; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: clamp(2.5rem, 7vw, 5rem); margin: 0 0 1.25rem; max-width: 850px; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0; }
.lede { color: var(--muted); font-size: clamp(1.15rem, 2.3vw, 1.4rem); max-width: 700px; }
.button { display: inline-block; border-radius: .45rem; background: var(--accent); color: #fff; padding: .7rem 1rem; text-decoration: none; font-weight: 700; }
.button:hover { background: var(--accent-dark); color: #fff; }
.section-block { border-top: 1px solid var(--border); padding-block: 2.5rem; }
.home-writing { border-top: 0; padding-top: 0; }
.section-heading { margin-bottom: 1rem; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); padding: .85rem 0; }
.link-list li a { font-size: 1.1rem; font-weight: 650; }
.link-list li span { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.simple-list li { justify-content: flex-start; }
.article { max-width: 880px; margin-inline: auto; }
.article-header { margin-bottom: 2.5rem; }
.article-header h1 { font-size: clamp(2.3rem, 6vw, 4.3rem); }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin-top: 2.75rem; }
.prose h3, .prose h4 { margin-top: 2rem; }
.prose img { max-width: 100%; height: auto; }
.prose pre { overflow-x: auto; padding: 1rem; border-radius: .5rem; background: #18242b; color: #e6f1f5; font-size: .9rem; }
.prose pre.shiki { background: #272822; color: #f8f8f2; }
.prose pre.shiki .line { display: inline-block; min-width: 100%; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.prose :not(pre) > code { border: 1px solid var(--border); border-radius: .25rem; padding: .08rem .3rem; }
.prose blockquote { border-left: 4px solid var(--accent); margin-inline: 0; padding-left: 1rem; color: var(--muted); }
.article-back { border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1.5rem; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.5rem 2.5rem; font-size: .9rem; }
.site-footer p { margin: 0; }
@media (min-width: 960px) {
  body { padding-inline-start: var(--sidebar-width); }
  .visual-sidebar { display: block; inset: 0 auto 0 0; position: fixed; width: var(--sidebar-width); }
  .page-shell.shell, .site-footer.shell { margin-inline-end: auto; margin-inline-start: max(1rem, calc((100% - 980px) / 4)); }
  .page-shell, .site-footer { position: relative; z-index: 1; }
}
@media (max-width: 600px) {
  .site-footer { align-items: flex-start; flex-direction: column; }
  .header-inner { gap: .65rem; min-height: 4rem; }
  .site-name { font-size: 1rem; }
  nav { font-size: .84rem; }
  .link-list li { align-items: flex-start; flex-direction: column; gap: .15rem; }
}
@media (max-width: 959px) {
  .visual-sidebar.has-image { display: block; height: clamp(11rem, 42vw, 18rem); }
  .visual-sidebar.has-image img { object-position: center top; }
  .visual-sidebar.has-content { display: flex; min-height: 19rem; }
}
