:root,
[data-theme="dark"] {
  --bg: #080C14;
  --surface: rgba(16, 23, 38, 0.74);
  --surface-solid: #101726;
  --surface-elevated: rgba(22, 32, 52, 0.88);
  --text: #F1F5F9;
  --muted: #8FA0B8;
  --hairline: rgba(148, 176, 218, 0.14);
  --hairline-strong: rgba(148, 176, 218, 0.28);
  --accent: #38BDF8;
  --accent-hover: #7DD3FC;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --gold-grad: linear-gradient(135deg, #38BDF8 0%, #60A5FA 55%, #F5B963 100%);
  --ink: #F5B963;
  --ink-soft: rgba(245, 185, 99, 0.14);
  --grad-btn-ink: #080C14;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.30), 0 16px 36px -14px rgba(0, 0, 0, 0.65);
  --shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.42), 0 24px 48px -14px rgba(8, 12, 20, 0.82), 0 0 28px rgba(56, 189, 248, 0.18);
  --shadow-pill: 0 12px 36px rgba(0, 0, 0, 0.58);
  --blob-1: rgba(37, 99, 235, 0.28);
  --blob-2: rgba(56, 189, 248, 0.18);
  --blob-3: rgba(245, 158, 11, 0.14);
  --header-glass: rgba(8, 12, 20, 0.78);
  --code-bg: #0C121E;
  --code-text: #E2E8F0;

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-italic: Georgia, "Times New Roman", "Noto Serif SC", serif;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  --max-w: 1200px;
  --radius-card: 20px;
  --radius-panel: 18px;
  --radius-input: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F6F8FC;
  --surface: rgba(255, 255, 255, 0.80);
  --surface-solid: #FFFFFF;
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --text: #0F172A;
  --muted: #5B6B82;
  --hairline: rgba(15, 23, 42, 0.10);
  --hairline-strong: rgba(15, 23, 42, 0.22);
  --accent: #1D4ED8;
  --accent-hover: #1E40AF;
  --accent-soft: rgba(29, 78, 216, 0.10);
  --gold-grad: linear-gradient(135deg, #2563EB 0%, #38BDF8 55%, #D97706 100%);
  --ink: #C2781A;
  --ink-soft: rgba(194, 120, 26, 0.10);
  --grad-btn-ink: #FFFFFF;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.14);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.06), 0 22px 44px -14px rgba(29, 78, 216, 0.22);
  --shadow-pill: 0 8px 30px rgba(15, 23, 42, 0.12);
  --blob-1: rgba(191, 219, 254, 0.65);
  --blob-2: rgba(224, 242, 254, 0.60);
  --blob-3: rgba(254, 243, 199, 0.55);
  --header-glass: rgba(246, 248, 252, 0.82);
  color-scheme: light;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.72;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* Ambient gradient blobs & ~4% grain */
.ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.ambient-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
}

.blob-1 {
  width: min(56vw, 680px);
  height: min(56vw, 680px);
  top: -14%;
  left: -8%;
  background: var(--blob-1);
}

.blob-2 {
  width: min(50vw, 620px);
  height: min(50vw, 620px);
  top: 26%;
  right: -12%;
  background: var(--blob-2);
}

.blob-3 {
  width: min(52vw, 640px);
  height: min(52vw, 640px);
  bottom: -16%;
  left: 18%;
  background: var(--blob-3);
}

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

a {
  color: inherit;
  text-decoration-color: var(--hairline-strong);
  text-underline-offset: 0.24em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  background: var(--gold-grad);
  color: var(--grad-btn-ink);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3.2vw, 2rem);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-caps: all-small-caps;
  color: var(--muted);
}

.italic-sub {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
}

/* Reading progress top hairline (<progress> element, zero inline style) */
progress.reading-progress {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 250;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
}

progress.reading-progress::-webkit-progress-bar {
  background: transparent;
}

progress.reading-progress::-webkit-progress-value {
  background: var(--gold-grad);
  transition: width 0.08s linear;
}

progress.reading-progress::-moz-progress-bar {
  background: var(--gold-grad);
}

/* Header: transparent over hero, morphs into floating glass pill after 40px */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  transition: padding 0.35s var(--ease);
}

.header-bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.75rem clamp(1rem, 3.2vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 0;
  border: 1px solid transparent;
  transition:
    margin 0.35s var(--ease),
    max-width 0.35s var(--ease),
    padding 0.35s var(--ease),
    border-radius 0.35s var(--ease),
    background-color 0.35s var(--ease),
    border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    color 0.25s ease;
}

.has-hero-header .site-header:not(.is-scrolled) .header-bar {
  background: transparent;
  color: #FFFFFF;
}

.has-hero-header .site-header:not(.is-scrolled) .brand-sub,
.has-hero-header .site-header:not(.is-scrolled) .site-nav a {
  color: rgba(255, 255, 255, 0.84);
}

.has-hero-header .site-header:not(.is-scrolled) .site-nav a:hover,
.has-hero-header .site-header:not(.is-scrolled) .site-nav a[aria-current="page"] {
  color: #FFFFFF;
}

.has-hero-header .site-header:not(.is-scrolled) .icon-btn,
.has-hero-header .site-header:not(.is-scrolled) .search-trigger {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.26);
  color: #FFFFFF;
  backdrop-filter: blur(12px);
}

.has-hero-header .site-header:not(.is-scrolled) .search-trigger kbd {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.site-header.is-scrolled .header-bar,
body:not(.has-hero-header) .site-header .header-bar {
  margin: 12px auto 0;
  max-width: min(calc(100% - 24px), var(--max-w));
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  background: var(--header-glass);
  border-color: var(--hairline);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-pill);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  color: inherit;
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

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

.site-nav a {
  padding: 0.38rem 0.78rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

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

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-btn,
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--hairline);
  padding: 0.4rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  cursor: pointer;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover,
.search-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--ink-soft);
  border: 1px solid var(--hairline);
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
}

.theme-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}

.theme-btn svg,
.search-trigger svg,
.menu-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-btn .icon-sun { display: inline-flex; }
.theme-btn .icon-moon { display: none; }

[data-theme="light"] .theme-btn .icon-sun { display: none; }
[data-theme="light"] .theme-btn .icon-moon { display: inline-flex; }

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}

@media (max-width: 860px) {
  .search-trigger kbd {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 12px;
    right: 12px;
    background: var(--surface-elevated);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--hairline);
    border-radius: 20px;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    gap: 0.25rem;
    box-shadow: var(--shadow-pill);
  }
  .site-nav.is-open {
    display: flex;
    animation: sheet-drop 0.26s var(--ease);
  }
  .site-nav a {
    padding: 0.7rem 1rem;
    border-radius: 12px;
    color: var(--text) !important;
  }
  .site-nav a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent) !important;
  }
}

@keyframes sheet-drop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 440px) {
  .search-trigger .search-label {
    display: none;
  }
  .search-trigger {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }
}

/* Main */
main {
  flex: 1 0 auto;
  padding-bottom: 5rem;
}

body:not(.has-hero-header) main {
  padding-top: 96px;
}

/* Full-Bleed Home Cinematic Slideshow Hero */
.hero-stage {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 540px;
  max-height: 820px;
  overflow: hidden;
  background: #0D1017;
  color: #FFFFFF;
}

@media (max-width: 480px) {
  .hero-stage {
    height: 78svh;
    min-height: 490px;
  }
}

.hero-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.1s ease, visibility 1.1s ease;
  z-index: 1;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-slide.is-active .hero-slide-img {
  animation: ken-burns 12s var(--ease) forwards;
}

@keyframes ken-burns {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.1);
  }
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 13, 18, 0.56) 0%, rgba(11, 13, 18, 0.14) 36%, rgba(11, 13, 18, 0.72) 78%, rgba(11, 13, 18, 0.90) 100%),
    linear-gradient(90deg, rgba(11, 13, 18, 0.78) 0%, rgba(11, 13, 18, 0.34) 55%, rgba(11, 13, 18, 0.12) 100%);
  pointer-events: none;
}

.hero-content-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(4.8rem, 7vw, 6.2rem);
  z-index: 3;
}

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

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.hero-kicker .mono {
  color: rgba(255, 255, 255, 0.82);
}

.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.24rem 0.78rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-decoration: none;
}

.glass-pill:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.65rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
  color: #FFFFFF;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero-subtitle {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: clamp(0.95rem, 1.5vw, 1.12rem);
  color: #F5B963;
  margin: 0 0 0.7rem;
}

.hero-desc {
  margin: 0 0 1.35rem;
  font-size: clamp(0.94rem, 1.4vw, 1.05rem);
  color: rgba(255, 255, 255, 0.88);
  max-width: 54ch;
  line-height: 1.65;
}

.gold-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 1.45rem;
  border-radius: 999px;
  background: var(--gold-grad);
  color: var(--grad-btn-ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.28);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), filter 0.2s ease;
}

.gold-pill-btn:hover {
  color: var(--grad-btn-ink);
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.40), 0 4px 16px rgba(245, 185, 99, 0.24);
}

.hero-bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(1.35rem, 3.6vw, 2.4rem);
  z-index: 10;
  pointer-events: none;
}

.hero-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .hero-bottom-inner {
    justify-content: flex-start;
  }
}

.hero-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
}

.hero-arrow {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(18, 21, 29, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  backdrop-filter: blur(12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(56, 189, 248, 0.85);
  border-color: #7DD3FC;
  color: #080C14;
}

.hero-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: width 0.28s var(--ease), background-color 0.2s ease;
}

.hero-dot[aria-selected="true"] {
  width: 26px;
  background: #F5B963;
}

/* Home Masthead Ribbon */
.editorial-ribbon {
  padding-block: clamp(1.5rem, 3vw, 2.2rem);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.ribbon-mark {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 1.25rem;
}

.ribbon-brand {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ribbon-tagline {
  margin: 0;
  font-size: 0.96rem;
  color: var(--muted);
}

/* Editorial Section Header with Gold Outlined Number & Ornament */
.luxe-section {
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--hairline);
}

.luxe-section:last-child {
  border-bottom: none;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.2rem);
}

.section-heading-block {
  display: flex;
  align-items: baseline;
  gap: 0.95rem;
}

.section-num-outline {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: transparent;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px var(--accent);
  user-select: none;
}

.section-titles {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.section-ornament {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.ornament-line {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
}

.section-more {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  backdrop-filter: blur(12px);
  color: var(--text);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.section-more:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Bento Grid for Drawers (Asymmetric Image-Led Tiles) */
.bento-drawer-stack {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.bento-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.bento-group-title {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.bento-group-title h3 {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem;
}

.bento-tile {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  min-height: 220px;
  background: #141822;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease);
}

.bento-tile.is-lead {
  grid-column: span 7;
  min-height: 390px;
}

.bento-stack {
  grid-column: span 5;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.bento-grid.is-flipped .bento-stack {
  order: 1;
}

.bento-grid.is-flipped .bento-tile.is-lead {
  order: 2;
}

@media (max-width: 900px) {
  .bento-tile.is-lead,
  .bento-stack {
    grid-column: span 12;
    order: unset !important;
  }
  .bento-tile.is-lead {
    min-height: 300px;
  }
  .bento-stack {
    grid-template-rows: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .bento-stack {
    grid-template-columns: 1fr;
  }
  .bento-tile {
    min-height: 210px;
  }
}

.bento-tile:hover,
.bento-tile:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.bento-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.bento-tile:hover .bento-bg {
  transform: scale(1.06);
}

.bento-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 16, 23, 0.10) 0%,
    rgba(13, 16, 23, 0.44) 48%,
    rgba(13, 16, 23, 0.88) 100%
  );
  pointer-events: none;
}

.bento-content {
  position: relative;
  z-index: 2;
  padding: 1.35rem 1.45rem;
  color: #FFFFFF;
}

.bento-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.55rem;
}

.bento-meta .mono {
  color: rgba(255, 255, 255, 0.80);
}

.bento-title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 1.6vw, 1.38rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.015em;
  margin: 0 0 0.42rem;
}

.bento-tile.is-lead .bento-title {
  font-size: clamp(1.38rem, 2.3vw, 1.85rem);
}

.bento-title a {
  text-decoration: none;
  color: #FFFFFF;
}

.bento-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.bento-desc {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Luxury Article Cards Everywhere */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.luxe-card {
  position: relative;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.25s ease;
}

/* Subtle gold folded-corner motif in top-right (non-destructive overlay) */
.luxe-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(225deg, rgba(245, 185, 99, 0.92) 0%, rgba(56, 189, 248, 0.78) 49%, transparent 51%);
  pointer-events: none;
  z-index: 4;
  opacity: 0.78;
  transition: width 0.26s var(--ease), height 0.26s var(--ease), opacity 0.22s ease;
}

.luxe-card:hover,
.luxe-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.luxe-card:hover::after,
.luxe-card:focus-within::after {
  width: 30px;
  height: 30px;
  opacity: 1;
}

.luxe-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #141822;
}

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

.luxe-card:hover .luxe-card-media img {
  transform: scale(1.06);
}

.luxe-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 13, 18, 0.04) 45%, rgba(11, 13, 18, 0.52) 100%);
  pointer-events: none;
}

.card-cat-pill {
  position: absolute;
  left: 0.9rem;
  bottom: 0.85rem;
  z-index: 3;
  padding: 0.22rem 0.72rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: rgba(18, 22, 31, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-decoration: none;
}

.card-cat-pill:hover {
  background: rgba(56, 189, 248, 0.88);
  border-color: #7DD3FC;
  color: #080C14;
}

.luxe-card-body {
  padding: 1.2rem 1.3rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1 1 auto;
}

.luxe-card-title {
  font-family: var(--font-serif);
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.015em;
  margin: 0;
}

.luxe-card-title a {
  text-decoration: none;
}

.luxe-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.luxe-card-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.luxe-card-foot {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Tools Glass Cards with Gold Circular Icon Badges */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
}

@media (max-width: 960px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

.tool-glass-card {
  position: relative;
  padding: 1.25rem;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.22s ease;
}

.tool-glass-card:hover,
.tool-glass-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.tool-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--grad-btn-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.26);
  margin-bottom: 0.2rem;
}

.tool-badge svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-card-name {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  font-weight: 700;
  margin: 0;
}

.tool-card-name a {
  text-decoration: none;
}

.tool-card-name a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tool-card-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

/* English Two-Column List with Italic Numerals */
.en-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.5rem;
}

@media (max-width: 760px) {
  .en-grid {
    grid-template-columns: 1fr;
  }
}

.en-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0.85rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--hairline);
  align-items: start;
}

.en-num {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--accent);
}

.en-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.en-row-title {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 700;
  text-decoration: none;
}

.en-row-desc {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Recent Updates / Index List */
.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem 1.25rem;
  padding: 0.95rem 1.1rem;
  margin-bottom: 0.65rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(14px);
  transition: transform 0.22s var(--ease), border-color 0.2s ease, box-shadow 0.22s ease;
}

.index-row:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}

.index-row-title {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 700;
  text-decoration: none;
}

.index-row-desc {
  margin: 0.18rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.index-row-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
}

.inline-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(56, 189, 248, 0.26);
}

.inline-badge:hover {
  background: var(--gold-grad);
  color: var(--grad-btn-ink);
}

@media (max-width: 720px) {
  .index-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }
}

/* Inner Page Hero Banner */
.page-hero {
  position: relative;
  width: 100%;
  min-height: 320px;
  padding-top: 96px;
  padding-bottom: clamp(2rem, 4vw, 3rem);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #12151E;
  color: #FFFFFF;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.page-hero.is-article-hero {
  min-height: 60svh;
  max-height: 580px;
}

@media (max-width: 480px) {
  .page-hero {
    min-height: 280px;
  }
  .page-hero.is-article-hero {
    min-height: 54svh;
  }
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 13, 18, 0.54) 0%, rgba(11, 13, 18, 0.32) 38%, rgba(11, 13, 18, 0.86) 100%),
    linear-gradient(90deg, rgba(11, 13, 18, 0.72) 0%, rgba(11, 13, 18, 0.22) 70%);
}

.page-hero-inner {
  position: relative;
  z-index: 2;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.breadcrumb a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
}

.breadcrumb a:hover {
  color: #F5B963;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
}

.page-lead {
  margin: 0;
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  color: rgba(255, 255, 255, 0.86);
  max-width: 62ch;
}

.plain-head {
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--hairline);
}

.plain-head .page-lead {
  color: var(--muted);
}

/* Filter Chips (Glass Pills + Gold Active) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.filter-chip {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(12px);
  padding: 0.42rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.filter-chip.is-active {
  background: var(--gold-grad);
  color: var(--grad-btn-ink);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.26);
}

.filter-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.8;
  margin-left: 0.35rem;
}

.is-hidden {
  display: none !important;
}

/* Article Page Layout, Drop Cap, Dark Code, Floating Glass TOC */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 1080px) {
  .article-layout.has-toc {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 3rem;
  }
}

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

.prose-panel {
  max-width: 74ch;
  padding: clamp(1.35rem, 3.2vw, 2.5rem);
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-card);
}

.prose {
  max-width: 68ch;
  font-size: 1.04rem;
  line-height: 1.88;
}

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

.prose.with-dropcap > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-size: 3.35rem;
  line-height: 0.9;
  font-weight: 700;
  padding: 0.08em 0.16em 0 0;
  color: var(--accent);
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.32rem, 2vw, 1.56rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin: 2.4rem 0 0.9rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
  scroll-margin-top: 96px;
}

.prose h2::before {
  content: "◆";
  color: var(--accent);
  font-size: 0.72em;
  margin-right: 0.55rem;
  vertical-align: 0.08em;
}

.prose h3 {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 1.75rem 0 0.65rem;
  scroll-margin-top: 96px;
}

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

.prose ul,
.prose ol {
  margin: 0 0 1.3rem;
  padding-left: 1.5rem;
}

.prose li + li {
  margin-top: 0.42rem;
}

.prose blockquote {
  position: relative;
  margin: 1.75rem 0;
  padding: 1.15rem 1.4rem 1.15rem 2.6rem;
  border-radius: 16px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  font-family: var(--font-italic);
  font-style: italic;
  color: var(--text);
}

.prose blockquote::before {
  content: "“";
  position: absolute;
  top: 0.2rem;
  left: 0.75rem;
  font-family: var(--font-serif);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
}

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

.prose code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--accent-soft);
  color: var(--text);
  padding: 0.14em 0.4em;
  border-radius: 6px;
}

.prose pre {
  margin: 1.5rem 0;
  padding: 1.15rem 1.35rem;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.65;
  box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.35);
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--hairline);
  text-align: left;
}

.prose th {
  background: var(--accent-soft);
  font-weight: 600;
}

.prose figure {
  margin: 1.75rem 0;
  padding: 0.75rem;
  background: var(--surface-solid);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.prose figure img,
.prose img {
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.prose figcaption {
  margin-top: 0.65rem;
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
}

.prose .source-box {
  margin-top: 2.25rem;
  padding: 1.1rem 1.35rem;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.prose .source-box h2 {
  margin: 0 0 0.45rem;
  padding: 0;
  border: none;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.prose .source-box h2::before {
  display: none;
}

.prose .source-box p {
  margin: 0;
  font-size: 0.94rem;
}

/* Floating Glass TOC */
.article-toc {
  display: none;
}

@media (min-width: 1080px) {
  .article-toc {
    display: block;
    position: sticky;
    top: 96px;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-card);
    background: var(--surface);
    border: 1px solid var(--hairline);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: var(--shadow-card);
  }
}

.toc-title {
  margin: 0 0 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--accent);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.46rem;
}

.toc-list a {
  display: block;
  padding: 0.2rem 0 0.2rem 0.65rem;
  border-left: 2px solid transparent;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.toc-list a:hover,
.toc-list a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.toc-item-h3 {
  padding-left: 0.75rem;
}

/* Prev / Next Image Cards */
.article-pager {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  max-width: 74ch;
}

@media (max-width: 620px) {
  .article-pager {
    grid-template-columns: 1fr;
  }
}

.pager-card {
  position: relative;
  min-height: 126px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #141822;
  color: #FFFFFF;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease);
}

.pager-card:hover {
  color: #FFFFFF;
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.pager-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.pager-card:hover img {
  transform: scale(1.06);
}

.pager-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 16, 23, 0.22) 0%, rgba(13, 16, 23, 0.84) 100%);
}

.pager-card > span {
  position: relative;
  z-index: 2;
}

.pager-card .mono {
  color: #F5B963;
  margin-bottom: 0.25rem;
}

.pager-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
}

.pager-card.is-next {
  text-align: right;
}

.related-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--hairline);
}

/* Floating Back-to-top + Circular Reading Progress Ring */
.progress-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.5rem;
  z-index: 120;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--surface-elevated);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  box-shadow: var(--shadow-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.24s ease, visibility 0.24s ease, transform 0.24s var(--ease), color 0.2s ease;
}

.progress-fab.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.progress-fab:hover {
  color: var(--accent);
}

.progress-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring-track {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 2.5;
}

.progress-ring-value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 125.66;
  transition: stroke-dashoffset 0.1s linear;
}

.progress-fab-arrow {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Archive Vertical Timeline with Gold Dots */
.timeline {
  position: relative;
  padding-left: 1.85rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--hairline));
}

.archive-year {
  margin-bottom: 2.5rem;
}

.archive-year-title {
  position: relative;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
}

.archive-year-title::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold-grad);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.archive-month {
  position: relative;
  margin-bottom: 1.75rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
}

.archive-month::before {
  content: "";
  position: absolute;
  left: calc(-1.85rem + 2px);
  top: 1.4rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.archive-month-label {
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.archive-month-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.archive-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.9rem;
}

.archive-item-title {
  font-family: var(--font-serif);
  font-weight: 700;
  text-decoration: none;
}

/* Tool Panel & Controls */
.tool-shell {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-card);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: 2.5rem;
}

.tool-privacy {
  margin: 0 0 1.2rem;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, 0.24);
  font-size: 0.87rem;
  color: var(--text);
}

.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  padding: 0.48rem 1.05rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-primary {
  background: var(--gold-grad);
  color: var(--grad-btn-ink);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.24);
}

.btn-primary:hover {
  color: var(--grad-btn-ink);
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.tool-field {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  margin-bottom: 1rem;
}

.tool-field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-input,
.tool-textarea,
.tool-select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-input);
  padding: 0.72rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-input:focus,
.tool-textarea:focus,
.tool-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.04), 0 0 0 3px var(--accent-soft);
}

.tool-textarea {
  min-height: 185px;
  resize: vertical;
}

.tool-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 760px) {
  .tool-split {
    grid-template-columns: 1fr;
  }
}

.tool-status {
  padding: 0.68rem 1rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--ink-soft);
  font-size: 0.9rem;
}

.tool-status.is-error {
  border-color: rgba(186, 56, 44, 0.45);
  background: rgba(186, 56, 44, 0.10);
  color: #C44536;
}

[data-theme="dark"] .tool-status.is-error {
  color: #FF8C7A;
}

.tool-status.is-ok {
  border-color: rgba(56, 189, 248, 0.40);
  background: var(--accent-soft);
  color: var(--accent);
}

.kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--hairline);
}

.kv-table th,
.kv-table td {
  padding: 0.62rem 0.85rem;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: middle;
}

.kv-table th {
  width: 34%;
  background: var(--ink-soft);
  font-weight: 600;
}

.kv-table td code {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  word-break: break-all;
}

.diff-view {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  overflow-x: auto;
}

.diff-line {
  display: grid;
  grid-template-columns: 44px 44px 22px minmax(0, 1fr);
  padding: 0.16rem 0.6rem;
  border-bottom: 1px solid var(--hairline);
  white-space: pre-wrap;
  word-break: break-word;
}

.diff-line:last-child {
  border-bottom: none;
}

.diff-ln {
  color: var(--muted);
  user-select: none;
}

.diff-add {
  background: rgba(56, 189, 248, 0.16);
}

.diff-del {
  background: rgba(245, 158, 11, 0.16);
}

.tool-related {
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
}

/* Search Modal */
dialog.search-dialog {
  width: min(680px, calc(100vw - 2rem));
  max-height: 82vh;
  padding: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: 22px;
  background: var(--surface-elevated);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  color: var(--text);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.34);
  margin: auto;
}

dialog.search-dialog::backdrop {
  background: rgba(11, 13, 18, 0.64);
  backdrop-filter: blur(4px);
}

.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--hairline);
}

.search-head h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 0;
}

.search-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.78rem 1rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 14px;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 46vh;
  overflow-y: auto;
  border-top: 1px solid var(--hairline);
}

.search-result-item a {
  display: block;
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--hairline);
  border-radius: 10px;
  text-decoration: none;
}

.search-result-item a:hover,
.search-result-item a[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--text);
}

.search-result-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.98rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.search-result-excerpt {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.search-results mark {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 0.2em;
  border-radius: 4px;
}

.search-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: var(--muted);
}

/* Theme-aware Footer: Deep Midnight Navy in Dark Mode, Soft Slate Glass in Light Mode */
.site-footer {
  background: rgba(11, 16, 27, 0.92);
  color: #F1F5F9;
  border-top: 1px solid rgba(148, 176, 218, 0.18);
  padding-block: clamp(2.5rem, 5vw, 3.75rem) 2.25rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(380px, 1.85fr) 1fr 1fr;
  gap: 2rem 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: #FFFFFF;
}

.footer-wordmark:hover {
  color: #7DD3FC;
}

.footer-wordmark-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.footer-tagline {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  color: rgba(241, 245, 249, 0.72);
  max-width: none;
}

@media (min-width: 768px) {
  .footer-tagline {
    white-space: nowrap;
  }
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #F5B963;
  margin: 0 0 0.85rem;
}

.footer-col-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col-links a {
  text-decoration: none;
  font-size: 0.92rem;
  color: rgba(241, 245, 249, 0.78);
}

.footer-col-links a:hover {
  color: #7DD3FC;
}

.footer-bottom {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(148, 176, 218, 0.16);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.82rem;
  color: rgba(241, 245, 249, 0.64);
}

.footer-sub {
  color: #F5B963;
}

[data-theme="light"] .site-footer {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #0F172A;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .footer-wordmark {
  color: #0F172A;
}

[data-theme="light"] .footer-wordmark:hover {
  color: #1D4ED8;
}

[data-theme="light"] .footer-sub {
  color: #C2781A;
}

[data-theme="light"] .footer-tagline {
  color: #475569;
}

[data-theme="light"] .footer-col-title {
  color: #1D4ED8;
}

[data-theme="light"] .footer-col-links a {
  color: #334155;
}

[data-theme="light"] .footer-col-links a:hover {
  color: #1D4ED8;
}

[data-theme="light"] .footer-bottom {
  border-top-color: rgba(15, 23, 42, 0.10);
  color: #475569;
}

.bento-group-num {
  color: var(--accent);
}

.filter-status {
  margin-bottom: 1.1rem;
}

.hero-kicker-article {
  margin-bottom: 0.65rem;
}

.topic-latest {
  margin: 0.2rem 0 0;
}

.topics-grid-pad {
  margin-bottom: 3rem;
}

.chip-link,
.btn {
  text-decoration: none;
}

.plain-head .breadcrumb {
  color: var(--muted);
}

.plain-head .breadcrumb a {
  color: var(--text);
}

.notfound-code {
  margin: 0 0 0.4rem;
  color: var(--accent);
}

.sr-copy-buffer {
  position: fixed;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.btn-inline-copy {
  margin-left: 0.6rem;
  padding: 0.18rem 0.5rem;
  font-size: 0.76rem;
}

.tool-select-auto {
  width: auto;
}

.tool-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.tool-input-count {
  width: 92px;
}

.tool-inline-label {
  font-size: 0.88rem;
}

.tool-textarea-compact {
  min-height: 130px;
}

.delay-0 { --reveal-delay: 0ms; }
.delay-1 { --reveal-delay: 40ms; }
.delay-2 { --reveal-delay: 80ms; }
.delay-3 { --reveal-delay: 120ms; }
.delay-4 { --reveal-delay: 160ms; }
.delay-5 { --reveal-delay: 200ms; }
.delay-6 { --reveal-delay: 240ms; }
.delay-7 { --reveal-delay: 280ms; }

/* Scroll Reveal (Progressive Enhancement: visible without JS) */
html.js .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(16px);
}

.reveal {
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-slide.is-active .hero-slide-img {
    animation: none !important;
  }
  html.js .reveal:not(.is-visible) {
    opacity: 1;
    transform: none;
  }
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
