/* ═══════════════════════════════════════════════════
   APPLE-LIKE D.A. — Esteban Pesnel
   Clean. Minimal. Generous whitespace. Frosted glass.
═══════════════════════════════════════════════════ */

/* ── Design tokens ── */
:root {
  --bg:             #ffffff;
  --bg-secondary:   #f5f5f7;
  --surface:        rgba(255,255,255,0.72);
  --surface-border: rgba(0,0,0,0.06);
  --text-primary:   #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary:  #86868b;
  --accent:         #0071e3;
  --accent-hover:   #0077ed;
  --accent-warm:    #e8723a;
  --accent-warm-subtle: rgba(232,114,58,0.08);
  --accent-subtle:  rgba(0,113,227,0.08);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.04);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg:      0 12px 40px rgba(0,0,0,0.08);
  --radius:         16px;
  --radius-sm:      10px;
  --transition:     0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --global-bg-color:          var(--bg);
  --global-link-color:        var(--accent);
  --global-link-color-hover:  var(--accent-hover);
  --global-text-color:        var(--text-primary);
  --global-base-color:        var(--accent);

  --blue:         #0071e3;
  --blue-light:   #2997ff;
  --blue-dark:    #0055b3;
  --blue-pale:    #f0f5ff;
  --text:         var(--text-primary);
  --text-light:   var(--text-secondary);
  --text-muted:   var(--text-tertiary);
  --title:        #1d1d1f;
  --heading:      #1d1d1f;
  --card-bg:      var(--surface);
  --card-border:  var(--surface-border);
  --code-bg:      #f5f5f7;
  --code-text:    #d63384;
  --pill-bg:      var(--accent-subtle);
  --pill-text:    var(--accent);
  --pill-border:  rgba(0,113,227,0.12);
  --eq-bg:        #f5f5f7;
  --separator:    rgba(0,0,0,0.08);
}

html[data-theme="dark"] {
  --bg:             #1c1c1e;
  --bg-secondary:   #2c2c2e;
  --surface:        rgba(58,58,62,0.55);
  --surface-border: rgba(255,255,255,0.12);
  --text-primary:   #f5f5f7;
  --text-secondary: #ababaf;
  --text-tertiary:  #7c7c80;
  --accent:         #2997ff;
  --accent-hover:   #64b5f6;
  --accent-warm:    #ff8c42;
  --accent-warm-subtle: rgba(255,140,66,0.12);
  --accent-subtle:  rgba(41,151,255,0.12);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.25);
  --shadow-md:      0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg:      0 12px 44px rgba(0,0,0,0.45);

  --global-bg-color:          #1c1c1e;
  --global-text-color:        #f5f5f7;
  --global-text-color-light:  #ababaf;
  --global-link-color:        #2997ff;
  --global-link-color-hover:  #64b5f6;
  --global-link-color-visited:#2997ff;
  --global-border-color:      rgba(255,255,255,0.12);
  --global-dark-border-color: rgba(255,255,255,0.08);
  --global-code-background-color: rgba(58,58,62,0.55);
  --global-code-text-color:   #f5f5f7;
  --global-footer-bg-color:   #1c1c1e;
  --global-masthead-link-color: #f5f5f7;
  --global-masthead-link-color-hover: #2997ff;
  --global-base-color:        #2997ff;
  --global-thead-color:       #2c2c2e;

  --blue:         #2997ff;
  --blue-light:   #64b5f6;
  --blue-dark:    #0a84ff;
  --blue-pale:    rgba(41,151,255,0.1);
  --text:         #f5f5f7;
  --text-light:   #ababaf;
  --text-muted:   #7c7c80;
  --title:        #f5f5f7;
  --heading:      #f5f5f7;
  --card-bg:      rgba(58,58,62,0.55);
  --card-border:  rgba(255,255,255,0.12);
  --code-bg:      rgba(58,58,62,0.55);
  --code-text:    #ff6b8a;
  --pill-bg:      rgba(41,151,255,0.12);
  --pill-text:    #2997ff;
  --pill-border:  rgba(41,151,255,0.18);
  --eq-bg:        rgba(58,58,62,0.4);
  --separator:    rgba(255,255,255,0.08);
}

/* ── Gradient mesh background ── */
.gradient-mesh {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.gm-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0;
  animation: gm-in 2s cubic-bezier(0.25,0.46,0.45,0.94) forwards;
}
html[data-theme="dark"] .gm-orb { opacity: 0; animation: gm-in 2s cubic-bezier(0.25,0.46,0.45,0.94) forwards; }
:root .gm-orb { opacity: 0; animation: gm-in-light 2s cubic-bezier(0.25,0.46,0.45,0.94) forwards; }

@keyframes gm-in {
  to { opacity: 1; }
}
@keyframes gm-in-light {
  to { opacity: 1; }
}

/* Dark mode orbs */
html[data-theme="dark"] .gm-orb-1,
html[data-theme="dark"] .gm-orb-2,
html[data-theme="dark"] .gm-orb-3 {
  display: none;
}

/* ── Floating particles background ── */
.bg-particles {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.bg-particle {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  animation: particleDrift linear infinite, particleFadeIn 3s ease forwards;
}

html[data-theme="dark"] .bg-particle--1 {
  width: 250px; height: 250px;
  background: rgba(41,151,255,0.3);
  top: 15%; left: 10%;
  animation: particleDrift1 28s linear infinite, particleFadeIn 3s ease forwards;
}
html[data-theme="dark"] .bg-particle--2 {
  width: 220px; height: 220px;
  background: rgba(255,140,66,0.25);
  top: 55%; right: 8%;
  animation: particleDrift2 32s linear infinite, particleFadeIn 3s 0.5s ease forwards;
}
html[data-theme="dark"] .bg-particle--3 {
  width: 280px; height: 280px;
  background: rgba(41,151,255,0.2);
  bottom: 10%; left: 35%;
  animation: particleDrift3 35s linear infinite, particleFadeIn 3s 1s ease forwards;
}
html[data-theme="dark"] .bg-particle--4 {
  width: 180px; height: 180px;
  background: rgba(255,140,66,0.2);
  top: 30%; right: 30%;
  animation: particleDrift4 30s linear infinite, particleFadeIn 3s 1.5s ease forwards;
}
html[data-theme="dark"] .bg-particle--5 {
  width: 230px; height: 230px;
  background: rgba(100,77,255,0.2);
  top: 70%; left: 15%;
  animation: particleDrift5 38s linear infinite, particleFadeIn 3s 2s ease forwards;
}


@keyframes particleFadeIn {
  to { opacity: 1; }
}
@keyframes particleDrift1 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(160px, -120px); }
  50%  { transform: translate(-80px, -200px); }
  75%  { transform: translate(-180px, -50px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleDrift2 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-140px, 100px); }
  50%  { transform: translate(120px, 180px); }
  75%  { transform: translate(160px, -80px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleDrift3 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(180px, 80px); }
  50%  { transform: translate(100px, -150px); }
  75%  { transform: translate(-120px, -100px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleDrift4 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-100px, -140px); }
  50%  { transform: translate(140px, -60px); }
  75%  { transform: translate(80px, 120px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleDrift5 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(120px, 150px); }
  50%  { transform: translate(-150px, 80px); }
  75%  { transform: translate(-60px, -130px); }
  100% { transform: translate(0, 0); }
}

/* Light mode orbs */
:root .gm-orb-1 {
  width: 600px; height: 600px;
  top: -10%; left: -5%;
  background: radial-gradient(circle, rgba(0,113,227,0.06) 0%, transparent 70%);
}
:root .gm-orb-2 {
  width: 500px; height: 500px;
  top: 30%; right: -8%;
  background: radial-gradient(circle, rgba(100,77,255,0.04) 0%, transparent 70%);
  animation-delay: 0.4s;
}
:root .gm-orb-3 {
  width: 700px; height: 700px;
  bottom: -15%; left: 25%;
  background: radial-gradient(circle, rgba(0,113,227,0.03) 0%, transparent 70%);
  animation-delay: 0.8s;
}

/* Subtle noise texture */
.gm-noise {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  opacity: 0.4;
}

/* ── Global base ── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html {
  background-color: var(--bg) !important;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif !important;
  letter-spacing: -0.01em;
  background-color: transparent !important;
}
* { transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); }

/* ══════════════════════════════
   MASTHEAD — frosted glass
══════════════════════════════ */
html body .masthead,
html body .masthead__inner-wrap,
html body .masthead__menu,
html body nav.greedy-nav,
html body .greedy-nav,
html body .greedy-nav .visible-links,
html body ul.visible-links,
html body .masthead__menu-item {
  background-color: transparent !important;
  background: transparent !important;
}
html body .masthead {
  background: rgba(28,28,30,0.65) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: none !important;
}
html body .masthead a,
html body .masthead__menu a,
html body .greedy-nav a,
html body .visible-links a,
html body .masthead__menu-item a {
  font-family: 'Inter', -apple-system, 'SF Pro Display', BlinkMacSystemFont, 'Helvetica Neue', sans-serif !important;
  color: rgba(255,255,255,0.82) !important;
  font-weight: 600 !important;
  font-size: 0.95em !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  transition: color var(--transition) !important;
}
html body .greedy-nav .visible-links li:not(.masthead__menu-item--lg):not(.tail) a {
  background: linear-gradient(90deg, rgba(255,255,255,0.85), rgba(200,215,240,0.85), rgba(240,200,180,0.8)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
html body .greedy-nav .visible-links li:not(.masthead__menu-item--lg):not(.tail) a:hover {
  background: linear-gradient(90deg, #ffffff, rgba(41,151,255,0.85), rgba(255,140,66,0.7)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
html body .masthead__menu-item--lg a {
  font-family: 'Great Vibes', cursive !important;
  font-size: 1.5em !important;
  font-weight: 400 !important;
  color: #f5f5f7 !important;
}
html body .masthead a:hover,
html body .greedy-nav a:hover,
html body .masthead__menu-item a:hover {
  color: #ffffff !important;
}
html body .greedy-nav .visible-links a::before {
  display: none !important;
}
html body .greedy-nav .visible-links li:not(.masthead__menu-item--lg) a {
  position: relative !important;
  padding: 0.5rem 0 !important;
  margin: 0 1.2rem !important;
}
html body .greedy-nav .visible-links li:not(.masthead__menu-item--lg) a::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  width: 0 !important;
  height: 2px !important;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm, #ff8c42)) !important;
  border-radius: 2px !important;
  transform: translateX(-50%) !important;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
html body .greedy-nav .visible-links li:not(.masthead__menu-item--lg) a:hover::after {
  width: 100% !important;
}
html body .greedy-nav .visible-links li.selected:not(.masthead__menu-item--lg) a::after {
  width: 100% !important;
}
html body #theme-icon,
html body #theme-toggle a { color: rgba(255,255,255,0.82) !important; }
html body .greedy-nav__toggle svg { fill: rgba(255,255,255,0.82) !important; }
html body .greedy-nav .visible-links {
  display: table !important;
  margin: 0 auto !important;
  width: auto !important;
}
html body .greedy-nav .visible-links li {
  display: table-cell !important;
  vertical-align: middle !important;
}
html body .greedy-nav button {
  display: none !important;
}
html body .greedy-nav .hidden-links {
  display: none !important;
}

/* ══════════════════════════════
   SIDEBAR — frosted card
══════════════════════════════ */
.sidebar.sticky {
  background: linear-gradient(165deg, var(--surface) 0%, rgba(41,151,255,0.08) 50%, rgba(255,140,66,0.08) 100%) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  border: 1px solid var(--surface-border) !important;
  border-radius: var(--radius) !important;
  padding: 1.8em 1.2em 1.6em !important;
  height: fit-content !important;
  align-self: flex-start !important;
  margin-top: 0 !important;
  box-shadow: var(--shadow-md) !important;
  overflow: hidden !important;
  position: relative !important;
}
.sidebar.sticky * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.sidebar.sticky::after { display: none !important; }
.sidebar.sticky::before {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  top: 0 !important; left: 0 !important; right: 0 !important;
  height: 3px !important;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm, #ff8c42)) !important;
  border-radius: var(--radius) var(--radius) 0 0 !important;
  z-index: 2 !important;
  pointer-events: none !important;
}
.sidebar.sticky .author__avatar {
  overflow: visible !important; display: flex !important;
  justify-content: center !important; margin-bottom: 0.5em !important;
}
.sidebar.sticky .author__avatar img {
  width: 100% !important; max-width: 100% !important; height: auto !important;
  border-radius: 0 !important; object-fit: contain !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important; outline: none !important;
  box-shadow: none !important;
  transition: transform var(--transition) !important; display: block !important;
}
.sidebar.sticky .author__avatar img:hover {
  transform: scale(1.02) !important;
}
.sidebar.sticky .author__name {
  color: var(--text-primary) !important; font-size: 1.35em !important; font-weight: 700 !important;
  text-align: center !important; margin: 0 !important;
  overflow-wrap: anywhere !important; letter-spacing: -0.03em !important;
  line-height: 1.2 !important;
  position: relative !important;
}
.sidebar.sticky .author__pronouns {
  color: var(--text-tertiary) !important; text-align: left !important;
  font-size: 0.62em !important; letter-spacing: 0.01em !important;
  font-style: italic !important;
  margin: 0.1em 0 0.6em !important;
  opacity: 0.6 !important;
  padding-left: calc(50% - 2.8ch) !important;
}
.sidebar.sticky .author__bio {
  color: var(--text-secondary) !important; font-size: 0.78em !important;
  line-height: 1.5 !important; text-align: center !important; margin-bottom: 0.8em !important;
  overflow-wrap: anywhere !important;
}
.sidebar.sticky p,
.sidebar.sticky li:not(.author__urls li) {
  color: var(--text-tertiary) !important; font-size: 0.72em !important;
  text-align: center !important; overflow-wrap: anywhere !important;
}
.sidebar.sticky .author__urls-wrapper button { display: none !important; }
.sidebar.sticky .author__urls li.author__desktop {
  display: block !important; width: 100% !important;
  text-align: center !important; font-size: 0.72em !important;
  color: var(--text-tertiary) !important;
  padding: 0.15em 0 !important; white-space: nowrap !important;
  overflow: hidden !important; text-overflow: ellipsis !important;
}

/* Social pills — subtle, monochrome */
.sidebar.sticky .author__urls {
  display: flex !important; flex-wrap: wrap !important; gap: 6px !important;
  justify-content: center !important; padding: 0.8em 0 0 !important;
  margin: 0 !important; list-style: none !important;
  border-top: 1px solid var(--separator) !important;
}
.sidebar.sticky .author__urls li {
  display: inline-flex !important; list-style: none !important;
  background: transparent !important; border: none !important; padding: 0 !important;
}
.sidebar.sticky .author__urls li::after { display: none !important; }
.sidebar.sticky .author__urls li a {
  display: inline-flex !important; align-items: center !important; gap: 0.4em !important;
  padding: 0.35em 0.8em !important; border-radius: 20px !important;
  font-size: 0.76em !important; font-weight: 500 !important;
  color: var(--text-secondary) !important; text-decoration: none !important;
  white-space: nowrap !important; overflow: hidden !important;
  text-overflow: ellipsis !important; max-width: 100% !important;
  background: var(--accent-subtle) !important;
  border: 1px solid var(--pill-border) !important;
  transition: all var(--transition) !important;
}
.sidebar.sticky .author__urls li a:hover {
  background: var(--accent) !important;
  color: white !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-sm) !important;
}
.sidebar.sticky .author__urls a i,
.sidebar.sticky .author__urls a svg {
  display: inline-block !important;
  font-size: 1.1em !important;
}
.sidebar.sticky .author__urls a [class*="fa-"] { display: inline-block !important; font-size: 1.1em !important; }
.sidebar.sticky .author__urls a::before { content: none !important; }

/* ── Sidebar focus & affiliations ── */
.sidebar.sticky .author__focus {
  margin-top: 0.8em !important;
  padding-top: 0.8em !important;
  border-top: 1px solid var(--separator) !important;
}
.sidebar.sticky .author__focus-header {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.45em !important;
  font-size: 0.64em !important;
  color: var(--text-tertiary) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  margin-bottom: 0.6em !important;
}
.focus-pulse {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #30d158;
  animation: focusPulse 2.5s ease-in-out infinite;
}
@keyframes focusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(48,209,88,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(48,209,88,0); }
}
.sidebar.sticky .author__focus-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  justify-content: flex-start !important;
}
.sidebar.sticky .author__focus-tags span {
  display: inline-block !important;
  padding: 0.2em 0.6em !important;
  border-radius: 14px !important;
  font-size: 0.64em !important;
  font-weight: 500 !important;
  background: var(--accent-warm-subtle) !important;
  color: var(--accent-warm) !important;
  border: 1px solid rgba(255,140,66,0.15) !important;
  transition: all var(--transition) !important;
}
.sidebar.sticky .author__focus-tags span:hover {
  background: var(--accent-warm) !important;
  color: white !important;
  transform: translateY(-1px) !important;
}
.sidebar.sticky .author__affiliations {
  margin-top: 0.8em !important;
  padding-top: 0.8em !important;
  border-top: 1px solid var(--separator) !important;
}
.sidebar.sticky .author__affil-logos {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1em !important;
}
.sidebar.sticky .author__affil-logos img {
  height: 24px !important;
  width: auto !important;
  max-width: 80px !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  object-fit: contain !important;
  opacity: 0.5 !important;
  filter: brightness(0) invert(1) !important;
  transition: opacity var(--transition) !important;
}
.sidebar.sticky .author__affil-logos img:hover {
  opacity: 0.8 !important;
  transform: none !important;
}

/* Platform-specific pill icons */
.sidebar.sticky .author__urls a[href*="mailto"]::before          { content: "\2709\FE0E "; }
.sidebar.sticky .author__urls a[href*="scholar.google"]::before  { content: "\1F393 "; }
.sidebar.sticky .author__urls a[href*="orcid"]::before           { content: "\1F52C "; }
.sidebar.sticky .author__urls a[href*="researchgate"]::before    { content: "\1F4CA "; }
.sidebar.sticky .author__urls a[href*="semanticscholar"]::before { content: "\1F9E0 "; }
.sidebar.sticky .author__urls a[href*="github"]::before          { content: "\1F4BB "; }
.sidebar.sticky .author__urls a[href*="linkedin"]::before        { content: "\1F4BC "; }

/* ══════════════════════════════
   PAGE CONTENT — generous spacing
══════════════════════════════ */
.page__content {
  line-height: 1.8 !important;
  color: var(--text) !important;
  font-size: 1.02em !important;
}
.page__content h2 {
  font-weight: 700 !important; color: var(--heading) !important;
  font-size: 1.6em !important;
  letter-spacing: -0.03em !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-top: 2.5em !important;
  margin-bottom: 0.8em !important;
}
.page__content h3 {
  font-weight: 600 !important; color: var(--heading) !important;
  font-size: 1.2em !important;
  letter-spacing: -0.02em !important;
}
.page__content a {
  color: var(--accent) !important; text-decoration: none !important;
  transition: color var(--transition) !important;
}
.page__content a:hover { color: var(--accent-hover) !important; }
.page__title {
  font-weight: 700 !important; color: var(--title) !important;
  letter-spacing: -0.03em !important;
  font-size: 2em !important;
}

/* ══════════════════════════════
   FOOTER — minimal
══════════════════════════════ */
.page__footer {
  background-color: var(--bg) !important;
  color: var(--text-tertiary) !important;
  border-top: 1px solid var(--separator) !important;
}
.page__footer a {
  color: var(--text-secondary) !important; text-decoration: none !important;
  transition: color var(--transition) !important;
}
.page__footer a:hover { color: var(--accent) !important; }
.page__footer-compact {
  max-width: 1200px; margin: 0 auto;
  padding: 1.2em 2em;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.5em; font-size: 0.78em;
}
.footer-left { color: var(--text-tertiary); }
.footer-right { display: flex; gap: 1.4em; }
.footer-right a {
  color: var(--text-tertiary) !important;
  font-size: 0.92em !important;
  transition: color var(--transition) !important;
}
.footer-right a:hover { color: var(--accent) !important; }
.page__footer-follow { display: none !important; }
.page__footer-copyright { display: none !important; }

/* ══════════════════════════════
   BREADCRUMBS
══════════════════════════════ */
.breadcrumbs {
  background: transparent !important;
  border-bottom: 1px solid var(--separator) !important;
  padding-top: 0.6em !important; padding-bottom: 0.6em !important;
  font-size: 0.8em !important;
}
.breadcrumbs ol { margin: 0 !important; }
.breadcrumbs li { color: var(--text-tertiary) !important; }
.breadcrumbs li a {
  color: var(--text-secondary) !important; text-decoration: none !important;
  font-weight: 400 !important;
  transition: color var(--transition) !important;
}
.breadcrumbs li a:hover { color: var(--accent) !important; }
.breadcrumbs .current { color: var(--text-primary) !important; font-weight: 600 !important; }
.breadcrumbs .sep { color: var(--text-tertiary) !important; margin: 0 0.4em !important; }

/* ══════════════════════════════
   MISC
══════════════════════════════ */
blockquote {
  border-left: 3px solid var(--accent) !important;
  background: var(--accent-subtle) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
  padding: 1em 1.4em !important;
}
code {
  background: var(--code-bg) !important; color: var(--code-text) !important;
  padding: 0.15em 0.4em !important; border-radius: 6px !important;
  font-size: 0.88em !important;
}
table {
  border-collapse: collapse !important;
}
table th {
  background: var(--bg-secondary) !important;
  font-weight: 600 !important;
}
table td, table th {
  border: 1px solid var(--separator) !important;
  padding: 0.6em 1em !important;
}

/* ══════════════════════════════
   ACTIVE NAV INDICATOR
══════════════════════════════ */
html body .masthead__menu-item.selected a {
  color: #ffffff !important;
}

/* ══════════════════════════════
   READING PROGRESS BAR
══════════════════════════════ */
.reading-progress {
  position: fixed; top: 0; left: 0;
  width: 0%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm, #ff8c42));
  z-index: 10000;
  transition: width 0.08s linear;
}

/* ══════════════════════════════
   SCROLL TO TOP
══════════════════════════════ */
.scroll-to-top {
  position: fixed; bottom: 2em; right: 2em;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all var(--transition);
  z-index: 9999;
  box-shadow: var(--shadow-md);
}
.scroll-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-to-top:hover {
  background: var(--accent); color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ══════════════════════════════
   HOMEPAGE SIDEBAR + CONTENT ALIGN
══════════════════════════════ */
#main:has(.sidebar) {
  display: flex !important;
  align-items: flex-start !important;
  gap: 2.5em !important;
}
#main:has(.sidebar)::after {
  display: none !important;
}
#main .sidebar,
#main .sidebar.sticky {
  position: relative !important;
  height: fit-content !important;
  padding-top: 1.8em !important;
  margin-top: 0.35em !important;
  margin-bottom: 0 !important;
  top: auto !important;
  float: none !important;
  width: 280px !important;
  max-width: 280px !important;
  flex-shrink: 0 !important;
}
#main:has(.sidebar) .page {
  flex: 1 !important;
  float: none !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
@media (max-width: 1024px) {
  #main:has(.sidebar) {
    flex-direction: column !important;
    gap: 1.5em !important;
    padding: 0 1em !important;
  }
  #main .sidebar,
  #main .sidebar.sticky {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0 !important;
    overflow: visible !important;
  }
  #main:has(.sidebar) .page {
    width: 100% !important;
  }
  .sidebar.sticky .author__urls-wrapper {
    display: block !important;
    position: relative !important;
  }
  .sidebar.sticky .author__urls {
    display: flex !important;
    position: relative !important;
    right: auto !important;
    margin-top: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    z-index: auto !important;
    overflow: visible !important;
  }
  .sidebar.sticky .author__urls li.author__desktop {
    white-space: normal !important;
    overflow: visible !important;
  }
  .sidebar.sticky .author__urls li a {
    white-space: nowrap !important;
    overflow: visible !important;
    max-width: none !important;
  }
  .sidebar.sticky .author__name {
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  .sidebar.sticky .author__bio {
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
}

/* ══════════════════════════════
   PAGE STRIP LAYOUT (shared)
══════════════════════════════ */
.archive:has(.strip-wrapper) {
  float: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
}
#main:has(.strip-wrapper) {
  max-width: 980px !important;
  margin: 0 auto !important;
  padding: 0 2em !important;
  float: none !important;
  width: 100% !important;
}
.strip-wrapper {
  display: flex;
  min-height: 80vh;
  gap: 0;
  position: relative;
}
.strip-bar {
  position: relative;
  width: 64px;
  flex-shrink: 0;
}
.strip-bar::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--accent) 10%,
    var(--accent-warm, #ff8c42) 50%,
    var(--separator) 90%,
    transparent 100%
  );
}
.strip-bar-inner {
  position: sticky;
  top: 80px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.5em;
  height: calc(100vh - 120px);
}
.strip-bar-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: 'Great Vibes', cursive;
  font-size: 2.6em;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--accent);
  opacity: 0;
  animation: strip-reveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
  background: linear-gradient(to bottom, var(--accent), var(--accent-warm, #ff8c42), var(--text-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
}
@keyframes strip-reveal {
  0%   { opacity: 0; transform: rotate(180deg) translateY(20px); }
  100% { opacity: 0.7; transform: rotate(180deg) translateY(0); }
}
.strip-content {
  flex: 1;
  min-width: 0;
  padding: 0 0 3em 2.5em;
}
@media (max-width: 600px) {
  .strip-bar { width: 36px; }
  .strip-bar-text { font-size: 1.3em; }
  .strip-content { padding-left: 1em; }
}

/* ══════════════════════════════
   PAGE FADE-IN
══════════════════════════════ */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
#main { animation: pageFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }

/* ══════════════════════════════
   CARD GRADIENT + HOVERS
══════════════════════════════ */
.intro-card,
.research-card,
.pub-list-card,
.pub-list-body,
.poster-card,
.tl-card,
.eq-block {
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(41,151,255,0.06) 100%) !important;
  position: relative !important;
  overflow: hidden !important;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition) !important;
  border-radius: var(--radius-sm) !important;
}
.intro-card::before,
.research-card::before,
.pub-list-card::before,
.pub-list-body::before,
.poster-card::before,
.tl-card::before {
  content: '' !important; position: absolute !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  background: linear-gradient(135deg, transparent 60%, rgba(255,140,66,0.06) 100%) !important;
  pointer-events: none !important;
}
.intro-card:hover,
.research-card:hover,
.pub-list-card:hover,
.poster-card:hover,
.tl-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
  transform: translateY(-2px) !important;
  border-color: rgba(41,151,255,0.25) !important;
}

/* ══════════════════════════════
   DARK MODE — page-specific
══════════════════════════════ */
html[data-theme="dark"] .intro-card {
  border-color: var(--card-border);
  border-left-color: var(--accent); color: var(--text);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
html[data-theme="dark"] .topic-item {
  border-color: var(--card-border); color: var(--text-secondary);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
html[data-theme="dark"] .hs { color: var(--heading); border-left-color: var(--accent); }
html[data-theme="dark"] .research-card {
  border-color: var(--card-border);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
html[data-theme="dark"] .research-card p { color: var(--text-light); }
html[data-theme="dark"] .eq-block {
  background: var(--eq-bg); border-left-color: var(--accent);
}
html[data-theme="dark"] .timeline::before {
  background: linear-gradient(to bottom, var(--accent) 0%, var(--separator) 100%);
}
html[data-theme="dark"] .timeline-item::before {
  background: var(--accent); box-shadow: 0 0 0 2px var(--accent);
}
html[data-theme="dark"] .timeline-date { color: var(--accent); }
html[data-theme="dark"] .timeline-content { color: var(--text-light); }
html[data-theme="dark"] .timeline-content strong { color: var(--title); }
html[data-theme="dark"] .timeline-content a { color: var(--accent); }
html[data-theme="dark"] .timeline-pill {
  background: var(--pill-bg); color: var(--pill-text); border-color: var(--pill-border);
}

html[data-theme="dark"] .pub-list-card { border-color: var(--card-border); }
html[data-theme="dark"] .pub-list-body {
  background: var(--card-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
html[data-theme="dark"] .pub-list-title,
html[data-theme="dark"] .pub-list-title a { color: var(--title); }
html[data-theme="dark"] .pub-list-title a:hover { color: var(--accent); }
html[data-theme="dark"] .pub-list-authors { color: var(--text-muted); }
html[data-theme="dark"] .pub-list-excerpt { color: var(--text-light); }
html[data-theme="dark"] .pub-list-footer { border-top-color: var(--separator); }
html[data-theme="dark"] .pub-tag {
  background: var(--pill-bg); color: var(--pill-text); border-color: var(--pill-border);
}

html[data-theme="dark"] .poster-card {
  background: var(--card-bg); border-color: var(--card-border);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
html[data-theme="dark"] .poster-card-info h3 { color: var(--title); }
html[data-theme="dark"] .poster-card-info .venue { color: var(--text-muted); }
html[data-theme="dark"] .poster-card-info .abstract { color: var(--text-light); }
html[data-theme="dark"] .cv-tag { background: var(--pill-bg); color: var(--text-muted); }
html[data-theme="dark"] .cv-tag-blue { background: var(--pill-bg); color: var(--pill-text); }

html[data-theme="dark"] .pdf-modal-box {
  background: #1c1c1e;
  border: 1px solid rgba(255,255,255,0.1);
}
html[data-theme="dark"] .pdf-modal-header {
  background: #000; border-bottom-color: rgba(255,255,255,0.06); color: #f5f5f7;
}
html[data-theme="dark"] .pdf-modal-close { color: #6e6e73; }

html[data-theme="dark"] .tl-card {
  border-color: var(--card-border);
  background: var(--card-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

/* ══════════════════════════════
   SCROLL REVEAL ANIMATIONS
══════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  filter: blur(6px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }
.reveal-delay-3 { transition-delay: 0.36s; }
.reveal-delay-4 { transition-delay: 0.48s; }
.reveal-delay-5 { transition-delay: 0.6s; }
.reveal-delay-6 { transition-delay: 0.72s; }

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  filter: blur(4px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.88);
  filter: blur(6px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* ══════════════════════════════
   CURSOR GLOW ON CARDS
══════════════════════════════ */
.glow-card {
  position: relative;
  overflow: hidden;
}
.glow-card::after {
  content: '';
  position: absolute;
  top: var(--glow-y, -200px);
  left: var(--glow-x, -200px);
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41,151,255,0.15) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}
.glow-card:hover::after {
  opacity: 1;
}
html[data-theme="dark"] .glow-card::after {
  background: radial-gradient(circle, rgba(41,151,255,0.2) 0%, rgba(255,140,66,0.06) 40%, transparent 70%);
}
.glow-card > * {
  position: relative;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ══════════════════════════════
   PAGE TRANSITIONS
══════════════════════════════ */
body {
  opacity: 1;
  transition: opacity 0.25s ease;
}
body.page-exit {
  opacity: 0;
  transform: translateY(-8px);
}
