*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== Dark Theme (Default) ========== */
:root, [data-theme="dark"] {
  --bg: #0c0c18;
  --bg-card: rgba(18, 18, 32, 0.85);
  --bg-card-hover: rgba(24, 24, 42, 0.95);
  --bg-nav: rgba(12, 12, 24, 0.9);
  --bg-input: rgba(18, 18, 32, 0.9);
  --bg-code: #111120;
  --bg-code-header: rgba(0, 0, 0, 0.2);
  --bg-quote: rgba(217, 164, 72, 0.05);
  --primary: #d9a448;
  --primary-rgb: 217, 164, 72;
  --secondary: #5b8def;
  --secondary-rgb: 91, 141, 239;
  --accent: #e07a5f;
  --text: #c0c0d4;
  --text-dim: #6b6b88;
  --text-bright: #ededf5;
  --border: rgba(217, 164, 72, 0.1);
  --border-input: rgba(217, 164, 72, 0.2);
  --glow-primary: 0 2px 16px rgba(217, 164, 72, 0.12);
  --glow-secondary: 0 2px 16px rgba(91, 141, 239, 0.12);
  --grid-line: rgba(217, 164, 72, 0.025);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.3);
  --code-line-highlight: rgba(217, 164, 72, 0.04);
  --tag-bg: rgba(91, 141, 239, 0.08);
  --tag-border: rgba(91, 141, 239, 0.15);
}

/* ========== Light Theme ========== */
[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-nav: rgba(245, 243, 238, 0.92);
  --bg-input: rgba(255, 255, 255, 0.95);
  --bg-code: #f9f7f3;
  --bg-code-header: rgba(0, 0, 0, 0.03);
  --bg-quote: rgba(180, 120, 40, 0.05);
  --primary: #b47828;
  --primary-rgb: 180, 120, 40;
  --secondary: #3d6bc7;
  --secondary-rgb: 61, 107, 199;
  --accent: #c75a42;
  --text: #3a3a4a;
  --text-dim: #7a7a90;
  --text-bright: #1a1a2e;
  --border: rgba(180, 120, 40, 0.12);
  --border-input: rgba(180, 120, 40, 0.2);
  --glow-primary: 0 2px 12px rgba(180, 120, 40, 0.08);
  --glow-secondary: 0 2px 12px rgba(61, 107, 199, 0.08);
  --grid-line: rgba(180, 120, 40, 0.03);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 6px 24px rgba(0, 0, 0, 0.08);
  --code-line-highlight: rgba(180, 120, 40, 0.03);
  --tag-bg: rgba(61, 107, 199, 0.06);
  --tag-border: rgba(61, 107, 199, 0.12);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
  cursor: none;
  animation: bodyFadeIn 0.8s ease;
}

@keyframes bodyFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (hover: none) {
  body { cursor: auto; }
}

::selection {
  background: rgba(var(--primary-rgb), 0.3);
  color: var(--text-bright);
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
  border-radius: 2px;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--secondary), var(--accent));
}

/* ========== Background ========== */

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ========== Custom Cursor ========== */

.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s;
  will-change: transform;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--primary);
  transition: width 0.3s, height 0.3s, background 0.3s, box-shadow 0.3s;
}

.cursor-dot.hover {
  width: 10px;
  height: 10px;
  background: var(--secondary);
  box-shadow: 0 0 15px var(--secondary);
}

.cursor-outline {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--primary);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s, background 0.3s;
}

body.cursor-active .cursor-dot,
body.cursor-active .cursor-outline {
  opacity: 1;
}

body.cursor-hover .cursor-outline {
  width: 48px;
  height: 48px;
  border-color: var(--secondary);
  background: rgba(var(--secondary-rgb), 0.08);
}

@media (hover: none) {
  .cursor-dot, .cursor-outline, .cursor-trail { display: none; }
}

/* ========== Navigation ========== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: navSlideDown 0.6s ease;
}

@keyframes navSlideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.nav:hover {
  border-bottom-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 2px 20px rgba(var(--primary-rgb), 0.1);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-bright);
  letter-spacing: -0.01em;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-logo:hover {
  transform: scale(1.05);
}

.logo-mark {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.3rem;
  transition: text-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-logo:hover .logo-mark {
  text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.5);
}

.logo-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  opacity: 0.6;
  transition: height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-logo:hover .logo-divider {
  height: 20px;
  background: var(--primary);
  opacity: 1;
}

.logo-text {
  color: var(--text-dim);
  font-weight: 500;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-logo:hover .logo-text {
  color: var(--primary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 1.5px;
  background: var(--primary);
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 60%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.06);
}

/* ========== Theme Toggle ========== */

.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.theme-toggle:hover::before {
  opacity: 1;
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(360deg) scale(1.15);
  box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
}

/* ========== Main Content ========== */

#app {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 60px - 100px);
  padding-top: 60px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ========== Hero Section ========== */

.hero {
  padding: 6rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(8rem, 20vw, 18rem);
  font-weight: 700;
  color: var(--text-bright);
  opacity: 0.03;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  letter-spacing: -0.05em;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-eyebrow::before {
  content: '';
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

.hero-title {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 0.95;
  margin-bottom: 2rem;
  letter-spacing: -0.04em;
}

.hero-title-line {
  display: block;
  overflow: hidden;
}

.hero-title-line:nth-child(2) {
  padding-left: 15%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 3rem;
  max-width: 600px;
}

.hero-description .typed-cursor {
  color: var(--primary);
  animation: blink 1s step-end infinite;
  font-weight: 300;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.hero-btn {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.hero-btn-primary {
  background: var(--text-bright);
  color: var(--bg);
}

.hero-btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.4s;
  border-radius: 50px;
}

.hero-btn-primary:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 40px rgba(var(--primary-rgb), 0.4);
}

.hero-btn-primary:hover::before {
  opacity: 1;
}

.hero-btn-primary span {
  position: relative;
  z-index: 1;
}

.hero-btn-secondary {
  background: transparent;
  color: var(--text-bright);
  border: 2px solid var(--border);
}

.hero-btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(var(--primary-rgb), 0.2);
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.hero-stat {
  text-align: left;
}

.hero-stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ========== Search & Filter ========== */

.toolbar {
  padding: 0 0 3rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 3rem;
}

.toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.8rem;
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
  opacity: 0.5;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg-input);
  border: 1.5px solid var(--border-input);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, border-width 0.3s;
}

.search-input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}

.search-input:focus {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.filter-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-right: 0.25rem;
  opacity: 0.6;
}

.filter-tag {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.filter-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tag.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.results-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.25rem 0 0;
  opacity: 0.7;
}

/* ========== Section Header ========== */

.articles-section {
  padding: 2rem 0 5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.section-header .label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.03em;
}

.section-header .count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 400;
}

.section-header .line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ========== Article Grid ========== */

.article-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
}

.article-grid .article-card:nth-child(1) {
  grid-column: 1 / 8;
}

.article-grid .article-card:nth-child(2) {
  grid-column: 8 / 13;
}

.article-grid .article-card:nth-child(3) {
  grid-column: 1 / 5;
}

.article-grid .article-card:nth-child(4) {
  grid-column: 5 / 9;
}

.article-grid .article-card:nth-child(5) {
  grid-column: 9 / 13;
}

.article-grid .article-card:nth-child(6) {
  grid-column: 1 / 7;
}

.article-grid .article-card:nth-child(7) {
  grid-column: 7 / 13;
}

.article-grid .article-card:nth-child(n+8) {
  grid-column: span 4;
}

.article-grid-empty {
  grid-column: 1 / -1;
}

.article-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-dim);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-grid-empty:hover {
  color: var(--text);
}

.article-grid-empty .empty-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.3;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-grid-empty:hover .empty-icon {
  opacity: 0.6;
  transform: scale(1.1);
}

.article-grid-empty p {
  font-size: 0.85rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-grid-empty:hover p {
  color: var(--primary);
}

/* ========== Article Card ========== */

.article-card {
  background: transparent;
  border: none;
  border-top: 2px solid var(--border);
  padding: 2rem 0;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card::after {
  display: none;
}

.article-card:hover {
  transform: translateY(-8px);
}

.article-card:hover::before {
  width: 100%;
}

.article-card:hover .card-title {
  color: var(--primary);
  transform: translateX(8px);
}

.article-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}

.article-meta .date {
  color: var(--text-dim);
}

.article-meta .read-time {
  color: var(--text-dim);
  opacity: 0.7;
}

.article-card .card-title {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.3;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.02em;
}

.article-card .card-excerpt {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1.5px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  transition: all 0.3s;
  cursor: pointer;
}

.tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  border-width: 2px;
}

.card-arrow {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 600;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========== Article Layout ========== */

.article-layout {
  display: flex;
  position: relative;
  min-height: calc(100vh - 60px);
  max-width: 1200px;
  margin: 0 auto;
}

/* ========== TOC Sidebar ========== */

.toc-sidebar {
  position: sticky;
  top: 80px;
  width: 260px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  flex-shrink: 0;
  margin: 2rem 0 2rem 2rem;
  padding: 0;
}

.toc-sidebar-inner {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), rgba(var(--secondary-rgb), 0.03));
  border-bottom: 1px solid var(--border);
}

.toc-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.toc-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 400px;
}

.toc-nav::-webkit-scrollbar { width: 4px; }
.toc-nav::-webkit-scrollbar-track { background: transparent; }
.toc-nav::-webkit-scrollbar-thumb { 
  background: rgba(var(--primary-rgb), 0.15); 
  border-radius: 2px;
  transition: background 0.3s;
}
.toc-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--primary-rgb), 0.3);
}

.toc-item {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.55rem 1.25rem;
  border-left: 2px solid transparent;
  transition: all 0.25s ease;
  line-height: 1.5;
  display: block;
  position: relative;
}

.toc-item:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.04);
  border-left-color: rgba(var(--primary-rgb), 0.3);
  padding-left: 1.4rem;
}

.toc-item-h3 {
  padding-left: 2rem;
  font-size: 0.76rem;
  opacity: 0.85;
}

.toc-item-h3:hover {
  padding-left: 2.15rem;
}

.toc-item-active {
  color: var(--primary);
  font-weight: 500;
  border-left-color: var(--primary);
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.08), transparent);
}

.toc-item-active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.6);
}

.toc-item-active:hover {
  padding-left: 1.25rem;
}

.toc-item-h3.toc-item-active:hover {
  padding-left: 2rem;
}

.toc-empty {
  padding: 2rem 1.25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  opacity: 0.5;
}

.toc-progress-wrap {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(var(--primary-rgb), 0.02);
}

.toc-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.toc-progress-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.toc-progress-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
}

.toc-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.toc-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width 0.3s ease;
  position: relative;
  box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
}

/* ========== Article Detail ========== */

.article-view {
  padding: 2rem 0 5rem;
  max-width: 720px;
  flex: 1;
  min-width: 0;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-view::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 0;
  background: linear-gradient(180deg, var(--primary), transparent);
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-view:hover::before {
  height: 150px;
}

.back-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  margin-bottom: 2rem;
  position: relative;
}

.back-link::before {
  content: '←';
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-right: 0.3rem;
}

.back-link:hover {
  color: var(--primary);
  transform: translateX(-8px);
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
}

.back-link:hover::before {
  transform: translateX(-5px) scale(1.2);
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-header:hover::after {
  width: 100%;
  box-shadow: 0 0 10px var(--primary);
}

.article-header .meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-header .meta .date {
  color: var(--primary);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.article-header:hover .meta .date {
  text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.5);
  transform: scale(1.05);
  display: inline-block;
}

.article-header h1 {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.35;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.article-header h1:hover {
  color: var(--primary);
  text-shadow: 0 0 40px rgba(var(--primary-rgb), 0.3);
  transform: translateX(5px);
}

.article-header .tags {
  gap: 0.4rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-header .tag {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-header .tag:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 6px 20px rgba(var(--secondary-rgb), 0.3);
}

/* ========== Article Body ========== */

.article-body {
  font-size: 1.02rem;
  line-height: 1.88;
  color: var(--text);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-body h2 {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 2.75rem 0 1.1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
  position: relative;
  transition: all 0.3s;
}

.article-body h2:hover {
  padding-left: 1.8rem;
  border-left-color: var(--secondary);
  color: var(--primary);
  text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
}

.article-body h2::before {
  content: '//';
  position: absolute;
  left: -2rem;
  color: var(--primary);
  opacity: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.article-body h2:hover::before {
  opacity: 0.5;
  left: -1.8rem;
}

.article-body h3 {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 2rem 0 0.85rem;
  line-height: 1.4;
  position: relative;
  padding-left: 0.8rem;
  transition: all 0.3s;
}

.article-body h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--secondary);
  transition: height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-body h3:hover {
  padding-left: 1.2rem;
  color: var(--secondary);
  text-shadow: 0 0 15px rgba(var(--secondary-rgb), 0.3);
}

.article-body h3:hover::before {
  height: 80%;
}

.article-body h4 {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 1.5rem 0 0.75rem;
  transition: all 0.3s;
}

.article-body h4:hover {
  color: var(--accent);
  transform: translateX(8px);
  text-shadow: 0 0 15px rgba(224, 122, 95, 0.3);
}

.article-body p {
  margin-bottom: 1.25rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-body p:hover {
  color: var(--text-bright);
  transform: translateX(3px);
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.2);
}

.article-body strong {
  color: var(--text-bright);
  font-weight: 600;
  position: relative;
  transition: all 0.3s;
}

.article-body strong:hover {
  color: var(--primary);
  text-shadow: 0 0 15px rgba(var(--primary-rgb), 0.4);
  transform: scale(1.02);
  display: inline-block;
}

.article-body em {
  font-style: italic;
  color: var(--secondary);
  transition: all 0.3s;
}

.article-body em:hover {
  color: var(--primary);
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
  transform: skewX(-5deg);
  display: inline-block;
}

.article-body a {
  color: var(--secondary);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--secondary-rgb), 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.article-body a::after {
  content: '↗';
  position: absolute;
  right: -12px;
  top: 0;
  font-size: 0.7em;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: all 0.3s;
}

.article-body a:hover {
  border-bottom-color: var(--secondary);
  transform: translateX(4px);
  text-shadow: 0 0 10px rgba(var(--secondary-rgb), 0.3);
}

.article-body a:hover::after {
  opacity: 1;
  transform: translate(0, 0);
}

.article-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 2.5rem 0;
  position: relative;
}

.article-body hr::after {
  content: '◆';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 1rem;
  color: var(--primary);
  font-size: 0.6rem;
  opacity: 0.5;
}

/* Inline code */
.article-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
  font-weight: 500;
  background: var(--bg-code);
  color: var(--accent);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.3s;
}

.article-body code:hover {
  background: rgba(var(--accent-rgb, 224, 122, 95), 0.15);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(224, 122, 95, 0.2);
}

/* Code blocks */
.article-body pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 1.5rem 0;
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-body pre:hover {
  border-color: rgba(var(--primary-rgb), 0.4);
  box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.1);
  transform: translateY(-2px);
}

.article-body pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.article-body pre:hover::before {
  opacity: 0.5;
}

.article-body pre .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1.1rem;
  background: var(--bg-code-header);
  border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim);
}

.article-body pre .code-header .code-dots {
  display: flex;
  gap: 5px;
}

.article-body pre .code-header .code-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.7;
}

.article-body pre .code-header .code-dots span:nth-child(1) { background: #ff5f57; }
.article-body pre .code-header .code-dots span:nth-child(2) { background: #febc2e; }
.article-body pre .code-header .code-dots span:nth-child(3) { background: #28c840; }

.article-body pre .code-lang {
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-body pre .code-copy-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  border-radius: 5px;
  background: rgba(var(--primary-rgb), 0.05);
  color: var(--text-dim);
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  line-height: 1;
}

.article-body pre .code-copy-btn:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  transform: translateY(-1px);
}

.article-body pre .code-copy-btn.copied {
  border-color: rgba(var(--secondary-rgb), 0.3);
  background: rgba(var(--secondary-rgb), 0.1);
  color: var(--secondary);
}

.article-body pre .code-copy-btn svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
  transition: opacity 0.25s;
}

.article-body pre .code-copy-btn:hover svg {
  opacity: 1;
}

.article-body pre code {
  display: block;
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.75;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 0;
}

/* Blockquote */
.article-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.85rem 1.35rem;
  margin: 1.5rem 0;
  background: var(--bg-quote);
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.8;
  position: relative;
  transition: all 0.3s;
}

.article-body blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 10px;
  font-size: 3rem;
  color: var(--primary);
  opacity: 0.2;
  font-family: Georgia, serif;
  line-height: 1;
}

.article-body blockquote:hover {
  border-left-width: 6px;
  padding-left: 1.8rem;
  background: rgba(var(--primary-rgb), 0.1);
  box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.1);
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Lists */
.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.85;
  position: relative;
  transition: all 0.3s;
}

.article-body li:hover {
  transform: translateX(8px);
  color: var(--text-bright);
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.2);
}

.article-body li::marker {
  color: var(--primary);
  font-weight: 600;
  transition: all 0.3s;
}

.article-body li:hover::marker {
  color: var(--secondary);
  font-size: 1.3em;
  text-shadow: 0 0 10px rgba(var(--secondary-rgb), 0.5);
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.article-body thead {
  background: var(--bg-code);
}

.article-body th {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  text-align: left;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.article-body td {
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.article-body tbody tr:last-child td {
  border-bottom: none;
}

.article-body tbody tr {
  transition: all 0.3s;
}

.article-body tbody tr:hover {
  background: var(--code-line-highlight);
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.1);
}

/* ========== About Page ========== */

.about-view {
  padding: 3.5rem 0 5rem;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-view::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 0;
  background: linear-gradient(180deg, var(--primary), transparent);
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-view:hover::before {
  height: 150px;
}

.about-hero {
  text-align: center;
  padding: 3rem 0 3.5rem;
}

.about-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-rgb), 0.06);
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  position: relative;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-avatar::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--secondary);
  border-right-color: var(--accent);
  animation: avatarSpin 4s linear infinite;
}

@keyframes avatarSpin {
  to { transform: rotate(360deg); }
}

.about-avatar:hover {
  transform: scale(1.15) rotate(10deg);
  box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.4);
}

.about-hero h1 {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.about-hero h1:hover {
  color: var(--primary);
  text-shadow: 0 0 30px rgba(var(--primary-rgb), 0.4);
  transform: scale(1.05);
}

.about-hero .about-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  transition: all 0.3s;
}

.about-hero:hover .about-sub {
  color: var(--secondary);
}

.about-hero .prompt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: all 0.3s;
}

.about-hero .prompt:hover {
  color: var(--text);
}

.about-hero .prompt .path {
  color: var(--secondary);
  transition: all 0.3s;
}

.about-hero .prompt:hover .path {
  color: var(--primary);
}

.about-hero .prompt .cmd {
  color: var(--primary);
  transition: all 0.3s;
}

.about-hero .prompt:hover .cmd {
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
}

.about-section {
  margin-bottom: 2.5rem;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-section:hover {
  transform: translateX(8px);
  box-shadow: -5px 0 20px rgba(var(--primary-rgb), 0.1);
}

.about-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  transition: all 0.3s;
}

.about-section h2::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  background: var(--primary);
  border-radius: 50%;
  transition: all 0.3s;
}

.about-section h2:hover::before {
  width: 6px;
  height: 6px;
}

.about-section h2:hover {
  color: var(--primary);
  transform: translateX(15px);
  text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
}

.about-section h2:hover .h2-marker {
  color: var(--secondary);
  transform: scale(1.3) rotate(10deg);
  text-shadow: 0 0 10px rgba(var(--secondary-rgb), 0.5);
}

.about-section h2 .h2-marker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--primary);
  opacity: 0.6;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.about-section p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 0.85rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-section p:hover {
  color: var(--text-bright);
  transform: translateX(5px);
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.2);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.65rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tech-grid:hover {
  gap: 0.8rem;
}

.tech-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'IBM Plex Mono', monospace;
  position: relative;
  overflow: hidden;
}

.tech-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.1), transparent);
  transition: left 0.5s;
}

.tech-item:hover::before {
  left: 100%;
}

.tech-item:hover {
  border-color: rgba(var(--primary-rgb), 0.25);
  transform: translateY(-6px) rotate(3deg);
  box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.15);
}

.tech-item .tech-icon {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--primary);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.tech-item:hover .tech-icon {
  transform: scale(1.3) rotate(5deg);
  color: var(--secondary);
  text-shadow: 0 0 15px rgba(var(--secondary-rgb), 0.5);
}

.tech-item .tech-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tech-item:hover .tech-name {
  color: var(--text-bright);
}

.contact-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.35rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.contact-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  background-size: 200% 100%;
  animation: contactGradient 3s ease infinite;
}

@keyframes contactGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.contact-box:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.08);
}

.contact-box .terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.contact-box .terminal-dots {
  display: flex;
  gap: 5px;
}

.contact-box .terminal-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.7;
}

.contact-box .terminal-dots span:nth-child(1) { background: #ff5f57; }
.contact-box .terminal-dots span:nth-child(2) { background: #febc2e; }
.contact-box .terminal-dots span:nth-child(3) { background: #28c840; }

.contact-box .terminal-title {
  color: var(--text-dim);
  font-size: 0.7rem;
  margin-left: 0.4rem;
  opacity: 0.6;
}

.contact-line {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-dim);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  padding-left: 0;
}

.contact-line:hover {
  color: var(--text-bright);
  padding-left: 0.8rem;
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.2);
}

.contact-line .prompt-sym {
  color: var(--primary);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.contact-line:hover .prompt-sym {
  color: var(--secondary);
  transform: scale(1.3);
  display: inline-block;
  text-shadow: 0 0 10px rgba(var(--secondary-rgb), 0.5);
}

.contact-line a {
  color: var(--secondary);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  display: inline-block;
}

.contact-line a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s;
}

.contact-line a:hover {
  color: var(--primary);
  transform: translateX(5px);
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
}

.contact-line a:hover::after {
  width: 100%;
}

.contact-cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--primary);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
  opacity: 0.7;
}

/* ========== Category Nav ========== */

.category-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.category-nav .cat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim);
  opacity: 0.5;
  margin-right: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.category-pill {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1.5px solid var(--border);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.category-pill:hover {
  border-color: var(--primary);
  border-width: 2px;
  color: var(--primary);
}

.category-pill.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
  border-width: 2px;
}

.category-pill .cat-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  opacity: 0.6;
}

.category-pill.active .cat-count {
  opacity: 0.8;
}

.article-card .card-category {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--primary);
  opacity: 0.75;
  letter-spacing: 0.02em;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-card:hover .card-category {
  opacity: 1;
  text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
  transform: translateX(3px);
}

/* ========== Archive / Timeline ========== */

.archive-view {
  padding: 3.5rem 0 5rem;
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.archive-view::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 0;
  background: linear-gradient(180deg, var(--primary), transparent);
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.archive-view:hover::before {
  height: 150px;
}

.archive-header {
  text-align: center;
  padding: 2rem 0 3rem;
}

.archive-header h1 {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.archive-header h1::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.archive-header:hover h1::after {
  width: 100%;
  box-shadow: 0 0 10px var(--primary);
}

.archive-header .archive-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: all 0.3s;
}

.archive-header:hover .archive-sub {
  color: var(--secondary);
}

.archive-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.archive-stat {
  text-align: center;
}

.archive-stat .stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  position: relative;
  display: inline-block;
}

.archive-stat .stat-num::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.archive-stat:hover .stat-num::after {
  width: 100%;
}

.archive-stat .stat-num {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.archive-stat:hover .stat-num {
  transform: scale(1.1);
}

.archive-stat .stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.3s;
}

.archive-stat:hover .stat-label {
  color: var(--primary);
}

.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-year {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-year::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0.55rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--primary);
  z-index: 1;
}

.timeline-year-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.timeline-year-label:hover {
  text-shadow: 0 0 30px rgba(var(--primary-rgb), 0.4);
  transform: translateX(8px);
}

.timeline-month {
  margin-bottom: 1.5rem;
}

.timeline-month-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  opacity: 0.7;
  transition: all 0.3s;
}

.timeline-month-label:hover {
  opacity: 1;
  color: var(--secondary);
}

.timeline-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: baseline;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-item:hover::before {
  transform: translateY(-50%) scale(1);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-item:hover {
  padding-left: 1rem;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.05), transparent);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.1);
}

.timeline-item:hover .tl-title {
  color: var(--primary);
  text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.4);
  transform: translateX(5px);
}

.timeline-item .tl-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 3.2rem;
  opacity: 0.6;
  transition: all 0.3s;
}

.timeline-item:hover .tl-date {
  opacity: 1;
  color: var(--primary);
}

.timeline-item .tl-title {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-bright);
  transition: all 0.3s;
  line-height: 1.5;
  display: inline-block;
}

.timeline-item .tl-tags {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.timeline-item .tl-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--secondary);
  background: linear-gradient(135deg, rgba(var(--secondary-rgb), 0.06), rgba(var(--primary-rgb), 0.04));
  border: 1px solid rgba(var(--secondary-rgb), 0.15);
  border-left: 2px solid var(--secondary);
  padding: 0.2rem 0.6rem 0.2rem 0.5rem;
  border-radius: 3px 6px 6px 3px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.timeline-item .tl-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--secondary);
  opacity: 0;
  transition: opacity 0.3s;
}

.timeline-item .tl-tag:hover {
  transform: translateY(-3px) rotate(-2deg);
  border-color: rgba(var(--secondary-rgb), 0.4);
  box-shadow: 0 6px 20px rgba(var(--secondary-rgb), 0.25);
  color: var(--text-bright);
}

.timeline-item .tl-tag:hover::before {
  opacity: 1;
}

.timeline-item:nth-child(even) .tl-tag {
  transform: rotate(0.5deg);
}

.timeline-item:nth-child(odd) .tl-tag {
  transform: rotate(-0.3deg);
}

.timeline-item:nth-child(even) .tl-tag:hover {
  transform: translateY(-2px) rotate(-0.5deg);
}

.timeline-item:nth-child(odd) .tl-tag:hover {
  transform: translateY(-2px) rotate(0.3deg);
}

/* ========== Fade-in ========== */

.fade-in {
  opacity: 0;
  transform: translateY(20px) rotate(1deg);
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.04s; }
.fade-in:nth-child(2) { animation-delay: 0.08s; }
.fade-in:nth-child(3) { animation-delay: 0.12s; }
.fade-in:nth-child(4) { animation-delay: 0.16s; }
.fade-in:nth-child(5) { animation-delay: 0.2s; }
.fade-in:nth-child(6) { animation-delay: 0.24s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

/* ========== Footer ========== */

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  transition: border-top-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: footerFadeIn 1s ease 0.5s both;
}

@keyframes footerFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.footer:hover {
  border-top-color: rgba(var(--primary-rgb), 0.3);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem;
}

.footer-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin-bottom: 1.5rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
  transition: color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-text::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.4s;
}

.footer-text:hover::after {
  width: 100%;
}

.footer-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.5;
  transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-sub:hover {
  opacity: 1;
  color: var(--secondary);
}

/* ========== Responsive ========== */

@media (max-width: 900px) {
  .article-layout {
    flex-direction: column;
  }
  .toc-sidebar {
    position: relative;
    top: 0;
    width: 100%;
    max-height: none;
    margin: 1rem 0 0;
    order: -1;
  }
  .toc-sidebar-inner {
    max-height: 300px;
  }
  .toc-nav {
    max-height: 200px;
  }
  .toc-sidebar .toc-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
  }
  .toc-sidebar .toc-item {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(var(--primary-rgb), 0.03);
    font-size: 0.75rem;
  }
  .toc-sidebar .toc-item:hover {
    padding-left: 0.8rem;
    background: rgba(var(--primary-rgb), 0.06);
    border-bottom-color: rgba(var(--primary-rgb), 0.3);
  }
  .toc-sidebar .toc-item-h3 {
    padding-left: 0.8rem;
  }
  .toc-sidebar .toc-item-h3:hover {
    padding-left: 0.8rem;
  }
  .toc-sidebar .toc-item-active {
    background: rgba(var(--primary-rgb), 0.08);
    border-bottom-color: var(--primary);
  }
  .toc-sidebar .toc-item-active::before {
    display: none;
  }
  .toc-sidebar .toc-item-active:hover {
    padding-left: 0.8rem;
  }
  .toc-sidebar .toc-item-h3.toc-item-active:hover {
    padding-left: 0.8rem;
  }
  .article-grid {
    grid-template-columns: 1fr;
  }
  .article-grid .article-card {
    grid-column: 1 / -1 !important;
  }
  .hero-stats {
    gap: 2rem;
  }
}

@keyframes tocOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .nav-inner { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  .hero { padding: 4rem 0 3rem; }
  .hero-title { font-size: clamp(2.5rem, 12vw, 4rem); }
  .hero-title-line:nth-child(2) { padding-left: 0; }
  .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
  .hero-stat { flex: 1; min-width: 120px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-btn { justify-content: center; }
  .article-grid { grid-template-columns: 1fr; }
  .article-grid .article-card { grid-column: 1 / -1 !important; }
  .article-view, .about-view, .archive-view { padding: 2.5rem 0 4rem; }
  .tech-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
  .footer-content { flex-direction: column; gap: 0.4rem; text-align: center; }
  .search-box { max-width: 100%; }
  .archive-stats { gap: 1.5rem; }
  .timeline { padding-left: 2rem; }
  .toc-sidebar { margin: 0.5rem 0 0; }
  .toolbar-inner { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .section-header { flex-wrap: wrap; gap: 0.75rem; }
  .section-header .label { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.5rem; }
  .hero-description { font-size: 1rem; }
  .article-card .card-title { font-size: 1.2rem; }
  .nav-logo { font-size: 1rem; }
  .article-body pre code { font-size: 0.76rem; padding: 0.9rem; }
  .hero-bg-text { display: none; }
}

/* Focused journal layout */
body { cursor: auto; }
:root, [data-theme="dark"] { --bg: #090d12; --bg-nav: rgba(9,13,18,.88); --text-dim: #929bab; --primary: #d9b778; --primary-rgb: 217,183,120; --border: rgba(157,172,190,.17); }
[data-theme="light"] { --bg: #f5f3ee; --bg-nav: rgba(245,243,238,.9); --text-dim: #626777; --primary: #90601d; --primary-rgb: 144,96,29; --border: rgba(65,75,90,.18); }
.grid-bg { opacity: .35; }
.noise-overlay { opacity: .025; }
.nav-inner, .container, .footer-inner { max-width: 1200px; }
a { text-underline-offset: 5px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--primary); outline-offset: 5px; }
.nav-link { font-size: .8rem; }
.landing-hero { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; min-height: 540px; padding: 64px 0 48px; }
.landing-copy { z-index: 2; }
.eyebrow { font: 10px 'IBM Plex Mono', monospace; letter-spacing: .15em; color: var(--text-dim); }
.status-dot { display: inline-block; width: 6px; height: 6px; background: var(--primary); border-radius: 50%; margin-right: 8px; box-shadow: 0 0 14px rgba(var(--primary-rgb), .6); }
.landing-copy h1 { font-size: clamp(44px, 5.5vw, 72px); line-height: 1.28; letter-spacing: -.055em; font-weight: 500; color: var(--text-bright); margin: 28px 0 22px; }
.landing-copy h1 span { color: var(--primary); }
.landing-description { font-size: 14px; color: var(--text-dim); letter-spacing: .07em; }
.explore-button { display: inline-flex; align-items: center; gap: 42px; margin-top: 32px; padding: 12px 21px; background: var(--text-bright); color: var(--bg); border-radius: 4px; text-decoration: none; font-size: 13px; transition: background .2s, transform .2s; }
.explore-button:hover { background: var(--primary); transform: translateY(-2px); }
.orbit-scene { position: relative; height: 410px; display: grid; place-items: center; isolation: isolate; }
.orbit-halo { position: absolute; inset: 0; background: radial-gradient(ellipse, rgba(var(--primary-rgb),.13), rgba(91,141,239,.05) 45%, transparent 70%); }
.orbit-core { width: 172px; height: 172px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(var(--primary-rgb),.35); border-radius: 50%; font-size: 70px; font-weight: 300; color: var(--primary); background: radial-gradient(circle at 30% 20%, rgba(var(--primary-rgb),.12), var(--bg) 80%); box-shadow: inset -12px -12px 35px rgba(0,0,0,.15), 0 0 60px rgba(var(--primary-rgb),.07); }
.orbit-core span { font: 6px 'IBM Plex Mono', monospace; letter-spacing: .18em; margin-top: 5px; }
.orbit-ring { position: absolute; width: 360px; height: 360px; border: 1px solid rgba(var(--primary-rgb), .35); border-radius: 50%; transform: rotate(-32deg) scaleY(.48); }
.orbit-ring::after { content: ''; position: absolute; top: 14%; left: 14%; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 18px var(--primary); }
.ring-one { animation: orbit-drift 30s linear infinite; }
.ring-two { width: 320px; height: 320px; transform: rotate(48deg) scaleY(.58); border-color: rgba(91,141,239,.4); }
.ring-two::after { background: var(--secondary); box-shadow: 0 0 18px var(--secondary); }
.ring-three { width: 390px; height: 390px; transform: rotate(-12deg); border-style: dashed; border-color: rgba(var(--primary-rgb),.12); animation: orbit-outline 100s linear infinite; }
.ring-three::after { display: none; }
.orbit-coordinate { position: absolute; bottom: 0; font: 9px 'IBM Plex Mono', monospace; color: var(--text-dim); letter-spacing: .12em; }
@keyframes orbit-drift { to { transform: rotate(328deg) scaleY(.48); } }
@keyframes orbit-outline { to { transform: rotate(348deg); } }
.topic-dock { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.topic-link { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 23px 16px; text-decoration: none; font-size: 12px; transition: background .2s, color .2s; }
.topic-dock .topic-link + .topic-link { border-left: 1px solid var(--border); }
.topic-code { font: 10px 'IBM Plex Mono', monospace; color: var(--primary); }
.topic-count { margin-left: auto; font: 10px 'IBM Plex Mono', monospace; color: var(--text-dim); }
.topic-link:hover, .topic-link.active { color: var(--primary); background: rgba(var(--primary-rgb), .07); }
.latest-section { padding: 38px 0 48px; }
.minimal-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.minimal-heading h2 { font-size: 14px; font-weight: 500; color: var(--text-bright); }
.minimal-heading h2 span { font: 10px 'IBM Plex Mono', monospace; color: var(--text-dim); margin-right: 14px; }
.minimal-heading a { color: var(--text-dim); font-size: 12px; text-decoration: none; }
.reading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.reading-card { padding: 25px; border: 1px solid var(--border); border-radius: 8px; background: linear-gradient(120deg, rgba(var(--primary-rgb),.035), transparent); transition: border-color .2s, background .2s; }
.reading-card:hover { border-color: rgba(var(--primary-rgb),.5); background: rgba(var(--primary-rgb),.04); }
.reading-meta { display: flex; justify-content: space-between; align-items: center; font: 10px 'IBM Plex Mono', monospace; color: var(--text-dim); }
.reading-meta a { color: var(--primary); text-decoration: none; }
.reading-title { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; color: var(--text-bright); text-decoration: none; margin: 14px 0 10px; }
.reading-title h2 { font-size: 19px; font-weight: 500; line-height: 1.6; }
.reading-title:hover { color: var(--primary); }
.reading-title > span { color: var(--primary); }
.reading-card p { font-size: 12px; line-height: 1.9; color: var(--text-dim); }
.reading-date { font: 10px 'IBM Plex Mono', monospace; margin-top: 20px; color: var(--text-dim); }
.collection-page { padding-top: 45px; padding-bottom: 70px; }
.collection-header { margin: 25px 0 30px; }
.collection-header h1 { font-size: 44px; color: var(--text-bright); font-weight: 500; margin: 12px 0; }
.collection-header > p:last-child { color: var(--text-dim); font-size: 14px; }
.collection-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.collection-categories .topic-link { border: 1px solid var(--border); border-radius: 5px; padding: 10px 14px; }
.collection-toolbar { display: flex; align-items: center; gap: 15px; margin: 28px 0; color: var(--text-dim); font-size: 12px; }
.collection-toolbar input { background: var(--bg-input); border: 1px solid var(--border); padding: 12px 15px; border-radius: 5px; color: var(--text-bright); width: min(360px, 50%); font: inherit; }
#results-count { margin-left: auto; white-space: nowrap; }
.empty-results { grid-column: 1 / -1; padding: 60px 0; color: var(--text-dim); text-align: center; }
.footer-line { display: none; }
.footer-inner { padding-top: 20px; padding-bottom: 20px; }
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1.1fr 1fr; min-height: 470px; }
  .orbit-scene { transform: scale(.8); }
  .topic-dock { grid-template-columns: repeat(3, 1fr); }
  .topic-dock .topic-link { border: 0; }
  .topic-dock .topic-link + .topic-link { border-left: 0; }
}
@media (max-width: 600px) {
  .nav-links { gap: 14px; }
  .nav-right { gap: 12px; }
  .nav-link { font-size: 12px; }
  .landing-hero { display: flex; flex-direction: column; align-items: stretch; padding-top: 42px; padding-bottom: 18px; }
  .landing-copy h1 { font-size: 48px; }
  .eyebrow { font-size: 8px; }
  .orbit-scene { height: 290px; transform: scale(.72); margin: -10px -25px -20px; }
  .topic-dock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-link { padding: 15px 10px; }
  .reading-grid { grid-template-columns: 1fr; }
  .reading-card { padding: 20px; }
  .collection-toolbar { flex-wrap: wrap; gap: 10px; }
  .collection-toolbar input { flex: 1; min-width: 140px; }
  .collection-header h1 { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Tag index */
.tag-index { padding-top: 64px; padding-bottom: 70px; }
.tag-index-header { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 20px 0 56px; }
.tag-index-header h1 { margin: 24px 0 16px; color: var(--text-bright); font-size: clamp(30px, 4vw, 48px); font-weight: 500; letter-spacing: -.045em; line-height: 1.4; }
.tag-index-header h1 span { color: var(--primary); }
.tag-index-description { color: var(--text-dim); font-size: 14px; }
.tag-index-mark { position: relative; flex: 0 0 180px; text-align: center; color: var(--primary); font: 140px/1 'Space Grotesk', sans-serif; font-weight: 300; transform: rotate(-10deg); opacity: .65; }
.tag-index-mark::before { content: ''; position: absolute; inset: -20px; border: 1px solid var(--border); border-radius: 50%; transform: scaleY(.65) rotate(-25deg); }
.tag-index-mark span { display: block; font: 8px/2 'IBM Plex Mono', monospace; letter-spacing: .16em; margin-top: 12px; }
.tag-index-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); padding: 0 0 18px; }
.tag-index-toolbar h2 { font-size: 14px; font-weight: 500; color: var(--text-bright); }
.tag-index-toolbar h2 span { margin-left: 12px; color: var(--primary); font: 11px 'IBM Plex Mono', monospace; }
.tag-index-toolbar p { color: var(--text-dim); font-size: 11px; }
.tag-index-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
.tag-index-item { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 25px 8px; border-bottom: 1px solid var(--border); color: var(--text-bright); text-decoration: none; transition: background .2s, border-color .2s; }
.tag-index-number { color: var(--text-dim); font: 9px 'IBM Plex Mono', monospace; }
.tag-index-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.tag-index-name > span { color: var(--primary); opacity: .65; margin-right: 7px; font-family: 'IBM Plex Mono', monospace; }
.tag-index-count { margin-left: auto; white-space: nowrap; font-size: 10px; color: var(--text-dim); }
.tag-index-arrow { color: var(--text-dim); font-size: 15px; transition: color .2s, transform .2s; }
.tag-index-item:hover { background: rgba(var(--primary-rgb), .045); border-bottom-color: var(--primary); }
.tag-index-item:hover .tag-index-name, .tag-index-item:hover .tag-index-arrow { color: var(--primary); }
.tag-index-item:hover .tag-index-arrow { transform: translate(2px, -2px); }
.tag-index-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; font-size: 11px; color: var(--text-dim); }
.tag-index-footer a { color: var(--primary); text-decoration: none; }
.selected-tag-title { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .tag-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tag-index-mark { flex-basis: 130px; font-size: 110px; }
}
@media (max-width: 600px) {
  .tag-index { padding-top: 36px; padding-bottom: 45px; }
  .tag-index-header { padding-bottom: 36px; }
  .tag-index-header h1 span { display: block; }
  .tag-index-description { max-width: 240px; line-height: 1.9; font-size: 12px; }
  .tag-index-mark { display: none; }
  .tag-index-grid { column-gap: 16px; }
  .tag-index-item { padding: 20px 0; gap: 6px; }
  .tag-index-number { display: none; }
  .tag-index-name { font-size: 12px; }
  .tag-index-arrow { font-size: 12px; }
}
@media (max-width: 360px) { .tag-index-grid { grid-template-columns: 1fr; } }
