/* ==========================================================================
   Qisong Zhang (张启淞) — Academic Homepage Design System
   Synthesizing:
   - meta/astryx (Stone & Neutral theme tokens, 1.2 modular type scale, motion tokens)
   - DavidHDev/canvas-ui (Interactive WebGL2 ForceField & 3D WaveGrid stage)
   - uiverse-io/galaxy (Spotlight cards, tactile pill buttons, skeleton shimmer)
   ========================================================================== */

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/figtree-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  /* Astryx Stone & Neutral Light Palette (Default Editorial Academic Mode) */
  --color-background-page: #FAF8F5;
  --color-background-surface: #FFFFFF;
  --color-background-elevated: #F3EFEA;
  --color-background-subtle: rgba(24, 24, 27, 0.035);
  --color-background-glass: rgba(250, 248, 245, 0.88);
  --color-bezel-outer: var(--color-background-surface);
  --color-bezel-border: rgba(24, 24, 27, 0.12);
  --color-inner-highlight: rgba(255, 255, 255, 0.9);

  --color-text-primary: #161618;
  --color-text-secondary: #4A4A52;
  --color-text-muted: #71717A;
  --color-text-on-accent: #FFFFFF;

  --color-border-subtle: rgba(24, 24, 27, 0.08);
  --color-border-emphasized: rgba(24, 24, 27, 0.16);

  /* Single Primary Accent (Warm Terracotta / Editorial Rust) + Semantic Status */
  --color-accent-primary: #C2410C;
  --color-accent-soft: rgba(194, 65, 12, 0.10);
  --color-accent-border: rgba(194, 65, 12, 0.28);
  --color-secondary-teal: #0F766E;
  --color-secondary-teal-soft: rgba(15, 118, 110, 0.10);
  --color-secondary-blue: #1D4ED8;
  --color-secondary-blue-soft: rgba(29, 78, 216, 0.10);

  --color-status-success: #15803D;
  --color-status-warning: #B45309;

  /* Shadows */
  --shadow-ambient: 0 8px 24px -16px rgba(22, 22, 24, 0.18);
  --shadow-elevated: 0 16px 32px -18px rgba(22, 22, 24, 0.24);

  /* Astryx Typography & Motion Tokens */
  --font-sans: "Figtree", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Instrument Serif", "Newsreader", "Georgia", "Songti SC", serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;

  --astryx-motion-fast: 125ms;
  --astryx-motion-medium: 300ms;
  --astryx-motion-slow: 700ms;
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

  --radius-outer: 24px;
  --radius-inner: 18px;
  --radius-pill: 9999px;
}

html[data-theme="dark"] {
  --color-background-page: #0B0C0E;
  --color-background-surface: #131519;
  --color-background-elevated: #1A1D24;
  --color-background-subtle: rgba(255, 255, 255, 0.04);
  --color-background-glass: rgba(19, 21, 25, 0.88);
  --color-bezel-outer: var(--color-background-surface);
  --color-bezel-border: rgba(255, 255, 255, 0.12);
  --color-inner-highlight: rgba(255, 255, 255, 0.07);

  --color-text-primary: #F4F4F6;
  --color-text-secondary: #A1A1AA;
  --color-text-muted: #A1A1AA;
  --color-text-on-accent: #0B0C0E;

  --color-border-subtle: rgba(255, 255, 255, 0.08);
  --color-border-emphasized: rgba(255, 255, 255, 0.18);

  --color-accent-primary: #FB923C;
  --color-accent-soft: rgba(251, 146, 60, 0.14);
  --color-accent-border: rgba(251, 146, 60, 0.34);
  --color-secondary-teal: #2DD4BF;
  --color-secondary-teal-soft: rgba(45, 212, 191, 0.12);
  --color-secondary-blue: #60A5FA;
  --color-secondary-blue-soft: rgba(96, 165, 250, 0.12);

  --shadow-ambient: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
  --shadow-elevated: 0 32px 64px -16px rgba(0, 0, 0, 0.72);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--color-background-page);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.academic-body {
  margin: 0;
  padding: 0;
  background-color: var(--color-background-page);
  color: var(--color-text-primary);
  overflow-x: hidden;
  transition: background-color var(--astryx-motion-medium) var(--ease-out-quart),
              color var(--astryx-motion-medium) var(--ease-out-quart);
}

/* Override any legacy Minimal Mistakes / Jekyll wrapper if rendered inside single.html */
body.academic-body .masthead,
body.academic-body .sidebar,
body.academic-body .page__footer {
  display: none !important;
}
body.academic-body #main,
body.academic-body .page,
body.academic-body .page__inner-wrap,
body.academic-body .page__content {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  border: none !important;
  background: transparent !important;
}

/* Bilingual Switching Rules */
html:not(.lang-zh-active) .lang-zh {
  display: none !important;
}
html.lang-zh-active .lang-en {
  display: none !important;
}

/* Fixed Subtle Editorial Grain Overlay (GPU-safe fixed layer) */
.editorial-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.024;
  background-image: radial-gradient(rgba(24, 24, 27, 0.65) 0.75px, transparent 0.75px);
  background-size: 18px 18px;
}

/* ==========================================================================
   Floating Fluid Island Navigation (Astryx + High-End Visual Design)
   ========================================================================== */
.island-header {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.island-nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 14px;
  background: var(--color-background-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-bezel-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-ambient), inset 0 1px 0 var(--color-inner-highlight);
  max-width: 100%;
  overflow-x: auto;
}

.island-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-text-primary);
  text-decoration: none;
  padding-right: 10px;
  border-right: 1px solid var(--color-border-subtle);
  white-space: nowrap;
}

.island-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent-primary);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
  animation: statusPulse 2.6s infinite var(--ease-out-quart);
}

@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.22); opacity: 0.75; }
}

.island-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0 4px;
}

.island-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--astryx-motion-fast) var(--ease-out-quart),
              background-color var(--astryx-motion-fast) var(--ease-out-quart),
              transform var(--astryx-motion-fast) var(--ease-out-quart);
}

.island-links a:hover {
  color: var(--color-text-primary);
  background: var(--color-background-subtle);
}

.island-links a:active {
  transform: scale(0.97);
}

.island-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--color-border-subtle);
}

.ctrl-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-background-surface);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--astryx-motion-fast) var(--ease-out-quart),
              border-color var(--astryx-motion-fast) var(--ease-out-quart),
              background-color var(--astryx-motion-fast) var(--ease-out-quart);
}

.ctrl-pill:hover {
  border-color: var(--color-border-emphasized);
  background: var(--color-background-elevated);
}

.ctrl-pill:active {
  transform: scale(0.96);
}

.ctrl-pill[aria-pressed="true"],
.ctrl-pill.active {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
  color: var(--color-accent-primary);
}

/* ==========================================================================
   Double-Bezel (Doppelrand) Architecture & Uiverse Spotlight Card
   ========================================================================== */
.bezel-shell {
  padding: 0;
  border-radius: var(--radius-outer);
  background: var(--color-bezel-outer);
  border: 1px solid var(--color-bezel-border);
  box-shadow: var(--shadow-ambient);
  transition: transform var(--astryx-motion-medium) var(--ease-out-expo),
              box-shadow var(--astryx-motion-medium) var(--ease-out-expo),
              border-color var(--astryx-motion-medium) var(--ease-out-expo);
}

.bezel-core {
  position: relative;
  border-radius: var(--radius-inner);
  background: var(--color-background-surface);
  color: var(--color-text-primary);
  border: 0;
  box-shadow: inset 0 1px 0 var(--color-inner-highlight);
  overflow: hidden;
}

/* Uiverse Galaxy Spotlight Hover Effect */
.spotlight-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
}

.spotlight-card > .bezel-core::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    460px circle at var(--mouse-x) var(--mouse-y),
    rgba(194, 65, 12, 0.08),
    transparent 65%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--astryx-motion-medium) var(--ease-out-quart);
  z-index: 0;
}

.spotlight-card:hover > .bezel-core::before {
  opacity: 0.7;
}

.spotlight-card > .bezel-core > * {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Hero Section + Canvas-UI WebGL2 Stage + Typewriter + Spring Logos
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: clamp(600px, 82dvh, 840px);
  padding: 112px 24px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border-subtle);
}

.canvas-ui-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 72% 76% at 50% 44%, transparent 12%, #000 92%);
  -webkit-mask-image: radial-gradient(ellipse 72% 76% at 50% 44%, transparent 12%, #000 92%);
}

.container-wide {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 36px;
  align-items: center;
}

/* Typewriter Greeting Bar */
.typewriter-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-background-surface);
  border: 1px solid var(--color-border-emphasized);
  box-shadow: var(--shadow-ambient);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-bottom: 22px;
}

.tw-prompt {
  color: var(--color-accent-primary);
  font-weight: 700;
}

.tw-hello {
  font-weight: 600;
  color: var(--color-text-primary);
}

.tw-dynamic {
  color: var(--color-secondary-teal);
  font-weight: 600;
}

.tw-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--color-accent-primary);
  vertical-align: -2px;
  margin-left: 2px;
  animation: cursorBlink 0.9s steps(2, start) infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-title {
  font-size: clamp(2.35rem, 4.4vw, 3.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0 0 18px;
  color: var(--color-text-primary);
}

.hero-title .serif-italic {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  color: var(--color-accent-primary);
  padding-right: 4px;
}

.hero-subtitle {
  font-size: 1.06rem;
  color: var(--color-text-secondary);
  max-width: 64ch;
  margin: 0 0 26px;
  line-height: 1.72;
}

.hero-subtitle strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* Button-in-Button CTA Architecture */
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.astryx-btn-primary,
.astryx-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--astryx-motion-fast) var(--ease-out-quart),
              box-shadow var(--astryx-motion-medium) var(--ease-out-expo),
              background-color var(--astryx-motion-fast) var(--ease-out-quart);
}

.astryx-btn-primary {
  background: var(--color-text-primary);
  color: var(--color-background-surface);
  border: 1px solid var(--color-text-primary);
  box-shadow: var(--shadow-ambient);
}

.astryx-btn-secondary {
  background: var(--color-background-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-emphasized);
}

.astryx-btn-primary:active,
.astryx-btn-secondary:active {
  transform: scale(0.97);
}

.btn-icon-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  transition: transform var(--astryx-motion-medium) var(--ease-out-expo);
}

.astryx-btn-secondary .btn-icon-circle {
  background: var(--color-background-elevated);
}

.astryx-btn-primary:hover .btn-icon-circle,
.astryx-btn-secondary:hover .btn-icon-circle {
  transform: translate(2px, -1px) scale(1.06);
}

/* Selectable Spring Physics Logos & Ecosystem Badges */
.spring-dock-wrap {
  margin-top: 8px;
}

.spring-dock-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spring-logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.spring-logo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--color-background-surface);
  border: 1px solid var(--color-border-subtle);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  user-select: none;
  will-change: transform;
  transition: border-color var(--astryx-motion-fast) var(--ease-out-quart),
              background-color var(--astryx-motion-fast) var(--ease-out-quart);
}

.spring-logo-pill img,
.spring-logo-pill svg {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.spring-logo-pill.is-selected {
  border-color: var(--color-accent-primary);
  background: var(--color-accent-soft);
  color: var(--color-accent-primary);
}

/* Right Hero Profile & Telemetry Card */
.hero-profile-card {
  padding: 26px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.profile-avatar-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 22px;
  padding: 3px;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-secondary-teal));
  flex-shrink: 0;
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 19px;
  display: block;
}

.profile-name {
  font-size: 1.32rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.profile-affil {
  font-size: 0.86rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.telemetry-cell {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
}

.telemetry-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.telemetry-label {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  margin-top: 3px;
}

.canvas-engine-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--color-background-subtle);
  border: 1px solid var(--color-border-subtle);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--color-text-secondary);
}

/* ==========================================================================
   Infinite Kinetic Marquee (Skills & Research Keywords)
   ========================================================================== */
.marquee-section {
  position: relative;
  padding: 14px 0;
  background: transparent;
  border-bottom: 1px solid var(--color-border-subtle);
  overflow: hidden;
}

.marquee-mask {
  mask-image: linear-gradient(to right, transparent, black 7%, black 93%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 7%, black 93%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 12px;
  animation: marqueeScrollLeft 64s linear infinite;
}

.marquee-track.reverse {
  animation-name: marqueeScrollRight;
  animation-duration: 68s;
}

.marquee-section:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScrollLeft {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes marqueeScrollRight {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

.marquee-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-background-surface);
  border: 1px solid var(--color-border-subtle);
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.marquee-chip strong {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent-primary);
}

/* ==========================================================================
   Section Layout & Headers
   ========================================================================== */
.academic-section {
  padding: 76px 24px;
  border-bottom: 1px solid var(--color-border-subtle);
  scroll-margin-top: 72px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: var(--color-accent-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  color: var(--color-text-primary);
}

.section-desc {
  font-size: 0.98rem;
  color: var(--color-text-secondary);
  max-width: 68ch;
  margin: 0;
}

/* ==========================================================================
   Split-Screen Research Showcase (50/50 Interactive Split + Skeleton Shimmer)
   ========================================================================== */
.split-showcase-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 36px;
  align-items: stretch;
}

.split-left-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.split-left-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.showcase-tab-card {
  text-align: left;
  width: 100%;
  padding: 18px 20px;
  border-radius: var(--radius-inner);
  background: var(--color-background-surface);
  border: 1px solid var(--color-border-subtle);
  cursor: pointer;
  transition: transform var(--astryx-motion-fast) var(--ease-out-quart),
              border-color var(--astryx-motion-fast) var(--ease-out-quart),
              box-shadow var(--astryx-motion-medium) var(--ease-out-expo);
}

.split-left-list.is-visible .showcase-tab-card {
  animation: showcase-card-enter 440ms var(--ease-out-expo) backwards;
}

.showcase-tab-card:hover {
  border-color: var(--color-border-emphasized);
  transform: translateX(3px);
}

.showcase-tab-card:nth-child(2) { animation-delay: 65ms; }
.showcase-tab-card:nth-child(3) { animation-delay: 130ms; }
.showcase-tab-card:nth-child(4) { animation-delay: 195ms; }

@keyframes showcase-card-enter {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}

.showcase-tab-card.is-active {
  border-color: var(--color-accent-primary);
  box-shadow: var(--shadow-ambient);
  background: linear-gradient(110deg, var(--color-accent-soft), var(--color-background-surface) 58%);
}

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

.venue-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--color-background-elevated);
  color: var(--color-text-secondary);
}

.venue-pill.oral {
  background: var(--color-accent-soft);
  color: var(--color-accent-primary);
  border: 1px solid var(--color-accent-border);
}

.venue-pill.accepted {
  background: var(--color-secondary-teal-soft);
  color: var(--color-secondary-teal);
}

.tab-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 6px;
  line-height: 1.38;
}

.tab-card-summary {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.55;
}

.split-right-stage {
  position: relative;
}

.stage-core {
  padding: 22px;
}

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

.stage-mode-group {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
}

.stage-mode-btn {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--astryx-motion-fast) var(--ease-out-quart),
              color var(--astryx-motion-fast) var(--ease-out-quart);
}

.stage-mode-btn.active {
  background: var(--color-background-surface);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-ambient);
}

/* Visual Frame + Uiverse Skeleton Shimmer */
.stage-figure-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.2;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
  margin-bottom: 18px;
}

@media (min-width: 981px) {
  .stage-core {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
  }

  .stage-figure-frame {
    flex: 1 0 auto;
    min-height: 240px;
  }
}

.stage-figure-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #FAF8F5;
  display: block;
  cursor: zoom-in;
  transition: opacity var(--astryx-motion-medium) var(--ease-out-quart),
              transform var(--astryx-motion-medium) var(--ease-out-expo);
}

.stage-figure-frame.is-loading img {
  opacity: 0;
  transform: scale(0.985);
}

.showcase-canvas-panel {
  position: relative;
  flex: 1 0 160px;
  min-height: 160px;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-inner);
  background: var(--color-background-elevated);
}

.showcase-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.showcase-motion-heading {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.showcase-motion-heading span:first-child {
  color: var(--color-text-primary);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.showcase-motion-heading span:last-child {
  color: var(--color-text-muted);
  font-size: 0.66rem;
}

.skeleton-shimmer {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--color-background-elevated);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out-quart);
}

.stage-figure-frame.is-loading .skeleton-shimmer,
.skeleton-card.is-loading .skeleton-shimmer {
  opacity: 1;
  pointer-events: auto;
}

.skeleton-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 100%
  );
  animation: shimmerSweep 1.25s infinite linear;
}

html[data-theme="dark"] .skeleton-shimmer::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.09) 50%,
    transparent 100%
  );
}

@keyframes shimmerSweep {
  100% { transform: translateX(100%); }
}

.skel-bar {
  height: 14px;
  border-radius: 7px;
  background: var(--color-border-subtle);
}

.skel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex: 1;
  margin: 16px 0;
}

.skel-box {
  border-radius: 10px;
  background: var(--color-border-subtle);
}

.stage-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stage-metric-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
}

.stage-metric-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-accent-primary);
}

.stage-metric-lbl {
  font-size: 0.74rem;
  color: var(--color-text-muted);
}

.stage-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-background-surface);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--astryx-motion-fast) var(--ease-out-quart),
              background-color var(--astryx-motion-fast) var(--ease-out-quart);
}

.stage-link-chip:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
  color: var(--color-accent-primary);
}

.stage-link-chip:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Stagger Cascade Animation System (Work Items, News, Experience, Papers)
   ========================================================================== */
.stagger-item {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
  transition: opacity 480ms var(--ease-out-expo),
              transform 480ms var(--ease-out-expo);
  transition-delay: calc(var(--stagger-index, 0) * 65ms);
}

.stagger-item.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* ==========================================================================
   DataEvolver 2026.11 Evolution Architecture Bento Grid
   ========================================================================== */
.bento-evolution-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.bento-col-7 { grid-column: span 7; }
.bento-col-5 { grid-column: span 5; }
.bento-col-4 { grid-column: span 4; }
.bento-col-8 { grid-column: span 8; }

.bento-inner {
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.bento-code-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
}

.bento-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-text-primary);
}

.bento-text {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0 0 16px;
  line-height: 1.62;
}

.pipeline-flow-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-subtle);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.flow-step {
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--color-background-elevated);
  color: var(--color-text-primary);
}

.flow-arrow {
  color: var(--color-accent-primary);
  font-weight: 700;
}

/* ==========================================================================
   Publications & Projects List (Stagger + Filter + Skeleton)
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.pub-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pub-row-inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 20px;
  align-items: center;
}

.pub-thumb-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.5;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
}

.pub-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform var(--astryx-motion-medium) var(--ease-out-expo);
}

.pub-thumb-box:hover img {
  transform: scale(1.03);
}

.pub-thumb-box img[src*="showcase_"] {
  object-fit: contain;
}

.pub-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pub-title {
  font-size: 1.16rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--color-text-primary);
}

.pub-authors {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin: 0 0 10px;
}

.pub-authors strong {
  color: var(--color-accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pub-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0 0 14px;
  line-height: 1.62;
}

/* ==========================================================================
   Experience, News Timeline & Honors
   ========================================================================== */
.dual-column-section {
  display: grid;
  grid-template-columns: 6fr 6fr;
  gap: 28px;
}

.timeline-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exp-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
}

.exp-logo-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--color-background-surface);
  border: 1px solid var(--color-border-subtle);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exp-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.exp-logo-box:has(.baai-logo) {
  width: 96px;
  background: #fff;
  border-color: #D4D4D8;
  padding: 6px;
}

.exp-logo-box .baai-logo {
  filter: brightness(0);
}

html[data-theme="dark"] .exp-logo-box:has(.baai-logo) {
  background: var(--color-background-surface);
  border-color: var(--color-border-subtle);
}

html[data-theme="dark"] .exp-logo-box .baai-logo {
  filter: none;
}

.exp-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent-primary);
  font-weight: 600;
}

.exp-org {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 2px 0 4px;
}

.exp-role {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.news-item-inner {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 15px 18px;
  align-items: baseline;
}

.news-date-pill {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent-primary);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--color-accent-soft);
  text-align: center;
}

/* Lightbox Modal */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: transparent;
  border: 0;
  color: var(--color-text-primary);
  max-width: 100vw;
  max-height: 100dvh;
  margin: auto;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-backdrop[open] {
  display: flex;
}

.lightbox-backdrop::backdrop {
  background: rgba(11, 12, 14, 0.86);
  backdrop-filter: blur(16px);
}

.lightbox-close {
  position: absolute;
  right: 24px;
  top: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border-emphasized);
  background: var(--color-background-surface);
  color: var(--color-text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox-backdrop img {
  max-width: 94vw;
  max-height: 88vh;
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  background: #FAF8F5;
}

/* Footer */
.academic-footer {
  padding: 48px 24px 64px;
  background: var(--color-background-surface);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ==========================================================================
   Responsive Collapse (< 960px and < 768px) & Reduced Motion
   ========================================================================== */
@media (max-width: 980px) {
  .hero-grid,
  .split-showcase-grid,
  .dual-column-section {
    grid-template-columns: 1fr;
  }
  .split-right-stage {
    position: static;
  }
  .bento-col-7,
  .bento-col-5,
  .bento-col-4,
  .bento-col-8 {
    grid-column: span 12;
  }
  .pub-row-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 102px 16px 40px;
    min-height: auto;
  }
  .academic-section {
    padding: 56px 16px;
  }
  .island-links {
    display: none;
  }
  .stage-metrics-row {
    grid-template-columns: 1fr;
  }
  .news-item-inner {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .stagger-item {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Grid Children Overflow Guard for Mobile 390px Viewports */
.hero-grid > *,
.split-showcase-grid > *,
.dual-column-section > *,
.bento-evolution-grid > *,
.pub-row-inner > *,
.news-item-inner > * {
  min-width: 0;
  max-width: 100%;
}

.typewriter-bar {
  max-width: 100%;
}

@media (max-width: 768px) {
  .island-header {
    top: 10px;
    padding: 0 10px;
  }
  .island-nav {
    width: 100%;
    justify-content: space-between;
    padding: 5px 8px 5px 12px;
    gap: 4px;
  }
  .island-brand {
    font-size: 0.82rem;
    padding-right: 6px;
  }
  .ctrl-pill[data-action="replay-motion"] {
    display: none;
  }
  .typewriter-bar {
    border-radius: 14px;
    padding: 8px 12px;
    font-size: 0.76rem;
  }
  .hero-title {
    font-size: 1.95rem;
    line-height: 1.16;
  }
  .hero-subtitle {
    font-size: 0.94rem;
  }
  .hero-profile-card {
    padding: 18px;
  }
}



html, body.academic-body {
  overflow-x: clip;
  max-width: 100vw;
}

.marquee-section,
.hero-section,
.academic-section {
  contain: paint;
  max-width: 100vw;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-180%);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--color-background-surface);
  color: var(--color-accent-primary);
}
.skip-link:focus { transform: none; }
.lang-switch { display: inline-flex; gap: 2px; }
.lang-btn {
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-secondary);
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.lang-btn.active { background: var(--color-accent-soft); color: var(--color-accent-primary); }
.lang-btn, .ctrl-pill, .spring-logo-pill, .island-links a, .stage-mode-btn, .stage-link-chip { min-height: 44px; }
.island-brand { min-width: 0; }
.island-brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.island-controls { flex-shrink: 0; }

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

.profile-facts > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
  box-shadow: inset 0 1px 0 var(--color-inner-highlight);
}

.profile-facts > .profile-bento-wide {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--color-accent-soft), var(--color-background-elevated) 72%);
  border-color: var(--color-accent-border);
}

.profile-facts dt, .profile-history {
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.profile-facts dd {
  margin: 2px 0 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-primary);
}

.profile-facts a { color: var(--color-accent-primary); text-decoration: none; overflow-wrap: anywhere; }
.profile-facts a:hover { text-decoration: underline; }
.profile-history { display: block; }
.profile-subnote {
  display: block;
  font-size: 0.74rem;
  color: var(--color-text-secondary);
}
.experience-heading { margin: 0 0 16px; font-size: 1rem; }
.project-text-card { padding: 28px; }
.project-update { border-top: 1px solid var(--color-border-subtle); margin-top: 20px; padding-top: 16px; }
.project-update h4, .pub-row-inner h4 { margin: 0 0 8px; }
.figure-credit {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: var(--color-background-glass);
  color: var(--color-text-secondary);
  font-size: 0.65rem;
  pointer-events: none;
}

section[id], article[id], [id="work-workbench"] { scroll-margin-top: 100px; }
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--color-accent-primary); outline-offset: 4px; }
html.no-js .stagger-item { opacity: 1; transform: none; }
html.no-js .split-showcase-grid, html.no-js .spring-dock-wrap,
html.no-js .island-controls, html.no-js .filter-bar { display: none; }
html.no-js .showcase-canvas-panel { display: none; }
.exp-logo-text { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; }

@media (max-width: 600px) {
  .island-controls .theme-label { display: none; }
  .island-controls [data-action="toggle-theme"] { min-width: 44px; justify-content: center; }
  .island-brand { font-size: 0.75rem; padding-right: 4px; }
  .profile-name { font-size: 1.1rem; }
  .profile-facts { grid-template-columns: 1fr; }
  .stage-toolbar { align-items: stretch; }
  .stage-mode-group { flex-wrap: wrap; }
  .project-text-card { padding: 20px; }
  .showcase-canvas-panel { flex-basis: 180px; min-height: 180px; }
  .showcase-motion-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media print {
  html, html[data-theme="dark"] {
    --color-background-page: #fff;
    --color-background-surface: #fff;
    --color-background-elevated: #f5f5f5;
    --color-text-primary: #161618;
    --color-text-secondary: #444;
    --color-text-muted: #555;
  }
  .island-header, .editorial-grain, .canvas-ui-stage, .showcase-canvas-panel, .marquee-section,
  .spring-dock-wrap, .typewriter-bar, .split-showcase-grid, .filter-bar,
  .lightbox-backdrop, .hero-cta-row { display: none !important; }
  .hero-section, .academic-section { padding: 20px 0; min-height: auto; contain: none; }
  .hero-grid, .dual-column-section, .pub-row-inner { display: block; }
  .stagger-item { opacity: 1; transform: none; transition: none; }
  article[data-work-tags][hidden] { display: block !important; }
  .bezel-shell, .bezel-core { box-shadow: none; break-inside: avoid; }
  .hero-profile-card, .exp-card-inner, .pub-row-inner { padding: 16px; }
  .pub-thumb-box { max-width: 320px; margin-bottom: 16px; }
  .academic-footer { padding: 20px 0; }
}
