/* ============================================================
   CUSTOM BEAUTY CSS v2.0 — Premium Visual Overhaul
   Author: WorkBuddy for azureovo.github.io
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+SC:wght@300;400;500;600;700;900&family=JetBrains+Mono:wght@400;500;600&family=Playfair+Display:wght@700;800;900&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Primary palette — elegant indigo-violet */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-lighter: #c7d2fe;
  --accent-dark: #4f46e5;
  --accent-deep: #3730a3;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --accent-gradient-h: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  --accent-gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
  --accent-gradient-cool: linear-gradient(135deg, #06b6d4, #6366f1, #8b5cf6);
  --accent-gradient-green: linear-gradient(135deg, #10b981, #059669);

  /* Surfaces */
  --bg-primary: #fafbff;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-elevated: #ffffff;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Borders */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #a5b4fc;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.12);
  --shadow-2xl: 0 25px 60px -15px rgba(0,0,0,0.18);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.12);
  --shadow-glow-strong: 0 0 60px rgba(99, 102, 241, 0.2);
  --shadow-accent: 0 4px 14px rgba(99, 102, 241, 0.25);
  --shadow-accent-lg: 0 8px 24px rgba(99, 102, 241, 0.35);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.4);

  /* Typography */
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', 'Noto Sans SC', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.15s var(--ease-out);
  --t-normal: 0.3s var(--ease-in-out);
  --t-slow: 0.5s var(--ease-in-out);
  --t-spring: 0.4s var(--ease-spring);
}

/* ---------- Dark mode ---------- */
[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-secondary: #141c2e;
  --bg-card: #1a2332;
  --bg-card-hover: #1e2a3a;
  --bg-elevated: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #1e3a5f;
  --border-light: #162032;
  --border-focus: #4f46e5;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.5);
  --shadow-2xl: 0 25px 60px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);
  --shadow-glow-strong: 0 0 60px rgba(99, 102, 241, 0.3);
  --glass-bg: rgba(11, 17, 32, 0.78);
  --glass-bg-strong: rgba(11, 17, 32, 0.9);
  --glass-border: rgba(30, 58, 95, 0.5);
}

/* ============================================================
   BASE RESET & GLOBAL
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans) !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Ambient Background ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 5% 10%, rgba(99,102,241,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 95% 90%, rgba(139,92,246,0.06) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(236,72,153,0.04) 0%, transparent 55%);
  pointer-events: none;
  z-index: -1;
}

/* Subtle dot grid */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--border-color) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

[data-theme="dark"] body::after {
  opacity: 0.12;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent-lighter);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-light);
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent-lighter);
  color: var(--accent-deep);
}

/* ============================================================
   NAVIGATION BAR — Glassmorphism Premium
   ============================================================ */
.masthead {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-bottom: 1px solid var(--glass-border) !important;
  box-shadow: 0 1px 30px rgba(0,0,0,0.04) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  transition: all var(--t-normal);
}

.masthead.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.08) !important;
}

.masthead__inner-wrap {
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 0 2rem !important;
}

.greedy-nav {
  background: transparent !important;
  max-width: 100% !important;
  overflow: hidden;
}

.greedy-nav .visible-links {
  overflow: hidden;
  flex-wrap: nowrap;
}

.greedy-nav a {
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  font-size: 0.9em !important;
  color: var(--text-secondary) !important;
  transition: all var(--t-fast) !important;
  position: relative !important;
  padding: 0.7em 1.1em !important;
  letter-spacing: 0.01em !important;
}

.greedy-nav a::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%; right: 50%;
  height: 2.5px;
  background: var(--accent-gradient-h);
  border-radius: 2px;
  transition: all var(--t-fast);
  opacity: 0;
}

.greedy-nav a:hover {
  color: var(--accent) !important;
}

.greedy-nav a:hover::after {
  left: 15%; right: 15%;
  opacity: 1;
}

/* Site title — gradient text */
.masthead__menu-item--lg a {
  font-size: 1.1em !important;
  font-weight: 800 !important;
  background: var(--accent-gradient-h);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 100%;
  animation: gradientShift 4s ease infinite;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.masthead__menu-item--lg a::after {
  display: none !important;
}

/* ============================================================
   HERO PROFILE — Premium Card
   ============================================================ */
.hero-profile {
  display: flex;
  gap: 3rem;
  align-items: center;
  padding: 3rem 3rem;
  margin-bottom: 3rem;
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s var(--ease-out) both;
}

/* Top accent bar — animated gradient */
.hero-profile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent-gradient-h);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

/* Corner glow */
.hero-profile::after {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(99,102,241,0.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Avatar */
.hero-avatar {
  flex: 0 0 200px;
  width: 200px;
  height: 200px;
  position: relative;
  z-index: 1;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50% !important;
  border: 4px solid var(--bg-card);
  box-shadow:
    0 0 0 3px var(--accent-lighter),
    var(--shadow-lg);
  transition: all var(--t-normal);
}

.hero-avatar img:hover {
  transform: scale(1.06) rotate(2deg);
  box-shadow:
    0 0 0 4px var(--accent-light),
    var(--shadow-xl),
    var(--shadow-glow-strong);
}

/* Avatar glow ring */
.hero-avatar::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: var(--accent-gradient);
  z-index: -1;
  opacity: 0.2;
  filter: blur(16px);
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Hero info */
.hero-info {
  flex: 1;
  min-width: 0;
  z-index: 1;
}

.hero-name {
  font-size: 2.8em;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0 0 0.15em;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-name-en {
  font-size: 0.38em;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-top: 0.3em;
}

.hero-tagline {
  font-size: 1.05em;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 1.2em;
  font-style: italic;
  opacity: 0.85;
  position: relative;
  padding-left: 1.2em;
}

.hero-tagline::before {
  content: '\201C';
  position: absolute;
  left: 0; top: -0.1em;
  font-size: 1.6em;
  color: var(--accent-lighter);
  font-family: var(--font-display);
}

/* Meta pills */
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.4em;
}

.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none !important;
}

.hero-meta-item:hover {
  border-color: var(--accent-lighter);
  background: rgba(99, 102, 241, 0.06);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.hero-meta-item i {
  color: var(--accent-light);
  font-size: 0.88em;
}

.hero-meta-item a {
  color: inherit !important;
  text-decoration: none !important;
}

/* Bio text */
.hero-bio {
  font-size: 1em;
  line-height: 1.85;
  color: var(--text-primary);
}

.hero-bio a {
  color: var(--accent) !important;
  text-decoration: none;
  font-weight: 600;
  background: linear-gradient(to bottom, transparent 60%, var(--accent-lighter) 60%);
  background-size: 100% 200%;
  background-position: 0 0;
  transition: all var(--t-fast);
}

.hero-bio a:hover {
  background-position: 0 100%;
  color: var(--accent-dark) !important;
}

/* ============================================================
   SECTION HEADINGS — Icon + Gradient Line
   ============================================================ */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 3.5rem 0 2rem;
  font-size: 1.5em;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-heading .icon {
  font-size: 0.9em;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-color), transparent 80%);
  margin-left: 0.8rem;
}

/* Alternate heading style: no icon, use text gradient */
h2.page-section-title {
  font-size: 1.5em;
  font-weight: 800;
  color: var(--text-primary);
  margin: 3rem 0 1.8rem;
  padding-bottom: 0.6rem;
  border-bottom: none !important;
  position: relative;
  letter-spacing: -0.02em;
}

h2.page-section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 60px; height: 3px;
  background: var(--accent-gradient-h);
  border-radius: 3px;
}

/* ============================================================
   NEWS / TIMELINE — Premium
   ============================================================ */
.news-timeline {
  position: relative;
  padding-left: 2.2rem;
  margin: 0;
  list-style: none;
}

.news-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-lighter), var(--border-color));
  border-radius: 2px;
}

.news-timeline li {
  position: relative;
  margin-bottom: 0.9rem;
  padding: 0.85rem 1.3rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all var(--t-fast);
  font-size: 0.93em;
  line-height: 1.7;
  animation: fadeInLeft 0.5s var(--ease-out) both;
}

.news-timeline li:nth-child(1) { animation-delay: 0.05s; }
.news-timeline li:nth-child(2) { animation-delay: 0.12s; }
.news-timeline li:nth-child(3) { animation-delay: 0.19s; }
.news-timeline li:nth-child(4) { animation-delay: 0.26s; }
.news-timeline li:nth-child(5) { animation-delay: 0.33s; }

.news-timeline li::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2.5px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-lighter);
  z-index: 1;
  transition: all var(--t-fast);
}

.news-timeline li:hover {
  border-color: var(--accent-lighter);
  box-shadow: var(--shadow-md);
  transform: translateX(6px);
}

.news-timeline li:hover::before {
  box-shadow: 0 0 0 4px var(--accent-light), 0 0 12px rgba(99,102,241,0.3);
  transform: translateY(-50%) scale(1.2);
}

.news-date {
  display: inline-block;
  font-size: 0.78em;
  font-weight: 700;
  font-family: var(--font-mono);
  color: white;
  background: var(--accent-gradient);
  padding: 2px 10px;
  border-radius: 10px;
  margin-right: 10px;
  letter-spacing: 0.02em;
}

.news-timeline li a {
  color: var(--accent) !important;
  font-weight: 600;
  text-decoration: none !important;
}

.news-timeline li a:hover {
  text-decoration: underline !important;
}

/* ============================================================
   EDUCATION & EXPERIENCE CARDS
   ============================================================ */
.edu-card, .exp-card {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem 1.6rem;
  margin-bottom: 0.8rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--t-normal);
  animation: fadeInUp 0.6s var(--ease-out) both;
  position: relative;
  overflow: hidden;
}

.edu-card::before, .exp-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--t-fast);
}

.edu-card:nth-child(1), .exp-card:nth-child(1) { animation-delay: 0.05s; }
.edu-card:nth-child(2), .exp-card:nth-child(2) { animation-delay: 0.12s; }
.edu-card:nth-child(3), .exp-card:nth-child(3) { animation-delay: 0.19s; }
.edu-card:nth-child(4), .exp-card:nth-child(4) { animation-delay: 0.26s; }

.edu-card:hover, .exp-card:hover {
  border-color: var(--accent-lighter);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.edu-card:hover::before, .exp-card:hover::before {
  opacity: 1;
}

.card-logo {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  padding: 8px;
  transition: all var(--t-fast);
}

.edu-card:hover .card-logo,
.exp-card:hover .card-logo {
  border-color: var(--accent-lighter);
  box-shadow: var(--shadow-sm);
}

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

.card-body {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 3px;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 0.93em;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0 0 4px;
}

.card-date {
  font-size: 0.82em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8em;
  font-weight: 600;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.18);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-left: 10px;
  text-decoration: none !important;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.card-badge:hover {
  background: var(--accent);
  color: white !important;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

/* ============================================================
   PUBLICATION CARDS
   ============================================================ */
.pub-card {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--t-normal);
  animation: fadeInUp 0.6s var(--ease-out) both;
  min-height: 160px;
  position: relative;
  overflow: hidden;
}

.pub-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--t-fast);
}

.pub-card:hover {
  border-color: var(--accent-lighter);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.pub-card:hover::before {
  opacity: 1;
}

.pub-thumb {
  flex: 0 0 220px;
  width: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-secondary);
}

.pub-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: all var(--t-slow);
}

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

.pub-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.pub-title {
  font-size: 1.08em;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.45;
}

.pub-authors {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.6;
}

.pub-venue {
  font-size: 0.86em;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.pub-venue .venue-badge {
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  font-size: 0.85em;
  color: white;
  background: var(--accent-gradient-green);
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: 6px;
  box-shadow: 0 2px 6px rgba(16,185,129,0.25);
}

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

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8em;
  font-weight: 600;
  color: var(--accent) !important;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  text-decoration: none !important;
  transition: all var(--t-fast);
}

.pub-link:hover {
  background: var(--accent);
  color: white !important;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

/* ============================================================
   UNIVERSITY LIFE BUTTONS
   ============================================================ */
.life-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 2rem;
}

.life-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  font-size: 0.9em;
  font-weight: 600;
  color: white !important;
  background: var(--accent-gradient) !important;
  border-radius: var(--radius-full);
  text-decoration: none !important;
  border: none !important;
  box-shadow: var(--shadow-accent);
  transition: all var(--t-normal);
  cursor: pointer;
}

.life-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent-lg);
}

.life-btn.secondary {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-sm);
}

.life-btn.secondary:hover {
  border-color: var(--accent-lighter) !important;
  box-shadow: var(--shadow-md);
  color: var(--accent) !important;
}

/* University life description box */
.life-description {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  font-size: 0.95em;
  color: var(--text-secondary);
  line-height: 1.8;
  position: relative;
  overflow: hidden;
}

.life-description::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-gradient);
}

.life-description .highlight {
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ============================================================
   FOOTER — Clean & Modern
   ============================================================ */
.page__footer {
  background: var(--bg-secondary) !important;
  border-top: 1px solid var(--border-color) !important;
  margin-top: 5rem !important;
}

.page__footer footer {
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 2rem !important;
  font-size: 0.85em;
  color: var(--text-muted);
}

.page__footer a {
  color: var(--accent) !important;
  text-decoration: none !important;
  transition: all var(--t-fast);
}

.page__footer a:hover {
  color: var(--accent-dark) !important;
}

.page__footer-follow .social-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
}

.page__footer-copyright {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-color);
  opacity: 0.75;
}

/* ============================================================
   SIDEBAR (author profile on sub pages)
   ============================================================ */
.sidebar {
  opacity: 1 !important;
}

.author__avatar img {
  border-radius: 50% !important;
  border: 3px solid var(--accent-lighter) !important;
  box-shadow: var(--shadow-md) !important;
  transition: all var(--t-normal);
}

.author__avatar img:hover {
  transform: scale(1.06);
  border-color: var(--accent) !important;
  box-shadow: var(--shadow-lg), var(--shadow-glow) !important;
}

.author__name {
  font-family: var(--font-sans) !important;
  font-weight: 800 !important;
  font-size: 1.2em !important;
  color: var(--text-primary) !important;
}

.author__bio {
  color: var(--text-secondary) !important;
  font-size: 0.9em !important;
  line-height: 1.65 !important;
}

.author__urls-wrapper .btn--inverse {
  background: var(--accent-gradient) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-full) !important;
  font-weight: 600 !important;
  padding: 6px 20px !important;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-accent);
}

.author__urls-wrapper .btn--inverse:hover {
  box-shadow: var(--shadow-accent-lg);
  transform: translateY(-2px);
}

.author__urls .social-icons li a {
  color: var(--text-secondary) !important;
  transition: all var(--t-fast);
}

.author__urls .social-icons li a:hover {
  color: var(--accent) !important;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
#main {
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 2rem !important;
}

.page {
  max-width: 100% !important;
}

.page__inner-wrap {
  max-width: 1100px !important;
  margin: 0 auto !important;
}

.page__content {
  font-size: 1em !important;
  line-height: 1.8 !important;
  color: var(--text-primary) !important;
}

.page__content h2 {
  font-size: 1.5em;
  font-weight: 800;
  color: var(--text-primary);
  margin: 3rem 0 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: none;
  position: relative;
  letter-spacing: -0.02em;
}

.page__content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color) 15%, var(--border-color) 85%, transparent);
  margin: 3rem 0;
}

.page__content a {
  color: var(--accent) !important;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--t-fast);
}

.page__content a:hover {
  color: var(--accent-dark) !important;
}

/* Hide default page title on homepage */
.page__title {
  font-family: var(--font-sans) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

/* ============================================================
   SECTION DIVIDER
   ============================================================ */
.section-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color) 15%, var(--border-color) 85%, transparent);
  margin: 2.5rem 0;
  border: none;
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 46px; height: 46px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--t-normal);
  box-shadow: var(--shadow-accent-lg);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45);
}

/* ============================================================
   LIFE GRID (University Life page)
   ============================================================ */
.life-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.back-to-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent) !important;
  font-weight: 600;
  font-size: 0.92em;
  text-decoration: none !important;
  margin-bottom: 1.5rem;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: all var(--t-fast);
}

.back-to-home-btn:hover {
  border-color: var(--accent-lighter);
  box-shadow: var(--shadow-sm);
  transform: translateX(-3px);
}

/* ============================================================
   STATS ROW (for homepage)
   ============================================================ */
.stats-row {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 1.2rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--t-fast);
}

.stat-item:hover {
  border-color: var(--accent-lighter);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  display: block;
  font-size: 1.8em;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.82em;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ============================================================
   TOOLTIP STYLES
   ============================================================ */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--text-primary);
  color: var(--bg-card);
  font-size: 0.78em;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-fast);
}

[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

/* ============================================================
   INTEREST TAGS
   ============================================================ */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}

.interest-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82em;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.interest-tag:hover {
  border-color: var(--accent-lighter);
  color: var(--accent);
  background: rgba(99,102,241,0.05);
  transform: translateY(-1px);
}

.interest-tag .tag-icon {
  font-size: 1em;
}

/* Action variant (clickable link tag) */
.interest-tag--action {
  background: var(--accent-gradient) !important;
  color: white !important;
  border-color: transparent !important;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}

.interest-tag--action:hover {
  color: white !important;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  transform: translateY(-2px);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-profile {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }
  .hero-avatar { flex: none; width: 160px; height: 160px; }
  .hero-meta { justify-content: center; }
  .hero-name { font-size: 2.2em; }
  .hero-tagline { padding-left: 0; text-align: center; }
  .hero-tagline::before { display: none; }
  .hero-bio { text-align: left; }
  .stats-row { gap: 0.6rem; }
  .stat-item { min-width: 90px; padding: 0.8rem 0.6rem; }
  .stat-number { font-size: 1.4em; }
}

@media (max-width: 768px) {
  .pub-card { flex-direction: column; }
  .pub-thumb { flex: none; width: 100%; height: 180px; }
  .edu-card, .exp-card { padding: 1rem; gap: 1rem; }
  .card-logo { flex: 0 0 48px; width: 48px; height: 48px; }
  #main { padding: 1rem !important; }
  .masthead__inner-wrap { padding: 0 0.8rem !important; }
  .masthead__menu-item--lg a {
    font-size: 0.92em !important;
    max-width: 140px;
  }
  .greedy-nav a {
    padding: 0.5em 0.6em !important;
    font-size: 0.82em !important;
  }
  .section-heading { font-size: 1.3em; }
  .interest-tags { justify-content: center; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 1.8em; }
  .hero-avatar { width: 130px; height: 130px; }
  .hero-meta-item { font-size: 0.78em; padding: 5px 10px; }
  .news-timeline { padding-left: 1.5rem; }
  .masthead__menu-item--lg a {
    font-size: 0.82em !important;
    max-width: 110px;
  }
  .greedy-nav a {
    padding: 0.4em 0.5em !important;
    font-size: 0.78em !important;
  }
}

/* ============================================================
   ✨ SPARKLE FX — Visual Effects Styles v1.0
   ============================================================ */

/* ---------- ① Click Star Burst Layer ---------- */
.sparkle-starburst-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.sparkle-star {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0) rotate(0deg);
  line-height: 1;
  user-select: none;
  z-index: 9999;
}

.sparkle-star.active {
  animation: starBurst var(--sb-life, 800ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes starBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
  }
  30% {
    opacity: 1;
    transform:
      translate(
        calc(-50% + cos(var(--sb-angle)) * var(--sb-velocity) * 0.4),
        calc(-50% + sin(var(--sb-angle)) * var(--sb-velocity) * 0.4)
      )
      scale(1.2)
      rotate(calc(var(--sb-angle) * 180 / 3.14 + 45deg));
  }
  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + cos(var(--sb-angle)) * var(--sb-velocity)),
        calc(-50% + sin(var(--sb-angle)) * var(--sb-velocity))
      )
      scale(0)
      rotate(calc(var(--sb-angle) * 360 / 3.14 + 90deg));
  }
}

/* ---------- ② Cursor Particle Trail Layer ---------- */
.sparkle-particle-trail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.sparkle-particle {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

.sparkle-particle.active {
  animation: particleFade var(--pt-life, 600ms) ease-out forwards;
}

@keyframes particleFade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(
      calc(-50% + var(--pt-dx, 20px)),
      calc(-50% + var(--pt-dy, -20px))
    ) scale(0);
  }
}

/* ---------- ③ Hero Floating Sparkles ---------- */
.sparkle-float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
  border-radius: inherit;
}

.sparkle-float {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: floatUp var(--fs-duration, 10s) ease-in-out infinite;
  animation-delay: var(--fs-delay, 0s);
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) scale(0);
  }
  15% {
    opacity: 0.9;
    transform: translateY(-25%) translateX(calc(var(--fs-drift) * 0.3)) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translateY(-55%) translateX(calc(var(--fs-drift) * 0.7)) scale(0.85);
  }
  80% {
    opacity: 0.2;
    transform: translateY(-80%) translateX(calc(var(--fs-drift))) scale(0.5);
  }
  100% {
    opacity: 0;
    transform: translateY(-95%) translateX(calc(var(--fs-drift) * 1.2)) scale(0);
  }
}

/* ---------- ④ Button Ripple Effect ---------- */
.sparkle-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
}

.sparkle-ripple.active {
  animation: rippleExpand 700ms ease-out forwards;
}

@keyframes rippleExpand {
  0% {
    opacity: 1;
    transform: scale(0);
  }
  60% {
    opacity: 0.5;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

/* Ensure interactive elements are positioned for ripple */
.life-btn,
.pub-link,
.card-badge,
.interest-tag--action,
.back-to-top,
.back-to-home-btn {
  position: relative;
  overflow: hidden !important;
}

/* ---------- ⑤ Text Shimmer Effect ---------- */
.shimmer-text {
  background: linear-gradient(
    120deg,
    var(--text-primary) 0%,
    var(--text-primary) 35%,
    var(--accent-lighter) 48%,
    var(--accent-light) 52%,
    var(--accent-deep) 58%,
    var(--text-primary) 65%,
    var(--text-primary) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerSweep 5s ease-in-out infinite;
}

[data-theme="dark"] .shimmer-text {
  background: linear-gradient(
    120deg,
    var(--text-primary) 0%,
    var(--text-primary) 30%,
    #c7d2fe 44%,
    #a5b4fc 50%,
    #818cf8 56%,
    var(--text-primary) 70%,
    var(--text-primary) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
}

@keyframes shimmerSweep {
  0%, 100% { background-position: 100% center; }
  50% { background-position: -30% center; }
}

/* Subtle glow pulse on section headings */
.glow-pulse-ready .icon {
  animation: iconGlowPulse 3s ease-in-out infinite;
}

@keyframes iconGlowPulse {
  0%, 100% {
    box-shadow: var(--shadow-accent);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.45), 0 0 36px rgba(139, 92, 246, 0.25);
    filter: brightness(1.12);
  }
}

/* ---------- ⑥ Scroll Reveal Enhancement ---------- */
.fx-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger children in timeline and card lists */
.news-timeline li:nth-child(1).fx-visible { transition-delay: 0.02s; }
.news-timeline li:nth-child(2).fx-visible { transition-delay: 0.06s; }
.news-timeline li:nth-child(3).fx-visible { transition-delay: 0.10s; }
.news-timeline li:nth-child(4).fx-visible { transition-delay: 0.14s; }
.news-timeline li:nth-child(5).fx-visible { transition-delay: 0.18s; }
.news-timeline li:nth-child(6).fx-visible { transition-delay: 0.22s; }

.edu-card:nth-child(1).fx-visible { transition-delay: 0.03s; }
.edu-card:nth-child(2).fx-visible { transition-delay: 0.09s; }

.exp-card:nth-child(1).fx-visible { transition-delay: 0.03s; }
.exp-card:nth-child(2).fx-visible { transition-delay: 0.09s; }
.exp-card:nth-child(3).fx-visible { transition-delay: 0.15s; }
.exp-card:nth-child(4).fx-visible { transition-delay: 0.21s; }

.pub-card:nth-child(1).fx-visible { transition-delay: 0.03s; }

.stat-item:nth-child(1).fx-visible { transition-delay: 0s; }
.stat-item:nth-child(2).fx-visible { transition-delay: 0.05s; }
.stat-item:nth-child(3).fx-visible { transition-delay: 0.10s; }
.stat-item:nth-child(4).fx-visible { transition-delay: 0.15s; }

/* ---------- ⑦ Hero Card Ambient Glow Animation ---------- */
.hero-profile::before {
  animation: accentBarGlow 4s ease-in-out infinite;
}

@keyframes accentBarGlow {
  0%, 100% { background-position: 0% 50%; opacity: 1; }
  50% { background-position: 100% 50%; opacity: 0.75; }
}

/* Avatar glow ring pulse enhancement */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.2; transform: scale(1); filter: blur(16px); }
  50% { opacity: 0.38; transform: scale(1.08); filter: blur(22px); }
}

/* ---------- Performance: Reduce motion for accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .sparkle-starburst-layer,
  .sparkle-particle-trail,
  .sparkle-float-layer {
    display: none !important;
  }
  .shimmer-text {
    animation: none !important;
    background: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
  }
  .sparkle-ripple { display: none !important; }
  .fx-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .glow-pulse-ready .icon {
    animation: none;
  }
}

/* ============================================================
   🌌 GALAXY PAGE — Skills Galaxy Styles
   ============================================================ */

#galaxy-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 56px);
  margin-top: -2rem;
  overflow: hidden;
  background: #050308;
}

#galaxy-container canvas {
  display: block;
  cursor: grab;
}

#galaxy-container:active canvas {
  cursor: grabbing;
}

/* ---------- Top UI Overlay ---------- */
.galaxy-ui-top {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 10;
  pointer-events: none;
  user-select: none;
}

.galaxy-title {
  font-size: 2.4em;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: transparent;
  background: linear-gradient(135deg, #a78bfa, #06b6d4, #ec4899, #f59e0b);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: galaxyTitleGlow 6s ease-in-out infinite;
  text-shadow: none;
  margin: 0;
  line-height: 1.2;
}

@keyframes galaxyTitleGlow {
  0%, 100% { background-position: 0% 50%; filter: drop-shadow(0 0 20px rgba(167,139,250,0.3)); }
  50% { background-position: 100% 50%; filter: drop-shadow(0 0 40px rgba(236,72,153,0.3)); }
}

.galaxy-subtitle {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
  margin-top: 8px;
  letter-spacing: 0.08em;
}

/* ---------- Detail Panel ---------- */
.galaxy-detail-panel {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  width: 300px;
  max-height: 70vh;
  padding: 1.6rem 1.8rem;
  background: rgba(15, 10, 30, 0.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(99, 102, 241, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 20;
  color: #e2e8f0;
  overflow-y: auto;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.galaxy-detail-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(30px);
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.detail-close:hover {
  background: rgba(236, 72, 153, 0.2);
  border-color: rgba(236, 72, 153, 0.3);
  color: #ec4899;
}

.detail-icon {
  font-size: 2.5em;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.detail-name {
  font-size: 1.25em;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.detail-category {
  font-size: 0.85em;
  color: #a78bfa;
  font-weight: 600;
  margin: 0 0 14px;
}

.detail-level {
  margin-bottom: 14px;
}

.level-bar {
  display: block;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.level-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #ec4899, #f59e0b);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 0%; /* Set by JS */
}

.level-text {
  font-size: 0.78em;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
}

.detail-tags {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tags li {
  font-size: 0.78em;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  font-weight: 500;
}

.detail-desc {
  font-size: 0.88em;
  line-height: 1.7;
  color: rgba(226, 232, 240, 0.75);
  margin: 0 0 14px;
}

.detail-projects {
  font-size: 0.85em;
  color: rgba(226, 232, 240, 0.7);
  line-height: 1.7;
}

.detail-projects ul {
  margin: 6px 0 0;
  padding-left: 16px;
}

.detail-projects li {
  margin-bottom: 3px;
  color: #67e8f9;
}

/* ---------- Bottom Hints ---------- */
.galaxy-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 10;
  pointer-events: none;
  user-select: none;
}

.galaxy-hint span {
  font-size: 0.78em;
  color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(4px);
}

/* ---------- Galaxy Page: Hide default page elements ---------- */
body:not(.no-js) #galaxy-container ~ .page__inner-wrap,
body:not(.no-js) #galaxy-container + * { /* Hide any default layout content on galaxy page */ }

/* Galaxy-specific overrides for full immersion */
.permalink-galaxy .masthead,
.permalink-galaxy .page__footer {
  /* Keep nav visible but make it blend in */
}

.permalink-galaxy #main {
  padding: 0 !important;
  max-width: 100% !important;
}

.permalink-galaxy .page__content {
  padding: 0 !important;
}

.permalink-galaxy .author__profile {
  display: none; /* Hide sidebar on galaxy page */
}

/* ---------- Responsive Galaxy ---------- */
@media (max-width: 768px) {
  #galaxy-container {
    height: calc(100vh - 52px);
    margin-top: -1rem;
  }

  .galaxy-title {
    font-size: 1.6em;
  }

  .galaxy-subtitle {
    font-size: 0.78em;
  }

  .galaxy-detail-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    transform: translateY(100%);
    width: 100%;
    max-height: 55vh;
    border-radius: 18px 18px 0 0;
    padding: 1.2rem 1.4rem;
  }

  .galaxy-detail-panel.hidden {
    transform: translateY(100%);
  }

  .galaxy-hint {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    bottom: 12px;
    padding: 0 12px;
  }

  .galaxy-hint span {
    font-size: 0.7em;
    padding: 4px 10px;
  }
}

/* ============================================================
   🤖 AI ARENA — Cyberpunk Fighting Game Styles
   ============================================================ */

#arena-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 56px);
  margin-top: -2rem;
  overflow: hidden;
  background: #0a0615;
}

#arena-container canvas {
  display: block;
}

/* ---------- Selection Overlay ---------- */
.arena-select-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 3, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.4s ease;
}

.arena-select-inner {
  width: 90%;
  max-width: 960px;
  text-align: center;
  animation: arenaFadeInUp 0.6s ease-out both;
}

@keyframes arenaFadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.arena-select-title {
  font-size: 2.2em;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.arena-title-icon {
  display: inline-block;
  animation: swordSwing 1.5s ease-in-out infinite;
}

@keyframes swordSwing {
  0%, 100% { transform: rotate(-15deg) scale(1); }
  50% { transform: rotate(15deg) scale(1.15); }
}

.arena-select-sub {
  color: rgba(255,255,255,0.45);
  font-size: 0.95em;
  margin-bottom: 2rem;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* ---------- Fighter Grid ---------- */
.arena-fighter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 2rem;
  max-height: 48vh;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.3) transparent;
}

.arena-fighter-card {
  background: rgba(20, 12, 35, 0.8);
  border: 2px solid rgba(99,102,241,0.12);
  border-radius: 16px;
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.arena-fighter-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.03));
  opacity: 0;
  transition: opacity 0.25s;
}

.arena-fighter-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(99,102,241,0.35);
  box-shadow:
    0 8px 30px rgba(0,0,0,0.4),
    0 0 20px rgba(99,102,241,0.1);
}

.arena-fighter-card:hover::before { opacity: 1; }

/* Selected states */
.arena-fighter-card.selected-p1 {
  border-color: #3B82F6;
  box-shadow: 0 0 20px rgba(59,130,246,0.25), inset 0 0 20px rgba(59,130,246,0.05);
}
.arena-fighter-card.selected-p1::after {
  content: 'P1';
  position: absolute;
  top: 8px; right: 8px;
  background: #3B82F6;
  color: #fff;
  font-size: 0.68em;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
}

.arena-fighter-card.selected-p2 {
  border-color: #EF4444;
  box-shadow: 0 0 20px rgba(239,68,68,0.25), inset 0 0 20px rgba(239,68,68,0.05);
}
.arena-fighter-card.selected-p2::after {
  content: 'P2';
  position: absolute;
  top: 8px; right: 8px;
  background: #EF4444;
  color: #fff;
  font-size: 0.68em;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
}

.fighter-avatar {
  flex: 0 0 58px;
  width: 58px; height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid transparent;
  transition: all 0.25s;
}

.fighter-emoji {
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.fighter-info { flex: 1; min-width: 0; }

.fighter-name {
  font-size: 1.05em;
  font-weight: 800;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.fighter-desc {
  font-size: 0.78em;
  color: rgba(255,255,255,0.45);
  margin: 0 0 6px;
}

.fighter-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.fighter-stats span {
  font-size: 0.72em;
  color: rgba(255,255,255,0.55);
  font-family: 'JetBrains Mono', monospace;
}

.fighter-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.skill-tag {
  font-size: 0.68em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(99,102,241,0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.18);
}

.ult-tag {
  font-size: 0.68em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.18);
}

/* ---------- VS Display (selected fighters) ---------- */
.arena-vs-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 1.5rem;
}

.arena-selected-fighter {
  min-width: 160px;
  padding: 12px 20px;
  border-radius: 14px;
  border: 2px dashed rgba(99,102,241,0.2);
  background: rgba(15,10,30,0.5);
  transition: all 0.3s ease;
}

.arena-placeholder-text {
  color: rgba(255,255,255,0.25);
  font-size: 0.85em;
  font-weight: 600;
}

.selected-fighter-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.selected-emoji {
  font-size: 32px;
}

.selected-name {
  font-weight: 800;
  font-size: 1.1em;
  letter-spacing: -0.02em;
}

.selected-desc {
  font-size: 0.75em;
  color: rgba(255,255,255,0.45);
}

.arena-vs-text {
  font-size: 2em;
  font-weight: 900;
  background: linear-gradient(135deg, #EF4444, #F59E0B, #EF4444);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: vsGlow 2s ease-in-out infinite;
  text-shadow: none;
  line-height: 1;
}

@keyframes vsGlow {
  0%, 100% { background-position: 0% 50%; filter: drop-shadow(0 0 10px rgba(239,68,68,0.3)); }
  50% { background-position: 100% 50%; filter: drop-shadow(0 0 20px rgba(245,158,11,0.4)); }
}

/* ---------- Start Button ---------- */
.arena-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px;
  font-size: 1.1em;
  font-weight: 800;
  color: #fff !important;
  background: linear-gradient(135deg, #6366F1, #EC4899, #F59E0B) !important;
  border: none !important;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(99,102,241,0.35), 0 0 40px rgba(236,72,153,0.15);
  opacity: 0.4;
  pointer-events: none;
}

.arena-start-btn.ready {
  opacity: 1;
  pointer-events: auto;
  animation: startBtnPulse 1.5s ease-in-out infinite;
}

.arena-start-btn.ready:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 35px rgba(99,102,241,0.5), 0 0 60px rgba(236,72,153,0.25);
}

@keyframes startBtnPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(99,102,241,0.35), 0 0 40px rgba(236,72,153,0.15); }
  50% { box-shadow: 0 4px 30px rgba(99,102,241,0.55), 0 0 70px rgba(236,72,153,0.3); }
}

/* ---------- Battle UI Overlay ---------- */
.arena-battle-ui {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

/* Health Bars */
.arena-health-row {
  position: absolute;
  top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 16;
  pointer-events: none;
}

.arena-p1-health { left: 20px; }
.arena-p2-health { right: 20px; }

.arena-fighter-name-bar {
  font-size: 0.85em;
  font-weight: 800;
  white-space: nowrap;
  min-width: 52px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.arena-hp-outer {
  width: 220px;
  height: 22px;
  background: rgba(0,0,0,0.6);
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.1);
  position: relative;
}

.arena-hp-fill {
  height: 100%;
  border-radius: 9px;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, #6366F1, #A78BFA);
  position: relative;
}

.arena-hp-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  border-radius: 9px 9px 0 0;
}

.arena-hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  font-weight: 700;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  z-index: 1;
}

/* Energy bar */
.arena-energy-bar {
  width: 50px;
  height: 22px;
  background: rgba(0,0,0,0.6);
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid rgba(245,158,11,0.2);
  position: relative;
}

.arena-energy-fill {
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
  transition: width 0.15s ease;
  position: relative;
  box-shadow: 0 0 8px rgba(245,158,11,0.4);
}

.arena-energy-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 1;
}

/* Ultimate ready indicator */
.arena-ultimate-ready {
  position: absolute;
  bottom: 80px;
  padding: 8px 20px;
  background: linear-gradient(135deg, rgba(239,68,68,0.85), rgba(245,158,11,0.85));
  border-radius: 30px;
  color: white;
  font-weight: 800;
  font-size: 0.82em;
  font-family: 'JetBrains Mono', monospace;
  animation: ultReadyPulse 0.6s ease-in-out infinite;
  z-index: 17;
  pointer-events: none;
  letter-spacing: 0.06em;
}

.arena-ultimate-ready.ult-right {
  left: auto;
  right: 20px;
}

@keyframes ultReadyPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(239,68,68,0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 30px rgba(245,158,11,0.6); }
}

.hidden { display: none !important; }

/* ---------- HUD Top ---------- */
.arena-hud-top {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 14;
  pointer-events: none;
}

.arena-round-badge {
  font-size: 0.75em;
  font-weight: 800;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.05);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
}

.arena-timer {
  font-size: 2.5em;
  font-weight: 900;
  color: #EF4444;
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 20px rgba(239,68,68,0.4);
  min-width: 60px;
  text-align: center;
  transition: all 0.2s;
}

/* ---------- Commentary Log ---------- */
.arena-commentary {
  position: absolute;
  bottom: 65px;
  left: 20px;
  width: calc(100% - 40px);
  max-height: 120px;
  overflow: hidden;
  z-index: 13;
  pointer-events: none;
}

.arena-comment-line {
  font-size: 0.82em;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 0;
  line-height: 1.5;
  transition: all 0.3s;
  animation: commentSlideIn 0.3s ease-out both;
}

.arena-comment-line.new {
  color: #fbbf24;
}

@keyframes commentSlideIn {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: inherit; transform: none; }
}

/* ---------- Controls Hint ---------- */
.arena-controls-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 13;
  pointer-events: none;
}

.arena-controls-hint span {
  font-size: 0.7em;
  color: rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.4);
  padding: 5px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.05);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

/* ---------- Victory Overlay ---------- */
.arena-victory-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 3, 15, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: victoryFadeIn 0.6s ease-out both;
}

@keyframes victoryFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.arena-victory-content {
  text-align: center;
  animation: victoryPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes victoryPopIn {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.arena-victory-crown {
  font-size: 4em;
  display: inline-block;
  margin-bottom: 10px;
  padding: 20px 30px;
  border-radius: 50%;
  animation: crownFloat 2s ease-in-out infinite;
  background: rgba(255,255,255,0.03);
}

@keyframes crownFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.arena-victory-title {
  font-size: 3em;
  font-weight: 900;
  margin: 0 0 8px;
  letter-spacing: -0.04em;
  text-shadow: 0 0 40px currentColor;
}

.arena-victory-subtitle {
  font-size: 1.1em;
  color: rgba(255,255,255,0.5);
  margin: 0 0 1.5rem;
}

.arena-victory-stats {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.2rem 2rem;
  margin: 0 auto 1.5rem;
  max-width: 340px;
  text-align: left;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.88em;
  color: rgba(255,255,255,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.stat-row:last-child { border-bottom: none; }

.stat-row strong {
  color: #fbbf24;
  font-family: 'JetBrains Mono', monospace;
}

.arena-restart-btn,
.arena-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.95em;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  margin: 0 8px;
  transition: all 0.25s ease;
  font-family: var(--font-sans);
}

.arena-restart-btn {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: white;
  box-shadow: 0 4px 15px rgba(99,102,241,0.35);
}

.arena-restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99,102,241,0.5);
}

.arena-back-btn {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.12);
}

.arena-back-btn:hover {
  background: rgba(255,255,255,0.12);
  color: white;
  transform: translateY(-2px);
}

/* ---------- Arena Page Layout Overrides ---------- */
.permalink-arena #main {
  padding: 0 !important;
  max-width: 100% !important;
}

.permalink-arena .page__content {
  padding: 0 !important;
}

.permalink-arena .author__profile {
  display: none;
}

.permalink-arena .page__title,
.permalink-arena .page__inner-wrap > *:not(#arena-container) {
  /* hide default page content on arena page */
}

/* ---------- Responsive Arena ---------- */
@media (max-width: 768px) {
  #arena-container {
    height: calc(100vh - 52px);
    margin-top: -1rem;
  }

  .arena-select-title {
    font-size: 1.5em;
  }

  .arena-fighter-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    max-height: 42vh;
  }

  .arena-fighter-card {
    padding: 0.8rem;
    gap: 10px;
  }

  .fighter-avatar { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px; font-size: 22px; }
  .fighter-name { font-size: 0.95em; }
  .fighter-desc { font-size: 0.72em; }
  .fighter-skills { display: none; }

  .arena-vs-display {
    flex-direction: column;
    gap: 8px;
  }

  .arena-vs-text {
    font-size: 1.5em;
  }

  .arena-selected-fighter { min-width: auto; width: 100%; }

  .arena-hp-outer { width: 140px; height: 18px; }
  .arena-health-row { gap: 6px; }
  .arena-energy-bar { width: 36px; height: 18px; }

  .arena-timer { font-size: 1.8em; }
  .arena-round-badge { font-size: 0.65em; padding: 3px 10px; }

  .arena-commentary {
    bottom: 55px;
    left: 10px;
    width: calc(100% - 20px);
  }

  .arena-controls-hint span { font-size: 0.6em; padding: 4px 12px; }
  .arena-ultimate-ready { bottom: 60px; font-size: 0.72em; padding: 6px 14px; }

  .arena-victory-title { font-size: 2em; }
  .arena-victory-crown { font-size: 3em; }
}

/* ============================================================
   💬 CHAT ARENA — Dual AI Conversation Battle
   ============================================================ */

#chat-arena {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
  margin-top: -1rem;
  background: linear-gradient(160deg, #0c0a1a 0%, #111128 40%, #0d0b1e 100%);
}

/* ---------- Header ---------- */
.ca-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(15,12,30,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(99,102,241,0.12);
  flex-shrink: 0;
  z-index: 10;
}

.ca-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ca-logo-icon {
  font-size: 1.5em;
  animation: swordSwing 2s ease-in-out infinite;
}

@keyframes swordSwing {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.1); }
}

.ca-title {
  font-size: 1.25em;
  font-weight: 900;
  color: #fff;
  margin: 0;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #6366f1, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ca-subtitle {
  font-size: 0.75em;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
}

/* Model Selectors */
.ca-model-selects {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
}

.ca-model-selector label {
  display: block;
  font-size: 0.68em;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.ca-model-selector select {
  width: 150px;
  padding: 7px 10px;
  background: rgba(30,24,60,0.9);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.ca-model-selector select:hover,
.ca-model-selector select:focus {
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 12px rgba(99,102,241,0.15);
}

.ca-vs-badge {
  font-size: 1.15em;
  font-weight: 900;
  background: linear-gradient(135deg, #EF4444, #F59E0B);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
}

/* Header Actions */
.ca-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ca-settings-btn,
.ca-clear-btn {
  padding: 6px 14px;
  font-size: 0.82em;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  font-family: var(--font-sans);
}

.ca-settings-btn:hover { border-color: #6366F1; color: #fff; background: rgba(99,102,241,0.1); }
.ca-clear-btn:hover { border-color: #EF4444; color: #fff; background: rgba(239,68,68,0.1); }

/* ---------- Settings Panel ---------- */
.ca-settings-panel {
  background: rgba(18,14,36,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(99,102,241,0.12);
  padding: 16px 24px;
  z-index: 9;
  transition: all 0.3s ease;
}

.ca-settings-panel.hidden {
  display: none !important;
}

.ca-settings-panel h3 {
  color: #fff;
  font-size: 1em;
  margin: 0 0 4px;
}
.ca-settings-hint {
  font-size: 0.78em;
  color: rgba(255,255,255,0.35);
  margin: 0 0 14px;
}

.ca-api-keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ca-key-item label {
  display: block;
  font-size: 0.78em;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
}

.ca-key-item input {
  width: 100%;
  padding: 7px 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  transition: border-color 0.2s;
}

.ca-key-item input:focus { border-color: #6366F1; }

.ca-settings-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.ca-save-btn,
.ca-demo-btn {
  padding: 8px 22px;
  font-size: 0.85em;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.ca-save-btn {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: white;
  box-shadow: 0 3px 12px rgba(99,102,241,0.3);
}
.ca-demo-btn {
  background: rgba(245,158,11,0.15);
  color: #FBBF24;
  border: 1px solid rgba(245,158,11,0.3);
}
.ca-save-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(99,102,241,0.45); }
.ca-demo-btn:hover { background: rgba(245,158,11,0.25); }

/* ---------- Input Area ---------- */
.ca-input-area {
  padding: 12px 20px;
  flex-shrink: 0;
  background: rgba(15,12,28,0.6);
  border-top: 1px solid rgba(99,102,241,0.08);
  border-bottom: 1px solid rgba(99,102,241,0.08);
}

.ca-input-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  background: rgba(20,16,40,0.7);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 14px;
  overflow: hidden;
  pointer-events: auto !important;
  transition: border-color 0.25s;
}

.ca-input-wrapper:focus-within {
  border-color: rgba(99,102,241,0.45);
  box-shadow: 0 0 20px rgba(99,102,241,0.08);
}

#chatInput {
  width: 100%;
  padding: 12px 120px 12px 16px;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 0.92em;
  font-family: var(--font-sans);
  resize: none;
  outline: none;
  line-height: 1.5;
  min-height: 44px;
  max-height: 160px;
}

#chatInput::placeholder { color: rgba(255,255,255,0.25); }

.ca-input-actions {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ca-char-count {
  font-size: 0.72em;
  color: rgba(255,255,255,0.25);
  font-family: 'JetBrains Mono', monospace;
}

.ca-send-btn {
  padding: 7px 18px;
  background: linear-gradient(135deg, #6366F1, #EC4899);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.85em;
  font-weight: 800;
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: all 0.25s;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  box-shadow: 0 3px 12px rgba(99,102,241,0.3);
}

.ca-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(99,102,241,0.45);
}

.ca-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Arena (Split Panels) ---------- */
.ca-arena {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.ca-divider {
  width: 4px;
  cursor: col-resize;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(99,102,241,0.2) 15%,
    rgba(99,102,241,0.3) 50%,
    rgba(99,102,241,0.2) 85%,
    transparent 100%
  );
  flex-shrink: 0;
  transition: background 0.2s;
  z-index: 5;
}

.ca-divider:hover {
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(139,92,246,0.4) 15%,
    rgba(236,72,153,0.5) 50%,
    rgba(139,92,246,0.4) 85%,
    transparent 100%
  );
}

/* Panel base */
.ca-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(12,10,24,0.5);
  overflow: hidden;
  border-top: 2px solid rgba(99,102,241,0.1);
}

.ca-panel-left { border-right: 2px solid rgba(139,92,246,0.1); }
.ca-panel-right { border-left: 2px solid rgba(255,140,0,0.1); }

/* Panel Header */
.ca-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(15,12,30,0.8);
  border-bottom: 1px solid rgba(99,102,241,0.08);
  flex-shrink: 0;
  z-index: 3;
}

.ca-panel-avatar {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: all 0.3s;
}

.ca-panel-name {
  font-weight: 800;
  font-size: 0.88em;
  color: #fff;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ca-panel-status {
  font-size: 0.72em;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  transition: all 0.3s;
  flex-shrink: 0;
}

.ca-panel-status.active {
  color: #FBBF24;
  background: rgba(251,191,36,0.1);
  animation: statusPulse 1.2s ease-in-out infinite;
}

.ca-panel-status.done { font-weight: 700; }

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

.ca-panel-timer {
  font-size: 0.78em;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #06B6D4;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.15);
  flex-shrink: 0;
}

/* Messages area */
.ca-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.2) transparent;

  /* Custom scrollbar for WebKit */
}
.ca-messages::-webkit-scrollbar { width: 5px; }
.ca-messages::-webkit-scrollbar-track { background: transparent; }
.ca-messages::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.2);
  border-radius: 3px;
}

/* Message bubbles */
.ca-msg { margin-bottom: 14px; animation: msgSlideIn 0.3s ease-out both; }

@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ca-user-bubble {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 16px;
  color: #e2e8f0;
  font-size: 0.9em;
  line-height: 1.6;
  word-break: break-word;
}

.ca-assistant-bubble {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px 16px 16px 4px;
  padding: 14px 18px;
}

.ca-msg-content {
  font-size: 0.9em;
  line-height: 1.75;
  color: #cbd5e1;
  word-wrap: break-word;
  word-break: break-word;
}

.ca-msg-content p { margin: 0 0 10px; }
.ca-msg-content p:last-child { margin-bottom: 0; }

/* Markdown in messages */
.ca-msg-content h2,
.ca-msg-content h3,
.ca-msg-content h4 {
  color: #f1f5f9;
  margin: 16px 0 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ca-msg-content h2 { font-size: 1.15em; }
.ca-msg-content h3 { font-size: 1.05em; }
.ca-msg-content h4 { font-size: 0.96em; }

.ca-msg-content strong { color: #fff; }

.ca-msg-content em { color: #a78bfa; font-style: normal; }

.ca-msg-content ul, .ca-msg-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.ca-msg-content li {
  margin: 4px 0;
  line-height: 1.6;
}

.ca-msg-content blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid #6366F1;
  background: rgba(99,102,241,0.06);
  border-radius: 0 8px 8px 0;
  color: #94a3b8;
  font-style: italic;
}

.ca-msg-content code.inline-code {
  background: rgba(99,102,241,0.12);
  color: #a5b4fc;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86em;
}

.ca-msg-content pre {
  margin: 10px 0;
  border-radius: 10px;
  overflow-x: auto;
}

.ca-msg-content pre code {
  display: block;
  padding: 12px 16px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: 10px;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  line-height: 1.55;
  overflow-x: auto;
}

.ca-msg-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.86em;
}

.ca-msg-content th,
.ca-msg-content td {
  padding: 7px 12px;
  border: 1px solid rgba(99,102,241,0.12);
  text-align: left;
}

.ca-msg-content th {
  background: rgba(99,102,241,0.08);
  color: #f1f5f9;
  font-weight: 700;
}

.ca-msg-content td { color: #94a3b8; }

.ca-msg-content hr {
  border: none;
  height: 1px;
  background: rgba(99,102,241,0.12);
  margin: 14px 0;
}

.ca-msg-content .math-block,
.ca-msg-content .math-inline {
  color: #fbbf24;
  font-family: 'Times New Roman', serif;
}

.ca-msg-error {
  animation: msgSlideIn 0.3s ease-out both;
}

.ca-error-bubble {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 12px;
  padding: 10px 16px;
  color: #fca5a5;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', monospace;
}

/* Panel Footer */
.ca-panel-footer {
  padding: 8px 16px;
  border-top: 1px solid rgba(99,102,241,0.06);
  background: rgba(12,10,24,0.4);
  flex-shrink: 0;
}

.ca-token-count {
  font-size: 0.72em;
  color: rgba(255,255,255,0.2);
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- Winner Banner ---------- */
.ca-winner-banner {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  animation: winnerBannerIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: none;
}

@keyframes winnerBannerIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.8) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}

.ca-winner-content {
  background: rgba(15,12,30,0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 16px;
  padding: 12px 28px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 30px rgba(99,102,241,0.08);
}

.ca-winner-label {
  font-size: 1.05em;
  font-weight: 800;
  color: #fbbf24;
  display: block;
  margin-bottom: 4px;
}

.winner-left .ca-winner-content { border-left: 3px solid #8B5CF6; }
.winner-right .ca-winner-content { border-right: 3px solid #FF8C00; }

.ca-winner-stats {
  font-size: 0.78em;
  color: rgba(255,255,255,0.4);
}

/* ---------- Page Layout Overrides ---------- */
.permalink-chat #main {
  padding: 0 !important;
  max-width: 100% !important;
}
.permalink-chat .page__content {
  padding: 0 !important;
}
.permalink-chat .author__profile { display: none; }
.permalink-chat .page__title,
.permalink-chat .page__inner-wrap > *:not(#chat-arena) {
  /* hide default content on chat page */
}

/* ---------- Responsive Chat Arena ---------- */
@media (max-width: 900px) {
  .ca-model-selector select { width: 120px; font-size: 0.8em; }
  .ca-vs-badge { font-size: 1em; }
  .ca-subtitle { display: none; }
}

@media (max-width: 768px) {
  #chat-arena { height: calc(100vh - 56px); margin-top: -0.5rem; }

  .ca-header {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }

  .ca-logo { flex-basis: 100%; justify-content: center; }
  .ca-title { font-size: 1.05em; }
  .ca-subtitle { display: inline; font-size: 0.65em; }

  .ca-model-selects { order: 3; flex-basis: 100%; justify-content: space-between; }
  .ca-model-selector select { width: 42%; font-size: 0.76em; }
  .ca-vs-badge { font-size: 1em; }

  .ca-header-actions { order: 2; }

  .ca-api-keys-grid { grid-template-columns: 1fr; }

  .ca-input-area { padding: 8px 12px; }
  #chatInput { font-size: 0.86em; padding: 10px 90px 10px 12px; }

  .ca-panel-header { padding: 8px 10px; }
  .ca-panel-avatar { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
  .ca-panel-name { font-size: 0.8em; }
  .ca-panel-status { font-size: 0.66em; padding: 2px 7px; }

  .ca-messages { padding: 10px; }
  .ca-msg-content { font-size: 0.84em; }

  .ca-send-btn { padding: 6px 12px; font-size: 0.8em; }

  .ca-winner-banner { bottom: 58px; }
  .ca-winner-label { font-size: 0.9em; }
}
