/* ==========================================================================
   帧间笔记 · PacketLens
   Liquid Glass Optical Material + Naked-Eye 3D Pop-Out + Warp Transitions
   ========================================================================== */

:root {
  --bg-base: #040714;
  --bg-elevated: #080f24;
  --text-primary: #f2f7ff;
  --text-secondary: rgba(210, 226, 255, 0.74);
  --text-muted: rgba(164, 188, 228, 0.56);

  /* Optical Accent Palette */
  --cyan: #38f2ff;
  --azure: #4d88ff;
  --violet: #9b6cff;
  --emerald: #2ef2a2;
  --amber: #ffb84d;
  --rose: #ff5f9e;

  /* Liquid Glass Material Tokens (Dark) */
  --glass-bg: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.13) 0%,
    rgba(165, 210, 255, 0.055) 48%,
    rgba(255, 255, 255, 0.09) 100%
  );
  --glass-bg-strong: linear-gradient(
    145deg,
    rgba(18, 28, 56, 0.78) 0%,
    rgba(10, 18, 40, 0.68) 55%,
    rgba(22, 34, 68, 0.76) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.22);
  --glass-rim-top: rgba(255, 255, 255, 0.48);
  --glass-rim-bottom: rgba(110, 210, 255, 0.14);
  --glass-shadow: 0 24px 60px rgba(2, 6, 20, 0.56), 0 4px 16px rgba(0, 0, 0, 0.35);
  --glass-sheen: rgba(140, 238, 255, 0.22);
  --code-bg: rgba(56, 242, 255, 0.11);
  --code-border: rgba(56, 242, 255, 0.26);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;

  --font-sans: 'Noto Sans SC', 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Light Mode: 晶昼琉璃 (Apple-style Bright Liquid Glass) */
[data-theme="light"] {
  --bg-base: #eaf2fb;
  --bg-elevated: #f6faff;
  --text-primary: #0b1630;
  --text-secondary: rgba(18, 34, 68, 0.74);
  --text-muted: rgba(42, 64, 108, 0.58);

  --cyan: #0099c8;
  --azure: #2563eb;
  --violet: #7c3aed;
  --emerald: #059669;
  --amber: #d97706;
  --rose: #e11d48;

  --glass-bg: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.74) 0%,
    rgba(235, 245, 255, 0.44) 52%,
    rgba(255, 255, 255, 0.68) 100%
  );
  --glass-bg-strong: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(241, 248, 255, 0.82) 55%,
    rgba(255, 255, 255, 0.9) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-rim-top: rgba(255, 255, 255, 0.96);
  --glass-rim-bottom: rgba(37, 99, 235, 0.12);
  --glass-shadow: 0 20px 50px rgba(15, 45, 98, 0.12), 0 4px 14px rgba(15, 45, 98, 0.06);
  --glass-sheen: rgba(255, 255, 255, 0.65);
  --code-bg: rgba(37, 99, 235, 0.09);
  --code-border: rgba(37, 99, 235, 0.22);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s var(--smooth), color 0.4s ease;
}

body.no-scroll {
  overflow: hidden;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.45em;
  border-radius: 7px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--cyan);
}

/* ==========================================================================
   AMBIENT OPTICAL STAGE (Background refracted through Liquid Glass)
   ========================================================================== */
.ambient-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.56;
  will-change: transform;
  animation: orbDrift 22s ease-in-out infinite alternate;
}

[data-theme="light"] .ambient-orb {
  opacity: 0.45;
  filter: blur(80px);
}

.orb-1 {
  width: 560px;
  height: 560px;
  top: -140px;
  left: -100px;
  background: radial-gradient(circle, rgba(56, 242, 255, 0.55), rgba(77, 136, 255, 0.15) 65%, transparent);
}

.orb-2 {
  width: 620px;
  height: 620px;
  top: 12%;
  right: -160px;
  background: radial-gradient(circle, rgba(155, 108, 255, 0.55), rgba(77, 136, 255, 0.14) 65%, transparent);
  animation-delay: -6s;
  animation-duration: 26s;
}

.orb-3 {
  width: 500px;
  height: 500px;
  bottom: -140px;
  left: 28%;
  background: radial-gradient(circle, rgba(46, 242, 162, 0.42), rgba(56, 242, 255, 0.12) 65%, transparent);
  animation-delay: -11s;
  animation-duration: 24s;
}

.orb-4 {
  width: 380px;
  height: 380px;
  bottom: 24%;
  right: 22%;
  background: radial-gradient(circle, rgba(255, 95, 158, 0.28), transparent 70%);
  animation-delay: -15s;
}

@keyframes orbDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(55px, 35px, 0) scale(1.12); }
  100% { transform: translate3d(-40px, 60px, 0) scale(0.95); }
}

#bgPacketCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.78;
}

[data-theme="light"] #bgPacketCanvas {
  opacity: 0.48;
}

.ambient-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 180, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 180, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 35%, transparent 100%);
}

/* ==========================================================================
   LIQUID GLASS OPTICAL MATERIAL PRIMITIVE
   ========================================================================== */
.liquid-glass {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(26px) saturate(195%) brightness(1.06);
  -webkit-backdrop-filter: blur(26px) saturate(195%) brightness(1.06);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1.5px 1px var(--glass-rim-top),
    inset 0 -1px 2px var(--glass-rim-bottom),
    inset 1px 0 0 rgba(255, 255, 255, 0.14),
    var(--glass-shadow);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s var(--smooth);
}

/* Cursor-following Liquid Specular Highlight */
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 0%),
    var(--glass-sheen),
    transparent 58%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 1;
}

.liquid-glass:hover::before {
  opacity: 1;
}

/* Chromatic Optical Dispersion Rim */
.liquid-glass::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(56, 242, 255, 0.35) 28%,
    rgba(155, 108, 255, 0.25) 60%,
    rgba(46, 242, 162, 0.32) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 2;
}

.liquid-glass:hover::after {
  opacity: 0.85;
}

/* Liquid Glass Interactive Buttons */
.liquid-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--glass-rim-top),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.28s var(--spring), box-shadow 0.28s ease, border-color 0.25s ease, background 0.25s ease;
  overflow: hidden;
}

.liquid-btn:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(56, 242, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 12px 30px rgba(56, 242, 255, 0.22);
}

.liquid-btn:active {
  transform: translateY(0) scale(0.97);
}

.primary-glass-btn {
  padding: 13px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(56, 242, 255, 0.3), rgba(77, 136, 255, 0.34), rgba(155, 108, 255, 0.28));
  border-color: rgba(120, 235, 255, 0.55);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.6),
    0 14px 36px rgba(56, 242, 255, 0.25);
}

[data-theme="light"] .primary-glass-btn {
  background: linear-gradient(135deg, rgba(0, 153, 200, 0.2), rgba(37, 99, 235, 0.22));
  color: #062148;
  border-color: rgba(37, 99, 235, 0.42);
}

.primary-glass-btn.small,
.secondary-glass-btn.small {
  padding: 9px 18px;
  font-size: 0.86rem;
}

.secondary-glass-btn {
  padding: 13px 22px;
  font-size: 0.95rem;
}

.mini-pill {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.mini-pill.is-active {
  background: linear-gradient(135deg, rgba(56, 242, 255, 0.28), rgba(155, 108, 255, 0.25));
  border-color: rgba(56, 242, 255, 0.55);
  color: var(--text-primary);
}

.icon-pill {
  width: 40px;
  height: 40px;
  padding: 0;
}

.cta-pill {
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(46, 242, 162, 0.22), rgba(56, 242, 255, 0.24));
  border-color: rgba(46, 242, 162, 0.45);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
  display: inline-block;
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

/* ==========================================================================
   FLOATING LIQUID GLASS NAVIGATION BAR
   ========================================================================== */
.glass-nav-wrap {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 20px;
  pointer-events: none;
}

.glass-nav {
  pointer-events: auto;
  width: 100%;
  max-width: 1220px;
  padding: 8px 12px 8px 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--glass-bg-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  z-index: 3;
}

/* Mini 3D Rotating Glass Prism in Brand */
.brand-prism {
  width: 34px;
  height: 34px;
  perspective: 180px;
  display: grid;
  place-items: center;
}

.brand-cube {
  width: 20px;
  height: 20px;
  position: relative;
  transform-style: preserve-3d;
  animation: brandSpin 10s linear infinite;
}

.brand-cube .face {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(56, 242, 255, 0.85);
  background: rgba(56, 242, 255, 0.16);
  box-shadow: inset 0 0 8px rgba(155, 108, 255, 0.4);
  border-radius: 3px;
}

.brand-cube .f-front  { transform: translateZ(10px); }
.brand-cube .f-back   { transform: rotateY(180deg) translateZ(10px); }
.brand-cube .f-right  { transform: rotateY(90deg) translateZ(10px); }
.brand-cube .f-left   { transform: rotateY(-90deg) translateZ(10px); }
.brand-cube .f-top    { transform: rotateX(90deg) translateZ(10px); }
.brand-cube .f-bottom { transform: rotateX(-90deg) translateZ(10px); }

@keyframes brandSpin {
  0% { transform: rotateX(-24deg) rotateY(0deg); }
  100% { transform: rotateX(-24deg) rotateY(360deg); }
}

.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.brand-en {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
}

/* Morphing Liquid Droplet Nav Track */
.nav-pill-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 3;
}

[data-theme="light"] .nav-pill-track {
  background: rgba(15, 45, 98, 0.05);
  border-color: rgba(15, 45, 98, 0.08);
}

.nav-droplet {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(56, 242, 255, 0.3), rgba(155, 108, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.6),
    0 6px 20px rgba(56, 242, 255, 0.24);
  transition: transform 0.52s var(--spring), width 0.48s var(--spring);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] .nav-droplet {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(224, 242, 255, 0.85));
  border-color: rgba(37, 99, 235, 0.26);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.14);
}

.nav-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.nav-tab:hover,
.nav-tab.is-active {
  color: var(--text-primary);
}

.nav-tab-icon {
  font-size: 0.86rem;
  color: var(--cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
}

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

/* ==========================================================================
   OPTICAL WARP PAGE TRANSITION PORTAL (酷炫跳转动画)
   ========================================================================== */
.warp-portal {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease;
}

.warp-portal.is-warping {
  opacity: 1;
  visibility: visible;
}

.warp-lens {
  position: absolute;
  width: 24vmax;
  height: 24vmax;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(56, 242, 255, 0.22) 0%,
    rgba(124, 108, 255, 0.26) 45%,
    rgba(6, 12, 32, 0.72) 72%,
    transparent 100%
  );
  backdrop-filter: blur(28px) saturate(220%) contrast(1.1);
  -webkit-backdrop-filter: blur(28px) saturate(220%) contrast(1.1);
  transform: scale(0.05);
  opacity: 0;
}

.warp-portal.is-warping .warp-lens {
  animation: warpLensSweep 0.68s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.warp-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(56, 242, 255, 0.75);
  box-shadow:
    0 0 34px rgba(56, 242, 255, 0.55),
    inset 0 0 24px rgba(155, 108, 255, 0.45);
  transform: scale(0.08);
  opacity: 0;
}

.ring-outer {
  width: 30vmax;
  height: 30vmax;
}

.ring-inner {
  width: 18vmax;
  height: 18vmax;
  border-color: rgba(155, 108, 255, 0.85);
}

.warp-portal.is-warping .ring-outer {
  animation: warpRingExpand 0.68s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.warp-portal.is-warping .ring-inner {
  animation: warpRingExpand 0.64s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards;
}

.warp-streaks {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.warp-streaks span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 240px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), #fff);
  transform-origin: left center;
  opacity: 0;
}

.warp-streaks span:nth-child(1) { --ang: 15deg; }
.warp-streaks span:nth-child(2) { --ang: 62deg; }
.warp-streaks span:nth-child(3) { --ang: 112deg; }
.warp-streaks span:nth-child(4) { --ang: 158deg; }
.warp-streaks span:nth-child(5) { --ang: 204deg; }
.warp-streaks span:nth-child(6) { --ang: 250deg; }
.warp-streaks span:nth-child(7) { --ang: 298deg; }
.warp-streaks span:nth-child(8) { --ang: 336deg; }

.warp-portal.is-warping .warp-streaks span {
  animation: streakShoot 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.warp-hud {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: rgba(8, 15, 36, 0.82);
  border: 1px solid rgba(56, 242, 255, 0.55);
  box-shadow: 0 12px 40px rgba(56, 242, 255, 0.32);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: #e9f9ff;
  transform: scale(0.82);
  opacity: 0;
}

.warp-portal.is-warping .warp-hud {
  animation: hudFlash 0.64s ease forwards;
}

.warp-hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

@keyframes warpLensSweep {
  0%   { transform: scale(0.08); opacity: 0; }
  38%  { transform: scale(5.4); opacity: 1; }
  100% { transform: scale(8.2); opacity: 0; }
}

@keyframes warpRingExpand {
  0%   { transform: scale(0.05) rotate(0deg); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scale(5.2) rotate(55deg); opacity: 0; }
}

@keyframes streakShoot {
  0%   { transform: rotate(var(--ang)) translateX(30px) scaleX(0.2); opacity: 0; }
  35%  { opacity: 0.95; }
  100% { transform: rotate(var(--ang)) translateX(52vmax) scaleX(1.8); opacity: 0; }
}

@keyframes hudFlash {
  0%   { opacity: 0; transform: scale(0.84) translateY(8px); }
  28%  { opacity: 1; transform: scale(1) translateY(0); }
  72%  { opacity: 1; transform: scale(1.02) translateY(0); }
  100% { opacity: 0; transform: scale(1.12) translateY(-8px); }
}

/* 3D Spatial View Entrance / Exit Transitions */
.main-stage {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 112px 24px 64px;
  perspective: 1600px;
}

.view-section {
  transform-origin: center 220px;
  will-change: transform, opacity, filter;
}

.view-section[hidden] {
  display: none;
}

.view-section.is-leaving {
  animation: viewWarpOut 0.34s cubic-bezier(0.55, 0, 0.75, 0.25) forwards;
}

.view-section.is-entering {
  animation: viewWarpIn 0.56s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes viewWarpOut {
  0% {
    opacity: 1;
    transform: translateZ(0) scale(1) rotateX(0deg);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateZ(-260px) scale(0.9) rotateX(6deg);
    filter: blur(14px);
  }
}

@keyframes viewWarpIn {
  0% {
    opacity: 0;
    transform: translateZ(160px) scale(1.06) rotateX(-5deg);
    filter: blur(16px);
  }
  100% {
    opacity: 1;
    transform: translateZ(0) scale(1) rotateX(0deg);
    filter: blur(0);
  }
}

/* ==========================================================================
   HERO SECTION & NAKED-EYE 3D POP-OUT STAGE (裸眼3D核心视觉)
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding: 18px 0 46px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--cyan);
  background: rgba(56, 242, 255, 0.09);
  border: 1px solid rgba(56, 242, 255, 0.32);
  backdrop-filter: blur(14px);
  margin-bottom: 20px;
}

.chip-glow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.hero-title {
  margin: 0 0 20px;
  font-size: clamp(2.2rem, 4.1vw, 3.45rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.gradient-text {
  background: linear-gradient(110deg, #38f2ff 0%, #63a4ff 48%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="light"] .gradient-text {
  background: linear-gradient(110deg, #0082b4 0%, #2563eb 52%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.glass-word {
  position: relative;
  display: inline-block;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-rim-top), 0 8px 24px rgba(56, 242, 255, 0.15);
}

.hero-desc {
  margin: 0 0 28px;
  font-size: 1.03rem;
  color: var(--text-secondary);
  max-width: 560px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 490px;
}

.metric-pill {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-num {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------- NAKED-EYE 3D ANAMORPHIC STAGE ---------- */
.naked3d-showcase {
  position: relative;
  perspective: 1150px;
  padding: 36px 26px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.naked3d-hint {
  position: absolute;
  top: 0;
  z-index: 15;
}

.hint-badge {
  display: inline-block;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
}

.naked3d-rig {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 410px;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, -12deg));
  transition: transform 0.14s ease-out;
  will-change: transform;
}

/* Recessed 3D Chamber (Z <= 0) */
.chamber-shell {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  transform-style: preserve-3d;
  overflow: visible;
  background: linear-gradient(155deg, rgba(10, 18, 42, 0.78), rgba(6, 10, 26, 0.92));
  border: 1.5px solid rgba(110, 225, 255, 0.36);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.75),
    0 34px 80px rgba(0, 0, 0, 0.52),
    0 0 42px rgba(56, 242, 255, 0.16);
}

[data-theme="light"] .chamber-shell {
  background: linear-gradient(155deg, rgba(14, 28, 62, 0.92), rgba(8, 16, 40, 0.96));
  box-shadow:
    inset 0 0 54px rgba(0, 0, 0, 0.65),
    0 30px 70px rgba(15, 45, 98, 0.28);
}

.chamber-wall {
  position: absolute;
  pointer-events: none;
}

.wall-back {
  inset: 14px;
  border-radius: 22px;
  transform: translateZ(-85px) scale(0.92);
  background: radial-gradient(circle at 50% 48%, rgba(56, 242, 255, 0.16), rgba(9, 14, 34, 0.96) 70%);
  border: 1px solid rgba(56, 242, 255, 0.25);
  overflow: hidden;
}

.chamber-grid {
  position: absolute;
  inset: -40%;
  background-image:
    linear-gradient(rgba(56, 242, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 242, 255, 0.18) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: perspective(360px) rotateX(55deg) translateY(38%);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.85), transparent 72%);
  animation: gridScroll 5s linear infinite;
}

@keyframes gridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 28px; }
}

.chamber-horizon-glow {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 42%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
  filter: blur(4px);
  opacity: 0.75;
}

.chamber-radar-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 240px;
  height: 240px;
  margin: -120px 0 0 -120px;
  border-radius: 50%;
  border: 1px dashed rgba(56, 242, 255, 0.28);
  animation: radarSpin 24s linear infinite;
}

@keyframes radarSpin {
  to { transform: rotate(360deg); }
}

/* Inner side bevel walls for true recessed box perspective */
.wall-top {
  left: 24px;
  right: 24px;
  top: 0;
  height: 85px;
  transform-origin: top center;
  transform: rotateX(-90deg);
  background: linear-gradient(to bottom, rgba(56, 242, 255, 0.18), rgba(4, 9, 24, 0.85));
}

.wall-bottom {
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 85px;
  transform-origin: bottom center;
  transform: rotateX(90deg);
  background: linear-gradient(to top, rgba(155, 108, 255, 0.22), rgba(4, 9, 24, 0.9));
}

.wall-left {
  top: 24px;
  bottom: 24px;
  left: 0;
  width: 85px;
  transform-origin: left center;
  transform: rotateY(90deg);
  background: linear-gradient(to right, rgba(56, 242, 255, 0.14), rgba(4, 9, 24, 0.85));
}

.wall-right {
  top: 24px;
  bottom: 24px;
  right: 0;
  width: 85px;
  transform-origin: right center;
  transform: rotateY(-90deg);
  background: linear-gradient(to left, rgba(155, 108, 255, 0.18), rgba(4, 9, 24, 0.85));
}

.projected-shadow {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.78), rgba(56, 242, 255, 0.18) 55%, transparent 72%);
  transform: translateZ(-78px) translate3d(var(--sx, 14px), var(--sy, 18px), 0);
  filter: blur(14px);
  pointer-events: none;
}

.chamber-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  transform: translateZ(-12px);
  pointer-events: none;
}

/* Glowing Physical Frame Bezel at Z=0 */
.chamber-bezel {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  border: 2px solid rgba(110, 232, 255, 0.42);
  box-shadow: inset 0 0 22px rgba(56, 242, 255, 0.2);
  pointer-events: none;
  transform: translateZ(2px);
}

.bezel-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--cyan);
  border-style: solid;
  border-width: 0;
}

.bezel-corner.tl { top: -2px; left: -2px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 18px; }
.bezel-corner.tr { top: -2px; right: -2px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 18px; }
.bezel-corner.bl { bottom: -2px; left: -2px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 18px; }
.bezel-corner.br { bottom: -2px; right: -2px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 18px; }

.bezel-label {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(150, 230, 255, 0.65);
  white-space: nowrap;
}

/* POP-OUT CORE: Objects literally floating IN FRONT OF the bezel (+Z) */
.popout-core {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

/* 5-Layer Translucent Glass Protocol Prism Stack */
.prism-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 224px;
  height: 224px;
  margin: -112px 0 0 -112px;
  transform-style: preserve-3d;
  transform: translateZ(66px) rotateX(56deg) rotateZ(-42deg);
  transition: transform 0.75s var(--spring);
  animation: prismHoverFloat 5.4s ease-in-out infinite;
}

@keyframes prismHoverFloat {
  0%, 100% { transform: translateZ(64px) rotateX(56deg) rotateZ(-42deg) translateY(0); }
  50% { transform: translateZ(84px) rotateX(58deg) rotateZ(-39deg) translateY(-8px); }
}

.prism-stack.is-exploded {
  animation: none;
  transform: translateZ(110px) rotateX(50deg) rotateZ(-34deg) scale(1.04);
}

.prism-layer {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1.5px solid rgba(255, 255, 255, 0.44);
  backdrop-filter: blur(12px) saturate(190%);
  -webkit-backdrop-filter: blur(12px) saturate(190%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    0 14px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.75s var(--spring), box-shadow 0.4s ease, border-color 0.25s ease;
  color: #f4f9ff;
  pointer-events: auto;
  cursor: pointer;
}

.prism-layer:hover {
  border-color: #ffffff;
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.85),
    0 0 38px rgba(56, 242, 255, 0.52);
}

.prism-layer .layer-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: 0.03em;
}

.prism-layer .layer-proto {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.88;
}

.layer-1 {
  background: linear-gradient(135deg, rgba(255, 184, 77, 0.34), rgba(255, 95, 158, 0.22));
  transform: translateZ(-36px);
}
.layer-2 {
  background: linear-gradient(135deg, rgba(46, 242, 162, 0.32), rgba(56, 242, 255, 0.22));
  transform: translateZ(-12px);
}
.layer-3 {
  background: linear-gradient(135deg, rgba(77, 136, 255, 0.36), rgba(56, 242, 255, 0.24));
  transform: translateZ(12px);
}
.layer-4 {
  background: linear-gradient(135deg, rgba(155, 108, 255, 0.38), rgba(77, 136, 255, 0.26));
  transform: translateZ(36px);
}
.layer-5 {
  background: linear-gradient(135deg, rgba(56, 242, 255, 0.44), rgba(155, 108, 255, 0.32));
  border-color: rgba(160, 248, 255, 0.85);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.78),
    0 0 36px rgba(56, 242, 255, 0.38);
  transform: translateZ(60px);
}

/* Exploded 3D Naked-Eye Z-Depth State */
.prism-stack.is-exploded .layer-1 { transform: translateZ(-64px); }
.prism-stack.is-exploded .layer-2 { transform: translateZ(-10px); }
.prism-stack.is-exploded .layer-3 { transform: translateZ(44px); }
.prism-stack.is-exploded .layer-4 { transform: translateZ(98px); }
.prism-stack.is-exploded .layer-5 { transform: translateZ(152px); }

/* Orbiting 3D Wireframe Cube Breaking Past Top-Right Frame Border */
.orbiter-cube {
  position: absolute;
  top: -18px;
  right: -22px;
  width: 68px;
  height: 68px;
  transform-style: preserve-3d;
  transform: translateZ(118px);
}

.mini-3d-cube {
  width: 58px;
  height: 58px;
  position: relative;
  transform-style: preserve-3d;
  animation: cubeTumble 9s linear infinite;
}

.mini-3d-cube .cf {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: #e9ffff;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 242, 255, 0.32), rgba(155, 108, 255, 0.28));
  border: 1.5px solid rgba(130, 245, 255, 0.78);
  box-shadow: inset 0 0 14px rgba(56, 242, 255, 0.32);
  backdrop-filter: blur(8px);
}

.mini-3d-cube .f1 { transform: translateZ(29px); }
.mini-3d-cube .f2 { transform: rotateY(180deg) translateZ(29px); }
.mini-3d-cube .f3 { transform: rotateY(90deg) translateZ(29px); }
.mini-3d-cube .f4 { transform: rotateY(-90deg) translateZ(29px); }
.mini-3d-cube .f5 { transform: rotateX(90deg) translateZ(29px); }
.mini-3d-cube .f6 { transform: rotateX(-90deg) translateZ(29px); }

@keyframes cubeTumble {
  0%   { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(180deg); }
}

/* Pop-Out Floating Glass Telemetry Badges (Physically Outside Bezel) */
.popout-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  color: #f3f9ff;
  background: linear-gradient(140deg, rgba(16, 28, 60, 0.82), rgba(12, 20, 44, 0.74));
  border: 1px solid rgba(150, 232, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 20px 38px rgba(0, 0, 0, 0.45);
}

.badge-tl {
  top: 22px;
  left: -34px;
  transform: translateZ(96px);
  animation: badgeBob1 4.6s ease-in-out infinite;
}

.badge-br {
  bottom: 36px;
  right: -30px;
  transform: translateZ(124px);
  animation: badgeBob2 5.2s ease-in-out infinite;
}

.badge-bl {
  bottom: -14px;
  left: -18px;
  transform: translateZ(84px);
  animation: badgeBob3 5.8s ease-in-out infinite;
}

@keyframes badgeBob1 {
  0%, 100% { transform: translateZ(96px) translateY(0); }
  50% { transform: translateZ(108px) translateY(-7px); }
}
@keyframes badgeBob2 {
  0%, 100% { transform: translateZ(124px) translateY(0); }
  50% { transform: translateZ(138px) translateY(7px); }
}
@keyframes badgeBob3 {
  0%, 100% { transform: translateZ(84px) translateY(0); }
  50% { transform: translateZ(96px) translateY(-6px); }
}

.badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-dot.cyan { background: #38f2ff; box-shadow: 0 0 12px #38f2ff; }
.badge-dot.emerald { background: #2ef2a2; box-shadow: 0 0 12px #2ef2a2; }
.badge-dot.violet { background: #a87cff; box-shadow: 0 0 12px #a87cff; }

.badge-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
}

.badge-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(200, 224, 255, 0.75);
}

/* ==========================================================================
   TELEMETRY TICKER STRIP
   ========================================================================== */
.ticker-strip {
  margin: 14px 0 54px;
  padding: 13px 0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  font-size: 0.85rem;
  color: var(--text-secondary);
  animation: tickerScroll 36s linear infinite;
}

.ticker-strip:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-track strong {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 600;
}

.ticker-track .sep {
  color: var(--violet);
  opacity: 0.75;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   SECTION HEADER & LIQUID FILTER BAR
   ========================================================================== */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
  margin-bottom: 6px;
}

.section-title {
  margin: 0;
  font-size: clamp(1.65rem, 2.8vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.filter-bar {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: var(--radius-pill);
}

.filter-droplet {
  position: absolute;
  top: 5px;
  left: 5px;
  height: calc(100% - 10px);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(56, 242, 255, 0.3), rgba(155, 108, 255, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.36);
  transition: transform 0.45s var(--spring), width 0.45s var(--spring);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] .filter-droplet {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.12);
}

.filter-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.25s ease;
}

.filter-btn:hover,
.filter-btn.is-active {
  color: var(--text-primary);
}

/* ==========================================================================
   NAKED-EYE 3D POP-OUT BLOG CARDS GRID
   ========================================================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.card-perspective-wrap {
  perspective: 1100px;
  animation: cardStaggerIn 0.6s var(--smooth) backwards;
  animation-delay: calc(var(--i, 0) * 75ms);
}

@keyframes cardStaggerIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.article-card {
  position: relative;
  height: 100%;
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: rotateX(var(--crx, 0deg)) rotateY(var(--cry, 0deg));
  transition: transform 0.18s ease-out, box-shadow 0.35s ease, border-color 0.35s ease;
  will-change: transform;
}

.article-card:hover {
  border-color: rgba(110, 235, 255, 0.55);
  box-shadow:
    inset 0 1.5px 1px var(--glass-rim-top),
    0 32px 68px rgba(0, 8, 28, 0.52),
    0 0 32px rgba(56, 242, 255, 0.16);
}

[data-theme="light"] .article-card:hover {
  box-shadow:
    inset 0 1.5px 1px #fff,
    0 28px 56px rgba(15, 45, 98, 0.18);
}

/* Recessed 3D Visual Stage inside Each Card */
.card-visual-stage {
  position: relative;
  height: 186px;
  border-radius: 20px;
  margin-bottom: 18px;
  transform-style: preserve-3d;
  background: radial-gradient(circle at 50% 35%, var(--accent-glow, rgba(56, 242, 255, 0.24)), rgba(6, 12, 30, 0.92) 78%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  overflow: visible;
  z-index: 3;
}

/* Subtle recessed grid inside card */
.card-stage-grid {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(circle at 50% 50%, #000 35%, transparent 90%);
  transform: translateZ(-8px);
}

/* Pop-Out 3D Illustration that LEAPS OUT of card on hover! */
.card-popout-art {
  position: relative;
  width: 88%;
  height: 88%;
  display: grid;
  place-items: center;
  transform: translateZ(26px);
  transition: transform 0.45s var(--spring), filter 0.35s ease;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.55));
}

.article-card:hover .card-popout-art {
  transform: translateZ(64px) scale(1.09) translateY(-8px);
  filter: drop-shadow(0 28px 26px rgba(0, 0, 0, 0.68));
}

.card-popout-art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Floating Pop-Out Category & Protocol Tag on Z-Axis */
.card-popout-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: #f3fbff;
  background: rgba(8, 16, 40, 0.72);
  border: 1px solid rgba(120, 232, 255, 0.45);
  backdrop-filter: blur(10px);
  transform: translateZ(34px);
  transition: transform 0.45s var(--spring);
}

.article-card:hover .card-popout-chip {
  transform: translateZ(72px) translateY(-4px);
}

.card-popout-layer {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(5, 11, 28, 0.78);
  border: 1px solid rgba(56, 242, 255, 0.32);
  transform: translateZ(30px);
  transition: transform 0.45s var(--spring);
}

.article-card:hover .card-popout-layer {
  transform: translateZ(66px) translateX(4px);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 2px 6px 6px;
  transform: translateZ(14px);
  z-index: 3;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-difficulty {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.card-title {
  margin: 0 0 10px;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.42;
  color: var(--text-primary);
}

.card-excerpt {
  margin: 0 0 18px;
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.62;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .card-footer {
  border-top-color: rgba(15, 45, 98, 0.09);
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--cyan);
}

.card-read-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
  transition: transform 0.28s var(--spring);
}

.article-card:hover .card-read-arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   VIEW 2: 3D PROTOCOL ATLAS (3D协议图谱)
   ========================================================================== */
.view-banner {
  margin-bottom: 34px;
  max-width: 720px;
}

.view-lead {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.atlas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  align-items: start;
}

.atlas-stage {
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 540px;
  perspective: 1100px;
}

.atlas-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  z-index: 4;
}

.atlas-3d-stack {
  position: relative;
  width: 280px;
  height: 310px;
  margin: 64px auto 64px;
  transform-style: preserve-3d;
  transform: rotateX(52deg) rotateZ(-36deg);
  transition: transform 0.6s var(--smooth);
}

.atlas-plate {
  position: absolute;
  left: 0;
  top: 40px;
  width: 260px;
  height: 220px;
  border-radius: 24px;
  padding: 18px 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.36);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f6fbff;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
  transition: transform 0.55s var(--spring), border-color 0.3s ease, box-shadow 0.35s ease;
  transform: translateZ(var(--plate-z, 0px));
}

.atlas-plate:hover {
  border-color: rgba(255, 255, 255, 0.85);
  transform: translateZ(calc(var(--plate-z, 0px) + 18px)) translateX(10px);
}

.atlas-plate.is-selected {
  border-color: #ffffff;
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.8),
    0 0 42px rgba(56, 242, 255, 0.5),
    0 24px 44px rgba(0, 0, 0, 0.5);
  transform: translateZ(calc(var(--plate-z, 0px) + 34px)) translateX(22px) scale(1.04);
}

.plate-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plate-num {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.34);
}

.plate-pdu {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  opacity: 0.86;
}

.plate-name {
  font-size: 1.12rem;
  font-weight: 800;
}

.plate-protos {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  opacity: 0.9;
}

.atlas-packet-bar {
  width: 100%;
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(4, 10, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  z-index: 4;
}

[data-theme="light"] .atlas-packet-bar {
  background: rgba(15, 34, 72, 0.08);
  border-color: rgba(15, 34, 72, 0.14);
}

.packet-bar-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.packet-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pkt-seg {
  padding: 6px 11px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #f5fbff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  animation: segPop 0.38s var(--spring) backwards;
}

.pkt-seg.is-stripped {
  opacity: 0.38;
  text-decoration: line-through;
  border-style: dashed;
}

@keyframes segPop {
  from { opacity: 0; transform: scale(0.76) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.atlas-inspector {
  border-radius: var(--radius-xl);
  padding: 28px;
  min-height: 540px;
}

.inspector-kicker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
}

.inspector-title {
  margin: 6px 0 12px;
  font-size: 1.6rem;
  font-weight: 800;
}

.inspector-desc {
  color: var(--text-secondary);
  margin: 0 0 22px;
  font-size: 0.95rem;
}

.inspector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.inspector-box {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .inspector-box {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(15, 45, 98, 0.1);
}

.inspector-box label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.inspector-box strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.inspector-analogy {
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 242, 255, 0.11), rgba(155, 108, 255, 0.1));
  border: 1px solid rgba(56, 242, 255, 0.28);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.inspector-analogy strong {
  color: var(--cyan);
}

.inspector-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inspector-chips span {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--cyan);
}

/* ==========================================================================
   VIEW 3: INTERACTIVE NETWORK LAB (交互实验室)
   ========================================================================== */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.lab-card {
  border-radius: var(--radius-xl);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lab-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.lab-card-head h3 {
  margin: 4px 0 0;
  font-size: 1.24rem;
}

.lab-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.lab-mode-switch {
  display: flex;
  gap: 6px;
}

/* TCP Arena */
.tcp-arena {
  display: grid;
  grid-template-columns: 122px 1fr 122px;
  align-items: center;
  gap: 12px;
  padding: 20px 14px;
  border-radius: 20px;
  background: rgba(4, 10, 26, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .tcp-arena {
  background: rgba(15, 40, 88, 0.06);
  border-color: rgba(15, 40, 88, 0.12);
}

.tcp-endpoint {
  text-align: center;
  padding: 14px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.endpoint-icon { font-size: 1.6rem; margin-bottom: 4px; }
.endpoint-name { font-weight: 700; font-size: 0.9rem; }
.endpoint-ip { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); margin: 3px 0 8px; }

.endpoint-state {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(56, 242, 255, 0.16);
  border: 1px solid rgba(56, 242, 255, 0.4);
  color: var(--cyan);
  transition: all 0.3s ease;
}

.endpoint-state.state-ok {
  background: rgba(46, 242, 162, 0.2);
  border-color: rgba(46, 242, 162, 0.55);
  color: var(--emerald);
}

.tcp-channel {
  position: relative;
  height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.tcp-wire {
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(56, 242, 255, 0.3), rgba(155, 108, 255, 0.65), rgba(46, 242, 162, 0.3));
}

.tcp-flying-packet {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  opacity: 0;
  padding: 5px 11px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 242, 255, 0.32), rgba(155, 108, 255, 0.36));
  border: 1px solid rgba(150, 245, 255, 0.78);
  box-shadow: 0 0 22px rgba(56, 242, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
}

.tcp-flying-packet.fly-right {
  animation: flyRight 0.9s var(--smooth) forwards;
}

.tcp-flying-packet.fly-left {
  animation: flyLeft 0.9s var(--smooth) forwards;
}

@keyframes flyRight {
  0%   { left: 8%; opacity: 0; transform: translateX(0) scale(0.8); }
  20%  { opacity: 1; transform: translateX(0) scale(1.06); }
  80%  { opacity: 1; }
  100% { left: 92%; opacity: 0.95; transform: translateX(-100%) scale(1); }
}

@keyframes flyLeft {
  0%   { left: 92%; opacity: 0; transform: translateX(-100%) scale(0.8); }
  20%  { opacity: 1; transform: translateX(-100%) scale(1.06); }
  80%  { opacity: 1; }
  100% { left: 8%; opacity: 0.95; transform: translateX(0) scale(1); }
}

.pkt-flag {
  font-weight: 700;
  color: #ffffff;
}

.pkt-meta {
  color: #b6f5ff;
}

.tcp-step-caption {
  position: absolute;
  bottom: 2px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  text-align: center;
}

.tcp-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tcp-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.tcp-log-item.is-done {
  color: var(--text-primary);
  background: rgba(56, 242, 255, 0.1);
  border-color: rgba(56, 242, 255, 0.35);
}

.tcp-log-item.is-current {
  border-color: var(--emerald);
  box-shadow: 0 0 18px rgba(46, 242, 162, 0.22);
}

.lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

/* CIDR Calculator */
.cidr-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--cyan);
}

.cidr-controls {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}

.cidr-input-group label,
.cidr-slider-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cidr-input-group input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  outline: none;
}

.cidr-input-group input[type="text"]:focus {
  border-color: var(--cyan);
}

.slider-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-top strong {
  font-family: var(--font-mono);
  color: var(--cyan);
}

#cidrPrefixRange {
  width: 100%;
  accent-color: var(--cyan);
  margin-top: 8px;
  cursor: pointer;
}

.cidr-bits-panel {
  padding: 14px;
  border-radius: 16px;
  background: rgba(4, 10, 26, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .cidr-bits-panel {
  background: rgba(15, 40, 88, 0.06);
  border-color: rgba(15, 40, 88, 0.12);
}

.bits-legend {
  display: flex;
  gap: 18px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.bits-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 6px;
}

.bits-legend .dot.net { background: var(--cyan); }
.bits-legend .dot.host { background: var(--violet); }

.cidr-bits-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.octet-group {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.bit-cell {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 0;
  border-radius: 4px;
}

.bit-cell.is-net {
  background: rgba(56, 242, 255, 0.22);
  color: var(--cyan);
}

.bit-cell.is-host {
  background: rgba(155, 108, 255, 0.22);
  color: #d6bcff;
}

[data-theme="light"] .bit-cell.is-host {
  color: #6d28d9;
}

.cidr-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cidr-stat {
  padding: 11px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .cidr-stat {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(15, 45, 98, 0.1);
}

.cidr-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cidr-stat strong {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* ==========================================================================
   VIEW 4: ABOUT AUTHOR (3D Glass ID Card)
   ========================================================================== */
.about-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.about-card-wrap {
  perspective: 1100px;
}

.about-id-card {
  border-radius: var(--radius-xl);
  padding: 32px 26px;
  text-align: center;
  transform-style: preserve-3d;
  transform: rotateX(var(--arx, 0deg)) rotateY(var(--ary, 0deg));
  transition: transform 0.18s ease-out;
}

.id-avatar-3d {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  transform: translateZ(46px);
  display: grid;
  place-items: center;
}

.avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(56, 242, 255, 0.65);
  animation: radarSpin 14s linear infinite;
}

.avatar-core {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #38f2ff, #4d88ff, #9b6cff);
  box-shadow: 0 14px 36px rgba(56, 242, 255, 0.35);
}

.id-name {
  margin: 0 0 4px;
  font-size: 1.45rem;
  transform: translateZ(32px);
}

.id-role {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--cyan);
  transform: translateZ(24px);
}

.id-bio {
  margin: 0 0 20px;
  font-size: 0.89rem;
  color: var(--text-secondary);
}

.id-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-bottom: 22px;
  transform: translateZ(28px);
}

.id-tags span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--cyan);
}

.id-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.id-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--cyan);
}

.id-stats span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.about-details {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-panel {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.about-panel h3 {
  margin: 4px 0 12px;
  font-size: 1.32rem;
}

.about-panel p {
  margin: 0;
  color: var(--text-secondary);
}

.roadmap-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.roadmap-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.rm-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.45);
}

.rm-dot.done {
  background: var(--emerald);
  border-color: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
}

.rm-dot.active {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.roadmap-list strong {
  display: block;
  margin-bottom: 4px;
}

/* ==========================================================================
   SHARED-ELEMENT FLIP MORPH & ARTICLE READER OVERLAY
   ========================================================================== */
.flip-stage {
  position: fixed;
  inset: 0;
  z-index: 850;
  pointer-events: none;
}

.flip-clone {
  position: fixed;
  border-radius: var(--radius-xl);
  background: var(--glass-bg-strong);
  border: 1.5px solid rgba(110, 232, 255, 0.6);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.55),
    0 32px 90px rgba(0, 10, 32, 0.65),
    0 0 40px rgba(56, 242, 255, 0.25);
  will-change: transform, width, height, top, left, opacity, border-radius;
}

.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.34s ease, visibility 0.34s ease;
}

.reader-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 20, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

[data-theme="light"] .reader-backdrop {
  background: rgba(215, 230, 248, 0.62);
}

.reader-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 520;
  background: rgba(255, 255, 255, 0.08);
}

.reader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--emerald));
  box-shadow: 0 0 14px var(--cyan);
  transition: width 0.08s linear;
}

.reader-sheet {
  position: relative;
  z-index: 510;
  width: 100%;
  max-width: 1060px;
  height: min(90vh, 880px);
  border-radius: 30px;
  background: var(--glass-bg-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(18px);
  opacity: 0;
  transition: transform 0.45s var(--smooth), opacity 0.35s ease;
}

.reader-overlay.is-open .reader-sheet {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.reader-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  z-index: 5;
}

.reader-topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.reader-cat-badge {
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.78rem;
}

.reader-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px 46px;
  scroll-behavior: smooth;
  z-index: 4;
}

.reader-hero {
  margin-bottom: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.reader-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.28;
}

.reader-hero-sub {
  margin: 0 0 22px;
  font-size: 1.02rem;
  color: var(--text-secondary);
}

.reader-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.reader-body-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 32px;
  align-items: start;
}

.reader-content h2 {
  margin: 34px 0 14px;
  font-size: 1.32rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.reader-content h2::before {
  content: '';
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(to bottom, var(--cyan), var(--violet));
  flex-shrink: 0;
}

.reader-content p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.97rem;
  line-height: 1.82;
}

.reader-content ul {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--text-secondary);
}

.reader-content li {
  margin-bottom: 8px;
}

/* Illustrated Diagram Card inside Article */
.diagram-figure {
  margin: 26px 0;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(6, 14, 34, 0.88), rgba(10, 20, 48, 0.78));
  border: 1px solid rgba(56, 242, 255, 0.3);
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.45), 0 14px 32px rgba(0, 0, 0, 0.28);
}

.diagram-figure svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-caption {
  margin-top: 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: rgba(175, 224, 255, 0.75);
}

.callout-box {
  margin: 22px 0;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 242, 255, 0.11), rgba(46, 242, 162, 0.08));
  border-left: 3px solid var(--cyan);
  font-size: 0.92rem;
  color: var(--text-primary);
}

.reader-aside {
  position: sticky;
  top: 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reader-toc-box,
.reader-keycard {
  border-radius: 18px;
  padding: 16px;
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 10px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-list a {
  text-decoration: none;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 5px 8px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.toc-list a:hover {
  background: rgba(56, 242, 255, 0.12);
  color: var(--cyan);
}

.keycard-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 8px;
}

.keycard-list {
  margin: 0;
  padding-left: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.keycard-list li {
  margin-bottom: 6px;
}

.reader-footer-nav {
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.footer-nav-card {
  padding: 16px 18px;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-family: inherit;
  transition: transform 0.25s var(--spring), border-color 0.25s ease;
}

.footer-nav-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
}

.footer-nav-card span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  margin-bottom: 4px;
}

.footer-nav-card strong {
  font-size: 0.92rem;
}

/* ==========================================================================
   QUICK SEARCH MODAL
   ========================================================================== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 110px 20px 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.search-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 22, 0.64);
  backdrop-filter: blur(12px);
}

.search-dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  border-radius: 24px;
  background: var(--glass-bg-strong);
  overflow: hidden;
  transform: translateY(-16px) scale(0.96);
  transition: transform 0.35s var(--spring);
}

.search-modal.is-open .search-dialog {
  transform: translateY(0) scale(1);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--cyan);
}

.search-input-row input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.98rem;
  font-family: inherit;
  outline: none;
}

.search-input-row kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text-muted);
}

.search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 10px;
}

.search-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  transition: background 0.2s ease;
}

.search-item:hover {
  background: rgba(56, 242, 255, 0.13);
}

.search-item-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.search-item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto 28px;
  padding: 0 24px;
}

.footer-bar {
  border-radius: var(--radius-pill);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--emerald);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .atlas-layout,
  .lab-grid,
  .about-layout {
    grid-template-columns: 1fr;
  }
  .reader-body-layout {
    grid-template-columns: 1fr;
  }
  .reader-aside {
    position: static;
  }
}

@media (max-width: 760px) {
  .glass-nav {
    flex-wrap: wrap;
    border-radius: 24px;
    padding: 10px 14px;
  }
  .nav-pill-track {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: space-between;
  }
  .nav-tab {
    padding: 7px 11px;
    font-size: 0.8rem;
  }
  .cta-pill {
    display: none;
  }
  .main-stage {
    padding-top: 148px;
  }
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .badge-tl { left: -8px; }
  .badge-br { right: -8px; }
  .badge-bl { left: -6px; }
  .orbiter-cube { right: -4px; }
  .reader-overlay {
    padding: 10px;
  }
  .reader-scroll {
    padding: 20px 18px 34px;
  }
  .cidr-controls,
  .cidr-bits-grid,
  .reader-footer-nav {
    grid-template-columns: 1fr;
  }
  .tcp-arena {
    grid-template-columns: 1fr;
  }
  .footer-bar {
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
