/* ==========================================================================
   Deluxe Killed-by-Google Resume Timeline - Dynamic Background & Fast Fonts
   ========================================================================== */

/* Custom Font Declaration with Fast System Fallback & Swap Rendering */
@font-face {
  font-family: 'TXHuaGuan';
  src: url('./fonts/TXHuaGuan-Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Instant system font render, zero blocking window delay */
}

:root {
  /* Rich Palette */
  --kbg-bg: #eef4ff;
  --kbg-card-bg: rgba(255, 255, 255, 0.88);
  --kbg-text-main: #0f172a;
  --kbg-text-sub: #475569;
  --kbg-text-light: #94a3b8;
  --kbg-border: rgba(148, 163, 184, 0.28);
  --kbg-border-hover: #2563eb;

  /* Frosted surfaces shared by cards and controls */
  --glass-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.78));
  --glass-border: rgba(255, 255, 255, 0.82);

  /* Node Specific Colors */
  --color-node-0: #f59e0b; /* Amber */
  --color-node-1: #0d9488; /* Teal */
  --color-node-2: #0284c7; /* Sky Blue */
  --color-node-3: #2563eb; /* Tencent Blue */

  /* Premium Multi-layer Shadows */
  --elevation-1: 0 20px 52px rgba(36, 55, 85, 0.11), 0 3px 10px rgba(15, 23, 42, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --elevation-hover: 0 30px 66px rgba(37, 99, 235, 0.2), 0 9px 22px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.98);

  /* Fonts: Immediate system fallbacks so page renders instantly */
  --font-main: 'TXHuaGuan', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --timeline-width: 2200px;
}

/* Base Reset & 100vh Screen Boundary */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -22%, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 0.78) 19rem, transparent 43rem),
    linear-gradient(135deg, #e8f0ff 0%, #f7f2ff 28%, #edf9ff 58%, #e9fff8 100%);
  color: var(--kbg-text-main);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

body {
  isolation: isolate;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Saturated mesh lighting establishes distinct blue, violet and teal zones. */
body::before {
  inset: -12%;
  background:
    radial-gradient(ellipse 48% 42% at 2% 10%, rgba(37, 99, 235, 0.3), transparent 67%),
    radial-gradient(ellipse 38% 36% at 28% 94%, rgba(124, 58, 237, 0.16), transparent 70%),
    radial-gradient(ellipse 47% 44% at 97% 82%, rgba(13, 148, 136, 0.28), transparent 68%),
    radial-gradient(ellipse 32% 28% at 82% 4%, rgba(6, 182, 212, 0.17), transparent 72%),
    conic-gradient(from 214deg at 51% 50%, transparent 0deg, rgba(99, 102, 241, 0.08) 35deg, transparent 72deg, rgba(14, 165, 233, 0.1) 138deg, transparent 192deg);
  filter: saturate(132%);
  animation: meshBreath 14s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

/* A diagonal spectral ribbon gives the static canvas a clear sense of motion. */
body::after {
  background:
    linear-gradient(116deg, transparent 27%, rgba(255, 255, 255, 0.16) 35%, rgba(99, 102, 241, 0.13) 43%, rgba(6, 182, 212, 0.16) 50%, rgba(255, 255, 255, 0.36) 54%, transparent 64%),
    repeating-linear-gradient(126deg, transparent 0 86px, rgba(37, 99, 235, 0.035) 86px 87px),
    radial-gradient(ellipse at center, transparent 45%, rgba(30, 64, 175, 0.065) 100%);
  opacity: 0.92;
}

/* --------------------------------------------------------------------------
   Rich Dynamic Ambient Background & Grid Pattern
   -------------------------------------------------------------------------- */
.bg-grid-pattern {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.055) 1px, transparent 1px),
    radial-gradient(rgba(30, 64, 175, 0.24) 0.85px, transparent 1px);
  background-size: 88px 88px, 88px 88px, 22px 22px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 50%, #000 22%, rgba(0, 0, 0, 0.7) 64%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 72% at 50% 50%, #000 22%, rgba(0, 0, 0, 0.7) 64%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.86;
}

.bg-grid-pattern::before,
.bg-grid-pattern::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Sparse luminous nodes make the grid feel intentional rather than decorative. */
.bg-grid-pattern::before {
  background:
    radial-gradient(circle at 8% 28%, rgba(37, 99, 235, 0.95) 0 1.5px, rgba(37, 99, 235, 0.26) 2px 6px, transparent 13px),
    radial-gradient(circle at 22% 76%, rgba(124, 58, 237, 0.85) 0 1.5px, rgba(124, 58, 237, 0.22) 2px 7px, transparent 14px),
    radial-gradient(circle at 41% 19%, rgba(14, 165, 233, 0.9) 0 1.5px, rgba(14, 165, 233, 0.24) 2px 6px, transparent 13px),
    radial-gradient(circle at 63% 72%, rgba(59, 130, 246, 0.85) 0 1.5px, rgba(59, 130, 246, 0.2) 2px 7px, transparent 14px),
    radial-gradient(circle at 79% 24%, rgba(6, 182, 212, 0.9) 0 1.5px, rgba(6, 182, 212, 0.23) 2px 6px, transparent 13px),
    radial-gradient(circle at 94% 62%, rgba(13, 148, 136, 0.9) 0 1.5px, rgba(13, 148, 136, 0.24) 2px 7px, transparent 14px);
  filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.25));
  animation: nodePulse 5.5s ease-in-out infinite alternate;
}

/* Hairline routes connect visual zones without competing with the timeline. */
.bg-grid-pattern::after {
  background:
    linear-gradient(118deg, transparent 0 15%, rgba(99, 102, 241, 0.18) 15.08% 15.16%, transparent 15.24% 100%),
    linear-gradient(62deg, transparent 0 73%, rgba(6, 182, 212, 0.16) 73.08% 73.16%, transparent 73.24% 100%),
    linear-gradient(152deg, transparent 0 48%, rgba(37, 99, 235, 0.12) 48.08% 48.16%, transparent 48.24% 100%);
  opacity: 0.72;
}

.bg-glow {
  position: fixed;
  border-radius: 46% 54% 58% 42% / 55% 44% 56% 45%;
  filter: blur(36px) saturate(155%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.88;
  mix-blend-mode: multiply;
  will-change: transform, opacity;
}

.bg-glow-1 {
  width: 900px;
  height: 330px;
  top: -128px;
  left: -235px;
  background: linear-gradient(92deg, rgba(37, 99, 235, 0.4), rgba(99, 102, 241, 0.26), rgba(147, 51, 234, 0.14));
  animation: auroraDrift1 13s ease-in-out infinite alternate;
}

.bg-glow-2 {
  width: 920px;
  height: 360px;
  bottom: -158px;
  right: -230px;
  background: linear-gradient(92deg, rgba(6, 182, 212, 0.2), rgba(13, 148, 136, 0.36), rgba(16, 185, 129, 0.18));
  animation: auroraDrift2 16s ease-in-out infinite alternate-reverse;
}

.bg-glow-3 {
  width: 860px;
  height: 245px;
  top: 46%;
  left: 43%;
  background: linear-gradient(92deg, rgba(245, 158, 11, 0.14), rgba(236, 72, 153, 0.1), rgba(99, 102, 241, 0.18), rgba(14, 165, 233, 0.16));
  filter: blur(44px) saturate(155%);
  animation: auroraDrift3 14s ease-in-out infinite alternate;
}

@keyframes meshBreath {
  0% { transform: scale(1) translate3d(0, 0, 0); opacity: 0.84; }
  100% { transform: scale(1.035) translate3d(1.2%, -0.8%, 0); opacity: 1; }
}

@keyframes nodePulse {
  0% { opacity: 0.48; }
  100% { opacity: 0.94; }
}

@keyframes auroraDrift1 {
  0% { transform: translate(0, 0) rotate(-13deg) scale(1); opacity: 0.72; }
  100% { transform: translate(92px, 42px) rotate(-6deg) scale(1.1); opacity: 0.98; }
}

@keyframes auroraDrift2 {
  0% { transform: translate(0, 0) rotate(-15deg) scale(1); opacity: 0.7; }
  100% { transform: translate(-96px, -34px) rotate(-7deg) scale(1.11); opacity: 0.96; }
}

@keyframes auroraDrift3 {
  0% { transform: translate(-50%, -50%) rotate(6deg) scale(0.92); opacity: 0.48; }
  100% { transform: translate(-41%, -43%) rotate(-3deg) scale(1.1); opacity: 0.78; }
}

.app-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

/* Horizontal atmospheric band follows the timeline without obscuring it. */
.app-viewport::before {
  content: '';
  position: absolute;
  left: -8%;
  right: -8%;
  top: 35%;
  height: 30%;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.11) 10%, rgba(244, 63, 94, 0.09) 25%, rgba(99, 102, 241, 0.18) 49%, rgba(6, 182, 212, 0.18) 75%, rgba(16, 185, 129, 0.1) 90%, transparent);
  filter: blur(25px) saturate(140%);
  opacity: 0.94;
  transform: skewY(-1deg);
  pointer-events: none;
  z-index: 0;
}

/* Fine orbital rings add structure to the otherwise empty right side. */
.app-viewport::after {
  content: '';
  position: absolute;
  width: 640px;
  height: 640px;
  top: 7%;
  right: -165px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 0 31%, rgba(255, 255, 255, 0.5) 31.2% 31.5%, transparent 31.8%),
    repeating-radial-gradient(circle, rgba(37, 99, 235, 0.1) 0 1px, transparent 1px 58px),
    conic-gradient(from 18deg, transparent 0 9%, rgba(37, 99, 235, 0.2) 9.2% 9.7%, transparent 10% 35%, rgba(6, 182, 212, 0.19) 35.2% 35.7%, transparent 36% 67%, rgba(99, 102, 241, 0.18) 67.2% 67.7%, transparent 68% 100%);
  -webkit-mask-image: radial-gradient(circle, #000 0 62%, transparent 82%);
  mask-image: radial-gradient(circle, #000 0 62%, transparent 82%);
  filter: drop-shadow(0 0 18px rgba(37, 99, 235, 0.12));
  opacity: 0.78;
  animation: orbitDrift 28s linear infinite;
  pointer-events: none;
  z-index: 0;
}

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

/* --------------------------------------------------------------------------
   Top Hero Compact Section
   -------------------------------------------------------------------------- */
.compact-hero {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 16px clamp(16px, 3vw, 36px) 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66) 0%, rgba(244, 249, 255, 0.26) 74%, transparent 100%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  z-index: 20;
}

.compact-hero::after {
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.24) 28%, rgba(99, 102, 241, 0.22) 50%, rgba(13, 148, 136, 0.2) 72%, transparent);
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.user-name {
  font-size: 1.85rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.status-ping {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 10px #2563eb;
}

.status-text {
  font-size: 0.76rem;
  font-weight: 600;
  color: #2563eb;
}

.hero-sub-row {
  font-size: 0.88rem;
  color: var(--kbg-text-sub);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dot-divider {
  color: #cbd5e1;
}

/* Action Chips */
.hero-actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
  color: var(--kbg-text-main);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-main);
  box-shadow: 0 7px 20px rgba(36, 55, 85, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.action-chip:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: #94a3b8;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.chip-lang {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.88), rgba(239, 246, 255, 0.78));
  color: #0f172a;
  border-color: #cbd5e1;
  font-weight: 600;
}

.chip-lang:hover {
  background: #ffffff;
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.chip-lang svg { color: #0284c7; }
.chip-phone svg { color: #16a34a; }
.chip-mail svg { color: #2563eb; }
.chip-blog svg { color: #0d9488; }
.chip-github svg { color: #0f172a; }

.chip-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.chip-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

/* --------------------------------------------------------------------------
   Center Timeline Viewport (Flex 1 to Fill Available Screen Height)
   -------------------------------------------------------------------------- */
.timeline-viewport-wrapper {
  flex: 1 1 auto;
  position: relative;
  width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  user-select: none;
  z-index: 10;
  scrollbar-width: none;
}

.timeline-viewport-wrapper::-webkit-scrollbar {
  display: none;
}

.timeline-viewport-wrapper:active {
  cursor: grabbing;
}

.timeline-viewport-track {
  position: relative;
  width: var(--timeline-width);
  height: 100%;
  padding: 0 80px;
}

.timeline-inner-track {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Guaranteed Vibrant Gradient Timeline Axis Line via CSS ::before */
.timeline-inner-track::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 7px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 25%, #0d9488 50%, #0284c7 75%, #2563eb 100%);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 0 24px rgba(2, 132, 199, 0.26), 0 6px 22px rgba(37, 99, 235, 0.12);
  z-index: 1;
  pointer-events: none;
}

/* SVG Vector Overlay */
.kbg-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.svg-dot-group {
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.25s ease;
}

.svg-dot-group:hover {
  transform: scale(1.35);
}

/* --------------------------------------------------------------------------
   Timeline Cards Layer (Symmetrical Top & Bottom Placement with Rich Aesthetics)
   -------------------------------------------------------------------------- */
.cards-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.card-wrapper {
  position: absolute;
  width: 360px;
  transition: opacity 0.25s ease, transform 0.25s ease;
  will-change: transform, opacity;
}

#node-0 { left: 80px; }
#node-1 { left: 580px; }
#node-2 { left: 1080px; }
#node-3 { left: 1580px; }

/* Symmetrical Placement relative to the 50% Timeline Axis line */
.card-top {
  bottom: calc(50% + 28px);
}

.card-bottom {
  top: calc(50% + 28px);
}

.kbg-card {
  position: relative;
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--elevation-1);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

/* Custom Colored Gradient Top Border Bar for each card */
.kbg-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #cbd5e1;
  transition: background 0.25s ease;
  z-index: 2;
}

#card-0::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
#card-1::before { background: linear-gradient(90deg, #0d9488, #14b8a6); }
#card-2::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }
#card-3::before { background: linear-gradient(90deg, #2563eb, #60a5fa); }

.kbg-card::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  right: -92px;
  bottom: -112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.13), transparent 68%);
  pointer-events: none;
  z-index: 0;
}

#card-0::after { background: radial-gradient(circle, rgba(245, 158, 11, 0.16), transparent 68%); }
#card-1::after { background: radial-gradient(circle, rgba(13, 148, 136, 0.16), transparent 68%); }
#card-2::after { background: radial-gradient(circle, rgba(2, 132, 199, 0.16), transparent 68%); }
#card-3::after { background: radial-gradient(circle, rgba(37, 99, 235, 0.19), transparent 68%); }

.kbg-card > * {
  position: relative;
  z-index: 1;
}

.card-wrapper:hover .kbg-card {
  box-shadow: var(--elevation-hover);
  transform: translateY(-5px);
}

#node-0:hover .kbg-card { border-color: rgba(245, 158, 11, 0.4); }
#node-1:hover .kbg-card { border-color: rgba(13, 148, 136, 0.4); }
#node-2:hover .kbg-card { border-color: rgba(2, 132, 199, 0.4); }
#node-3:hover .kbg-card { border-color: rgba(37, 99, 235, 0.5); }

.card-featured {
  border: 2px solid var(--color-node-3);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.84));
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.time-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.badge-blue {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.type-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--kbg-text-light);
}

.tag-amber { color: #d97706; }
.tag-blue { color: #2563eb; }

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--kbg-text-main);
  margin-bottom: 4px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card-role {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--kbg-blue);
  margin-bottom: 10px;
}

.role-amber { color: #d97706; }
.role-blue { color: #2563eb; }

.card-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--kbg-text-sub);
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

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

.pill {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.pill-node-0 {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.15);
}

.pill-node-1 {
  background: rgba(13, 148, 136, 0.08);
  color: #0d9488;
  border-color: rgba(13, 148, 136, 0.15);
}

.pill-node-2 {
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.15);
}

.pill-node-3 {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.15);
}

/* Spotlight dimming */
.cards-container.has-active .card-wrapper:not(.is-active) {
  opacity: 0.35;
}

/* --------------------------------------------------------------------------
   Bottom Quick Navigation Bar
   -------------------------------------------------------------------------- */
.footer-nav {
  flex: 0 0 auto;
  padding-bottom: 14px;
  display: flex;
  justify-content: center;
  z-index: 90;
}

.nav-pills {
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  backdrop-filter: blur(20px) saturate(145%);
  border: 1px solid rgba(255, 255, 255, 0.84);
  padding: 6px 18px;
  border-radius: 24px;
  box-shadow: 0 16px 38px rgba(36, 55, 85, 0.1), 0 0 0 1px rgba(148, 163, 184, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-node-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--kbg-text-sub);
  font-size: 0.78rem;
  font-family: var(--font-main);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-node-btn:hover,
.nav-node-btn.active {
  color: var(--kbg-text-main);
  background: #f1f5f9;
  font-weight: 600;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}

.dot-amber { background: #d97706; }
.dot-blue { background: #2563eb; }

.nav-node-btn.active .dot {
  background: #2563eb;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
  transform: scale(1.3);
}

.sep {
  width: 12px;
  height: 1px;
  background: var(--kbg-border);
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  .bg-glow,
  .bg-grid-pattern::before,
  .app-viewport::after {
    animation: none !important;
  }

  .action-chip,
  .card-wrapper,
  .kbg-card,
  .svg-dot-group {
    transition-duration: 0.01ms !important;
  }
}

/* Print */
.print-container { display: none; }
@media print {
  body::before,
  body::after,
  .bg-glow,
  .bg-grid-pattern,
  .app-viewport::before,
  .app-viewport::after {
    display: none !important;
  }

  body * { visibility: hidden; }
  .print-container, .print-container * { visibility: visible; }
  .print-container {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: #ffffff;
    color: #000;
  }
  .print-header { border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 20px; }
  .print-header h2 { font-size: 20px; }
  .print-section { margin-bottom: 20px; }
  .print-section-title { font-size: 14px; border-bottom: 1px solid #ccc; padding-bottom: 4px; margin-bottom: 10px; font-weight: bold; }
  .print-item { margin-bottom: 14px; }
  .print-item-header { display: flex; justify-content: space-between; font-size: 13px; font-weight: bold; }
}

/* Low-height laptops need denser cards rather than clipped content. */
@media screen and (max-height: 780px) and (min-width: 769px) {
  .compact-hero {
    padding: 8px 20px 5px;
  }

  .hero-top-row {
    gap: 9px;
    margin-bottom: 2px;
  }

  .user-name {
    font-size: 1.55rem;
  }

  .status-indicator {
    padding: 3px 10px;
  }

  .status-text {
    font-size: 0.68rem;
  }

  .hero-sub-row {
    margin-bottom: 6px;
    gap: 4px;
    font-size: 0.75rem;
    line-height: 1.2;
  }

  .hero-actions-row {
    gap: 6px;
  }

  .action-chip {
    gap: 5px;
    padding: 5px 11px;
    border-radius: 14px;
    font-size: 0.72rem;
  }

  .action-chip svg {
    width: 13px;
    height: 13px;
  }

  .card-wrapper {
    width: 380px;
  }

  .card-top {
    bottom: calc(50% + 24px);
  }

  .card-bottom {
    top: calc(50% + 24px);
  }

  .kbg-card {
    padding: 14px 16px;
    border-radius: 14px;
  }

  .card-meta {
    margin-bottom: 5px;
  }

  .time-badge {
    padding: 2px 7px;
    font-size: 0.66rem;
  }

  .type-tag {
    font-size: 0.66rem;
  }

  .card-title {
    margin-bottom: 2px;
    font-size: 1rem;
    line-height: 1.24;
  }

  .card-role {
    margin-bottom: 5px;
    font-size: 0.78rem;
  }

  .card-desc {
    margin-bottom: 7px;
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .card-pills {
    gap: 4px;
  }

  .pill {
    padding: 2px 7px;
    font-size: 0.65rem;
  }

  .footer-nav {
    padding-bottom: 7px;
  }

  .nav-pills {
    padding: 4px 14px;
  }

  .nav-node-btn {
    padding: 3px 8px;
    font-size: 0.7rem;
  }
}

@media screen and (max-height: 640px) and (min-width: 769px) {
  .compact-hero {
    padding-top: 5px;
  }

  .hero-sub-row {
    margin-bottom: 4px;
    font-size: 0.68rem;
  }

  .action-chip {
    padding: 4px 9px;
    font-size: 0.67rem;
  }

  .kbg-card {
    padding: 11px 13px;
  }

  .card-title {
    font-size: 0.92rem;
  }

  .card-role,
  .card-desc {
    font-size: 0.7rem;
  }

  .card-desc {
    line-height: 1.25;
  }
}

/* Mobile becomes a readable vertical timeline instead of a shrunken desktop. */
@media screen and (max-width: 768px) {
  :root {
    --timeline-width: 100%;
  }

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
  }

  .app-viewport {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    padding-bottom: calc(74px + min(24vh, 200px));
    overflow: visible;
  }

  .app-viewport::before,
  .app-viewport::after {
    position: fixed;
  }

  .compact-hero {
    padding: 14px 14px 9px;
  }

  .hero-top-row {
    gap: 8px;
    margin-bottom: 5px;
  }

  .user-name {
    font-size: 1.55rem;
  }

  .status-indicator {
    padding: 3px 9px;
  }

  .status-text {
    font-size: 0.68rem;
  }

  .hero-sub-row {
    margin-bottom: 9px;
    gap: 4px;
    font-size: 0.74rem;
    line-height: 1.4;
  }

  .hero-actions-row {
    width: 100%;
    padding: 2px 2px 7px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .hero-actions-row::-webkit-scrollbar {
    display: none;
  }

  .action-chip {
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .timeline-viewport-wrapper {
    flex: none;
    width: 100%;
    overflow: visible;
    cursor: default;
    user-select: auto;
  }

  .timeline-viewport-wrapper:active {
    cursor: default;
  }

  .timeline-viewport-track {
    width: 100%;
    height: auto;
    padding: 22px 16px 24px 44px;
  }

  .timeline-inner-track {
    width: 100%;
    height: auto;
  }

  .timeline-inner-track::before,
  .kbg-svg {
    display: none;
  }

  .cards-container {
    display: grid;
    width: 100%;
    height: auto;
    gap: 16px;
  }

  .cards-container::before {
    content: '';
    position: absolute;
    top: 30px;
    bottom: 30px;
    left: -24px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, #f59e0b, #0d9488 38%, #0284c7 70%, #2563eb);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.24);
  }

  .card-wrapper,
  #node-0,
  #node-1,
  #node-2,
  #node-3 {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    scroll-margin-top: 120px;
    will-change: auto;
  }

  .card-wrapper::before {
    content: '';
    position: absolute;
    top: 27px;
    left: -30px;
    width: 14px;
    height: 14px;
    border: 3px solid currentColor;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.72), 0 4px 12px rgba(15, 23, 42, 0.14);
    z-index: 5;
  }

  #node-0 { color: #f59e0b; }
  #node-1 { color: #0d9488; }
  #node-2 { color: #0284c7; }
  #node-3 { color: #2563eb; }

  .kbg-card {
    padding: 18px;
    color: var(--kbg-text-main);
  }

  .card-wrapper:hover .kbg-card {
    transform: none;
  }

  .cards-container.has-active .card-wrapper:not(.is-active) {
    opacity: 1;
  }

  .footer-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: linear-gradient(180deg, transparent, rgba(238, 246, 255, 0.9) 34%, rgba(238, 246, 255, 0.98));
  }

  .nav-pills {
    width: 100%;
    max-width: 100%;
    padding: 5px 10px;
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border-radius: 18px;
    scrollbar-width: none;
  }

  .nav-pills::-webkit-scrollbar {
    display: none;
  }

  .nav-node-btn {
    flex: 0 0 auto;
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .sep {
    flex: 0 0 10px;
  }

  .bg-grid-pattern {
    background-size: 72px 72px, 72px 72px, 20px 20px;
    opacity: 0.7;
  }

  .bg-glow {
    opacity: 0.64;
  }

  .app-viewport::after {
    width: 440px;
    height: 440px;
    top: 12%;
    right: -235px;
    opacity: 0.46;
  }
}

@media screen and (max-width: 420px) {
  .compact-hero {
    padding-right: 10px;
    padding-left: 10px;
  }

  .user-name {
    font-size: 1.4rem;
  }

  .timeline-viewport-track {
    padding-right: 12px;
    padding-left: 38px;
  }

  .cards-container::before {
    left: -20px;
  }

  .card-wrapper::before {
    left: -26px;
  }

  .kbg-card {
    padding: 16px;
  }
}
