:root {
  color-scheme: light;
  --paper: #faf6ee; --ink: #2a2233; --muted: #4a3f52;
  --accent: #5b2a9e; --gold: #f2b01e; --gold-ink: #8a6a00; --pink: #dd5a98; --berry: #7a2e4a;
  --rule: #ece3d2; --card: #fffdf8;
  --tag-tech-bg: #ece1f7; --tag-tech-fg: #5b2a9e;
  --tag-personal-bg: #fbe3ef; --tag-personal-fg: #aa2c6c;
  --maxw: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #241a3a; --ink: #ece6f5; --muted: #c6b9e0;
    --accent: #c4a9f0; --gold: #f2b01e; --gold-ink: #f2b01e; --pink: #f5a8cf; --berry: #f5a8cf;
    --rule: #352a52; --card: #2c2148;
    --tag-tech-bg: #34265e; --tag-tech-fg: #c4a9f0;
    --tag-personal-bg: #4a2440; --tag-personal-fg: #f5a8cf;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #241a3a; --ink: #ece6f5; --muted: #c6b9e0;
  --accent: #c4a9f0; --gold: #f2b01e; --gold-ink: #f2b01e; --pink: #f5a8cf; --berry: #f5a8cf;
  --rule: #352a52; --card: #2c2148;
  --tag-tech-bg: #34265e; --tag-tech-fg: #c4a9f0;
  --tag-personal-bg: #4a2440; --tag-personal-fg: #f5a8cf;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: Charter, "Iowan Old Style", Georgia, serif;
  line-height: 1.65; -webkit-text-size-adjust: 100%;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
a { color: var(--accent); text-decoration: none; border-bottom: 2px solid var(--gold); }
a:hover { border-bottom-color: var(--accent); }
.site-header { display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding: 1.5rem 0 1rem; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.site-header .brand { font-size: 1.3rem; font-weight: 700; color: var(--accent); border: 0; }
.site-nav { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.site-nav a { border: 0; color: var(--muted); }
.site-nav a:hover { color: var(--accent); }
.site-nav .rss-link { display: inline-flex; align-items: center; color: var(--gold-ink); }
.site-nav .rss-link:hover { color: var(--accent); }
.site-nav .nav-writing { display: inline-flex; gap: .5rem; align-items: baseline; }
.site-nav .nav-writing-label { color: var(--muted); }
.site-nav .nav-writing .sep { color: var(--rule); }
.site-nav .nav-divider { width: 1px; height: 1.1em; background: var(--rule); align-self: center; }
.theme-switch { display: inline-flex; gap: .15rem; padding: .2rem; border: 1px solid var(--rule);
  border-radius: 999px; background: var(--card); }
.theme-switch__opt { display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 999px; background: none;
  color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.theme-switch__opt:hover { color: var(--ink); }
.theme-switch__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-switch__opt.is-active,
.theme-switch__opt.is-active:hover { background: var(--accent); color: var(--paper); }
main { padding: 2rem 0 1rem; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: .55rem 0; border-bottom: 1px solid var(--rule);
  display: flex; gap: .8rem; align-items: baseline; }
.post-list .date { flex: 0 0 5.5rem; color: var(--muted); font-size: .85rem; }
.post-list .title { border: 0; }
.tag { font-size: .72rem; padding: .1rem .55rem; border-radius: 20px; white-space: nowrap;
  border: 0; }
.post-list .tag { margin-left: auto; }
.tag.tech { background: var(--tag-tech-bg); color: var(--tag-tech-fg); }
.tag.personal { background: var(--tag-personal-bg); color: var(--tag-personal-fg); }
.hero { display: flex; gap: 1.25rem; align-items: flex-start; }
.hero img { width: 90px; height: 90px; object-fit: contain; flex: 0 0 90px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 38rem) { .cols { grid-template-columns: 1fr; } .post-list .date { flex-basis: 4.8rem; } }
.col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-ink); }
.col h2 a { color: inherit; }
.post-hero { display: block; width: auto; max-width: 100%; max-height: 22rem; height: auto; border-radius: 6px; margin: 0 auto 1.75rem; }
article .content { font-size: 1.06rem; }
article .content img { display: block; max-width: 100%; height: auto; border-radius: 4px; margin: 1.5rem auto; }
.aside { border-left: 3px solid var(--gold); padding: .1rem 0 .1rem 1rem; margin: 1.25rem 0;
  color: var(--muted); font-size: .92rem; }
.aside p { margin: .5rem 0 0; }
.aside p:first-child { margin-top: 0; }
.fn-num { font-weight: 700; color: var(--gold-ink); }
.tweet { border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.25rem; margin: 1rem auto; max-width: 34rem; background: var(--card); }
.tweet-meta { margin: 0 0 .4rem; font-size: .95rem; }
.tweet-name { font-weight: 700; color: var(--ink); }
.tweet-handle, .tweet-date { color: var(--muted); font-weight: 400; }
.tweet-text p { margin: .5rem 0 0; }
.tweet-text p:first-child { margin-top: 0; }
.thread-link { text-align: center; margin: 1.75rem 0; }
.post-meta { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 1.5rem 0 3rem;
  color: var(--muted); font-size: .9rem; text-align: center; }
.site-footer .theme-switch { margin-bottom: 1rem; }
.site-footer img { width: 30px; height: 30px; vertical-align: middle; }
.site-footer .social { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap;
  margin: .6rem 0; }
.empty { text-align: center; padding: 2rem 0; color: var(--muted); }
.empty img { width: 140px; height: 140px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: .4rem .7rem; z-index: 100; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Lightbox (progressive enhancement; only active with JS) */
img.zoomable { cursor: zoom-in; }
dialog.lightbox { max-width: 94vw; max-height: 94vh; border: 0; padding: 0; background: transparent; overflow: visible; }
dialog.lightbox::backdrop { background: rgba(20, 12, 30, .85); }
dialog.lightbox img { display: block; max-width: 94vw; max-height: 84vh; width: auto; height: auto;
  margin: 0 auto; border-radius: 6px; }
.lightbox-cap { color: #f3eef9; text-align: center; font-size: .9rem; line-height: 1.5;
  margin: .7rem auto 0; max-width: 60ch; }
.lightbox-close { position: fixed; top: .75rem; right: 1rem; background: none; border: 0;
  color: #f3eef9; font-size: 2rem; line-height: 1; cursor: pointer; }
