/* ==========================================================================
   俗人的博客 — Homepage v3
   Aesthetic: Modern Chinese Editorial Paper & Ink + Kinetic Craft
   Zero external fonts/CDNs · GPU-composited animations · Server-light
   ========================================================================== */

:root {
  /* Paper & Ink Palette */
  --paper: #f6f4ef;
  --paper-deep: #edeae2;
  --surface: #fcfbf8;
  --surface-elevated: #ffffff;
  --ink: #161614;
  --ink-secondary: #524e48;
  --ink-muted: #847e75;
  --hairline: rgba(22, 22, 20, 0.09);
  --hairline-strong: rgba(22, 22, 20, 0.18);

  /* Vermilion Signature Accent (朱砂印泥红) */
  --vermilion: #c84b31;
  --vermilion-deep: #a93b24;
  --vermilion-soft: rgba(200, 75, 49, 0.09);
  --vermilion-border: rgba(200, 75, 49, 0.28);

  /* Editorial Category Pigments */
  --cat-tech-bg: #ebeef5;
  --cat-tech-fg: #2b4570;
  --cat-ai-bg: #f1ecf7;
  --cat-ai-fg: #583b84;
  --cat-insp-bg: #faeee9;
  --cat-insp-fg: #b4422a;
  --cat-app-bg: #e9f3ef;
  --cat-app-fg: #22604d;

  /* Typography */
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout & Motion */
  --container-max: 1120px;
  --header-h: 72px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-card: 0 2px 10px -2px rgba(22, 22, 20, 0.045), 0 1px 2px rgba(22, 22, 20, 0.03);
  --shadow-hover: 0 24px 48px -16px rgba(22, 22, 20, 0.14), 0 8px 18px -8px rgba(200, 75, 49, 0.08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--paper);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ultra-subtle paper grain texture (inline SVG, 0 HTTP requests) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(200, 75, 49, 0.18);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 3px;
}

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

/* ==========================================================================
   Scroll Progress Hairline
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 1002;
  pointer-events: none;
}

.scroll-progress__bar {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--ink) 0%, var(--vermilion) 100%);
  will-change: transform;
}

/* ==========================================================================
   Header & Hover-Tracking Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(246, 244, 239, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s var(--ease-expo), border-color 0.35s var(--ease-expo), box-shadow 0.35s var(--ease-expo);
}

.site-header.is-scrolled {
  background: rgba(252, 251, 248, 0.92);
  border-bottom-color: var(--hairline);
  box-shadow: 0 6px 24px -12px rgba(22, 22, 20, 0.08);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Brand Seal + Wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}

.brand__seal {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--vermilion);
  color: #fcfbf8;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(200, 75, 49, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  transform: rotate(-3deg);
  transition: transform 0.38s var(--ease-expo), box-shadow 0.38s var(--ease-expo);
}

.brand:hover .brand__seal {
  transform: rotate(0deg) scale(1.06);
  box-shadow: 0 8px 18px rgba(200, 75, 49, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.brand__name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Desktop Nav with Sliding Hover Pill */
.site-nav {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-hover-pill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 36px;
  border-radius: 999px;
  background: rgba(22, 22, 20, 0.055);
  transform: translate3d(0, -50%, 0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.34s var(--ease-expo), width 0.34s var(--ease-expo), opacity 0.22s ease;
  z-index: 0;
}

.nav-list {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--vermilion);
  transform: translateX(-50%);
}

.nav-caret {
  width: 13px;
  height: 13px;
  opacity: 0.7;
  transition: transform 0.3s var(--ease-expo);
}

.nav-dropdown.is-open .nav-caret {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  margin: 0;
  list-style: none;
  background: var(--surface-elevated);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(22, 22, 20, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.24s var(--ease-expo), transform 0.28s var(--ease-expo), visibility 0.24s;
  z-index: 20;
}

.nav-dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--ink-secondary);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.22s var(--ease-expo);
}

.dropdown-menu a::after {
  content: "↗";
  font-size: 12px;
  opacity: 0;
  transform: translate(-4px, 2px);
  transition: opacity 0.2s ease, transform 0.22s var(--ease-expo);
}

.dropdown-menu a:hover {
  background: var(--paper);
  color: var(--vermilion);
  transform: translateX(2px);
}

.dropdown-menu a:hover::after {
  opacity: 1;
  transform: translate(0, 0);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.menu-toggle:hover {
  border-color: var(--hairline-strong);
  background: var(--surface-elevated);
}

.menu-toggle__bars {
  width: 18px;
  height: 13px;
  position: relative;
  display: block;
}

.menu-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.8px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.28s var(--ease-expo), opacity 0.2s ease, top 0.28s var(--ease-expo);
}

.menu-toggle__bars span:nth-child(1) { top: 0; }
.menu-toggle__bars span:nth-child(2) { top: 5.5px; width: 72%; }
.menu-toggle__bars span:nth-child(3) { top: 11px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) {
  top: 5.5px;
  transform: rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) {
  top: 5.5px;
  transform: rotate(-45deg);
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 999;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.28s;
}

.mobile-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 22, 20, 0.3);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.mobile-drawer.is-open .mobile-drawer__backdrop {
  opacity: 1;
}

.mobile-drawer__panel {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  padding: 16px 24px 26px;
  box-shadow: 0 20px 40px rgba(22, 22, 20, 0.12);
  transform: translateY(-16px);
  opacity: 0;
  transition: transform 0.34s var(--ease-expo), opacity 0.26s ease;
}

.mobile-drawer.is-open .mobile-drawer__panel {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav-list a {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.mobile-nav-list a.is-active,
.mobile-nav-list a:hover {
  background: var(--vermilion-soft);
  color: var(--vermilion);
}

.mobile-nav-group-title {
  padding: 10px 12px 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.mobile-nav-sub {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1.5px solid var(--hairline-strong);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ==========================================================================
   Hero Section with Kinetic Ink-Mesh Canvas
   ========================================================================== */
.hero {
  position: relative;
  padding: 84px 0 64px;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Subtle warm radial glow behind typography */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 68% 72% at 22% 42%, rgba(246, 244, 239, 0.92) 0%, rgba(246, 244, 239, 0.52) 60%, rgba(246, 244, 239, 0.15) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  will-change: transform;
}

.hero-main {
  max-width: 680px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-secondary);
}

.hero-kicker__line {
  width: 28px;
  height: 1.5px;
  background: var(--vermilion);
  transform-origin: left center;
  animation: drawLine 0.8s var(--ease-expo) 0.1s both;
}

/* Masked Typography Reveal */
.reveal-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.reveal-mask__inner {
  display: inline-block;
  animation: maskRise 0.85s var(--ease-expo) var(--delay, 0s) both;
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.hero-desc {
  margin: 0 0 32px;
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink-secondary);
  max-width: 560px;
  animation: fadeSlide 0.8s var(--ease-expo) 0.24s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  animation: fadeSlide 0.8s var(--ease-expo) 0.34s both;
}

/* Editorial Colophon Stats on Hero Right (real data only: 12 posts, 4 categories) */
.hero-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  padding-left: 28px;
  border-left: 1px solid var(--hairline);
  animation: fadeSlide 0.9s var(--ease-expo) 0.38s both;
}

.hero-stat {
  text-align: right;
}

.hero-stat__num {
  display: block;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.hero-stat__label {
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* Magnetic Buttons with Kinetic Dual-Arrow Roll */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  will-change: transform;
  transition: background-color 0.28s var(--ease-expo), color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s var(--ease-expo);
}

.btn-primary {
  background: var(--ink);
  color: #fcfbf8;
  box-shadow: 0 8px 22px -8px rgba(22, 22, 20, 0.36);
}

.btn-primary:hover {
  background: var(--vermilion);
  box-shadow: 0 12px 26px -8px rgba(200, 75, 49, 0.42);
}

.btn-ghost {
  background: rgba(252, 251, 248, 0.85);
  color: var(--ink-secondary);
  border-color: var(--hairline-strong);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--surface-elevated);
}

.icon-slot {
  position: relative;
  display: inline-flex;
  width: 16px;
  height: 16px;
  overflow: hidden;
}

.icon-slot svg {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  transition: transform 0.36s var(--ease-expo);
}

.icon-slot--down svg:last-child {
  transform: translateY(-130%);
}

.btn:hover .icon-slot--down svg:first-child {
  transform: translateY(130%);
}

.btn:hover .icon-slot--down svg:last-child {
  transform: translateY(0);
}

/* ==========================================================================
   Articles Section & Filter Bar
   ========================================================================== */
.posts-section {
  padding: 44px 0 96px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 34px;
}

/* Sliding Pill Filter Bar */
.filter-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--paper-deep);
  border: 1px solid var(--hairline);
}

.filter-indicator {
  position: absolute;
  top: 5px;
  left: 5px;
  height: calc(100% - 10px);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 4px 12px rgba(22, 22, 20, 0.16);
  transition: transform 0.42s var(--ease-expo), width 0.42s var(--ease-expo), opacity 0.25s ease;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
  will-change: transform, width;
}

.filter-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: color 0.28s ease;
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--ink);
}

.filter-tab.is-active {
  color: #fcfbf8;
}

.filter-tab__count {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.65;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.filter-tab.is-active .filter-tab__count {
  opacity: 0.85;
  color: #f3b5a6;
}

.toolbar-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Editorial 2-Column Article Grid + FLIP + 3D Spring Tilt
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  perspective: 1400px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transform-style: preserve-3d;
  will-change: transform;
  transition: box-shadow 0.4s var(--ease-expo), border-color 0.35s ease;
}

.post-card.is-hidden {
  display: none;
}

/* Solo card on 1-item filter/page spans full width as horizontal editorial showcase */
.post-card.post-card--solo {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.post-card.post-card--solo .post-card__media {
  aspect-ratio: auto;
  min-height: 290px;
  height: 100%;
  border-bottom: none;
  border-right: 1px solid var(--hairline);
}

.post-card.post-card--solo .post-card__body {
  padding: 32px 34px;
  justify-content: center;
}

.post-card.post-card--solo .post-card__title {
  font-size: 22px;
}

/* Scroll & Filter Reveal */
.post-card.is-awaiting-reveal {
  opacity: 0;
  transform: translateY(28px);
}

.post-card.is-revealed {
  animation: cardReveal 0.65s var(--ease-expo) var(--stagger, 0ms) both;
}

.post-card:hover {
  border-color: var(--vermilion-border);
  box-shadow: var(--shadow-hover);
}

/* Specular Paper Sheen Overlay */
.post-card__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--glare-x, 50%) var(--glare-y, 50%),
    rgba(255, 255, 255, 0.42) 0%,
    rgba(200, 75, 49, 0.045) 38%,
    transparent 70%
  );
  transition: opacity 0.35s ease;
}

.post-card:hover .post-card__sheen {
  opacity: 1;
}

/* Unified Gallery Mat Cover Framing */
.post-card__media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--mat-bg, var(--paper-deep));
  border-bottom: 1px solid var(--hairline);
}

.post-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(22, 22, 20, 0.05);
  pointer-events: none;
  z-index: 2;
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--img-pos, center);
  transition: transform 0.72s var(--ease-expo), filter 0.45s ease;
  will-change: transform;
}

/* Contain framing for square graphic/SVG covers so text is NEVER cropped */
.post-card__media--contain {
  padding: 16px;
}

.post-card__media--contain img {
  object-fit: contain;
  border-radius: 6px;
}

.post-card:hover .post-card__media img {
  transform: scale(1.048);
}

.post-card:hover .post-card__media--contain img {
  transform: scale(1.035);
}

/* Editorial Floating Index Number & Latest Ribbon */
.post-card__index {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(252, 251, 248, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(22, 22, 20, 0.08);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
  transition: transform 0.4s var(--ease-expo), background-color 0.25s ease, color 0.25s ease;
}

.post-card:hover .post-card__index {
  transform: translateY(-2px);
  background: var(--ink);
  color: #fcfbf8;
}

.post-card__latest {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--vermilion);
  color: #fcfbf8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 12px rgba(200, 75, 49, 0.34);
}

/* Card Body */
.post-card__body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 20px;
}

.post-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-expo), filter 0.2s ease;
}

.badge:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

.badge--tech { background: var(--cat-tech-bg); color: var(--cat-tech-fg); }
.badge--ai { background: var(--cat-ai-bg); color: var(--cat-ai-fg); }
.badge--inspiration { background: var(--cat-insp-bg); color: var(--cat-insp-fg); }
.badge--app { background: var(--cat-app-bg); color: var(--cat-app-fg); }

.post-card__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.post-card__title {
  margin: 0 0 10px;
  font-size: 18.5px;
  font-weight: 700;
  line-height: 1.44;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Editorial underline glide on title hover */
.post-card__title a {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  transition: color 0.25s ease, background-size 0.42s var(--ease-expo);
  padding-bottom: 1px;
}

.post-card:hover .post-card__title a {
  color: var(--vermilion-deep);
  background-size: 100% 1.5px;
}

.post-card__excerpt {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Kinetic Dual-Arrow Read More */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.22s ease;
}

.read-more__slot {
  position: relative;
  display: inline-flex;
  width: 16px;
  height: 16px;
  overflow: hidden;
}

.read-more__slot svg {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  transition: transform 0.38s var(--ease-expo);
}

.read-more__slot svg:last-child {
  transform: translateX(-130%);
}

.post-card:hover .read-more {
  color: var(--vermilion);
}

.post-card:hover .read-more__slot svg:first-child {
  transform: translateX(130%);
}

.post-card:hover .read-more__slot svg:last-child {
  transform: translateX(0);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 52px;
}

.pagination.is-hidden {
  display: none;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: transform 0.24s var(--ease-expo), background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-2px);
}

.page-btn.is-current {
  background: var(--ink);
  border-color: var(--ink);
  color: #fcfbf8;
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  padding: 38px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-brand__title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.footer-brand__domain {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.footer-links a {
  color: var(--ink-secondary);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--vermilion);
}

/* ==========================================================================
   Floating Back-to-Top with Circular SVG Progress Ring
   ========================================================================== */
.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-elevated);
  color: var(--ink);
  box-shadow: 0 10px 28px -8px rgba(22, 22, 20, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.3s var(--ease-expo), transform 0.35s var(--ease-expo), visibility 0.3s, color 0.2s ease;
  z-index: 900;
  will-change: transform;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  color: var(--vermilion);
}

.back-to-top__ring {
  position: absolute;
  inset: 0;
  width: 46px;
  height: 46px;
  transform: rotate(-90deg);
}

.back-to-top__track {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 2;
}

.back-to-top__fill {
  fill: none;
  stroke: var(--vermilion);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 131.95;
  stroke-dashoffset: 131.95;
}

.back-to-top__arrow {
  position: relative;
  width: 17px;
  height: 17px;
  transition: transform 0.28s var(--ease-expo);
}

.back-to-top:hover .back-to-top__arrow {
  transform: translateY(-2px);
}

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes maskRise {
  from {
    opacity: 0;
    transform: translateY(108%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drawLine {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes stampDrop {
  from {
    opacity: 0;
    transform: scale(1.35) rotate(-14deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(-6deg);
  }
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 880px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-aside {
    flex-direction: row;
    align-items: center;
    padding-left: 0;
    padding-top: 20px;
    border-left: none;
    border-top: 1px solid var(--hairline);
    gap: 28px;
  }

  .hero-stat {
    text-align: left;
  }

  .post-card.post-card--solo {
    grid-template-columns: 1fr;
  }

  .post-card.post-card--solo .post-card__media {
    aspect-ratio: 3 / 2;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--hairline);
  }
}

@media (max-width: 740px) {
  :root {
    --header-h: 64px;
  }

  .container {
    padding: 0 20px;
  }

  .site-nav {
    display: none;
  }

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

  .hero {
    padding: 52px 0 42px;
  }

  .hero-desc {
    font-size: 15.5px;
  }

  .posts-section {
    padding: 32px 0 72px;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .back-to-top {
    right: 18px;
    bottom: 18px;
  }
}

/* Respect user reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__canvas {
    display: none;
  }

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