/* ============ THEME TOKENS ============ */
:root {
  /* Font pairings controlled via --f-display / --f-body / --f-mono */
  --f-display: 'Fraunces', Georgia, serif;
  --f-body: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --f-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Light (warm paper) */
  --paper: #faf8f3;
  --paper-2: #f2efe6;
  --ink: #1a1915;
  --ink-2: #4a4740;
  --ink-3: #7a756a;
  --rule: #d9d3c2;
  --rule-soft: #e8e3d5;

  /* Accent (tweakable) */
  --accent: oklch(0.55 0.15 30);
  --accent-soft: oklch(0.55 0.15 30 / 0.12);

  /* Reading width (tweakable) */
  --read-w: 64ch;

  --shadow-sm: 0 1px 0 rgba(20, 18, 14, 0.04);
}

[data-theme="dark"] {
  --paper: #14130f;
  --paper-2: #1c1a15;
  --ink: #e8e3d5;
  --ink-2: #b8b2a2;
  --ink-3: #7a756a;
  --rule: #2c2a24;
  --rule-soft: #232119;
  --accent: oklch(0.72 0.12 30);
  --accent-soft: oklch(0.72 0.12 30 / 0.14);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #14130f;
    --paper-2: #1c1a15;
    --ink: #e8e3d5;
    --ink-2: #b8b2a2;
    --ink-3: #7a756a;
    --rule: #2c2a24;
    --rule-soft: #232119;
    --accent: oklch(0.72 0.12 30);
    --accent-soft: oklch(0.72 0.12 30 / 0.14);
  }
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.2s ease, color 0.2s ease;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

/* ============ TYPE ============ */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; color: var(--ink); margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); letter-spacing: -0.015em; margin-top: 2.2em; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.2em; text-wrap: pretty; }
small, .meta { font-family: var(--f-sans); font-size: 0.82rem; letter-spacing: 0.02em; color: var(--ink-3); }
blockquote { border-left: 2px solid var(--accent); margin: 1.6em 0; padding: 0.2em 0 0.2em 1.4em; font-style: italic; color: var(--ink-2); }
code { font-family: var(--f-mono); font-size: 0.9em; background: var(--paper-2); padding: 0.12em 0.35em; border-radius: 3px; }
pre { font-family: var(--f-mono); background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 6px; padding: 1em 1.2em; overflow-x: auto; font-size: 0.86rem; line-height: 1.6; margin: 1.6em 0; }
pre code { background: none; padding: 0; font-size: inherit; }

/* ============ SITE CHROME ============ */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head__inner { max-width: 1240px; margin: 0 auto; padding: 1.4rem 1.6rem; display: flex; align-items: baseline; justify-content: space-between; gap: 2rem; }
.brand { font-family: var(--f-display); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.brand em { font-style: italic; color: var(--accent); }
.site-nav { display: flex; gap: 1.6rem; align-items: center; font-family: var(--f-sans); font-size: 0.86rem; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover, .site-nav a.is-active { color: var(--ink); }
.theme-toggle { background: none; border: 1px solid var(--rule); color: var(--ink-2); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-family: var(--f-sans); font-size: 0.9rem; padding: 0; }
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }

.site-foot { border-top: 1px solid var(--rule); margin-top: 6rem; padding: 2rem 1.6rem 3rem; }
.site-foot__inner { max-width: 1240px; margin: 0 auto; display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 1rem; font-family: var(--f-sans); font-size: 0.82rem; color: var(--ink-3); }
.site-foot a { color: var(--ink-3); }

/* ============ CONTAINERS ============ */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 1.6rem; }
.read { max-width: var(--read-w); margin: 0 auto; padding: 0 1.6rem; }

/* ============ V1: COLUMN (classic centered) ============ */
.v-column .lede { padding: 4rem 0 3rem; border-bottom: 1px solid var(--rule); }
.v-column .lede__kicker { font-family: var(--f-sans); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.v-column .lede__title { font-size: clamp(2.4rem, 5vw, 4rem); margin: 0 0 0.8rem; }
.v-column .lede__dek { font-family: var(--f-body); font-style: italic; font-size: 1.25rem; color: var(--ink-2); line-height: 1.5; max-width: 42rem; margin: 0; }

.v-column .post-list { padding: 2.4rem 0; display: flex; flex-direction: column; }
.post-item { display: grid; grid-template-columns: 120px 1fr; gap: 2rem; padding: 1.8rem 0; border-bottom: 1px solid var(--rule-soft); text-decoration: none; }
.post-item:hover { background: var(--paper-2); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; border-radius: 4px; }
.post-item__date { font-family: var(--f-sans); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding-top: 0.5em; }
.post-item__title { font-family: var(--f-display); font-size: 1.55rem; font-weight: 500; letter-spacing: -0.015em; margin: 0 0 0.5rem; color: var(--ink); line-height: 1.2; }
.post-item__excerpt { font-size: 1rem; color: var(--ink-2); line-height: 1.55; margin: 0; }
.post-item__tag { display: inline-block; margin-top: 0.7rem; font-family: var(--f-sans); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }

/* ============ V2: BROADSHEET (asymmetric newspaper) ============ */
.v-broadsheet .masthead { padding: 3rem 0 2rem; border-bottom: 3px double var(--rule); text-align: center; }
.v-broadsheet .masthead__title { font-family: var(--f-display); font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 400; letter-spacing: -0.03em; margin: 0; font-style: italic; }
.v-broadsheet .masthead__sub { font-family: var(--f-sans); font-size: 0.78rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-3); margin-top: 0.8rem; }

.v-broadsheet .feature { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; padding: 3rem 0; border-bottom: 1px solid var(--rule); }
.v-broadsheet .feature__lead h2 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; margin: 0.5rem 0 1rem; }
.v-broadsheet .feature__lead p { font-size: 1.08rem; color: var(--ink-2); }
.v-broadsheet .feature__side { border-left: 1px solid var(--rule); padding-left: 2rem; }
.v-broadsheet .side-item { padding: 0.8rem 0; border-bottom: 1px solid var(--rule-soft); }
.v-broadsheet .side-item:last-child { border-bottom: 0; }
.v-broadsheet .side-item__kicker { font-family: var(--f-sans); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.v-broadsheet .side-item h3 { font-size: 1.1rem; margin: 0.2rem 0 0.3rem; line-height: 1.25; }
.v-broadsheet .side-item .meta { display: block; }

.v-broadsheet .columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.4rem; padding: 3rem 0; }
.v-broadsheet .col-item h3 { font-size: 1.2rem; margin: 0 0 0.4rem; }
.v-broadsheet .col-item p { font-size: 0.95rem; color: var(--ink-2); margin: 0; }
.v-broadsheet .col-item .meta { display: block; margin-bottom: 0.4rem; }

.v-broadsheet .dropcap::first-letter { font-family: var(--f-display); font-weight: 500; font-size: 4.2em; float: left; line-height: 0.85; padding: 0.08em 0.1em 0 0; color: var(--accent); }
.post-dek { font-size: 1.18rem; color: var(--ink-2); font-style: italic; line-height: 1.5; margin: 0 0 1.4rem; }
.post-layout .body.has-dropcap > p:first-of-type::first-letter { font-family: var(--f-display); font-weight: 500; font-size: 4.2em; float: left; line-height: 0.85; padding: 0.08em 0.1em 0 0; color: var(--accent); }

/* ============ V3: INDEX (dense year-grouped) ============ */
.v-index .hero { padding: 5rem 0 3rem; max-width: 50rem; }
.v-index .hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 0 0 1rem; }
.v-index .hero p { font-size: 1.2rem; color: var(--ink-2); font-style: italic; line-height: 1.55; }

.v-index .index-list { padding: 2rem 0 4rem; }
.v-index .year-group { display: grid; grid-template-columns: 120px 1fr; gap: 3rem; padding: 2rem 0; border-top: 1px solid var(--rule); }
.v-index .year { font-family: var(--f-display); font-size: 2.4rem; font-weight: 400; color: var(--ink-3); position: sticky; top: 2rem; align-self: start; font-variant-numeric: oldstyle-nums; }
.v-index .year-posts { display: flex; flex-direction: column; }
.v-index .idx-row { display: grid; grid-template-columns: 60px 1fr auto; gap: 1.2rem; align-items: baseline; padding: 0.65rem 0; border-bottom: 1px dotted var(--rule-soft); text-decoration: none; font-size: 0.98rem; }
.v-index .idx-row:last-child { border-bottom: 0; }
.v-index .idx-row:hover { color: var(--accent); }
.v-index .idx-row:hover .idx-title { color: var(--accent); }
.v-index .idx-date { font-family: var(--f-sans); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.v-index .idx-title { color: var(--ink); font-family: var(--f-display); font-size: 1.08rem; transition: color .15s; }
.v-index .idx-kind { font-family: var(--f-sans); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding: 0.1rem 0.5rem; border: 1px solid var(--rule); border-radius: 2px; white-space: nowrap; }

/* ============ SINGLE POST (shared across variants) ============ */
.post-head { padding: 4rem 0 2rem; border-bottom: 1px solid var(--rule); text-align: center; }
.post-head__kicker { font-family: var(--f-sans); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.post-head__title { font-size: clamp(2rem, 4.5vw, 3.4rem); max-width: 24ch; margin: 0 auto 1rem; text-wrap: balance; }
.post-head__meta { font-family: var(--f-sans); font-size: 0.82rem; color: var(--ink-3); display: flex; gap: 1.2rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.post-head__linked { font-family: var(--f-sans); font-size: 0.82rem; color: var(--ink-3); margin: 0.2rem auto 0; text-align: center; }
.post-head__linked a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); transition: color .15s, border-color .15s; }
.post-head__linked a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.post-link { margin: 3rem 0 2rem; text-align: center; font-family: var(--f-sans); font-size: 0.95rem; }
.post-link a { display: inline-block; padding: 0.7rem 1.3rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2); text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.post-link a:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.post-link strong { font-family: var(--f-mono); font-weight: 500; font-size: 0.9em; letter-spacing: 0; }
.post-head__meta span + span::before { content: "·"; margin-right: 1.2rem; color: var(--rule); }

.post-layout { position: relative; max-width: var(--read-w); margin: 0 auto; padding: 3rem 1.6rem; }
.post-layout .body { width: 100%; }
.post-layout .full { max-width: none; margin: 2rem -2rem; }

.toc { position: sticky; top: 2rem; font-family: var(--f-sans); font-size: 0.86rem; align-self: start; }
.toc__label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.8rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule); }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; padding: 0.35rem 0; border-left: 2px solid transparent; padding-left: 0.8rem; }
.toc li.is-active { border-left-color: var(--accent); }
.toc li.is-active a { color: var(--ink); }
.toc a { text-decoration: none; color: var(--ink-2); display: block; line-height: 1.35; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-variant-numeric: tabular-nums; color: var(--ink-3); margin-right: 0.6rem; font-size: 0.82em; }

@media (min-width: 1100px) {
  /* Body stays centered to the page; TOC + rail float into the negative space beside it. */
  .post-layout.with-toc .toc { position: absolute; top: 0; right: calc(100% + 2.5rem); width: 200px; }
  .post-layout.with-toc .rail { position: absolute; top: 0; left: calc(100% + 2.5rem); width: 200px; }
}
@media (max-width: 1099px) {
  .post-layout.with-toc .toc, .post-layout.with-toc .rail { display: none; }
}

.rail { position: sticky; top: 2rem; align-self: start; font-family: var(--f-sans); font-size: 0.82rem; color: var(--ink-3); }
.rail__item { padding: 0.6rem 0; border-top: 1px solid var(--rule-soft); }
.rail__item:first-child { border-top: 0; }
.rail__label { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.25rem; }
.rail__val { color: var(--ink); }

.figure { margin: 2.4rem 0; }
.figure__img { background: repeating-linear-gradient(135deg, var(--paper-2), var(--paper-2) 10px, var(--rule-soft) 10px, var(--rule-soft) 11px); aspect-ratio: 16/9; border: 1px solid var(--rule-soft); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 0.78rem; color: var(--ink-3); letter-spacing: 0.05em; }
.figure figcaption { font-family: var(--f-sans); font-size: 0.82rem; color: var(--ink-3); margin-top: 0.6rem; text-align: center; font-style: italic; }

.pullquote { font-family: var(--f-display); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.3; color: var(--ink); text-align: center; margin: 3rem 0; padding: 2rem 1rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); max-width: 38rem; margin-left: auto; margin-right: auto; }

.tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 2rem 0; }
.tag { font-family: var(--f-sans); font-size: 0.78rem; padding: 0.25rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; color: var(--ink-2); }
.tag:hover { border-color: var(--accent); color: var(--accent); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding: 2rem 0; border-top: 1px solid var(--rule); margin-top: 3rem; }
.post-nav a { text-decoration: none; color: var(--ink); padding: 1rem; border: 1px solid var(--rule); border-radius: 4px; display: block; transition: border-color .15s; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav .dir { font-family: var(--f-sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 0.4rem; }
.post-nav .next { text-align: right; }

/* ============ ALERTS (GitHub-style blockquote admonitions) ============ */
.alert { display: grid; grid-template-columns: 110px 1fr; gap: 1.4rem; margin: 1.8rem 0; padding: 1rem 1.2rem; border-left: 2px solid var(--ink-3); background: var(--paper-2); border-radius: 0 2px 2px 0; }
.alert__head { font-family: var(--f-sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding-top: 0.2rem; }
.alert__body { font-size: 0.98rem; line-height: 1.55; color: var(--ink-2); }
.alert__body > :first-child { margin-top: 0; }
.alert__body > :last-child { margin-bottom: 0; }
.alert__body p { margin: 0 0 0.7rem; }
.alert__body p:last-child { margin-bottom: 0; }
.alert__body code { background: var(--paper); }
.alert--note      { border-left-color: oklch(0.55 0.12 240); }
.alert--note      .alert__head { color: oklch(0.55 0.12 240); }
.alert--tip       { border-left-color: oklch(0.55 0.14 150); }
.alert--tip       .alert__head { color: oklch(0.55 0.14 150); }
.alert--important { border-left-color: var(--accent); }
.alert--important .alert__head { color: var(--accent); }
.alert--warning   { border-left-color: oklch(0.65 0.16 80); }
.alert--warning   .alert__head { color: oklch(0.55 0.16 70); }
.alert--caution   { border-left-color: oklch(0.55 0.18 25); }
.alert--caution   .alert__head { color: oklch(0.55 0.18 25); }
[data-theme="dark"] .alert--note      { border-left-color: oklch(0.72 0.10 240); }
[data-theme="dark"] .alert--note      .alert__head { color: oklch(0.75 0.10 240); }
[data-theme="dark"] .alert--tip       { border-left-color: oklch(0.72 0.12 150); }
[data-theme="dark"] .alert--tip       .alert__head { color: oklch(0.75 0.12 150); }
[data-theme="dark"] .alert--warning   { border-left-color: oklch(0.75 0.14 80); }
[data-theme="dark"] .alert--warning   .alert__head { color: oklch(0.78 0.14 80); }
[data-theme="dark"] .alert--caution   { border-left-color: oklch(0.72 0.15 25); }
[data-theme="dark"] .alert--caution   .alert__head { color: oklch(0.75 0.15 25); }
@media (max-width: 700px) {
  .alert { grid-template-columns: 1fr; gap: 0.3rem; padding: 0.9rem 1rem; }
}

/* ============ SERIES BOX ============ */
.series-box { max-width: 780px; margin: 2rem auto 0; padding: 1.4rem 1.6rem; border: 1px solid var(--rule-soft); border-radius: 2px; background: var(--paper-2); }
.series-box__kicker { font-family: var(--f-sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.3rem; }
.series-box__title { font-family: var(--f-display); font-style: italic; font-size: 1.4rem; font-weight: 500; margin: 0 0 0.9rem; line-height: 1.2; }
.series-box__title a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); transition: color .15s, border-color .15s; }
.series-box__title a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.series-box__list { list-style: none; padding: 0; margin: 0; font-family: var(--f-sans); font-size: 0.88rem; }
.series-box__list li { padding: 0.3rem 0; display: flex; align-items: baseline; gap: 0.8rem; color: var(--ink-2); }
.series-box__list li a { color: inherit; text-decoration: none; display: flex; align-items: baseline; gap: 0.8rem; flex: 1; }
.series-box__list li a:hover { color: var(--accent); }
.series-box__list .num { font-family: var(--f-mono); font-size: 0.78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 1.6rem; }
.series-box__list .title { flex: 1; }
.series-box__list .here { font-family: var(--f-sans); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.series-box__list li.is-current { color: var(--ink); font-weight: 500; }
.series-box__list li.is-current .num { color: var(--accent); }

/* ============ RELATED POSTS ============ */
.related-posts { margin: 3rem 0 2rem; padding-top: 1.4rem; border-top: 1px solid var(--rule-soft); }
.related-posts__label { font-family: var(--f-sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.8rem; }
.related-posts ul { list-style: none; padding: 0; margin: 0; }
.related-posts li { padding: 0.55rem 0; border-bottom: 1px dotted var(--rule-soft); }
.related-posts li:last-child { border-bottom: 0; }
.related-posts li a { display: grid; grid-template-columns: 2rem 1fr auto; gap: 1rem; align-items: baseline; text-decoration: none; color: inherit; transition: color .15s; }
.related-posts li a:hover .related-posts__title { color: var(--accent); }
.related-posts__num { font-family: var(--f-mono); font-size: 0.78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.related-posts__title { font-family: var(--f-display); font-size: 1.05rem; color: var(--ink); transition: color .15s; }
.related-posts__meta { font-family: var(--f-sans); font-size: 0.78rem; color: var(--ink-3); letter-spacing: 0.03em; }
@media (max-width: 600px) {
  .related-posts li a { grid-template-columns: 1.6rem 1fr; }
  .related-posts__meta { grid-column: 2; color: var(--ink-3); font-size: 0.74rem; }
}

/* ============ POST HERO / COVER ============ */
.post-hero { margin: 2rem auto 2.5rem; max-width: 980px; padding: 0 1.4rem; }
.post-hero img { width: 100%; height: auto; display: block; border-radius: 2px; aspect-ratio: 16/9; object-fit: cover; background: var(--paper-2); }
.post-hero figcaption { font-family: var(--f-sans); font-size: 0.78rem; color: var(--ink-3); margin-top: 0.6rem; letter-spacing: 0.02em; line-height: 1.5; }
.post-hero .credit { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; margin-left: 0.3rem; }
.feature__lead-cover { display: block; margin: 0 0 1rem; }
.feature__lead-cover img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; display: block; border-radius: 2px; background: var(--paper-2); }

/* ============ ABOUT PAGE ============ */
.about-head { padding: 4rem 0 2rem; }
.about-head h1 { font-size: clamp(2.6rem, 5vw, 4rem); font-style: italic; margin: 0; }
.about-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; padding: 1rem 0 4rem; }
.about-grid .avatar { aspect-ratio: 3/4; background: repeating-linear-gradient(135deg, var(--paper-2), var(--paper-2) 8px, var(--rule-soft) 8px, var(--rule-soft) 9px); border: 1px solid var(--rule-soft); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-3); letter-spacing: 0.08em; position: sticky; top: 2rem; align-self: start; }
.about-grid .bio p { font-size: 1.08rem; }
.about-grid .bio h2 { font-size: 1.4rem; margin-top: 2rem; }
.about-list { font-family: var(--f-sans); font-size: 0.9rem; }
.about-list li { padding: 0.4rem 0; border-bottom: 1px dotted var(--rule-soft); display: flex; justify-content: space-between; gap: 1rem; }
.about-list { list-style: none; padding: 0; margin: 0; }

/* ============ TAG ARCHIVE ============ */
.tag-cloud { padding: 4rem 0 3rem; }
.tag-cloud h1 { font-size: clamp(2rem, 4vw, 3rem); font-style: italic; }
.cloud { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: baseline; margin-top: 2rem; }
.cloud a { font-family: var(--f-display); text-decoration: none; color: var(--ink); padding: 0.2rem 0; }
.cloud a:hover { color: var(--accent); }
.cloud .t-sm { font-size: 0.95rem; color: var(--ink-3); }
.cloud .t-md { font-size: 1.25rem; }
.cloud .t-lg { font-size: 1.8rem; }
.cloud .t-xl { font-size: 2.4rem; }
.cloud .count { font-family: var(--f-sans); font-size: 0.72rem; color: var(--ink-3); vertical-align: super; margin-left: 0.15rem; }

/* ============ 404 ============ */
.fourofour { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 3rem 1.6rem; }
.fourofour .num { font-family: var(--f-display); font-size: clamp(6rem, 18vw, 12rem); font-style: italic; line-height: 1; color: var(--accent); margin: 0; font-variant-numeric: oldstyle-nums; }
.fourofour h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0.5rem 0 1rem; }
.fourofour p { color: var(--ink-2); max-width: 32rem; margin: 0 auto 2rem; }

/* ============ SERVICES / PORTAL ============ */
.services-head { padding: 4rem 0 2rem; border-bottom: 1px solid var(--rule); }
.services-head h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 0.4rem 0 0.8rem; }
.services-head p { font-size: 1.15rem; color: var(--ink-2); font-style: italic; max-width: 44rem; margin: 0; line-height: 1.55; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0; padding: 1.5rem 0 4rem; border-top: 1px solid transparent; }
.service-card { display: flex; flex-direction: column; gap: 0.8rem; padding: 1.5rem 1.4rem; text-decoration: none; color: inherit; border: 1px solid var(--rule-soft); margin: -1px 0 0 -1px; background: var(--paper); transition: background .15s, border-color .15s, transform .15s; position: relative; }
.service-card:hover { background: var(--paper-2); border-color: var(--rule); z-index: 1; }
.service-card:hover .service-card__name { color: var(--accent); }
.service-card:hover .service-card__arrow { transform: translate(3px, -3px); color: var(--accent); }

.service-card__thumb { aspect-ratio: 16/10; background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 3px; overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; padding: 1rem; }
.service-card__thumb img { max-width: 60%; max-height: 75%; object-fit: contain; display: block; image-rendering: -webkit-optimize-contrast; }
.service-card__thumb--placeholder { background: repeating-linear-gradient(135deg, var(--paper-2), var(--paper-2) 10px, var(--rule-soft) 10px, var(--rule-soft) 11px); font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }

.service-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; }
.service-card__name { font-family: var(--f-display); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); margin: 0; transition: color .15s; line-height: 1.2; }
.service-card__arrow { font-family: var(--f-sans); color: var(--ink-3); font-size: 0.9rem; transition: transform .15s, color .15s; display: inline-block; }

.service-card__desc { font-size: 0.96rem; color: var(--ink-2); margin: 0; line-height: 1.5; flex: 1; }

.service-card__foot { display: flex; justify-content: space-between; align-items: center; padding-top: 0.6rem; border-top: 1px dotted var(--rule-soft); font-family: var(--f-sans); font-size: 0.74rem; color: var(--ink-3); letter-spacing: 0.04em; }
.service-card__host { font-family: var(--f-mono); text-transform: lowercase; letter-spacing: 0; }
.service-card__status { display: inline-flex; align-items: center; gap: 0.4rem; }
.service-card__dot { width: 6px; height: 6px; border-radius: 50%; background: oklch(0.6 0.15 150); box-shadow: 0 0 0 2px oklch(0.6 0.15 150 / 0.18); }
.service-card__dot.is-down { background: oklch(0.6 0.18 30); box-shadow: 0 0 0 2px oklch(0.6 0.18 30 / 0.18); }

/* Section headers within the services list */
.services-section { padding: 2.2rem 0 0.6rem; display: grid; grid-template-columns: 120px 1fr; gap: 2rem; align-items: baseline; border-top: 1px solid var(--rule); margin-top: 2rem; }
.services-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 1rem; }
.services-section__label { font-family: var(--f-sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding-top: 0.3rem; }
.services-section__title { font-family: var(--f-display); font-size: 1.4rem; font-weight: 500; margin: 0; font-style: italic; color: var(--ink); }
.services-section__note { font-family: var(--f-body); font-size: 0.95rem; color: var(--ink-3); margin: 0.25rem 0 0; font-style: normal; }

@media (max-width: 780px) {
  .services-section { grid-template-columns: 1fr; gap: 0.3rem; }
  .services-grid { grid-template-columns: 1fr; }
}

/* ============ TWEAKS PANEL ============ */
.tweaks { position: fixed; right: 1rem; bottom: 1rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; font-family: var(--f-sans); font-size: 0.82rem; box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 50; width: 260px; display: none; }
.tweaks.is-open { display: block; }
.tweaks h3 { font-family: var(--f-sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.8rem; font-weight: 600; }
.tweaks .row { margin-bottom: 0.8rem; }
.tweaks label { display: block; font-size: 0.74rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.tweaks select, .tweaks input[type=range] { width: 100%; font-family: inherit; font-size: 0.86rem; background: var(--paper-2); border: 1px solid var(--rule); color: var(--ink); padding: 0.3rem 0.4rem; border-radius: 4px; }
.tweaks .swatches { display: flex; gap: 0.4rem; }
.tweaks .swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.tweaks .swatch.is-active { border-color: var(--ink); }

/* ============ VARIATION SWITCHER ============ */
.view-switch { position: fixed; bottom: 1rem; left: 1rem; z-index: 40; background: var(--paper); border: 1px solid var(--rule); border-radius: 999px; padding: 0.3rem; display: flex; gap: 0.1rem; font-family: var(--f-sans); font-size: 0.78rem; box-shadow: 0 4px 16px rgba(0,0,0,0.12); max-width: calc(100vw - 2rem); flex-wrap: wrap; }
.view-switch button { background: none; border: 0; color: var(--ink-2); padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: inherit; }
.view-switch button.is-active { background: var(--ink); color: var(--paper); }
.view-switch button:hover:not(.is-active) { color: var(--ink); }

/* ============ MOBILE ============ */
@media (max-width: 780px) {
  body { font-size: 17px; }
  .site-head__inner { padding: 1rem 1.1rem; }
  .site-nav { gap: 1rem; }
  .site-nav a:not(.brand):not(.theme-toggle) { display: none; }
  .wrap, .post-layout { padding-left: 1.1rem; padding-right: 1.1rem; }
  .post-layout { grid-template-columns: 1fr; }
  .post-layout.with-toc { grid-template-columns: 1fr; }
  .post-layout .rail, .post-layout .toc { display: none; }
  .post-item { grid-template-columns: 1fr; gap: 0.4rem; }
  .post-item__date { padding-top: 0; }
  .v-broadsheet .feature { grid-template-columns: 1fr; gap: 2rem; }
  .v-broadsheet .feature__side { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
  .v-broadsheet .columns { grid-template-columns: 1fr; gap: 1.6rem; }
  .v-index .year-group { grid-template-columns: 1fr; gap: 0.6rem; }
  .v-index .year { position: static; font-size: 1.6rem; }
  .v-index .idx-row { grid-template-columns: 55px 1fr; }
  .v-index .idx-kind { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-grid .avatar { max-width: 200px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .tweaks { left: 1rem; right: 1rem; bottom: 4.5rem; width: auto; }
  .view-switch { bottom: 1rem; left: 1rem; right: 1rem; justify-content: center; }
  .view-switch.hide-mobile { display: none; }
}

/* ============ UTILITY ============ */
.hidden { display: none !important; }
.screen { display: none; }
.screen.is-active { display: block; }
