:root {
  --wide-max: 1100px;
  --color-bg: #10151b;
  --color-bg-rgb: 16, 21, 27;
  --color-surface: #182029;
  --color-surface-raised: #1d2630;
  --color-ink: #eef2f4;
  --color-sub: #8b98a3;
  --color-line: #2a3540;
  --color-accent: #29c48f;
  --color-accent-ink: #0b1310;
  --color-amber: #e8b84b;
  --radius: 6px;
  --font-serif: "Noto Serif TC", "PingFang TC", serif;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system,
    BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", monospace;

  /* Article-typography bases — one set of "reading comfort" defaults per
     locale (font-size/line-height/column-width/paragraph-gap), tuned to how
     each script is actually read (CJK: narrower column measured in
     characters; Latin scripts: wider column measured in ch). Overridden per
     html[lang] below. data-reading-level then scales UP from whichever
     locale base is active via calc(), so accessibility mode and locale
     tuning compose instead of one clobbering the other. */
  --reader-font-size-base: 1.125rem;
  --reader-line-height-base: 1.7;
  --reader-content-width-base: 64ch;
  --reader-paragraph-gap-base: 1.3em;

  /* Adaptive reading tokens — layered on top of the base design system.
     data-reading-level (0-3) scales these up progressively; data-color-mode
     swaps the palette above without touching layout. See assets/js/adaptive-reading.js. */
  --reader-font-size: var(--reader-font-size-base);
  --reader-line-height: var(--reader-line-height-base);
  --reader-content-width: var(--reader-content-width-base);
  --reader-paragraph-gap: var(--reader-paragraph-gap-base);
  --reader-heading-gap-top: 2em;
  --reader-heading-gap-bottom: 0.7em;
  --reader-post-padding-x: 20px;
}

/* Per-locale article typography. Only these tokens change — everything else
   (nav, cards, footer, buttons) is locale-agnostic and untouched. Traditional
   and Simplified Chinese read comfortably narrower, measured in characters
   (em); Latin scripts read comfortably wider, measured in ch. */
html[lang="zh-Hant"] {
  --reader-font-size-base: 1.125rem;
  --reader-line-height-base: 1.85;
  --reader-content-width-base: 33em;
  --reader-paragraph-gap-base: 1.35em;
}

html[lang="zh-CN"] {
  --reader-font-size-base: 1.125rem;
  --reader-line-height-base: 1.82;
  --reader-content-width-base: 34em;
  --reader-paragraph-gap-base: 1.35em;
}

html[lang="en"] {
  --reader-font-size-base: 1.125rem;
  --reader-line-height-base: 1.7;
  --reader-content-width-base: 64ch;
  --reader-paragraph-gap-base: 1.3em;
}

html[lang="vi"] {
  --reader-font-size-base: 1.125rem;
  --reader-line-height-base: 1.78;
  --reader-content-width-base: 60ch;
  --reader-paragraph-gap-base: 1.3em;
}

html[lang="id"] {
  --reader-font-size-base: 1.125rem;
  --reader-line-height-base: 1.72;
  --reader-content-width-base: 64ch;
  --reader-paragraph-gap-base: 1.3em;
}

/* Cool, clean off-white palette (deliberately not warm cream — matches the
   same "precise/clinical" direction the dark theme was chosen for). Only the
   palette changes; layout and components are shared. */
html[data-color-mode="light"] {
  --color-bg: #f5f7f8;
  --color-bg-rgb: 245, 247, 248;
  --color-surface: #ffffff;
  --color-surface-raised: #eef1f3;
  --color-ink: #14181c;
  --color-sub: #55606a;
  --color-line: #d8dee2;
  --color-accent: #066b4a;
  --color-accent-ink: #ffffff;
  --color-amber: #96690a;
}

/* Reading level 1: loosen line-height only. Delta is relative to whichever
   locale base is active (see html[lang] rules above), so accessibility mode
   and locale tuning compose instead of one clobbering the other. */
html[data-reading-level="1"],
html[data-reading-level="2"],
html[data-reading-level="3"] {
  --reader-line-height: calc(var(--reader-line-height-base) + 0.1);
}

/* Reading level 2: also step up body font-size. */
html[data-reading-level="2"],
html[data-reading-level="3"] {
  --reader-font-size: calc(var(--reader-font-size-base) + 0.1rem);
}

/* Reading level 3: also widen paragraph/heading spacing, content width, and
   mobile side padding. */
html[data-reading-level="3"] {
  --reader-paragraph-gap: calc(var(--reader-paragraph-gap-base) + 0.5em);
  --reader-heading-gap-top: 2.4em;
  --reader-heading-gap-bottom: 0.9em;
  --reader-content-width: calc(var(--reader-content-width-base) + 40px);
  --reader-post-padding-x: 24px;
}

/* Transitions are only enabled once adaptive-reading.js adds this class after
   first paint, so the very first render is never mid-transition (no FOUC). */
html.reading-transitions-ready body,
html.reading-transitions-ready .post-content,
html.reading-transitions-ready .site-header,
html.reading-transitions-ready .site-footer {
  transition: background-color 0.2s ease, color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.75;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
}

.container {
  width: 100%;
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: rgba(var(--color-bg-rgb), 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-line);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--color-ink);
}

.tagline {
  margin: 0;
  padding-left: 14px;
  border-left: 1px solid var(--color-line);
  font-size: 0.8rem;
  color: var(--color-sub);
  letter-spacing: 0.02em;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--color-sub);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--color-ink);
}

.lang-switch {
  position: relative;
}

.lang-switch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-sub);
  padding: 4px 12px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-switch-icon {
  font-size: 0.9em;
  line-height: 1;
}

.lang-switch-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-ink);
}

.lang-switch-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 140px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  flex-direction: column;
  gap: 2px;
}

.lang-switch.is-open .lang-switch-menu {
  display: flex;
}

.lang-switch-menu a,
.lang-switch-menu span {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch-menu a {
  color: var(--color-sub);
}

.lang-switch-menu a:hover,
.lang-switch-menu a[aria-current="true"] {
  background: var(--color-surface-raised);
  color: var(--color-ink);
}

.lang-switch-menu .lang-switch-disabled {
  color: var(--color-line);
  cursor: not-allowed;
}

.site-nav a.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 999px;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.site-nav a.nav-cta:hover {
  filter: brightness(1.08);
  color: var(--color-accent-ink);
  transform: translateY(-1px);
}

/* Mobile nav toggle — hidden entirely above the mobile breakpoint, where the
   full .site-nav already displays inline as before. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-ink);
}

/* Hero (homepage) — the cover image already contains the title text,
   shown in full without cropping, framed like a lit panel in a dark room. */
.hero {
  width: 100%;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-amber);
  box-shadow: 0 1px 24px rgba(232, 184, 75, 0.12);
}

.hero-img {
  width: 100%;
  height: auto;
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Main content */
main.container {
  padding-top: 40px;
  padding-bottom: 64px;
}

/* LINE notice banner */
.notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-left: 4px solid #06c755;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-top: 40px;
}

.notice-banner-text {
  flex: 1 1 380px;
}

.notice-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--color-ink);
}

.notice-banner-text p {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: var(--color-sub);
  line-height: 1.7;
}

.notice-banner-text p:last-child {
  margin-bottom: 0;
}

.notice-banner-text strong {
  color: var(--color-ink);
}

.line-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: #06c755;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 999px;
  white-space: nowrap;
  transition: filter 0.15s ease, transform 0.15s ease;
}

/* In the nav, the LINE button sits right next to nav-cta and must match its
   size exactly (the notice-banner's standalone .line-cta keeps its larger,
   more prominent sizing). */
.site-nav .line-cta {
  padding: 9px 20px;
  font-size: 0.85rem;
}

.line-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Category sections + index list */
.category-section {
  margin-bottom: 52px;
  scroll-margin-top: 90px;
}

.category-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--color-ink);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 10px;
  display: block;
}

.index-list {
  border-top: 1px solid var(--color-line);
}

.index-row {
  display: flex;
  gap: 22px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-line);
}

.index-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-amber);
  flex-shrink: 0;
  padding-top: 3px;
  width: 28px;
}

.index-link {
  display: block;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.index-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.55;
  margin: 0 0 8px;
  color: var(--color-ink);
  transition: color 0.15s ease;
}

.index-link:hover .index-title {
  color: var(--color-accent);
}

.index-excerpt {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--color-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.index-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--color-sub);
  font-variant-numeric: tabular-nums;
}

.index-meta .index-date {
  color: var(--color-amber);
}

.index-badge-new {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Article-notification subscribe form (homepage lower-middle, article
   footer). Deliberately understated — a quiet utility, not a promo banner. */
.subscribe-block {
  margin: 40px 0;
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.subscribe-block-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 10px;
  display: block;
}

.subscribe-block-heading {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 8px;
  color: var(--color-ink);
}

.subscribe-block-desc {
  margin: 0 0 18px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--color-sub);
}

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subscribe-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.subscribe-input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-ink);
  font: inherit;
  font-size: 0.9rem;
}

.subscribe-input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.subscribe-submit {
  padding: 10px 20px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.subscribe-submit:hover {
  opacity: 0.88;
}

.subscribe-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.subscribe-status {
  margin: 12px 0 0;
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--color-sub);
}

/* Standalone confirm/unsubscribe landing pages */
.subscribe-action-card {
  max-width: var(--reader-content-width);
  margin: 64px auto;
  padding: 32px var(--reader-post-padding-x);
  text-align: center;
}

.subscribe-action-card h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0 0 14px;
  color: var(--color-ink);
}

.subscribe-action-status {
  font-size: 0.95rem;
  color: var(--color-sub);
  margin: 0 0 24px;
}

/* Article page */
.post {
  max-width: var(--reader-content-width);
  margin: 0 auto;
  padding: 36px var(--reader-post-padding-x) 64px;
}

.post-header h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 4.5vw, 2.2rem);
  line-height: 1.5;
  margin: 0 0 16px;
  color: var(--color-ink);
  text-wrap: balance;
  /* CJK text has no spaces, so the browser's default is free to break between
     ANY two characters — which can split a word in half. keep-all restricts
     breaks to punctuation (and explicit <wbr> where a title has none), so a
     line only ever wraps at a real semantic boundary. Latin scripts are
     unaffected by this property. */
  word-break: keep-all;
  overflow-wrap: break-word;
}

.post-subtitle {
  margin: -8px 0 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-sub);
}

.profile-header {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

.profile-photo-frame {
  border: 1px solid var(--color-amber);
  box-shadow: 0 0 0 5px var(--color-bg), 0 0 28px rgba(232, 184, 75, 0.15);
  padding: 6px;
  background: var(--color-surface);
}

.profile-photo {
  width: 100%;
  height: auto;
  display: block;
}

.profile-header h1 {
  margin: 0 0 8px;
}

.post-category {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--color-sub);
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-line);
}

.post-hero {
  margin: 0 0 32px;
}

.post-hero-img {
  width: 100%;
  height: auto;
  border: 1px solid var(--color-amber);
  box-shadow: 0 0 0 5px var(--color-bg), 0 0 28px rgba(232, 184, 75, 0.12);
  padding: 6px;
  background: var(--color-surface);
}

.post-hero figcaption {
  margin-top: 8px;
  font-size: calc(var(--reader-font-size) * 0.76);
  color: var(--color-sub);
}

.post-inline-figure {
  max-width: 320px;
  margin: 28px auto;
}

.post-inline-figure--wide {
  max-width: 560px;
}

.post-inline-img {
  width: 100%;
  height: auto;
  border: 1px solid var(--color-amber);
  box-shadow: 0 0 0 5px var(--color-bg), 0 0 28px rgba(232, 184, 75, 0.12);
  padding: 6px;
  background: var(--color-surface);
}

.post-inline-figure figcaption {
  margin-top: 8px;
  font-size: calc(var(--reader-font-size) * 0.76);
  color: var(--color-sub);
  text-align: center;
}

.post-content {
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
}

.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: var(--reader-heading-gap-top) 0 var(--reader-heading-gap-bottom);
  padding-top: 1.6em;
  border-top: 1px solid var(--color-line);
  color: var(--color-ink);
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.post-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.post-content h3 {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  margin: calc(var(--reader-heading-gap-top) * 0.65) 0 calc(var(--reader-heading-gap-bottom) * 0.85);
  color: var(--color-ink);
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.post-content h3:first-child {
  margin-top: 0;
}

.post-content p {
  margin: 0 0 var(--reader-paragraph-gap);
  color: var(--color-ink);
}

.post-content ul,
.post-content ol {
  padding-left: 1.4em;
  margin: 0 0 var(--reader-paragraph-gap);
}

.post-content li {
  margin-bottom: 0.5em;
}

.post-content blockquote {
  margin: 1.6em 0;
  padding: 0.4em 0 0.4em 24px;
  border-left: 3px solid var(--color-amber);
  color: var(--color-sub);
  font-family: var(--font-serif);
  font-size: calc(var(--reader-font-size) * 1.03);
  font-style: italic;
}

.post-content blockquote p {
  margin: 0 0 0.4em;
  color: inherit;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--color-line);
  margin: 2.4em 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-sub);
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--color-accent);
}

/* Related articles */
.related-articles {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-line);
}

.related-heading {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sub);
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.related-link {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-line);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.related-list .related-link:last-child {
  border-bottom: none;
}

.related-link:hover {
  opacity: 0.75;
}

.related-category {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.related-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding: 32px 0;
  color: var(--color-sub);
  font-size: 0.82rem;
  background: var(--color-bg);
}

.friend-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.8rem;
}

.friend-links-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-sub);
}

.friend-links a {
  color: var(--color-sub);
  text-decoration: none;
  border-bottom: 1px solid var(--color-line);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.friend-links a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.site-footer p {
  margin: 0 0 8px;
}

.site-footer .credit a {
  color: var(--color-accent);
}

/* Low-key reading-settings control (footer). Deliberately understated —
   this is an accessibility affordance, not a feature to promote. */
.reading-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
  font-size: 0.78rem;
}

.reading-settings-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-sub);
}

.reading-settings-options {
  display: inline-flex;
  gap: 6px;
}

.reading-settings button {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: transparent;
  color: var(--color-sub);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.reading-settings button:hover {
  border-color: var(--color-accent);
  color: var(--color-ink);
}

.reading-settings button[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 600;
}

@media (max-width: 640px) {
  :root {
    --reader-post-padding-x: 20px;
  }

  html[data-reading-level="3"] {
    --reader-post-padding-x: 24px;
  }

  .index-row {
    gap: 14px;
  }

  .post {
    padding: 28px var(--reader-post-padding-x) 48px;
  }

  .profile-header {
    grid-template-columns: 1fr;
  }

  .profile-photo-frame {
    max-width: 220px;
  }

  /* Collapse the nav behind a toggle so the header doesn't push the whole
     first screen of content below the fold on small viewports. */
  .tagline {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-line);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 10px 4px;
    white-space: normal;
  }

  .site-nav a.nav-cta {
    justify-content: center;
    margin-top: 4px;
  }

  .lang-switch {
    order: -1;
  }

  .lang-switch-toggle {
    width: 100%;
    text-align: center;
  }

  .lang-switch-menu {
    display: none;
    position: static;
    box-shadow: none;
    margin-top: 4px;
  }

  .lang-switch.is-open .lang-switch-menu {
    display: flex;
  }

  .lang-switch-menu a,
  .lang-switch-menu span {
    text-align: center;
  }
}
