/* ==========================================================================
   Lomodoo — 个人网站样式
   目录
   1. 设计令牌        2. 重置与基础      3. 布局容器
   4. 页头与导航      5. 按钮            6. 首页 Hero
   7. 区块与标题      8. 卡片与列表      9. 文章排版 (prose)
   10. 关于页         11. 页脚           12. 动效与工具类
   13. 响应式与可访问性
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  color-scheme: light;

  --bg: #fbfaf7;
  --bg-soft: #f4f2ec;
  --surface: #ffffff;
  --surface-hover: #ffffff;

  --text: #15171c;
  --text-muted: #5f6570;
  --text-faint: #8b909a;

  --border: #e6e3dc;
  --border-strong: #d6d2c8;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.09);
  --accent-line: rgba(79, 70, 229, 0.28);

  --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.05);
  --shadow-md: 0 6px 20px -8px rgba(20, 22, 28, 0.16);
  --shadow-lg: 0 24px 60px -30px rgba(20, 22, 28, 0.35);

  --container: 1080px;
  --container-narrow: 720px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0c0d11;
  --bg-soft: #12141a;
  --surface: #14161d;
  --surface-hover: #191c24;

  --text: #eceef4;
  --text-muted: #a1a7b3;
  --text-faint: #767d8a;

  --border: #23262f;
  --border-strong: #323641;

  --accent: #9a9af5;
  --accent-hover: #b3b3ff;
  --accent-soft: rgba(154, 154, 245, 0.13);
  --accent-line: rgba(154, 154, 245, 0.32);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 70px -35px rgba(0, 0, 0, 0.8);
}

/* ---------- 2. 重置与基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.22;
  letter-spacing: -0.022em;
  font-weight: 640;
  text-wrap: balance;
}

p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 3. 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.container-narrow {
  max-width: var(--container-narrow);
}

main {
  min-height: 60vh;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 14px;
}

/* ---------- 4. 页头与导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header {
    background: var(--bg);
  }
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 660;
  letter-spacing: -0.02em;
  font-size: 1.0625rem;
  flex: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6 55%, #ec4899);
  box-shadow: 0 0 0 1px var(--accent-line);
  position: relative;
  flex: none;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.92;
}

.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.04);
  transition: transform 0.35s var(--ease);
}

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

.nav a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 520;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-soft);
  border-color: var(--border);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.nav-toggle {
  display: none;
}

/* 按钮显示的是「点击后会变成的模式」：浅色下显示月亮，深色下显示太阳 */
[data-theme="light"] .icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 560;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn-primary {
  color: #14161d;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--bg-soft);
  border-color: var(--text-faint);
  transform: translateY(-1px);
}

.btn-link {
  padding: 0;
  color: var(--accent);
  font-weight: 560;
  border: 0;
}

.btn-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- 6. 首页 Hero ---------- */
.hero {
  position: relative;
  padding: clamp(56px, 11vh, 116px) 0 clamp(40px, 7vh, 72px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 620px;
  background: radial-gradient(
      42% 55% at 18% 30%,
      var(--accent-soft) 0%,
      transparent 68%
    ),
    radial-gradient(38% 48% at 82% 12%, rgba(236, 72, 153, 0.09) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 520;
  letter-spacing: 0.01em;
  margin-bottom: 26px;
}

.hero-kicker .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.hero-title {
  font-size: clamp(2.4rem, 6.4vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 22px;
}

.hero-title .accent {
  background: linear-gradient(100deg, var(--accent), #ec4899 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-lead {
  max-width: 60ch;
  font-size: clamp(1.0625rem, 1.9vw, 1.1875rem);
  color: var(--text-muted);
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 58px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* ---------- 7. 区块与标题 ---------- */
.section {
  padding: clamp(44px, 7vh, 76px) 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.section-title {
  font-size: clamp(1.5rem, 3.2vw, 1.95rem);
  letter-spacing: -0.03em;
}

.section-desc {
  color: var(--text-muted);
  margin-top: 8px;
  max-width: 62ch;
  font-size: 0.9688rem;
}

.section-more {
  font-size: 0.9375rem;
  color: var(--accent);
  font-weight: 540;
  white-space: nowrap;
  padding-bottom: 4px;
}

.section-more:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.page-head {
  padding: clamp(46px, 8vh, 84px) 0 34px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.035em;
}

.page-desc {
  color: var(--text-muted);
  margin-top: 14px;
  max-width: 64ch;
}

/* ---------- 8. 卡片与列表 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.card-cover {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

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

.card-cover .cover-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-title {
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.card-summary {
  color: var(--text-muted);
  font-size: 0.9375rem;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  padding-top: 4px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  line-height: 1.5;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

a.tag:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: all 0.2s var(--ease);
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

[data-theme="dark"] .chip[aria-pressed="true"] {
  color: #14161d;
}

.search-box {
  position: relative;
  max-width: 340px;
  margin-bottom: 24px;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.search-box input::placeholder {
  color: var(--text-faint);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.post-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 22px;
  padding: 24px 4px;
  border-top: 1px solid var(--border);
  transition: background 0.25s var(--ease);
}

.post-item:last-child {
  border-bottom: 1px solid var(--border);
}

.post-item:hover {
  background: var(--bg-soft);
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-faint);
  padding-top: 5px;
  white-space: nowrap;
}

.post-title {
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  margin-bottom: 7px;
}

.post-item:hover .post-title {
  color: var(--accent);
}

.post-summary {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 12px;
}

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- 9. 文章排版 (prose) ---------- */
.article-head {
  padding: clamp(40px, 7vh, 72px) 0 30px;
}

.article-title {
  font-size: clamp(1.85rem, 4.6vw, 2.9rem);
  letter-spacing: -0.035em;
  margin-bottom: 18px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--text-faint);
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

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

.back-link svg {
  width: 15px;
  height: 15px;
}

.prose {
  padding-bottom: 20px;
  font-size: 1.0625rem;
  line-height: 1.82;
  color: var(--text);
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.2em;
  margin-bottom: 0.2em;
  letter-spacing: -0.025em;
}

.prose h3 {
  font-size: 1.1875rem;
  margin-top: 1.9em;
  margin-bottom: 0.2em;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s var(--ease);
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose strong {
  font-weight: 640;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
  margin-block: 1.15em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose li::marker {
  color: var(--text-faint);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--accent-soft);
  color: var(--text);
  padding: 0.18em 0.42em;
  border-radius: 5px;
}

.prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent-line);
  color: var(--text-muted);
  font-style: normal;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.article-foot {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #ec4899);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ---------- 10. 关于页 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 56px;
  align-items: start;
}

.avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 1px solid var(--border);
}

.avatar-fallback {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--accent), #8b5cf6 60%, #ec4899);
  color: #fff;
  font-size: 3.4rem;
  font-weight: 680;
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-lg);
}

.fact-list {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  font-size: 0.9375rem;
}

.fact-list li {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.fact-list li:last-child {
  border-bottom: 1px solid var(--border);
}

.fact-list .k {
  color: var(--text-faint);
  min-width: 74px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding-top: 2px;
}

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
}

.skill-group h3 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 12px;
}

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

.timeline li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.timeline li:last-child {
  border-bottom: 1px solid var(--border);
}

.timeline .when {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-faint);
  padding-top: 4px;
}

.timeline .what {
  font-weight: 600;
  margin-bottom: 5px;
}

.timeline .detail {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ---------- 11. 页脚 ---------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 48px 0 40px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-name {
  font-weight: 660;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.footer-note {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 8px;
  max-width: 40ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-links a {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}

.footer-links a:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
}

/* ---------- 12. 动效与工具类 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.muted {
  color: var(--text-muted);
}

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

/* ---------- 13. 响应式与可访问性 ---------- */
@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-grid .about-aside {
    order: -1;
    max-width: 220px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .container {
    padding-inline: 18px;
  }

  .nav-toggle {
    display: grid;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 12px 18px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  }

  .nav.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav a {
    padding: 12px 14px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .post-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero-stats {
    gap: 26px;
    margin-top: 44px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .reading-progress,
  .back-link {
    display: none;
  }
}
