/* Commonplace — a comfortable column for writing, reading, and making. */
:root {
  color-scheme: light dark;
  --color-bg: #fdfdfc;
  --color-fg: #30332f;
  --color-muted: #70746d;
  --color-accent: #444444;
  --color-selection: #e8e8e6;
  --color-border: #eaece7;
  --color-surface: #f4f5f1;
  --font-display: "Public Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --content-width: 620px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1c1e1b;
    --color-fg: #e0e3db;
    --color-muted: #a0a69a;
    --color-accent: #eeeeec;
    --color-selection: #40413f;
    --color-border: #32372f;
    --color-surface: #252922;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--color-border); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--color-accent); text-decoration-color: currentColor; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { background: none; border: 0; padding: 0; }
img, video { max-width: 100%; }
img { display: block; height: auto; }
iframe { max-width: 100%; }
::selection { background: var(--color-selection); color: var(--color-fg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 8px 12px; background: var(--color-bg); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.site-main, .site-header, .site-footer { width: min(var(--content-width), calc(100% - 48px)); margin-inline: auto; }
.site-header { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding-top: 64px; margin-bottom: 62px; }
.site-title { font-weight: 500; text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; gap: 23px; font-size: 13px; }
.site-nav a { color: var(--color-muted); text-decoration: none; }
.site-nav a[aria-current], .site-nav a:hover { color: var(--color-fg); }
.content-area { min-width: 0; }
.layout-home .site-main { padding-top: 94px; }

/* The introduction and the three indexes. */
.intro-name { margin: 0 0 28px; font-size: 16px; line-height: 1.5; font-weight: 500; letter-spacing: -.2px; }
.intro-copy p { margin: 0 0 20px; }
.intro-copy p:last-child { margin-bottom: 0; }
.intro-copy a { text-decoration-color: #c7ccc2; }
.home-index { margin-top: 48px; }
.index-tabs { position: relative; display: flex; gap: 28px; border-bottom: 1px solid var(--color-border); }
.index-tabs a { position: relative; display: block; padding: 10px 0 13px; color: var(--color-muted); text-decoration: none; }
.index-tabs a:hover, .index-tabs a[aria-selected="true"] { color: var(--color-fg); }
.tab-indicator { position: absolute; left: 0; bottom: -1px; height: 1px; background: var(--color-fg); pointer-events: none; }
.tab-indicator.is-ready { transition: transform 260ms cubic-bezier(.22, 1, .36, 1), width 260ms cubic-bezier(.22, 1, .36, 1); }
@media (prefers-reduced-motion: reduce) {
  .tab-indicator.is-ready { transition: none; }
}
.index-panel:focus-visible { outline: none; box-shadow: inset 0 1px var(--color-muted); }
.index-panel + .index-panel { margin-top: 36px; }
.tabs-ready .index-panel { margin-top: 0; }
.view-all { display: inline-flex; align-items: center; gap: 9px; margin-top: 24px; color: var(--color-muted); font-size: 13px; text-decoration: none; }
.view-all:hover { color: var(--color-fg); }

/* Writing: the year sits quietly in the margin. */
.writing-year { display: grid; grid-template-columns: 62px minmax(0, 1fr); column-gap: 20px; border-bottom: 1px solid var(--color-border); }
.year-label, .article-body .year-label { margin: 0; padding-top: 14px; font-size: 13px; font-weight: 400; line-height: 22px; color: var(--color-muted); }
.post-list, .article-body .post-list { list-style: none; padding: 0; margin: 0; }
.post-list li, .article-body .post-list li { margin: 0; padding: 0; }
.post-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 13px 0; line-height: 23px; text-decoration: none; }
.post-list li:not([hidden]) ~ li:not([hidden]) .post-row { border-top: 1px solid var(--color-border); }
.post-title { min-width: 0; overflow-wrap: anywhere; }
.post-date { flex: 0 0 52px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--color-muted); white-space: nowrap; }

/* Books: every book can be logged, only books with notes are links. */
.book-line { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 17px; padding: 14px 0; border-bottom: 1px solid var(--color-border); text-decoration: none; }
.book-line-cover { width: 28px; min-height: 38px; display: grid; align-items: center; }
.book-line-cover img { width: 28px; height: 40px; object-fit: cover; border-radius: 1px; }
.book-line-cover > span { display: grid; place-items: center; height: 40px; background: var(--color-surface); color: var(--color-muted); font-family: Georgia, serif; }
.book-line-main { min-width: 0; }
.book-line-title { display: block; line-height: 1.45; overflow-wrap: anywhere; }
.book-line-author { display: block; margin-top: 3px; font-size: 12px; color: var(--color-muted); line-height: 1.4; }
.book-line-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; white-space: nowrap; }
.book-line-rating { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.book-line-flag { color: var(--color-accent); }
.reading-now { font-size: 11px; color: var(--color-accent); }
.library-controls, .writing-controls { margin: 0 0 20px; font-size: 13px; }
.library-search, .writing-search { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--color-border); }
.library-search:focus-within, .writing-search:focus-within { border-bottom-color: var(--color-muted); }
.search-label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.search-icon { flex: 0 0 14px; color: var(--color-muted); }
.search-label input { appearance: none; width: 100%; min-width: 0; min-height: 42px; padding: 8px 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; outline: none; }
.search-label input:focus-visible { outline: none; }
.search-label input::-webkit-search-cancel-button, .search-label input::-webkit-search-decoration { -webkit-appearance: none; }
.search-label input::placeholder { color: var(--color-muted); opacity: 1; }
.search-clear { width: 28px; height: 36px; color: var(--color-muted); font-size: 18px; line-height: 1; }
.search-clear:hover { color: var(--color-fg); }
.library-options { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 30px; margin-top: 9px; }
.library-option-group { display: flex; flex-wrap: wrap; gap: 20px; }
.library-option { min-height: 34px; padding: 5px 0; color: var(--color-muted); font-size: 12px; line-height: 24px; white-space: nowrap; }
.library-option:hover { color: var(--color-fg); }
.library-option[aria-pressed="true"] { color: var(--color-fg); text-decoration: underline; text-decoration-color: var(--color-muted); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.library-count, .article-body .library-count, .writing-count, .article-body .writing-count { margin: 0 0 5px; color: var(--color-muted); font-size: 12px; }
.empty-state { color: var(--color-muted); padding: 28px 0; }

/* Projects. */
.app-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; align-items: center; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--color-border); text-decoration: none; }
.app-icon { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; }
.app-icon--letter { display: grid; place-items: center; background: var(--color-surface); }
.app-info { display: block; min-width: 0; }
.app-name { display: block; line-height: 1.5; }
.app-desc { display: block; margin-top: 3px; color: var(--color-muted); font-size: 13px; line-height: 1.5; }
.row-arrow { color: var(--color-muted); font-size: 14px; }

/* The same column continues into the writing. */
.article-header { margin-bottom: 38px; }
.article-title { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -.8px; line-height: 1.3; text-wrap: balance; overflow-wrap: anywhere; }
.article-description { margin: 12px 0 0; color: var(--color-muted); line-height: 1.65; }
.article-kicker { display: inline-block; margin-bottom: 22px; color: var(--color-muted); font-size: 13px; text-decoration: none; }
.article-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 20px; margin-top: 17px; color: var(--color-muted); font-size: 12px; }
.article-body { font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: 0 0 22px; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4 { font-weight: 500; line-height: 1.4; color: var(--color-fg); }
.article-body h1 { font-size: 24px; margin: 40px 0 16px; }
.article-body h2 { font-size: 21px; margin: 38px 0 16px; letter-spacing: -.35px; }
.article-body h3 { font-size: 17px; margin: 30px 0 12px; }
.article-body h4 { font-size: 15px; margin: 25px 0 10px; }
.layout-post .article-body :is(h1, h2, h3, h4, h5, h6)[id] { scroll-margin-top: 32px; }
.anchored-heading { position: relative; cursor: pointer; }
.heading-anchor { position: absolute; inset-inline-start: -24px; top: 0; display: flex; align-items: center; justify-content: center; width: 24px; height: 1.4em; font-weight: 400; color: var(--color-muted); text-decoration: none; opacity: 0; }
.heading-anchor span { font-size: .75em; }
.heading-anchor-visible > .heading-anchor, .heading-anchor:focus-visible { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .anchored-heading:hover > .heading-anchor { opacity: 1; }
}
.article-body ul, .article-body ol { padding-left: 22px; margin: 0 0 24px; }
.article-body li { padding-left: 3px; margin: 6px 0; }
.article-body strong { font-weight: 600; }
.article-body img { margin: 24px auto; }
.article-body figure { margin: 26px 0; }
.article-body figcaption { color: var(--color-muted); font-size: 12px; margin-top: 10px; text-align: center; }
.article-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 24px 0; font-size: 13px; }
.article-body td, .article-body th { padding: 10px 14px; border-bottom: 1px solid var(--color-border); text-align: left; }
.article-body th { font-weight: 500; }
blockquote { margin: 28px 0; padding: 2px 0 2px 22px; border-left: 2px solid var(--color-border); color: var(--color-muted); }
blockquote p:last-child { margin-bottom: 0; }
.pull-quote { color: var(--color-fg); font-size: 17px; line-height: 1.65; }
.page-number { display: block; margin-top: 8px; font-size: 12px; color: var(--color-muted); }
hr { border: 0; border-top: 1px solid var(--color-border); margin: 36px 0; }
code { font-family: var(--font-mono); font-size: .86em; background: var(--color-surface); border-radius: 3px; padding: 2px 4px; overflow-wrap: anywhere; }
pre { overflow-x: auto; background: var(--color-surface); padding: 18px 20px; font-size: 13px; line-height: 1.7; margin: 26px 0; border-radius: 3px; }
pre code { padding: 0; background: transparent; overflow-wrap: normal; }
.back-link { display: inline-block; margin-top: 32px; font-size: 13px; color: var(--color-muted); text-decoration: none; }
.book-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 28px; }
.book-cover { width: 76px; max-height: 116px; object-fit: contain; }
.book-byline { margin: 10px 0 0; color: var(--color-muted); }
.app-header { display: flex; align-items: center; gap: 20px; }
.app-detail-icon { width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0; }
.app-header .article-description { margin-top: 6px; font-size: 14px; }
.app-links a { color: var(--color-accent); }
.article-body .app-card img, .article-body .book-line img { margin: 0; }
.article-body .app-list, .article-body .book-list, .article-body .writing-list { line-height: 1.65; }

/* Existing app content and utility pages. */
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 22px; margin: 26px 0; }
.feature-card, .feature { padding-bottom: 20px; border-bottom: 1px solid var(--color-border); }
.feature-card h3, .feature h3 { margin-top: 0; }
.feature-card p:last-child, .feature p:last-child { margin-bottom: 0; }
.screenshot-strip { display: flex; gap: 16px; overflow-x: auto; overscroll-behavior-inline: contain; padding: 8px 0 18px; margin: 22px 0; scroll-snap-type: x proximity; }
.article-body .screenshot-card { flex: 0 0 170px; margin: 0; scroll-snap-align: start; }
.article-body .screenshot-card img { width: 100%; margin: 0; border-radius: 12px; }
.stack-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.stack-card { display: block; border: 1px solid var(--color-border); padding: 18px; text-decoration: none; border-radius: 3px; }
.stack-card-header { display: flex; justify-content: space-between; gap: 16px; color: var(--color-muted); }
.article-body .stack-card-count { font-size: 12px; margin: 0 0 16px; }
.article-body .stack-card-title { font-size: 16px; margin: 0; }
.stack-card-download-icon { font-size: 15px; }
.callout { background: var(--color-surface); padding: 22px; border-radius: 3px; margin: 26px 0; }
.callout p:last-child { margin-bottom: 0; }
.currently-reading { margin: 20px 0; }
.reading-card { padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.reading-card-title, .reading-card-author { display: block; }
.reading-card-author, .page-footer-note { font-size: 13px; color: var(--color-muted); }
.error-page { padding: 50px 0; }
.error-code { font-size: 42px; font-weight: 500; margin: 0; }
.error-message { color: var(--color-muted); }

/* The design archive remains a visual record. */
.archive-today { border-block: 1px solid var(--color-border); padding: 20px 0; }
.archive-today-label { display: block; color: var(--color-muted); font-size: 12px; }
.archive-today-theme { display: block; margin-top: 5px; font-size: 20px; font-weight: 500; }
.article-body .archive-today-manifesto { margin: 14px 0; }
.archive-today-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.archive-meta-item { color: var(--color-muted); font-size: 12px; }
.archive-palette { display: flex; align-items: center; gap: 4px; }
.archive-palette i { width: 10px; height: 10px; border: 1px solid var(--color-border); border-radius: 50%; }
.archive-controls { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; margin: 24px 0; }
.archive-count { color: var(--color-muted); }
.archive-surprise { color: var(--color-accent); }
.archive-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 22px; }
.archive-card { display: block; min-width: 0; text-decoration: none; }
.archive-card--lost { color: var(--color-muted); }
.archive-thumb { display: block; aspect-ratio: 3 / 2; overflow: hidden; border: 1px solid var(--color-border); background: var(--color-surface); }
.archive-thumb img { width: 100%; height: 100%; object-fit: cover; margin: 0; }
.archive-thumb-fallback { display: grid; place-items: center; text-align: center; height: 100%; padding: 24px; font-size: 18px; }
.archive-card-info { display: block; margin-top: 12px; }
.archive-date { display: block; font-size: 11px; color: var(--color-muted); }
.archive-theme { display: block; font-size: 14px; font-weight: 500; margin: 4px 0; }
.archive-desc { display: block; font-size: 12px; color: var(--color-muted); line-height: 1.6; margin-bottom: 10px; }

/* A small, ordinary end to the page. */
.site-footer { margin-top: 68px; margin-bottom: 54px; padding-top: 22px; border-top: 1px solid var(--color-border); font-size: 12px; color: var(--color-muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a { text-decoration: none; }

@media (max-width: 600px) {
  .layout-home .site-main { padding-top: 56px; }
  .site-header { padding-top: 32px; margin-bottom: 46px; gap: 18px; flex-wrap: wrap; }
  .site-nav { gap: 20px; }
  .intro-name { margin-bottom: 25px; }
  .home-index { margin-top: 36px; }
  .writing-year { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
  .post-row { gap: 10px; font-size: 14px; }
  .post-date { flex-basis: 44px; font-size: 11px; }
  .year-label, .article-body .year-label { font-size: 12px; }
  .book-line { gap: 12px; }
  .book-line-title { font-size: 14px; }
  .app-card { gap: 15px; }
  .article-title { font-size: 25px; }
  .article-header { margin-bottom: 30px; }
  .article-body { font-size: 15px; }
  .book-header { gap: 20px; }
  .book-cover { width: 58px; }
  .library-options { gap: 0 30px; }
  .search-label input { font-size: 16px; min-height: 44px; }
  .site-footer { margin-top: 52px; margin-bottom: 36px; }
  .footer-links { gap: 2px; margin-inline: -9px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 9px; }
}

/* Keyboard focus follows the page's typography, with no enclosing boxes. */
a:focus-visible, button:focus-visible {
  outline: none;
  color: var(--color-fg);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.index-tabs a:focus-visible, .library-option:focus-visible { outline: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
@media (max-width: 380px) {
  .site-main, .site-header, .site-footer { width: calc(100% - 36px); }
  .heading-anchor { inset-inline-start: -18px; width: 18px; }
  .site-nav { gap: 22px; }
  .book-line-meta { max-width: 72px; white-space: normal; text-align: right; }
  .stack-grid, .archive-gallery { grid-template-columns: 1fr; }
}
