/*
 * Design tokens + base styles for thetradd.xyz.
 * Ported from sj.land (MIT License, © 2022 SJ Zhang — see LICENSE).
 *
 * Visual hierarchy:
 *   body/layout  → --appbg  (outer grey)
 *   sidebar      → transparent (shows --appbg)
 *   .main        → --bg (white rounded card with shadow) — the inner panel
 *   .link-card   → --linkContainerBg (white with subtle border)
 */

@import url("https://rsms.me/inter/inter.css");

:root {
  --font-sans: "Inter var", "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-l: 14.7px;
  --font-m: 13.5px;
  --font-s: 12.3px;

  --appbg: #f8f8f8;
  --bg: #ffffff;
  --bgSticky: rgba(255, 255, 255, 0.746);

  --text: rgb(23, 23, 23);
  --textMuted: rgba(0, 0, 0, 0.55);
  --textSubtle: rgba(0, 0, 0, 0.42);

  --menuLabel: rgba(0, 0, 0, 0.825);

  --highlight: rgba(255, 255, 255, 0.95);
  --highlighthover: rgba(0, 0, 0, 0.04);
  --highlightActiveBorder: rgba(0, 0, 0, 0.064);
  --tabbg: rgba(0, 0, 0, 0.04);
  --tabText: rgba(0, 0, 0, 0.32);

  --linkContainerBg: #ffffff;
  --linkContainerGrayBg: rgb(251, 251, 251);
  --linkContainerBorder: #f5f5f5;
  --linkContainerBgHover: rgb(243, 243, 243);
  --linkContainerBorderHover: rgb(230, 230, 230);

  --tabBorder: rgb(240, 240, 240);

  --imageBg: #f9fafb;

  --divider: rgb(232, 232, 232);
  --dividerStrong: rgb(210, 210, 210);

  --cardShadow: rgba(0, 0, 0, 0.035) 0 1px 6px 0;
}

[data-theme="dark"] {
  --appbg: #202020;
  --bg: #101010;
  --bgSticky: rgba(16, 16, 16, 0.746);

  --text: rgb(237, 237, 237);
  --textMuted: rgba(255, 255, 255, 0.6);
  --textSubtle: rgba(255, 255, 255, 0.38);

  --menuLabel: hsla(0, 0%, 100%, 0.8);
  --highlight: hsla(0, 0%, 100%, 0.1);
  --highlighthover: hsla(0, 0%, 100%, 0.05);
  --highlightActiveBorder: hsla(0, 0%, 100%, 0.04);
  --tabbg: hsla(0, 0%, 100%, 0.06);
  --tabText: hsla(0, 0%, 100%, 0.372);

  --linkContainerBg: #151515;
  --linkContainerGrayBg: rgb(25, 25, 25);
  --linkContainerBorder: #1a1a1a;
  --linkContainerBgHover: rgb(42, 42, 42);
  --linkContainerBorderHover: rgb(45, 45, 45);

  --tabBorder: rgb(44, 44, 44);
  --imageBg: #191919;
  --divider: rgb(44, 44, 44);
  --dividerStrong: rgb(70, 70, 70);

  --cardShadow: rgba(0, 0, 0, 0.2) 0 1px 6px 0;
}

@media (max-width: 700px) {
  :root {
    --font-l: 15px;
    --font-m: 13.8px;
    --font-s: 12.7px;
  }
}

* { box-sizing: border-box; }

html {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  background-color: var(--appbg);
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

html, body, p, h1, h2, h3, h4, h5, h6, button {
  padding: 0;
  margin: 0;
  font-family: var(--font-sans);
}

body {
  background-color: var(--appbg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

p {
  letter-spacing: 0.1px;
  font-weight: 390;
  line-height: 1.55;
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
strong, b { font-weight: 600; }

hr {
  border: 0;
  border-top: 0.75px solid var(--divider);
  margin: 32px 0;
}

code {
  background: var(--divider);
  border-radius: 3px;
  padding: 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
}

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

[data-theme="dark"] .iconInvert { filter: invert(1); }
.iconInvert { transition: filter 0.2s ease; }

/* -------------------------------------------------------------------------- */
/*  Animated background canvas + signature                                    */
/* -------------------------------------------------------------------------- */

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
}

[data-theme="dark"] .bg-canvas { opacity: 0.08; }

.signature {
  display: block;
  color: var(--text);
  transition: color 0.2s ease;
  margin: 1.5rem 0 1rem 0.5rem;
}

.signature text {
  font-family: "Rock Salt", "Permanent Marker", cursive;
  fill: currentColor;
}

.signature .sig-main { font-size: 44px; font-weight: 400; letter-spacing: -1px; }

.signature .sig-flourish {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  opacity: 0.55;
}

/* SVG uses currentColor so no invert filter is needed in dark mode. */
[data-theme="dark"] .signature.iconInvert { filter: none; }

/* -------------------------------------------------------------------------- */
/*  Layout — sidebar on grey --appbg, main as floating white card             */
/* -------------------------------------------------------------------------- */

.layout {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  align-items: stretch;
  background: var(--appbg);
}

.sidebar {
  width: 14.5rem;
  padding: 0.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  height: calc(100vh - 1rem);
  margin: 0.5rem;
  background: transparent;
}

.sidebar-upper {
  overflow-y: visible;
  overflow-x: auto;
  flex-shrink: 1;
  margin: -6px;
  padding: 6px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 0.875rem 1rem;
  margin-bottom: 0.25rem;
  transition: opacity 0.15s ease;
}

.sidebar-brand:hover { opacity: 0.7; }

.sidebar-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--text);
  color: var(--appbg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar-brand-name { font-size: 13.5px; font-weight: 580; color: var(--text); }
.sidebar-brand-loc  { font-size: 11.8px; font-weight: 400; color: var(--textMuted); margin-top: 2px; }

.nav { display: flex; flex-direction: column; }

.nav-divider {
  padding: 1.25rem 0 0.5rem 0.875rem;
  font-size: 11.6px;
  font-weight: 480;
  color: var(--textSubtle);
  transition: color 0.15s ease;
}

.nav-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.575rem 0.5rem 0.85rem;
  width: 100%;
  height: 2.25rem;
  border-radius: 8px;
  margin-top: 2px;
  border: 0.5px solid transparent;
  transition: background 0.12s ease, transform 0.08s ease, border-color 0.12s ease;
}
.nav-item:hover  { background: var(--highlighthover); }
.nav-item:active { background: var(--highlighthover); transform: scaleX(0.985) scaleY(0.985) translateY(0.5px); }
.nav-item[aria-current="page"] {
  background: var(--highlight);
  border-color: var(--highlightActiveBorder);
  box-shadow: 0 3px 3px rgba(0, 0, 0, 0.05);
}

.nav-item-left { display: flex; flex-direction: row; align-items: center; min-width: 0; }
.nav-icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon img { width: 16px; height: 16px; }
.nav-label {
  font-size: 13.2px;
  margin: 0 0 0 10px;
  color: var(--menuLabel);
  font-weight: 450;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.shortcut {
  background: var(--tabbg);
  border-radius: 3px;
  width: 16px; height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shortcut-text { font-weight: 390; font-size: 11px; color: var(--tabText); }

.external-icon {
  font-size: 16px; width: 16px; height: 16px;
  color: var(--tabText); font-weight: 300;
  display: flex; align-items: center; justify-content: center;
}

/* -------------------------------------------------------------------------- */
/*  Theme toggle                                                               */
/* -------------------------------------------------------------------------- */

.theme-toggle-wrap { padding: 0.6rem 0.4rem 0.4rem; }

.theme-tabs {
  display: flex;
  position: relative;
  background-color: var(--tabbg);
  padding: 2.5px;
  border-radius: 8px;
  width: 100%;
}

.theme-tabs input[type="radio"] { display: none; }

.theme-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.75rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--menuLabel);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  z-index: 1;
}
.theme-tab:hover { color: var(--text); }
.theme-tabs input[type="radio"]:checked + .theme-tab {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* -------------------------------------------------------------------------- */
/*  Main content — the inner white card                                        */
/* -------------------------------------------------------------------------- */

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.5rem 0.5rem 0.5rem 15.5rem;
  min-height: calc(100vh - 1rem);
  position: relative;
  border-radius: 8px;
  padding: 2rem;
  flex-grow: 1;
  background-color: var(--bg);
  overflow: auto;
  box-shadow: var(--cardShadow);
  transition: background-color 0.2s ease;
}

.page-column {
  width: 100%;
  max-width: 40rem;
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.home-column {
  width: 100%;
  max-width: 1280px;
  padding: 0 1rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* -------------------------------------------------------------------------- */
/*  Home page                                                                  */
/* -------------------------------------------------------------------------- */

.hero-greeting {
  margin: 1.5rem 0 1rem;
  font-size: clamp(48px, calc((100vw - 350px) * 0.08), 110px);
  margin-left: clamp(-12px, calc((100vw - 350px) * -0.009), 0px);
  font-weight: 390;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
  transition: color 0.25s ease;
}

.hero-tagline {
  font-size: 13px;
  color: var(--textMuted);
  font-weight: 400;
  letter-spacing: 0.15px;
  opacity: 0.9;
  padding-bottom: 5rem;
  max-width: 48rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 0.75rem;
  row-gap: 0.75rem;
  margin: 0.5rem 0 2rem;
}

.intro-card {
  font-size: var(--font-s);
  color: var(--textMuted);
  font-weight: 400;
  line-height: 1.45;
  padding: 1rem 1.1rem;
  border-right: 1px solid var(--divider);
  transition: background 0.12s ease;
}

.intro-card:first-child {
  border-left: 1px solid var(--divider);
}

.intro-card:hover {
  background: var(--highlighthover);
}

.intro-card:last-child { border-right: 0; }

.intro-card a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--divider);
}
.intro-card a:hover { text-decoration-color: var(--dividerStrong); }

@media (max-width: 1380px) { .intro-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1080px) { .intro-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px)  { .intro-grid  { display: none; } }

.section-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding-top: 3rem;
  padding-bottom: 0.75rem;
}

.section-title {
  font-size: 1.25rem;
  line-height: 1.7;
  font-weight: 550;
  color: var(--text);
}

.section-link {
  font-size: var(--font-s);
  color: var(--textSubtle);
  padding: 3px 5px;
  border-radius: 5px;
  transition: background 0.075s ease-in, color 0.075s ease-in;
}
.section-link:hover {
  color: var(--text);
  background: var(--linkContainerBgHover);
}

/* Home update grid — 4 up on desktop, responsive */
.home-updates-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 0.75rem;
  row-gap: 0.75rem;
  padding: 0;
  list-style: none;
  margin: 0;
}

@media (max-width: 1380px) { .home-updates-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1080px) { .home-updates-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .home-updates-grid { grid-template-columns: repeat(1, 1fr); } }

.update-tile {
  display: flex;
  flex-direction: column;
  background: var(--linkContainerBg);
  border: 1px solid var(--linkContainerBorder);
  border-radius: 10px;
  padding: 1.1rem;
  gap: 0.5rem;
  min-height: 220px;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.update-tile:hover {
  background: var(--linkContainerBgHover);
  border-color: var(--linkContainerBorderHover);
}
.update-tile:active { transform: translateY(0.5px); }

.update-tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--imageBg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text);
  font-size: 15px;
}
.update-tile-icon img { width: 100%; height: 100%; object-fit: contain; }

.update-tile-title {
  font-size: var(--font-m);
  font-weight: 560;
  color: var(--text);
  line-height: 1.35;
}
.update-tile-body {
  font-size: var(--font-m);
  color: var(--textMuted);
  font-weight: 400;
  line-height: 1.5;
  flex: 1;
}
.update-tile-date {
  font-size: var(--font-s);
  color: var(--textSubtle);
  font-weight: 420;
  margin-top: auto;
}

/* Home goods strip — horizontal scroll on smaller screens, wraps otherwise */
.home-goods-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 0.75rem;
  row-gap: 0.75rem;
  padding: 0;
  list-style: none;
  margin: 0;
}

@media (max-width: 1080px) { .home-goods-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .home-goods-grid { grid-template-columns: repeat(2, 1fr); } }

.goods-tile {
  display: flex;
  flex-direction: column;
  background: var(--linkContainerBg);
  border: 1px solid var(--linkContainerBorder);
  border-radius: 10px;
  overflow: hidden;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.goods-tile:hover {
  background: var(--linkContainerBgHover);
  border-color: var(--linkContainerBorderHover);
}

.goods-tile-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--imageBg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.goods-tile-image img { width: 100%; height: 100%; object-fit: contain; }

.goods-tile-body {
  padding: 0.6rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.goods-tile-name  { font-size: var(--font-m); font-weight: 520; color: var(--text); line-height: 1.3; }
.goods-tile-brand { font-size: var(--font-s); color: var(--textSubtle); }

.home-reading-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 0.75rem;
  row-gap: 0.75rem;
  padding: 0;
  list-style: none;
  margin: 0;
}

@media (max-width: 1080px) { .home-reading-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .home-reading-grid { grid-template-columns: repeat(2, 1fr); } }

/* -------------------------------------------------------------------------- */
/*  Page heading, sections, cards (shared across non-home pages)              */
/* -------------------------------------------------------------------------- */

.page-header { margin-bottom: 1.5rem; }

.page-header-over {
  font-size: var(--font-s);
  color: var(--textSubtle);
  padding-bottom: 0.35rem;
  display: inline-block;
  transition: color 0.15s ease;
}
.page-header-over:hover { color: var(--text); }

.page-title {
  font-size: 2.275rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

.page-subtitle {
  font-size: var(--font-m);
  color: var(--textMuted);
  font-weight: 400;
  line-height: 1.5;
  max-width: 48rem;
}

.section-heading {
  font-size: 13px;
  font-weight: 580;
  color: var(--textSubtle);
  letter-spacing: 0.1px;
  padding: 1.5rem 0 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.section-heading-link {
  font-size: 12px;
  color: var(--textSubtle);
  font-weight: 440;
  transition: color 0.15s ease;
}
.section-heading-link:hover { color: var(--text); }

/* Generic stacked link card (used on interior pages) */
.link-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--linkContainerBg);
  border: 1px solid var(--linkContainerBorder);
  border-radius: 10px;
  margin-bottom: 0.4rem;
  gap: 0.85rem;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.link-card:hover {
  background: var(--linkContainerBgHover);
  border-color: var(--linkContainerBorderHover);
}
.link-card:active { transform: translateY(0.5px); }

.link-card-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--imageBg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.link-card-icon img { width: 100%; height: 100%; object-fit: contain; }

.link-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.link-card-title { font-size: var(--font-m); font-weight: 520; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card-sub   { font-size: var(--font-s); color: var(--textMuted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card-arrow { color: var(--textSubtle); font-size: 16px; flex-shrink: 0; }

/* Update "card" used on the about-page timeline */
.update-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  background: var(--linkContainerBg);
  border: 1px solid var(--linkContainerBorder);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  gap: 0.45rem;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.update-card:hover { background: var(--linkContainerBgHover); border-color: var(--linkContainerBorderHover); }

.update-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.update-title { font-size: var(--font-m); font-weight: 540; color: var(--text); }
.update-date  { font-size: var(--font-s); color: var(--textSubtle); font-weight: 420; white-space: nowrap; flex-shrink: 0; }
.update-body  { font-size: var(--font-m); color: var(--textMuted); font-weight: 400; line-height: 1.5; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

/* Reading list page - vertical list style */
.reading-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.reading-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--divider);
  transition: background 0.12s ease;
}
.reading-item:first-child { border-top: 1px solid var(--divider); }
.reading-item:hover { background: var(--linkContainerBgHover); margin: 0 -0.5rem; padding: 0.75rem 0.5rem; }

.reading-item-cover {
  width: 36px;
  height: 48px;
  border-radius: 4px;
  background: var(--imageBg);
  flex-shrink: 0;
  overflow: hidden;
}
.reading-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reading-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reading-item-title {
  font-size: var(--font-m);
  font-weight: 520;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reading-item-author {
  font-size: var(--font-s);
  color: var(--textMuted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reading-item-tag {
  flex-shrink: 0;
  font-size: 11px;
  color: #2d6a4f;
  background: #d8f3dc;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}
.reading-item-tag--purple {
  color: #5b21b6;
  background: #ede9fe;
}

/* Book cards for reading list */
.book-card {
  display: flex;
  flex-direction: column;
  background: var(--linkContainerBg);
  border: 1px solid var(--linkContainerBorder);
  border-radius: 10px;
  overflow: hidden;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.book-card:hover {
  background: var(--linkContainerBgHover);
  border-color: var(--linkContainerBorderHover);
  transform: translateY(-2px);
}

.book-cover {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--imageBg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.book-info {
  padding: 0.6rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.book-title {
  font-size: var(--font-m);
  font-weight: 540;
  color: var(--text);
  line-height: 1.3;
}
.book-author {
  font-size: var(--font-s);
  color: var(--textMuted);
  font-weight: 400;
}

@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .grid-3 { grid-template-columns: 1fr; } }

.empty-state {
  padding: 2rem 1.25rem;
  border: 1px dashed var(--divider);
  border-radius: 10px;
  text-align: center;
  color: var(--textMuted);
  font-size: var(--font-m);
}

.footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--divider);
  font-size: var(--font-s);
  color: var(--textSubtle);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}
.footer a {
  text-decoration: underline;
  text-decoration-color: var(--divider);
  text-underline-offset: 3px;
}
.footer a:hover { color: var(--text); text-decoration-color: var(--dividerStrong); }

/* Writing / project long-form content */
.prose { font-size: var(--font-l); line-height: 1.7; color: var(--text); }
.prose h1 { font-size: 22px; margin: 2rem 0 0.75rem; font-weight: 600; }
.prose h2 { font-size: 18px; margin: 1.5rem 0 0.5rem; font-weight: 600; }
.prose h3 { font-size: 15px; margin: 1.2rem 0 0.4rem; font-weight: 600; }
.prose p  { margin-bottom: 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.25rem; }
.prose a  { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { border-left: 3px solid var(--divider); padding-left: 0.9rem; color: var(--textMuted); margin: 1rem 0; }

.tag {
  display: inline-block;
  padding: 2px 6px;
  margin-right: 4px;
  border-radius: 4px;
  background: var(--tabbg);
  color: var(--tabText);
  font-size: var(--font-s);
  font-weight: 450;
}

/* -------------------------------------------------------------------------- */
/*  Responsive — mobile bottom nav                                             */
/* -------------------------------------------------------------------------- */

@media (max-width: 700px) {
  .sidebar {
    padding: 0.375rem 1.5rem 0.5rem 0.375rem;
    width: 100%;
    justify-content: flex-start;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    position: fixed;
    height: 60px;
    top: auto;
    bottom: 0;
    left: 0; right: 0;
    border-top: 1px solid var(--linkContainerBorder);
    margin: 0;
    background-color: var(--appbg);
    z-index: 9;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-brand, .nav-divider, .theme-toggle-wrap { display: none; }

  .nav { flex-direction: row; gap: 0; }
  .nav-item {
    padding: 0.5rem;
    height: 3rem; width: 3rem;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
    margin-top: 0;
  }
  .nav-label, .shortcut, .external-icon { display: none; }

  .main {
    margin: 0.5rem 0.5rem 5rem 0.5rem;
    padding: 1.25rem 1.25rem 2rem;
    min-height: auto;
  }

  .home-column, .page-column { padding: 0; }

  .hero-greeting { font-size: 42px; margin-top: 2rem; font-weight: 420; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
