/* Ram-Dawson · 书房 (ramdom.me) Global Stylesheet
 * Single-screen menu rail + scrollable .page-main + 3D study smoked-glass mode.
 * Served directly at /styles/site.css in dev; renamed to /styles/site.<hash>.css in production build.
 */

/* ==========================================================================
   1. Design Tokens & Color Palettes (Light / Dark)
   ========================================================================== */

:root {
  --shell-bg: #F8FAFC;
  --bg: #FFFFFF;
  --surface: #F8FAFC;
  --surface-sunken: #F1F5F9;
  --ink: #0F172A;
  --ink-soft: #475569;
  --ink-muted: #64748B;
  --accent: #2E5077;
  --accent-hover: #213B59;
  --accent-line: #466D98;
  --accent-text: #28476B;
  --accent-secondary: #3A627D;
  --accent-secondary-line: #5682A3;
  --accent-glow: rgba(70, 109, 152, 0.48);
  --line: #E2E8F0;
  --line-soft: #F1F5F9;
  --code-bg: #F8FAFC;
  --selection: rgba(46, 80, 119, 0.16);
  --hljs-fg: #24292e;
  --hljs-keyword: #d73a49;
  --hljs-title: #6f42c1;
  --hljs-constant: #005cc5;
  --hljs-string: #032f62;
  --hljs-variable: #e36209;
  --hljs-comment: #6a737d;
  --hljs-tag: #22863a;
  --hljs-bullet: #735c0f;
  --hljs-addition-fg: #22863a;
  --hljs-addition-bg: #f0fff4;
  --hljs-deletion-fg: #b31d28;
  --hljs-deletion-bg: #ffeef0;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --shell-bg: #070C17;
    --bg: #0B1120;
    --surface: #111827;
    --surface-sunken: #1E293B;
    --ink: #E2E8F0;
    --ink-soft: #CBD5E1;
    --ink-muted: #94A3B8;
    --accent: #8AAEC9;
    --accent-hover: #B4C8DC;
    --accent-line: #6C92B4;
    --accent-text: #93B4CE;
    --accent-secondary: #7DA6BF;
    --accent-secondary-line: #6E97B2;
    --accent-glow: rgba(138, 174, 201, 0.55);
    --line: #1E293B;
    --line-soft: #172033;
    --code-bg: #0F172A;
    --selection: rgba(138, 174, 201, 0.22);
    --hljs-fg: #c9d1d9;
    --hljs-keyword: #ff7b72;
    --hljs-title: #d2a8ff;
    --hljs-constant: #79c0ff;
    --hljs-string: #a5d6ff;
    --hljs-variable: #ffa657;
    --hljs-comment: #8b949e;
    --hljs-tag: #7ee787;
    --hljs-section: #1f6feb;
    --hljs-bullet: #f2cc60;
    --hljs-addition-fg: #aff5b4;
    --hljs-addition-bg: #033a16;
    --hljs-deletion-fg: #ffdcd7;
    --hljs-deletion-bg: #67060c;
    color-scheme: dark;
  }
}

/* ==========================================================================
   2. Base Document Reset & Single-Screen Viewport
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background: var(--shell-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: 'Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.8em;
  background: var(--shell-bg);
}

::selection {
  background: var(--selection);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 140ms ease;
}

a:hover {
  color: var(--accent-hover);
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

img {
  height: auto;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ==========================================================================
   3. Game-Style Menu Rail & Page Container Shell
   ========================================================================== */

.site-shell {
  display: grid;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  grid-template-columns: 17rem minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: transparent;
}

.site-shell::before {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 100dvh;
  opacity: 1.0;
  content: "";
  background: var(--shell-bg);
  pointer-events: none;
  transition: opacity 320ms ease;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground))::before {
  opacity: 0.0;
}

.site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 1.45rem 1.15rem 1.15rem;
  scrollbar-width: thin;
}

.sidebar-top {
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 0.55rem;
  z-index: 3;
  padding: 0 0.2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.brand-domain {
  color: var(--accent-text);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.sidebar-tagline {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.55em;
}

.menu-nav {
  position: relative;
  z-index: 3;
  min-width: 0;
}

.menu-list {
  display: flex;
  padding: 0;
  margin: 0;
  flex-direction: column;
  gap: 0.25rem;
  list-style-type: none;
}

.menu-item {
  margin: 0;
}

.menu-option {
  display: flex;
  width: 100%;
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
  text-align: left;
  font-family: 'Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.35em;
  padding: 0.5rem 0.78rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  transition: background-color 90ms ease, border-color 90ms ease, box-shadow 90ms ease, color 90ms ease;
}

.menu-option-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.menu-cursor {
  font-size: 0.76rem;
  line-height: 1em;
  color: var(--accent-line);
  opacity: 0.28;
  transform: translateX(-1px);
  transition: opacity 140ms ease, transform 140ms ease, color 140ms ease;
}

.menu-label {
  white-space: nowrap;
}

.menu-meta {
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.menu-arrow {
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-size: 0.78rem;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.menu-option:hover {
  color: var(--accent);
  background: var(--bg);
  border-color: color-mix(in srgb, var(--accent-line) 42%, var(--line));
  box-shadow: inset 3px 0 0 var(--accent-line);
}

.menu-option:hover .menu-cursor, .menu-option.is-active .menu-cursor {
  opacity: 1;
  transform: translateX(1px);
}

.menu-option:hover .menu-arrow {
  color: var(--accent);
  opacity: 1;
  transform: translateX(0);
}

.menu-option.is-active {
  color: var(--ink);
  font-weight: 600;
  background: var(--bg);
  border-color: var(--line);
  box-shadow: inset 3px 0 0 var(--accent-line), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.menu-option.is-active .menu-meta {
  color: var(--accent-text);
  font-weight: 600;
}

.menu-option.is-active .menu-arrow {
  color: var(--accent-text);
  opacity: 1;
  transform: translateX(0);
}

.sidebar-scene {
  min-width: 0;
}

/* ==========================================================================
   4. 3D Study Controls, Loading Curtain & Stage
   ========================================================================== */

.study-controls {
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 3;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.menu-option-scene {
  color: var(--ink);
  font-weight: 600;
  background: color-mix(in srgb, var(--accent-line) 7%, var(--bg));
  border-color: color-mix(in srgb, var(--accent-line) 36%, var(--line));
  box-shadow: inset 3px 0 0 var(--accent-line);
}

.menu-option-scene .menu-cursor {
  opacity: 1;
}

.menu-scene-badge {
  color: var(--accent-secondary);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-size: 0.75rem;
  font-weight: 600;
}

.menu-option-scene:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-line) 13%, var(--bg));
  border-color: var(--accent-line);
}

.menu-option-scene[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.menu-option-bg {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 70%, var(--bg));
}

.menu-bg-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1.5px solid var(--ink-muted);
  background: transparent;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.menu-bg-dot.is-loading {
  border-color: var(--accent-secondary-line);
  background: var(--accent-secondary-line);
  animation: study-pulse 1s ease-in-out infinite;
}

.menu-bg-dot.is-on {
  border-color: var(--accent-line);
  background: var(--accent-line);
  box-shadow: 0 0 8px var(--accent-glow);
}

.sidebar-footer {
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.77rem;
  line-height: 1.5em;
  z-index: 3;
  margin-top: auto;
  padding: 0.75rem 0.25rem 0;
}

.sidebar-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-footer a {
  color: var(--ink-soft);
}

.sidebar-footer a:hover {
  color: var(--accent);
}

.page-main {
  position: relative;
  background-color: var(--bg);
  z-index: 3;
  min-width: 0;
  min-height: 0;
  contain: layout paint;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-padding-top: 1.5rem;
  margin: 0.75rem 0.75rem 0.75rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.page-main:focus {
  outline: none;
}

.button {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.2em;
  padding: 0.62rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover {
  border-color: var(--accent-line);
  color: var(--ink);
}

.button[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.home-view {
  margin-left: auto;
  margin-right: auto;
  width: min(64rem, calc(100% - 3.5rem));
  padding: 1.85rem 0 3rem;
}

.home-topbar {
  display: flex;
  margin-bottom: 1.65rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.home-topbar-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
}

.home-heading {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.3em;
}

.home-subtitle {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.home-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.4rem;
}

.home-feed {
  display: flex;
  flex-direction: column;
  gap: 2.3rem;
  min-width: 0;
}

.home-block {
  min-width: 0;
}

.section-head {
  display: flex;
  margin-bottom: 1rem;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.section-title {
  margin: 0;
  font-size: 1.08rem;
}

.section-more {
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.section-more:hover {
  color: var(--accent);
}

.featured-cards {
  display: flex;
  padding: 0;
  margin: 0;
  flex-direction: column;
  gap: 0.85rem;
  list-style-type: none;
}

.featured-card {
  padding: 1.05rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.featured-card:hover {
  border-color: color-mix(in srgb, var(--accent-line) 48%, var(--line));
  box-shadow: inset 3px 0 0 var(--accent-line);
  background: color-mix(in srgb, var(--surface) 65%, var(--bg));
}

.featured-card-title {
  margin-top: 0;
  margin-bottom: 0.38rem;
  font-size: 1.16rem;
  line-height: 1.45em;
}

.featured-card-title a {
  color: var(--ink);
}

.featured-card-title a:hover {
  color: var(--accent);
}

.featured-card-summary {
  margin-top: 0;
  margin-bottom: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.72em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-aside {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-width: 0;
}

.aside-panel {
  min-width: 0;
}

.aside-head {
  display: flex;
  margin-bottom: 0.6rem;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.aside-title {
  margin: 0;
  font-size: 0.95rem;
}

.aside-links {
  display: flex;
  padding: 0;
  margin: 0;
  flex-direction: column;
  gap: 0.42rem;
  list-style-type: none;
}

.aside-links a {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.aside-links a:hover {
  color: var(--accent);
}

.shelf-list {
  display: flex;
  padding: 0;
  margin: 0;
  flex-direction: column;
  list-style-type: none;
}

.shelf-list li {
  border-bottom: 1px solid var(--line-soft);
}

.shelf-list li:last-child {
  border-bottom: 0;
}

.shelf-list a {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.89rem;
  padding: 0.45rem 0;
}

.shelf-list a:hover {
  color: var(--accent);
}

.shelf-count {
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-size: 0.78rem;
}

.aside-tag-cloud {
  display: flex;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style-type: none;
}

.aside-tag-pill {
  display: inline-block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.4em;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 140ms ease, color 140ms ease;
}

.aside-tag-pill:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

.study-stage {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  opacity: 1.0;
  background-color: #120F0D;
  pointer-events: none;
  user-select: none;
  overscroll-behavior: none;
}

.study-stage.is-bg-ready:not(.is-foreground)::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 10, 8, 0.50) 0%, rgba(12, 10, 8, 0.16) 18rem, rgba(12, 10, 8, 0.04) 100%);
}

.study-stage.is-foreground {
  z-index: 100;
  background-color: #120F0D;
  pointer-events: auto;
  user-select: auto;
}

.study-frame {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1.0;
  border: 0;
  pointer-events: none;
}

.study-stage.is-exploring .study-frame {
  pointer-events: auto;
}

.study-loading {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  color: #E8D9B8;
  text-align: center;
  background-color: #120F0D;
}

.study-loading p {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.study-loading-poly {
  display: flex;
  position: relative;
  height: 4.5rem;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  gap: 0.45rem;
}

.study-loading-poly::before {
  position: absolute;
  top: -0.24rem;
  left: 50%;
  width: 4.4rem;
  height: 4.4rem;
  content: "";
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.05) 48%, transparent 72%);
  animation: study-poly-breathe 3.2s ease-in-out infinite;
}

.study-loading-poly-crystal {
  position: relative;
  z-index: 1;
}

.study-loading-poly-svg {
  display: block;
}

.study-loading-poly-shadow {
  width: 1.9rem;
  height: 0.34rem;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.42) 0%, transparent 72%);
  animation: study-poly-breathe 3.2s ease-in-out infinite;
}

.study-loading-progress {
  display: flex;
  width: 16.5rem;
  max-width: 78vw;
  flex-direction: column;
  align-items: center;
  gap: 0.48rem;
}

.study-loading-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(232, 217, 184, 0.14);
  box-shadow: inset 0 0 0 1px rgba(201, 164, 90, 0.18);
  overflow: hidden;
}

.study-loading-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(201, 164, 90, 0.85) 0%, #F59E0B 100%);
  transition: width 240ms ease-out;
}

.study-loading-meta {
  margin: 0;
  color: #D6C39A;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

@keyframes study-poly-breathe {
  0%, 100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1.0;
  }
}

@keyframes study-pulse {
  0%, 100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1.0;
  }
}

.study-loading .button {
  background: rgba(26, 18, 13, 0.85);
  border-color: rgba(201, 164, 90, 0.55);
  color: #E8D9B8;
}

.study-loading .button:hover {
  border-color: #F59E0B;
  color: #FAF0DC;
}

/* ==========================================================================
   5. 3D Study Active Background: Smoked Mahogany Glass Overrides
   ========================================================================== */

html:has(.study-stage.is-bg-ready:not(.is-foreground)) {
  --shell-bg: #120F0D;
  --bg: #14100D;
  --surface: rgba(34, 27, 22, 0.56);
  --surface-sunken: rgba(14, 11, 9, 0.68);
  --ink: #F5F0E6;
  --ink-soft: #D6CEC0;
  --ink-muted: #B5AC9E;
  --accent: #F59E0B;
  --accent-hover: #FDE68A;
  --accent-line: #F59E0B;
  --accent-text: #FBBF24;
  --accent-secondary: #FBBF24;
  --accent-secondary-line: #F59E0B;
  --accent-glow: rgba(245, 158, 11, 0.75);
  --line: rgba(245, 236, 220, 0.14);
  --line-soft: rgba(245, 236, 220, 0.08);
  --code-bg: rgba(14, 11, 9, 0.76);
  --selection: rgba(245, 158, 11, 0.24);
  --hljs-fg: #c9d1d9;
  --hljs-keyword: #ff7b72;
  --hljs-title: #d2a8ff;
  --hljs-constant: #79c0ff;
  --hljs-string: #a5d6ff;
  --hljs-variable: #ffa657;
  --hljs-comment: #8b949e;
  --hljs-tag: #7ee787;
  --hljs-section: #1f6feb;
  --hljs-bullet: #f2cc60;
  --hljs-addition-fg: #aff5b4;
  --hljs-addition-bg: #033a16;
  --hljs-deletion-fg: #ffdcd7;
  --hljs-deletion-bg: #67060c;
  color-scheme: dark;
}

html:has(.study-stage.is-bg-ready:not(.is-foreground)), body:has(.study-stage.is-bg-ready:not(.is-foreground)) {
  background: #120F0D;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .brand, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .brand:hover, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .brand-name {
  color: #F8FAFC;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .brand-mark {
  filter: brightness(1.12) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .brand-domain, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-scene-badge {
  color: #FBBF24;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .sidebar-tagline, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .sidebar-footer {
  color: rgba(241, 245, 249, 0.78);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .sidebar-footer a {
  color: #F8FAFC;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .sidebar-footer a:hover {
  color: #FBBF24;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .study-controls {
  border-top-color: rgba(248, 250, 252, 0.16);
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option {
  color: rgba(248, 250, 252, 0.90);
  background: rgba(18, 15, 13, 0.56);
  border-color: rgba(248, 250, 252, 0.14);
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option .menu-meta, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option .menu-arrow {
  color: rgba(226, 232, 240, 0.72);
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option:hover {
  color: #FBBF24;
  background: rgba(24, 19, 15, 0.78);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: inset 3px 0 0 #F59E0B;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option.is-active {
  color: #FFFFFF;
  background: rgba(24, 19, 15, 0.84);
  border-color: rgba(245, 158, 11, 0.50);
  box-shadow: inset 3px 0 0 #F59E0B, 0 4px 14px rgba(0, 0, 0, 0.25);
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option.is-active .menu-meta, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option.is-active .menu-arrow {
  color: #FBBF24;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option-scene {
  color: #FFFFFF;
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: inset 3px 0 0 #F59E0B;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option-scene:hover {
  color: #FDE68A;
  background: rgba(245, 158, 11, 0.32);
  border-color: #F59E0B;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .page-main {
  color: var(--ink);
  background: rgba(20, 16, 13, 0.76);
  border-color: rgba(245, 158, 11, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 245, 225, 0.06);
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .featured-card {
  background: rgba(34, 27, 22, 0.54);
  border-color: rgba(245, 236, 220, 0.12);
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .featured-card:hover {
  background: rgba(46, 36, 28, 0.74);
  border-color: rgba(245, 158, 11, 0.50);
  box-shadow: inset 3px 0 0 var(--accent-line);
}

.content-page {
  margin-left: auto;
  margin-right: auto;
  width: min(42rem, calc(100% - 3.5rem));
  padding: 2.4rem 0 3rem;
}

.content-page > h1, .page-title {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 2rem;
  line-height: 1.25em;
}

.content-page > h2 {
  margin-top: 2.2rem;
  margin-bottom: 0.7rem;
  font-size: 1.35rem;
}

.content-page > p {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.lead {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.8em;
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--accent-text);
  font-size: 0.9rem;
}

/* ==========================================================================
   6. Content Pages, Cards, Archive & Prose Typography
   ========================================================================== */

.about-hero {
  display: grid;
  margin-bottom: 1.75rem;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.6rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.about-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 9rem;
  height: 9rem;
  flex-shrink: 0;
}

.about-avatar {
  width: 9rem;
  height: 9rem;
  display: block;
}

.about-hero-copy .eyebrow {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.about-hero-copy .page-title {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.about-subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .about-hero {
  background: rgba(34, 27, 22, 0.54);
  border-color: rgba(245, 236, 220, 0.12);
}

.site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .about-avatar {
  filter: brightness(1.16) saturate(1.08) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.48));
}

@media (prefers-color-scheme: dark) {
  .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .about-avatar {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.48));
  }
}

.browse-nav {
  display: flex;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.browse-nav a {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.browse-nav a:hover {
  color: var(--accent);
}

.browse-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 0.65rem 0 -0.55rem var(--accent-line);
}

.breadcrumb {
  margin-bottom: 0.7rem;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.breadcrumb a {
  color: var(--ink-soft);
}

.crumb-sep {
  color: var(--line);
}

.post-list {
  display: flex;
  padding: 0;
  margin: 0;
  flex-direction: column;
  list-style-type: none;
}

.post-item {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.post-item:first-child {
  padding-top: 0.3rem;
}

.post-item-title {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.18rem;
  line-height: 1.45em;
}

.post-item-title a {
  color: var(--ink);
}

.post-item-title a:hover {
  color: var(--accent);
}

.post-item-summary {
  margin-top: 0;
  margin-bottom: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.72em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  color: var(--ink-muted);
  font-size: 0.83rem;
  gap: 0.2rem 0.55rem;
}

.meta-line time {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-variant-numeric: tabular-nums;
}

.meta-line a {
  color: var(--ink-muted);
}

.meta-line a:hover {
  color: var(--accent);
}

.meta-sep {
  color: var(--line);
}

.meta-category {
  color: var(--accent-text);
}

.group-list {
  display: grid;
  padding: 0;
  margin: 0;
  list-style-type: none;
  grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr));
  gap: 0 2rem;
}

.group-item a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--ink);
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.group-item a:hover {
  color: var(--accent);
}

.group-count {
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-size: 0.8rem;
}

.tag-row {
  display: flex;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  list-style-type: none;
  gap: 0.15rem 0.85rem;
}

.tag-chip {
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.tag-chip::before {
  content: "#";
  color: var(--accent-secondary);
  margin-right: 0.1rem;
}

a.tag-chip:hover {
  color: var(--accent-secondary);
}

.read-more {
  color: var(--accent);
  font-size: 0.92rem;
}

.read-more .arrow {
  display: inline-block;
  transition: transform 140ms ease;
}

.read-more:hover .arrow {
  transform: translateX(2px);
}

.archive-year {
  margin-top: 2rem;
}

.archive-year-title {
  display: flex;
  margin-top: 0;
  margin-bottom: 0.6rem;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 1.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.archive-count {
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-size: 0.78rem;
  font-weight: 400;
}

.archive-month {
  margin-top: 1rem;
}

.archive-month-title {
  margin-top: 0;
  margin-bottom: 0.3rem;
  color: var(--accent-text);
  font-size: 0.95rem;
}

.archive-list {
  display: flex;
  padding: 0;
  margin: 0;
  flex-direction: column;
  list-style-type: none;
}

.archive-item {
  display: grid;
  align-items: baseline;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.5rem 0;
}

.archive-date {
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-size: 0.8rem;
}

.archive-item a {
  color: var(--ink);
}

.archive-item a:hover {
  color: var(--accent);
}

.note-group {
  margin-top: 2rem;
}

.note-group-title {
  display: flex;
  margin-top: 0;
  margin-bottom: 0.5rem;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 1.3rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.note-list {
  display: flex;
  padding: 0;
  margin: 0;
  flex-direction: column;
  list-style-type: none;
}

.note-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--ink);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.note-link:hover .note-title {
  color: var(--accent);
}

.note-title {
  font-weight: 600;
}

.note-desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.empty-state {
  color: var(--ink-muted);
  padding: 1rem 0;
}

.article-layout {
  display: grid;
  margin-left: auto;
  margin-right: auto;
  width: min(42rem, calc(100% - 3.5rem));
  grid-template-columns: minmax(0, 1fr);
  padding: 2.4rem 0 3rem;
}

.post-article {
  min-width: 0;
}

.post-header {
  padding-bottom: 1.5rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--line);
}

.post-kicker {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
}

.post-kicker a {
  color: var(--accent-text);
}

.post-header h1 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 2.15rem;
  line-height: 1.3em;
}

.post-header .lead {
  margin-bottom: 1rem;
}

.post-header .tag-row {
  margin-top: 0.55rem;
}

.toc-inline {
  margin-bottom: 2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 0.7rem 1rem;
}

.toc-inline summary {
  cursor: pointer;
  color: var(--ink-soft);
}

.toc-title {
  margin-top: 0;
  margin-bottom: 0.6rem;
  color: var(--accent-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.toc-list {
  padding: 0;
  margin-top: 0.5rem;
  list-style-type: none;
  font-size: 0.86rem;
  line-height: 1.5em;
}

.toc-list li {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.toc-list .toc-sub {
  padding-left: 0.9rem;
}

.toc-list a {
  color: var(--ink-soft);
}

.toc-list a:hover {
  color: var(--accent);
}

.toc-side {
  display: none;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.2rem;
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--ink);
}

.post-nav a:hover {
  color: var(--accent);
}

.post-nav .post-nav-next {
  text-align: right;
  grid-column: 2;
}

.post-nav-label {
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.prose {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.85em;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin-top: 2.4rem;
  margin-bottom: 0.75rem;
  font-size: 1.45rem;
  line-height: 1.4em;
}

.prose h3 {
  margin-top: 1.9rem;
  margin-bottom: 0.55rem;
  font-size: 1.18rem;
  line-height: 1.45em;
}

.prose h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.04rem;
}

.prose p {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.prose li {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.prose li::marker {
  color: var(--accent-line);
}

.prose strong {
  font-weight: 600;
}

.prose blockquote {
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
  color: var(--ink-soft);
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 2px solid var(--accent-line);
}

.prose blockquote p {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4rem 0;
}

.prose img {
  border: 1px solid var(--line);
  display: block;
  margin: 1.5rem auto;
}

.prose code {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'SF Mono', 'Menlo', monospace;
  font-size: 0.86em;
  padding: 0.12rem 0.36rem;
  border-radius: 4px;
  background: var(--surface-sunken);
  overflow-wrap: anywhere;
}

/* ==========================================================================
   7. Code Blocks & Highlight.js Syntax Tokens
   ========================================================================== */

.prose pre {
  position: relative;
  overflow: auto;
  line-height: 1.55;
  margin: 1.4rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--code-bg);
  tab-size: 2;
}

.prose pre code {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--hljs-fg);
  padding: 0;
  background: transparent;
  overflow-wrap: normal;
}

.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  opacity: 0;
  transition: opacity 150ms ease, background 150ms ease, color 150ms ease;
  user-select: none;
  line-height: 1.2;
}

.prose pre:hover .code-copy-btn, .code-copy-btn:focus {
  opacity: 1;
}

.code-copy-btn:hover {
  color: var(--ink);
  background: var(--surface-sunken);
  border-color: var(--accent);
}

.code-copy-btn.copied {
  color: var(--accent-secondary);
  opacity: 1;
  border-color: var(--accent-secondary);
}

.hljs-doctag, .hljs-keyword, .hljs-meta .hljs-keyword, .hljs-template-tag, .hljs-template-variable, .hljs-type, .hljs-variable.language_ {
  color: var(--hljs-keyword);
}

.hljs-title, .hljs-title.class_, .hljs-title.class_.inherited__, .hljs-title.function_ {
  color: var(--hljs-title);
}

.hljs-attr, .hljs-attribute, .hljs-literal, .hljs-meta, .hljs-number, .hljs-operator, .hljs-variable, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id {
  color: var(--hljs-constant);
}

.hljs-regexp, .hljs-string, .hljs-meta .hljs-string {
  color: var(--hljs-string);
}

.hljs-built_in, .hljs-symbol {
  color: var(--hljs-variable);
}

.hljs-comment, .hljs-code, .hljs-formula {
  color: var(--hljs-comment);
}

.hljs-name, .hljs-quote, .hljs-selector-tag, .hljs-selector-pseudo {
  color: var(--hljs-tag);
}

.hljs-subst {
  color: var(--hljs-fg);
}

.hljs-section {
  font-weight: 700;
  color: var(--hljs-section, var(--hljs-constant));
}

.hljs-bullet {
  color: var(--hljs-bullet);
}

.hljs-emphasis {
  font-style: italic;
  color: var(--hljs-fg);
}

.hljs-strong {
  font-weight: 700;
  color: var(--hljs-fg);
}

.hljs-addition {
  color: var(--hljs-addition-fg);
  background-color: var(--hljs-addition-bg);
}

.hljs-deletion {
  color: var(--hljs-deletion-fg);
  background-color: var(--hljs-deletion-bg);
}

.prose table {
  width: 100%;
  font-size: 0.93rem;
  border-collapse: collapse;
  margin: 1.6rem 0;
  display: block;
  overflow-x: auto;
}

.prose th {
  text-align: left;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--ink-muted);
}

.prose td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.skip-link {
  position: absolute;
  z-index: 200;
  color: var(--bg);
  font-size: 0.9rem;
  left: 1rem;
  top: -4rem;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  background: var(--accent);
}

.skip-link:focus {
  top: 0.75rem;
}

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .page-main {
    scroll-behavior: auto;
  }
}

@media screen and (min-width: 1220px) {
  .home-board {
    grid-template-columns: minmax(0, 1fr) 15.5rem;
    gap: 2.75rem;
    align-items: start;
  }
  .home-aside {
    position: sticky;
    top: 1.5rem;
    padding-left: 1.4rem;
    border-left: 1px solid var(--line);
  }
  .article-layout.has-toc {
    width: min(62rem, calc(100% - 3.5rem));
    grid-template-columns: minmax(0, 42rem) 13.5rem;
    gap: 3.25rem;
  }
  .has-toc .toc-inline {
    display: none;
  }
  .has-toc .toc-side {
    display: block;
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    padding-left: 1rem;
    border-left: 1px solid var(--line);
  }
}

/* ==========================================================================
   8. Responsive Breakpoints & Reduced Motion
   ========================================================================== */

@media screen and (max-width: 860px) {
  .site-shell {
    display: flex;
    flex-direction: column;
  }
  .site-sidebar {
    display: grid;
    flex-shrink: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
    overflow-y: visible;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand scene" "menu menu";
    align-items: center;
    gap: 0.55rem 0.75rem;
    padding: 0.65rem 1rem 0.6rem;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-top {
    grid-area: brand;
    padding: 0;
    min-width: 0;
  }
  .brand-mark {
    width: 1.85rem;
    height: 1.85rem;
  }
  .brand-name {
    font-size: 1.02rem;
    white-space: nowrap;
  }
  .brand-domain, .sidebar-tagline, .sidebar-footer {
    display: none;
  }
  .sidebar-scene {
    grid-area: scene;
    min-width: 0;
  }
  .study-controls {
    flex-direction: row;
    gap: 0.35rem;
    padding-top: 0;
    border-top: 0;
  }
  .menu-option-scene, .menu-option-bg {
    min-height: 44px;
    width: auto;
    padding: 0.34rem 0.56rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    box-shadow: none;
  }
  .menu-option-bg .menu-cursor {
    display: none;
  }
  .menu-nav {
    grid-area: menu;
    min-width: 0;
  }
  .menu-list {
    flex-direction: row;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .menu-list::-webkit-scrollbar {
    display: none;
  }
  .menu-item {
    flex-shrink: 0;
  }
  .menu-option:not(.menu-option-scene):not(.menu-option-bg) {
    min-height: 44px;
    width: auto;
    padding: 0.34rem 0.65rem;
    font-size: 0.86rem;
    display: inline-flex;
    align-items: center;
  }
  .menu-option:not(.menu-option-scene):not(.menu-option-bg):hover, .menu-option:not(.menu-option-scene):not(.menu-option-bg).is-active {
    box-shadow: inset 0 -2px 0 var(--accent-line);
  }
  .menu-option-scene, .menu-option-scene:hover, .menu-option-bg:hover, .menu-option-bg.is-active {
    box-shadow: none;
  }
  .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option:not(.menu-option-scene):not(.menu-option-bg):hover, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option:not(.menu-option-scene):not(.menu-option-bg).is-active {
    box-shadow: inset 0 -2px 0 #F59E0B;
  }
  .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option-scene, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option-scene:hover, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option-bg:hover, .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .menu-option-bg.is-active {
    box-shadow: none;
  }
  .code-copy-btn {
    opacity: 0.85;
  }
  .menu-option:not(.menu-option-scene) .menu-cursor, .menu-arrow {
    display: none;
  }
  .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .site-sidebar {
    position: relative;
    border-bottom-color: rgba(248, 250, 252, 0.14);
  }
  .site-shell:has(.study-stage.is-bg-ready:not(.is-foreground)) .site-sidebar::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    content: "";
    z-index: 2;
    pointer-events: none;
    background: rgba(18, 15, 13, 0.72);
  }
  .page-main {
    flex-grow: 1;
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .home-view, .content-page, .article-layout {
    width: calc(100% - 2rem);
    padding: 1.4rem 0 2.5rem;
  }
  .post-header h1, .content-page > h1, .page-title {
    font-size: 1.65rem;
  }
  .prose h2 {
    font-size: 1.3rem;
  }
  .archive-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }
  .post-nav {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-nav .post-nav-next {
    text-align: left;
    grid-column: auto;
  }
  .about-hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1.2rem 1rem;
  }
  .about-avatar-wrap, .about-avatar {
    width: 7.5rem;
    height: 7.5rem;
  }
}

@media screen and (max-width: 560px) {
  .site-sidebar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "scene" "menu";
    gap: 0.45rem 0;
    padding: 0.55rem 0.85rem 0.5rem;
  }
  .study-controls {
    display: grid;
    width: 100%;
    gap: 0.4rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .menu-option-scene, .menu-option-bg {
    min-height: 44px;
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    padding: 0.34rem 0.62rem;
    font-size: 0.79rem;
  }
  .menu-option-scene .menu-cursor {
    display: none;
  }
  .menu-list {
    gap: 0.28rem;
  }
  .menu-option:not(.menu-option-scene):not(.menu-option-bg) {
    min-height: 44px;
    padding: 0.34rem 0.56rem;
    font-size: 0.84rem;
  }
  .home-view, .content-page, .article-layout {
    width: calc(100% - 1.7rem);
    padding: 1.15rem 0 2.2rem;
  }
  .featured-card {
    padding: 0.9rem 0.95rem;
  }
}
