:root {
  /* Even-inspired: single theme + deputy, scholarly twist */
  --theme: #2a6b5e;
  --theme-soft: #3d8a7a;
  --theme-muted: #e8f2ef;
  --deputy: #edf3f8;
  --accent-warm: #b85a3c;

  --bg: #f8f7f4;
  --bg-elevated: #fffdf9;
  --bg-muted: #efede8;
  --ink: #1a1f2e;
  --ink-soft: #3d4455;
  --ink-muted: #6b7280;
  --border: rgba(26, 31, 46, 0.08);
  --border-strong: rgba(26, 31, 46, 0.14);
  --shadow-sm: 0 2px 8px rgba(26, 31, 46, 0.04);
  --shadow: 0 16px 48px rgba(26, 31, 46, 0.07);
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: "Source Serif 4", "Noto Serif KR", Georgia, serif;
  --font-serif: "Source Serif 4", "Noto Serif KR", Georgia, serif;
  --font-sans: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --container: 1120px;
  --content: 680px;
  --sidebar-w: 16rem;
  --rail-w: 15rem;
  --header-h: 4rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.45s;

  /* mode-specific tokens (overridden in dark) */
  --code-bg: #f3f6f8;
  --code-ink: #2d4a3c;
  --row-alt: #fafafa;
  --callout-summary-bg: #eef6f3;
  --callout-warn-bg: #fdf4ef;
  --callout-warn-ink: #b85a3c;
  --header-bg: rgba(248, 247, 244, 0.82);
  --nav-panel-bg: rgba(248, 247, 244, 0.97);
  --graph-edge: rgba(26, 31, 46, 0.14);
  --btn-primary-ink: #ffffff;
}

:root[data-theme="dark"] {
  --theme: #4db6a0;
  --theme-soft: #6cc9b5;
  --theme-muted: rgba(77, 182, 160, 0.15);
  --deputy: #232833;
  --accent-warm: #e0805f;

  --bg: #14171f;
  --bg-elevated: #1b1f29;
  --bg-muted: #232833;
  --ink: #f2f4f8;
  --ink-soft: #c4ccd8;
  --ink-muted: #8b94a3;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.55);

  --code-bg: #232833;
  --code-ink: #7fd9c1;
  --row-alt: rgba(255, 255, 255, 0.03);
  --callout-summary-bg: rgba(77, 182, 160, 0.12);
  --callout-warn-bg: rgba(224, 128, 95, 0.13);
  --callout-warn-ink: #e0805f;
  --header-bg: rgba(20, 23, 31, 0.82);
  --nav-panel-bg: rgba(20, 23, 31, 0.97);
  --graph-edge: rgba(255, 255, 255, 0.16);
  --btn-primary-ink: #0e1116;

  color-scheme: dark;
}

body { transition: background-color 0.3s var(--ease-smooth), color 0.3s var(--ease-smooth); }

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* No forced width here: .container/.site-shell (class selectors, lower
   specificity than this id) own the actual width/centering. An id-level
   width:100% used to beat them and stretch main edge-to-edge, throwing
   it out of alignment with the header's centered .container. */
#main-content {
  flex: 1;
  min-width: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
}

.skip-link:focus { top: 1rem; }

a {
  color: var(--theme);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.25s var(--ease-smooth);
}

a:hover { color: var(--theme-soft); }

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

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

.page-main { padding-block: 2.5rem 5rem; }

/* ── Sidebar layout (blog, pages, posts) ── */
.site-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  padding-block: 2.5rem 5rem;
}

.site-main {
  min-width: 0;
}

/* ── Home: wider shell, tighter sidebar so the main column breathes ── */
.is-home-shell {
  width: min(1280px, 100% - 2.5rem);
  --sidebar-w: 15rem; /* equal to --rail-w so the home layout is symmetric */
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

/* Unified width for pages that carry the rail (home + posts) so the header
   and the shell share the same left/right edges at every breakpoint. */
.site-shell.has-rail { width: min(1280px, 100% - 2.5rem); }

/* ── Right rail (graph panel beside content) ──
   Mobile-first: rail stacks full width below the main column. The 3-column
   layout only kicks in on wide screens (see the min-width rule below). */
.site-rail {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 1.75rem;
}

.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.rail-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.rail-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-decoration: none;
  color: var(--ink-muted);
  white-space: nowrap;
  transition: color 0.25s;
}

.rail-link:hover { color: var(--theme); }

@media (min-width: 1181px) {
  .site-shell.has-rail {
    width: min(1360px, 100% - 2.5rem);
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  }

  .site-shell.has-rail .site-rail {
    grid-column: auto;
    position: sticky;
    top: calc(var(--header-h) + 1.25rem);
    align-self: start;
    margin-top: 0;
  }
}

/* On mid widths the stacked rail graph should not stretch too wide */
@media (max-width: 1180px) {
  .graph-rail { max-width: 34rem; margin-inline: auto; }
}

.site-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sidebar-brand {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.sidebar-brand:hover {
  text-decoration: none;
}

.sidebar-avatar {
  display: block;
  width: 7rem;
  height: 7rem;
  margin: 0 auto 0.85rem;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  transition: border-color 0.25s;
}

.sidebar-brand:hover .sidebar-avatar {
  border-color: var(--theme);
}

.sidebar-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.sidebar-name-ko {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.sidebar-tagline {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
}

.sidebar-bio {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.sidebar-meta {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--border);
}

.sidebar-meta li {
  padding: 0.3rem 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar-nav a {
  display: block;
  padding: 0.42rem 0.65rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sidebar-nav a:hover {
  color: var(--ink);
  background: var(--bg-muted);
  text-decoration: none;
}

.sidebar-nav a[aria-current="page"] {
  color: var(--theme);
  background: var(--theme-muted);
  border-left-color: var(--theme);
}

.sidebar-nav-github {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.78rem !important;
}

.sidebar-contact {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  line-height: 1.5;
}

.sidebar-contact a {
  display: block;
  color: var(--ink-muted);
  text-decoration: none;
  word-break: break-all;
}

.sidebar-contact a:hover {
  color: var(--theme);
}

.sidebar-location {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-muted);
}

/* Reading columns stay narrow for legibility and align to the grid start;
   grid/list pages (blog, cv, publications, home) fill the full column. */
.has-sidebar .site-main .post-shell {
  width: 100%;
  max-width: 52rem;
}

.has-sidebar .site-main .page-about .page-header,
.has-sidebar .site-main .page-about .page-content {
  max-width: 44rem;
}

@media (min-width: 861px) {
  .has-sidebar .site-header .site-nav {
    display: none;
  }
}

/* ── Reading progress ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 200;
  background: transparent;
}

.reading-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--theme), var(--theme-soft));
  transition: width 0.1s linear;
}

/* ── Reveal animations ── */
.reveal,
.reveal-child {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible,
.reveal-child.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
}

.site-header.is-scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

/* Home + post pages use a wider shell; match the header edges to it so the
   brand lines up with the sidebar below (mirrors .site-shell.has-rail). */
.header-wide { width: min(1280px, 100% - 2.5rem); }
@media (min-width: 1181px) {
  .header-wide { width: min(1360px, 100% - 2.5rem); }
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.brand-home {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-home:hover { color: var(--ink); text-decoration: none; }

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  transition: transform 0.3s var(--ease-out), border-color 0.3s;
}

.brand-home:hover .brand-mark {
  border-color: var(--theme);
  transform: scale(1.05);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-handle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-decoration: none;
  margin-left: 2.65rem;
  transition: color 0.25s;
}

.brand-handle:hover { color: var(--theme); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.25s, background 0.25s;
}

.site-nav a::after {
  content: "";
  position: absolute;
  bottom: 0.15rem;
  left: 0.75rem;
  right: 0.75rem;
  height: 1.5px;
  background: var(--theme);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.site-nav a.is-active {
  color: var(--ink);
}

.site-nav a[aria-current="page"]::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  padding: 0.35rem 0.7rem !important;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem !important;
}

.nav-github::after { display: none !important; }

.nav-github-icon { width: 0.85rem; height: 0.85rem; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.theme-toggle:hover {
  color: var(--theme);
  border-color: var(--theme);
}

.theme-toggle svg { width: 1.05rem; height: 1.05rem; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* keep the toggle snug to the hamburger on small screens */
.theme-toggle + .nav-toggle { margin-left: 0.5rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1rem;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  transition: transform 0.25s var(--ease-out), opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* ── Home shell ── */
/* ── Home hero (main-column masthead; profile lives in the sidebar) ── */
.home-hero {
  padding: 0.25rem 0 2.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.home-hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--theme);
  margin: 0 0 0.9rem;
}

.home-hero-title {
  margin: 0 0 0.6rem;
  line-height: 1.08;
}

.home-hero-en {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.home-hero-ko {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.home-hero-tagline {
  margin: 0 0 0.9rem;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.home-hero-intro {
  max-width: 40rem;
  margin: 0 0 1.6rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, background 0.3s, color 0.3s, border-color 0.3s;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--ink);
  color: var(--btn-primary-ink) !important;
  box-shadow: 0 4px 16px rgba(26, 31, 46, 0.12);
}

.btn-primary:hover {
  background: var(--theme);
  color: var(--btn-primary-ink) !important;
  box-shadow: 0 6px 20px rgba(42, 107, 94, 0.2);
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--ink-soft) !important;
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  color: var(--theme) !important;
  border-color: var(--theme);
  background: var(--theme-muted);
}

/* ── Social links ── */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-decoration: none;
  background: var(--bg-elevated);
  transition: border-color 0.25s, color 0.25s, transform 0.25s var(--ease-out);
}

.social-link:hover {
  color: var(--theme);
  border-color: var(--theme);
  text-decoration: none;
  transform: translateY(-1px);
}

.social-icon { width: 0.85rem; height: 0.85rem; }

/* ── Sections ── */
.home-section {
  position: relative;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.home-section:last-child {
  border-bottom: none;
  padding-bottom: 1rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--theme);
  margin: 0 0 0.5rem;
}

.home-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.home-section-header h2 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.section-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
  color: var(--ink-muted);
  transition: color 0.25s, transform 0.25s var(--ease-out);
}

.section-link:hover {
  color: var(--theme);
  transform: translateX(2px);
}

.empty-note { color: var(--ink-muted); font-size: 0.95rem; }

/* ── Project cards ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.project-preview {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.35s var(--ease-out);
}

.project-card:hover .project-preview img {
  transform: scale(1.02);
}

.project-preview img[src$=".svg"] {
  object-fit: contain;
  padding: 0.75rem;
  background: #fff;
}

.project-card-body {
  padding: 0.85rem 1rem 1rem;
}

.project-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.project-stars {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.25s;
}

.project-stars:hover { color: var(--accent-warm); }

.project-name {
  font-family: var(--font-sans);
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
}

.project-name a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.25s;
}

.project-name a:hover { color: var(--theme); }

.project-desc {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag-list li {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  background: var(--deputy);
  color: var(--ink-muted);
}

/* ── Blog cards (home preview grid) ── */
.blog-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.blog-card {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.3s var(--ease-out);
}

.blog-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.blog-card-link:hover { text-decoration: none; }

.blog-card-cover {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.blog-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.35s var(--ease-out);
}

.blog-card:hover .blog-card-cover img {
  transform: scale(1.02);
}

.blog-card-cover.is-fallback {
  display: grid;
  place-items: center;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, var(--theme) 0%, var(--theme-soft) 55%, var(--accent-warm) 130%);
}

.blog-card-cover-text {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem 1rem;
}

.blog-card-body time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.blog-card-title {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.25s;
}

.blog-card:hover .blog-card-title { color: var(--theme); }

.blog-card-excerpt {
  margin: 0.5rem 0 0;
  font-family: var(--font-serif);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.blog-card .tag-list {
  margin-top: 0.75rem;
}

/* ── Post list (Even-style editorial) ── */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list-editorial > li {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 1.25rem;
  align-items: start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.35s var(--ease-out);
}

.post-list-editorial > li:first-child { padding-top: 0; }

.post-list-editorial > li:hover {
  padding-left: 0.35rem;
}

.post-list-editorial time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  padding-top: 0.2rem;
}

.post-list-editorial .post-link {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.25s;
  letter-spacing: -0.01em;
}

.post-list-editorial > li:hover .post-link { color: var(--theme); }

.post-list-editorial .excerpt {
  margin: 0.3rem 0 0;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.post-arrow {
  font-size: 1rem;
  color: var(--border-strong);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.3s, transform 0.3s var(--ease-out), color 0.3s;
  padding-top: 0.15rem;
}

.post-list-editorial > li:hover .post-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--theme);
}

.post-list-editorial .tag-list {
  margin-top: 0.5rem;
}

.post-list-editorial .tag-list li {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  line-height: 1.3;
}

.post-list-full > li {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list-full .post-link {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
}

.post-list-full .post-link:hover { color: var(--theme); }

.post-list-full .excerpt {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

/* ── Page / Post headers ── */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  max-width: var(--content);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.65rem);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page-subtitle {
  margin: 0.85rem 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.page-content {
  max-width: none;
}

/* ── Prose (reading-optimized, Even-like) ── */
.prose {
  max-width: var(--content);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--ink-soft);
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.75rem 0 1rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.prose h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--ink);
}

.prose p { margin: 0 0 1.15rem; }

.prose ul, .prose ol {
  margin: 0 0 1.15rem;
  padding-left: 1.35rem;
}

.prose li { margin-bottom: 0.4rem; }

.prose a {
  color: var(--theme);
  text-underline-offset: 4px;
}

.prose blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--theme);
  background: var(--theme-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  font-style: italic;
}

.prose hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2.5rem 0;
}

.post-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Blog post page ── */
body.is-post {
  background: var(--bg);
}

.post-main {
  width: 100%;
  padding: 2.5rem 1.25rem 5rem;
}

/* legacy: posts now use .site-shell */
body.is-post.has-sidebar .site-shell.is-post-shell {
  padding-block: 2.5rem 5rem;
}

.post-shell {
  width: min(52rem, 100%);
  margin-inline: auto;
}

.post-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.75rem, 4vw, 2.75rem) clamp(1.75rem, 3vw, 2.25rem);
}

.post-card .post-header {
  max-width: none;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-card .post-header h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.post-meta {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.post-meta-tags {
  color: var(--theme);
}

.post-meta-sep {
  margin: 0 0.35rem;
  color: var(--border-strong);
}

.post-summary {
  margin: 0.85rem 0 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.post-prose {
  max-width: none;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink-soft);
}

.post-prose > :first-child {
  margin-top: 0;
}

.post-prose h2 {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2.25rem 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.post-prose h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
  color: var(--ink);
}

.post-prose p {
  margin: 0 0 1.15rem;
}

.post-prose ul,
.post-prose ol {
  margin: 0 0 1.15rem;
  padding-left: 1.35rem;
}

.post-prose li {
  margin-bottom: 0.4rem;
}

.post-prose strong {
  color: var(--ink);
  font-weight: 600;
}

.post-prose a {
  color: var(--theme);
  font-weight: 500;
}

.post-prose table {
  width: 100%;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

.post-prose thead th {
  background: var(--deputy);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.post-prose tbody td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.post-prose tbody tr:last-child td {
  border-bottom: none;
}

.post-prose tbody tr:nth-child(even) td {
  background: var(--row-alt);
}

.post-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid var(--border);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.post-prose pre,
.post-prose .highlighter-rouge .highlight {
  margin: 1.25rem 0 1.5rem;
}

.post-prose pre,
.post-prose .highlighter-rouge pre {
  background: #1e2433;
  color: #e8ecf4;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
}

.post-prose pre code,
.post-prose .highlighter-rouge pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.post-prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--theme);
  background: var(--theme-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-sans);
  font-style: normal;
  color: var(--ink-soft);
}

.post-prose blockquote p {
  margin: 0;
}

.post-prose blockquote p + p {
  margin-top: 0.5rem;
}

.post-prose blockquote.callout-summary {
  border-left-color: var(--theme);
  background: var(--callout-summary-bg);
}

.post-prose blockquote.callout-summary strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--theme);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-prose blockquote.callout-warn {
  border-left-color: #c45d3a;
  background: var(--callout-warn-bg);
}

.post-prose blockquote.callout-warn strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--callout-warn-ink);
  font-size: 0.82rem;
}

.post-prose .label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--theme);
  background: var(--theme-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-right: 0.25rem;
}

.post-prose img {
  margin: 1.5rem auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.post-prose hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

.post-card .post-footer {
  max-width: none;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.post-card .back-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--ink-muted);
  transition: color 0.25s, transform 0.25s var(--ease-out);
  display: inline-block;
}

.back-link:hover {
  color: var(--theme);
  transform: translateX(-3px);
}

/* ── Graph view ── */
.graph-intro {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.graph-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg-elevated);
  overflow: hidden;
}

.graph-canvas {
  display: block;
  width: 100%;
  touch-action: none;
}

.graph-legend {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  display: flex;
  gap: 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.graph-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }

.graph-legend .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: inline-block;
}

.dot-post { background: var(--theme); }
.dot-project { background: var(--accent-warm); }
.dot-tag { background: var(--ink-muted); }

.graph-fallback {
  position: absolute;
  inset: auto 1rem 1rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-align: center;
}

/* JS adds .is-live once the graph draws; until then the note + index list
   are the no-JS fallback. */
.graph-wrap .graph-canvas { position: relative; z-index: 1; }
.graph-wrap.is-live .graph-fallback { display: none; }
.graph-wrap.is-live .graph-legend { display: flex; }
.graph-wrap:not(.is-live) .graph-legend { display: none; }

/* Compact rail variant */
.graph-rail { border-radius: var(--radius-sm); }
.graph-rail .graph-legend { display: none !important; }
.graph-rail .graph-fallback {
  position: static;
  padding: 0.9rem;
  font-size: 0.75rem;
}

.rail-note {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.rail-note strong { color: var(--ink-soft); font-weight: 600; }

.rail-note .dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin: 0 0.15rem 0 0.45rem;
  vertical-align: middle;
}

.graph-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem 2.5rem;
  margin-top: 2rem;
}

.graph-index h2 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--theme);
  margin: 0 0 0.75rem;
}

.graph-index ul { list-style: none; margin: 0; padding: 0; }

.graph-index li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.graph-index a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.graph-index a:hover { color: var(--theme); }

.graph-index-tags {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
}

/* ── Post table of contents ── */
.post-toc {
  margin: 0 0 2rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.post-toc-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.post-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-toc-item { line-height: 1.4; }
.post-toc-item.lvl-h3 { padding-left: 0.9rem; }

.post-toc-item a {
  display: inline-block;
  padding: 0.2rem 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s;
}

.post-toc-item a:hover { color: var(--theme); }

.post-toc-item a.is-active {
  color: var(--theme);
  font-weight: 600;
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 1.75rem;
  max-width: var(--content);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--theme), var(--border-strong));
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 0.55rem;
  width: 7px;
  height: 7px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--theme);
  transition: background 0.3s, transform 0.3s var(--ease-out);
}

.timeline-item:hover::before {
  background: var(--theme);
  transform: scale(1.2);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--theme);
  margin-bottom: 0.2rem;
}

.timeline-role {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.1rem;
}

.timeline-org {
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.timeline-detail {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
  max-width: var(--content);
}

.skill-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.skill-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.skill-card h3 {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--theme);
  margin: 0 0 0.45rem;
}

.skill-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ── Publications ── */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: var(--content);
}

.pub-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  transition: box-shadow 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.pub-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--theme);
  margin-bottom: 0.45rem;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 0.2rem;
}

.pub-venue {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--theme);
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
}

.pub-abstract {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0 0 0.75rem;
  line-height: 1.7;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pub-links a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.pub-links a:hover {
  background: var(--theme-muted);
  color: var(--theme);
  border-color: var(--theme);
}

/* ── About page ── */
.page-about .page-header {
  max-width: 44rem;
  margin-inline: 0;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.page-about .page-header h1 {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
}

.about-lead {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.page-about .page-content {
  max-width: none;
}

.about-main.prose {
  max-width: 40rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.about-main.prose p {
  margin: 0 0 1rem;
}

.about-main.prose p:last-child {
  margin-bottom: 0;
}

.about-main.prose h2 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2rem 0 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.about-main.prose h2:first-child {
  margin-top: 0;
}

/* ── Earlier list ── */
.earlier-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.earlier-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.earlier-list li:last-child { border-bottom: none; }

.earlier-list a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.25s;
}

.earlier-list a:hover { color: var(--theme); }

.earlier-list .desc {
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* ── Code (deputy color, Even-style) — page content only ── */
.page-content pre,
.page-content code {
  font-family: var(--font-mono);
  font-size: 0.84em;
}

.page-content pre {
  background: var(--deputy);
  color: var(--ink);
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.6;
  border: 1px solid var(--border);
}

.page-content code {
  background: var(--deputy);
  padding: 0.12rem 0.38rem;
  border-radius: 4px;
  color: var(--ink);
}

.page-content pre code {
  background: none;
  padding: 0;
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.25rem 0;
  font-family: var(--font-sans);
}

.page-content th,
.page-content td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.8rem;
  text-align: left;
}

.page-content th {
  background: var(--deputy);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-name {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.footer-handle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 400;
  margin-left: 0.35rem;
  text-decoration: none;
  transition: color 0.25s;
}

.footer-handle:hover { color: var(--theme); }

.footer-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.footer-meta a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.25s;
}

.footer-meta a:hover { color: var(--theme); }

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.footer-right a {
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.25s;
}

.footer-right a:hover { color: var(--theme); }

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .site-shell {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-block: 1.5rem 3.5rem;
  }

  .site-sidebar {
    position: static;
    padding: 1.15rem 1.25rem;
  }

  .sidebar-brand {
    text-align: center;
  }

  .sidebar-tagline {
    text-align: center;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
  }

  .sidebar-nav a {
    border-left: none;
    border: 1px solid var(--border);
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
  }

  .sidebar-nav a[aria-current="page"] {
    border-color: var(--theme);
  }

  .sidebar-nav-github {
    margin-top: 0;
  }

  .sidebar-contact {
    text-align: center;
  }

  /* On mobile the stacked sidebar card already shows name/tagline —
     drop the duplicate masthead heading, keep the intro + CTAs. */
  .is-home .home-hero-title,
  .is-home .home-hero-tagline {
    display: none;
  }

  .home-hero {
    padding-top: 0.25rem;
  }
}

@media (max-width: 680px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: var(--nav-panel-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }

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

  .site-nav a {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .site-nav a::after { display: none; }

  .nav-github {
    margin: 0.5rem 0 0;
    text-align: center;
    justify-content: center;
  }

  .site-header { position: sticky; }

  .post-list-editorial > li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .post-arrow { display: none; }

  .post-list-full > li { grid-template-columns: 1fr; }

  .project-grid { grid-template-columns: 1fr; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-main {
    padding: 1.5rem 1rem 3.5rem;
  }

  .post-card {
    padding: 1.5rem 1.25rem 1.25rem;
    box-shadow: var(--shadow-sm);
  }

  .post-prose table {
    font-size: 0.82rem;
  }

  .post-prose thead th,
  .post-prose tbody td {
    padding: 0.55rem 0.65rem;
  }
}
