﻿/* ── Cascade layer order ──────────────────────────────────────
   Zero-build partition: every rule lives inside a named layer so
   the cascade is explicit and DevTools can filter by layer name.
   Unlayered styles (e.g. inline) still win over any layer.       */
@layer reset, layout, components, utilities, theme, responsive, a11y, viz, overlay;

/* ── Accent palette ───────────────────────────────────────────
   Four accent colors as RGB triplets for rgba() compositing.
   Positional: --accent-1 through --accent-4. Legacy named aliases
   kept for backward compat. BOOT.JS overrides from SETTINGS.json.
   Fork? Change accents in SETTINGS.json; everything recolors.    */
:root {
  --accent-1: 0, 164, 239;
  --accent-2: 255, 185, 0;
  --accent-3: 242, 80, 34;
  --accent-4: 127, 186, 0;

  /* Legacy aliases — consumed by 280 existing rules */
  --accent-blue:   var(--accent-1);
  --accent-yellow: var(--accent-2);
  --accent-red:    var(--accent-3);
  --accent-green:  var(--accent-4);
}

/* ═══════════════════════════════════════════════════════════════
   RESET & FOUNDATION
   ═══════════════════════════════════════════════════════════════ */
@layer reset {
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  caret-color: transparent;
}

/* Restore caret for actual input fields */
input,
textarea,
[contenteditable="true"] {
  caret-color: auto;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  color: #fff;
  background: #1a1a1a;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Skip-to-content link for keyboard accessibility */
.skip-to-content {
  position: fixed;
  top: -100%;
  left: 16px;
  z-index: 100000;
  padding: 8px 16px;
  background: rgb(var(--accent-blue));
  color: #fff;
  border-radius: 0 0 6px 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 0;
}

a:hover {
  text-decoration: none;
}

hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.33);
  margin: 24px 0;
}

::selection {
  background: rgba(var(--accent-blue), 0.35);
  color: #fff;
}
} /* end @layer reset */

/* ═══════════════════════════════════════════════════════════════
   PARALLAX BACKGROUND — SINGLE FIXED CANVAS LAYER
   ═══════════════════════════════════════════════════════════════ */
@layer layout {
#parallax-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

#parallax-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE STRUCTURE — alternating parallax windows & opaque bands
   ═══════════════════════════════════════════════════════════════ */
#page-content {
  position: relative;
  z-index: 1;
}

/* ── Parallax Window: transparent strip showing the bg ────── */
.parallax-window {
  background: transparent;
  position: relative;
}

.parallax-section-padding {
  padding: 40px 24px 80px;
}

.parallax-window-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  flex-direction: column;
}

/* ── Scroll-down hint ──────────────────────────────────────── */
.scroll-hint {
  position: relative;
  margin-top: 48px;
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.4s ease, color 0.25s ease;
  animation: bounce-y 1.8s ease-in-out infinite, tl-glow-pulse 3s ease-in-out infinite;
  /* Glow pill */
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 0, 0, 0.25);
  padding: 8px 20px;
  border-radius: 18px;
}

a.scroll-hint:hover {
  color: rgba(255, 255, 255, 0.85);
}

a.scroll-hint strong {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.25s ease;
}

a.scroll-hint:hover strong {
  color: rgba(255, 255, 255, 1);
}

.scroll-hint .scroll-arrow {
  font-size: 20px;
  order: -1;
}

.parallax-window-hero .scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
  width: auto;
  animation: bounce-y-hero 1.8s ease-in-out infinite, tl-glow-pulse 3s ease-in-out infinite;
}

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

@keyframes bounce-y-hero {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(10px); }
}

.parallax-window-gap {
  height: 25vh;
  min-height: 160px;
  max-height: 300px;
}

/* ── Opaque Band: frosted glass section ───────────────────── */
.opaque-band {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-top: 1px solid rgba(255, 255, 255, 0.33);
  border-bottom: 1px solid rgba(255, 255, 255, 0.33);
}

/* Band inner content wrapper */
.band-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
}

/* ═══════════════════════════════════════════════════════════════
   GLASSMORPHISM NAV BAR
   ═══════════════════════════════════════════════════════════════ */
.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.33);
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.nav-brand {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  letter-spacing: 0.3px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  padding: 5px 12px 5px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.nav-brand .brand-icon {
  font-size: 1.5em;
  vertical-align: -0.05em;
  margin-right: 2px;
}

.nav-brand.visible {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.radio-brand-slot {
  display: none;
  position: relative;
  flex-shrink: 0;
}

.radio-brand-slot .radio-brand,
.radio-brand-slot .theme-toggle-radio {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.radio-brand {
  display: none;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.3px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  padding: 4px 10px 4px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  align-items: center;
  line-height: 1;
}

.radio-brand .brand-icon {
  font-size: 1.5em;
  vertical-align: -0.05em;
  margin-right: 2px;
}

.radio-brand.visible {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.glass-nav a:not(.nav-brand) {
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.glass-nav a:not(.nav-brand):hover,
.glass-nav a:not(.nav-brand).active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.glass-nav a:not(.nav-brand).active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.25),
              0 0 28px rgba(255, 255, 255, 0.10),
              inset 0 0 8px rgba(255, 255, 255, 0.06);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   RADIO PLAYER — NAV BAR CONTROLS
   ═══════════════════════════════════════════════════════════════ */
.radio-player {
  position: fixed;
  right: 16px;
  top: 0;
  height: 50px;
  z-index: 101;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.radio-song {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 160px;
  overflow: hidden;
}

.radio-song-title {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  transition: color 0.3s;
}

.radio-player.playing .radio-song-title {
  color: rgba(255, 255, 255, 0.8);
}

/* Equalizer bars */
.radio-eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  width: 60px;
  flex-shrink: 0;
}

.radio-eq-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 1px;
  min-height: 2px;
  transition: height 0.08s ease, background 0.3s;
}

/* Transport controls */
.radio-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.radio-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.radio-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.radio-btn-play {
  width: 34px;
  height: 34px;
  font-size: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.radio-btn-play:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  transform: scale(1.08);
}

.radio-player.playing .radio-btn-play {
  background: rgba(var(--accent-blue), 0.15);
  border-color: rgba(var(--accent-blue), 0.4);
  color: rgba(var(--accent-blue), 0.95);
  box-shadow: 0 0 15px rgba(var(--accent-blue), 0.25),
              0 0 40px rgba(var(--accent-blue), 0.12),
              0 0 80px rgba(var(--accent-blue), 0.06);
}

.radio-player.playing .radio-btn-play:hover {
  background: rgba(var(--accent-blue), 0.25);
  box-shadow: 0 0 20px rgba(var(--accent-blue), 0.4),
              0 0 50px rgba(var(--accent-blue), 0.2),
              0 0 100px rgba(var(--accent-blue), 0.1);
}

/* Volume */
.radio-volume {
  display: flex;
  align-items: center;
  gap: 4px;
}

.radio-vol-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.radio-vol-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.vol-muted {
  position: relative;
}
.vol-muted::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.radio-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.radio-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.radio-vol-slider::-webkit-slider-thumb:hover {
  background: #fff;
  transform: scale(1.2);
}

.radio-vol-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
}
} /* end @layer layout */

/* ═══════════════════════════════════════════════════════════════
   GLASS TILE — THE CORE DESIGN TOKEN
   ═══════════════════════════════════════════════════════════════ */
@layer components {
.glass-tile {
  background: rgba(0, 0, 0, 0.33);
  border: 1px solid rgba(255, 255, 255, 0.33);
  border-radius: 20px;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  padding: 20px 40px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.07),
              0 0 40px rgba(255, 255, 255, 0.03);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.glass-tile:hover {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15),
              0 0 50px rgba(255, 255, 255, 0.08),
              0 0 100px rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.45);
}

.glass-tile-clickable {
  cursor: pointer;
}

/* ── Tile glow (applied when navigateToModal targets a tile) ── */
@keyframes tile-glow-pulse {
  0%, 100% { box-shadow: 0 0 12px 2px rgba(255,255,255,0.25), 0 0 32px 4px rgba(var(--accent-blue),0.18); }
  50%      { box-shadow: 0 0 20px 6px rgba(255,255,255,0.40), 0 0 48px 10px rgba(var(--accent-blue),0.30); }
}
.tile-glow {
  animation: tile-glow-pulse 1.2s ease-in-out infinite;
  border-color: rgba(var(--accent-blue),0.5) !important;
  z-index: 2;
  position: relative;
}
@keyframes tile-glow-fadeout {
  0%   { box-shadow: 0 0 20px 6px rgba(255,255,255,0.40), 0 0 48px 10px rgba(var(--accent-blue),0.30);
         border-color: rgba(var(--accent-blue),0.5); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent;
         border-color: rgba(255,255,255,0.12); }
}
.tile-glow-fade {
  animation: tile-glow-fadeout 500ms ease-out forwards;
  z-index: 2;
  position: relative;
}

/* In opaque bands, tiles get a subtler treatment */
.opaque-band .glass-tile {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.opaque-band .glass-tile:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   SECTION HEADINGS & GRID
   ═══════════════════════════════════════════════════════════════ */
.section-heading {
  font-size: 32px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0;
  letter-spacing: -0.3px;
}

/* Section header bands — flex row with top breathing room */
.band-header {
  padding: 70px 24px 12px !important;
  display: flex;
  align-items: center;
}

.section-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  max-width: 700px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.section-desc a {
  color: rgba(var(--accent-blue), 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.section-blurb {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  flex: 1;
  min-width: 0;
}

.section-blurb .step, .bio-symbol-block .step, .bio-principle-block .step { margin-bottom: 6px; color: rgba(255, 255, 255, 0.75); font-size: 13.5px; line-height: 1.75; }
.section-blurb .step-left, .bio-symbol-block .step-left, .bio-principle-block .step-left { text-align: left; }
.section-blurb .step-center, .bio-symbol-block .step-center, .bio-principle-block .step-center { text-align: center; }
.section-blurb .step-right, .bio-symbol-block .step-right, .bio-principle-block .step-right { text-align: right; }

.section-blurb .step-summary {
  margin-top: 12px;
  text-align: left;
}

.section-blurb a {
  color: rgba(var(--accent-blue), 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Section Badge — floated bottom-right link pill ──────── */
.section-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.section-badge-group .section-badge {
  margin-left: 0;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 6px 14px 6px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-decoration: none !important;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.section-badge:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.section-badge i {
  font-size: 14px;
  opacity: 0.85;
}

.section-badge-glow {
  color: rgba(var(--accent-yellow), 0.9);
  background: rgba(var(--accent-yellow), 0.1);
  border-color: rgba(var(--accent-yellow), 0.3);
  box-shadow: 0 0 8px rgba(var(--accent-yellow), 0.3), 0 0 20px rgba(var(--accent-yellow), 0.1);
  animation: win-pulse 2s ease-in-out infinite;
}

.section-badge-glow:hover {
  color: #fff;
  background: rgba(var(--accent-yellow), 0.25);
  border-color: rgba(var(--accent-yellow), 0.6);
}

/* Responsive badge text: long on desktop, short on mobile */
.badge-long { display: inline; }
.badge-short { display: none; }
.badge-desktop { display: inline-flex; }

.section-intro {
  display: flex;
  align-items: center;
  gap: 24px;
}

.section-intro-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1),
              0 0 40px rgba(255, 255, 255, 0.05);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.section-intro-img:hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.25),
              0 0 50px rgba(255, 255, 255, 0.12),
              0 0 100px rgba(255, 255, 255, 0.06);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.card-grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

/* ── Key Figures — compact 4×2 stat tiles ───────────────────── */
.key-figures-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.key-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  padding: 18px 10px;
  min-height: 100px;
  transition: transform 0.3s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.key-figure:hover {
  transform: translateY(-3px);
}

.key-figure-icon {
  font-size: 24px;
  margin-bottom: 6px;
  line-height: 1;
}

.key-figure-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: #fff;
}

.key-figure-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero-card {
  max-width: 500px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 36px 32px;
}

.hero-text {
  text-align: center;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-portrait {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  transition: border-color 0.4s, box-shadow 0.4s, opacity 0.35s;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15),
              0 0 40px rgba(255, 255, 255, 0.08),
              0 0 80px rgba(255, 255, 255, 0.04);
}

/* Portrait link container */
.hero-portrait-link {
  position: relative;
  display: inline-block;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Penguin overlay */
.hero-portrait-penguin {
  --glow: var(--accent-blue);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 10px;
  font-size: 194px;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  border: 3px solid rgba(var(--glow), 0.7);
  box-shadow: 0 0 50px rgba(var(--glow), 0.6),
              0 0 120px rgba(var(--glow), 0.3),
              0 0 240px rgba(var(--glow), 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, box-shadow 1s ease, border-color 1s ease;
}

.hero-portrait-link:hover .hero-portrait,
.hero-portrait-link.hover .hero-portrait {
  opacity: 0;
}

.hero-portrait-link:hover .hero-portrait-penguin,
.hero-portrait-link.hover .hero-portrait-penguin {
  opacity: 1;
}

.hero-penguin-emoji {
  display: inline-block;
  position: relative;
  z-index: 2;
}

.hero-penguin-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 40px;
  font-size: 388px;
  z-index: 1;
  opacity: 0.35;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.hero-penguin-bg-b {
  opacity: 0;
}

.hero-portrait-link:hover .hero-penguin-emoji,
.hero-portrait-link.hover .hero-penguin-emoji {
  animation: kg-penguin-bounce 1s ease infinite;
}

.hero-portrait:hover {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3),
              0 0 50px rgba(255, 255, 255, 0.15),
              0 0 100px rgba(255, 255, 255, 0.08);
}

.hero-name {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 2px;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-name .hero-surname {
  display: block;
  font-size: 0.52em;
  font-weight: 300;
  letter-spacing: 0.05em;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.6);
}
html.light-mode .hero-name .hero-surname {
  -webkit-text-fill-color: rgba(0, 0, 0, 0.45);
}
.hero-name .emoji-reset {
  -webkit-text-fill-color: initial;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}

.hero-tagline {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.hero-tagline strong a {
  color: rgba(var(--accent-blue), 0.95);
  transition: color 0.3s;
}

.hero-tagline strong a:hover {
  color: #fff;
}

.hero-bio {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 28px;
  line-height: 1.6;
}

.hero-bio strong a {
  color: rgba(var(--accent-blue), 0.85);
}

.hero-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.hero-links a {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05),
              0 0 30px rgba(255, 255, 255, 0.02);
  transition: box-shadow 0.4s ease, border-color 0.4s ease, color 0.4s ease, background 0.4s ease;
}

.hero-links a:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2),
              0 0 40px rgba(255, 255, 255, 0.1),
              0 0 80px rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT CARDS
   ═══════════════════════════════════════════════════════════════ */
.entry-card {
  padding: 24px 36px;
}

.entry-card .entry-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}

.entry-card .entry-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.entry-card .entry-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

.entry-card .entry-info {
  flex: 1 1 auto;
  min-width: 0;
}

.entry-card-compact .entry-name {
  font-size: 28px !important;
}

.entry-card-compact .entry-meta {
  display: none !important;
}

.entry-card .entry-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: break-word;
}

.entry-card .entry-title {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.entry-card .entry-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry-card .entry-meta .fa {
  margin-right: 4px;
  font-size: 11px;
}

.entry-card .entry-motto {
  font-size: 13px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 10px;
  line-height: 1.5;
}

.entry-card .entry-github {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(var(--accent-blue), 0.7);
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(var(--accent-blue), 0.08);
  border: 1px solid rgba(var(--accent-blue), 0.15);
  transition: all 0.3s;
}

.entry-card .entry-github:hover {
  background: rgba(var(--accent-blue), 0.15);
  color: #fff;
}

.entry-card .entry-win {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(var(--accent-yellow), 0.9);
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(var(--accent-yellow), 0.1);
  border: 1px solid rgba(var(--accent-yellow), 0.3);
  box-shadow: 0 0 8px rgba(var(--accent-yellow), 0.3), 0 0 20px rgba(var(--accent-yellow), 0.1);
  white-space: nowrap;
  animation: win-pulse 2s ease-in-out infinite;
}

.entry-card .entry-play {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: rgba(var(--accent-yellow), 0.9);
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(var(--accent-yellow), 0.1);
  border: 1px solid rgba(var(--accent-yellow), 0.3);
  box-shadow: 0 0 8px rgba(var(--accent-yellow), 0.3), 0 0 20px rgba(var(--accent-yellow), 0.1);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  animation: win-pulse 2s ease-in-out infinite;
}

.entry-card .entry-play:hover {
  background: rgba(var(--accent-yellow), 0.25);
  color: #fff;
  border-color: rgba(var(--accent-yellow), 0.6);
  transform: scale(1.05);
}

@keyframes play-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-green), 0.3); }
  50% { box-shadow: 0 0 8px 2px rgba(var(--accent-green), 0.15); }
}

@keyframes win-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-yellow), 0.3); }
  50% { box-shadow: 0 0 8px 2px rgba(var(--accent-yellow), 0.15); }
}

.entry-card .entry-title-highlight {
  color: rgba(var(--accent-yellow), 0.9);
  background: rgba(var(--accent-yellow), 0.1);
  border: 1px solid rgba(var(--accent-yellow), 0.3);
  font-weight: 700;
  animation: win-pulse 2s ease-in-out infinite;
}

@keyframes title-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-yellow), 0.3); }
  50% { box-shadow: 0 0 8px 2px rgba(var(--accent-yellow), 0.15); }
}

/* ═══════════════════════════════════════════════════════════════
   VIDEO CARDS
   ═══════════════════════════════════════════════════════════════ */
.video-card {
  padding: 0;
  overflow: hidden;
}

.video-card .video-label {
  padding: 20px 24px 18px;
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.year-badge {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  flex-shrink: 0;
}

.video-card .video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 0 0 19px 19px;
  overflow: hidden;
}

.video-card .video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ═══════════════════════════════════════════════════════════════
   CARD ACTION BADGES  (Watch Me / Dive Deeper)
   ═══════════════════════════════════════════════════════════════ */
.card-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
  flex-shrink: 0;
  order: 10;
  color: #fff;
  background: rgba(var(--accent-yellow), 0.18);
  border: 1px solid rgba(var(--accent-yellow), 0.45);
  box-shadow: 0 0 6px rgba(var(--accent-yellow), 0.25), inset 0 0 4px rgba(var(--accent-yellow), 0.08);
  animation: badgePulse 2.5s ease-in-out infinite;
}

.card-action-badge.badge-static {
  animation: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.card-action-badge.badge-dive {
  background: rgba(var(--accent-blue), 0.15);
  border: 1px solid rgba(var(--accent-blue), 0.45);
  box-shadow: 0 0 6px rgba(var(--accent-blue), 0.3), inset 0 0 4px rgba(var(--accent-blue), 0.08);
  animation: badgePulseDive 2.5s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(var(--accent-yellow), 0.25), inset 0 0 4px rgba(var(--accent-yellow), 0.08); }
  50%      { box-shadow: 0 0 14px rgba(var(--accent-yellow), 0.5), inset 0 0 6px rgba(var(--accent-yellow), 0.15); }
}

@keyframes badgePulseDive {
  0%, 100% { box-shadow: 0 0 6px rgba(var(--accent-blue), 0.3), inset 0 0 4px rgba(var(--accent-blue), 0.08); }
  50%      { box-shadow: 0 0 14px rgba(var(--accent-blue), 0.55), inset 0 0 6px rgba(var(--accent-blue), 0.15); }
}

html.light-mode .card-action-badge {
  color: rgba(var(--accent-yellow), 0.95);
  background: rgba(var(--accent-yellow), 0.12);
  border-color: rgba(var(--accent-yellow), 0.35);
  box-shadow: 0 0 6px rgba(var(--accent-yellow), 0.15), inset 0 0 4px rgba(var(--accent-yellow), 0.05);
}

html.light-mode .card-action-badge.badge-dive {
  color: rgba(0, 120, 212, 0.9);
  background: rgba(0, 120, 212, 0.1);
  border-color: rgba(0, 120, 212, 0.35);
  box-shadow: 0 0 6px rgba(0, 120, 212, 0.15), inset 0 0 4px rgba(0, 120, 212, 0.05);
}

html.light-mode .card-action-badge.badge-static {
  animation: none;
  box-shadow: none;
  color: rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL OVERLAY
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 40px 12px;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
}

.modal-overlay.closing {
  display: flex;
  animation: overlayFadeOut 0.25s ease forwards;
}

.modal-overlay.closing .modal-card {
  animation: modalOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.modal-card {
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  animation: modalIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.modal-card .modal-img {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.modal-card .modal-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  padding-left: 1.4em;
  text-indent: -1.4em;
}

.modal-card .modal-subtitle {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  gap: 6px;
  margin: 0;
  justify-content: flex-end;
}

.modal-card .modal-subtitle .modal-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(30, 30, 30, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.modal-card .modal-subtitle .modal-win-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(var(--accent-yellow), 0.95);
  background: rgba(35, 35, 35, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--accent-yellow), 0.4);
  box-shadow: 0 0 8px rgba(var(--accent-yellow), 0.3), 0 0 20px rgba(var(--accent-yellow), 0.1);
  white-space: nowrap;
  animation: win-pulse 2s ease-in-out infinite;
}

.modal-card .modal-subtitle .modal-play-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: rgba(var(--accent-yellow), 0.9);
  background: rgba(var(--accent-yellow), 0.1);
  border: 1px solid rgba(var(--accent-yellow), 0.3);
  box-shadow: 0 0 8px rgba(var(--accent-yellow), 0.3), 0 0 20px rgba(var(--accent-yellow), 0.1);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  animation: win-pulse 2s ease-in-out infinite;
}

.modal-card .modal-subtitle .modal-play-badge:hover {
  background: rgba(var(--accent-yellow), 0.25);
  color: #fff;
  border-color: rgba(var(--accent-yellow), 0.6);
  transform: scale(1.05);
}

.modal-card .modal-body {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
}

.modal-card .modal-body ul { padding-left: 20px; margin: 8px 0; }
.modal-card .modal-body li { margin-bottom: 8px; }
.modal-card .modal-body h3 { margin-top: 20px; margin-bottom: 8px; }
.modal-card .modal-body h3:first-child { margin-top: 0; }

.modal-card .modal-body blockquote {
  position: relative;
  margin: 20px 0;
  padding: 24px 28px 20px 28px;
  border: none;
  border-left: 3px solid rgba(var(--accent-yellow), 0.4);
  background: linear-gradient(135deg, rgba(var(--accent-yellow), 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.8;
  font-size: 13.5px;
}

.modal-card .modal-body blockquote::before {
  content: '\201C';
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 48px;
  line-height: 1;
  font-style: normal;
  font-weight: 700;
  color: rgba(var(--accent-yellow), 0.25);
  pointer-events: none;
}

.modal-card .modal-body blockquote p {
  margin: 0;
  padding-left: 24px;
  text-indent: 0;
}

.modal-card .modal-body blockquote cite {
  display: block;
  margin-top: 12px;
  padding-left: 24px;
  text-align: right;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: rgba(var(--accent-yellow), 0.65);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.modal-card .modal-body blockquote cite::before {
  content: '\2014\00a0';
  color: rgba(var(--accent-yellow), 0.35);
}

.modal-card .modal-body blockquote + blockquote {
  margin-top: 12px;
}

/* ── Bio quote crossfade viewer ── */
.bio-quote-viewer {
  position: relative;
  margin: 16px 0;
}

.modal-card .modal-body .bio-quote-viewer .bio-quote-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  margin: 0;
}

.modal-card .modal-body .bio-quote-viewer .bio-quote-layer.bio-quote-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.modal-card .modal-body .bio-quote-viewer blockquote.bio-quote-layer {
  margin: 0;
}

/* Guarantee two-line height so crossfades don't shift */
.bio-quote-viewer .bio-quote-layer p {
  min-height: 3.2em;
}

.modal-card .modal-body .modal-figure {
  position: relative;
  margin: 20px 0;
  padding: 16px 16px 12px 16px;
  border: none;
  border-left: 3px solid rgba(var(--accent-blue), 0.35);
  background: linear-gradient(135deg, rgba(var(--accent-blue), 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: 0 12px 12px 0;
}

.modal-card .modal-body .modal-figure img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.modal-card .modal-body .modal-figure figcaption {
  display: block;
  margin-top: 10px;
  text-align: right;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: rgba(var(--accent-blue), 0.6);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1.4;
}

.modal-card .modal-body .modal-figure figcaption::before {
  content: '\2014\00a0';
  color: rgba(var(--accent-blue), 0.3);
}

.modal-card .modal-body a {
  color: rgba(var(--accent-blue), 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 40px 8px;
  margin: -20px -40px 0;
  pointer-events: none;
  border-radius: 20px 20px 0 0;
}

.modal-sticky-bar > * {
  pointer-events: auto;
}

/* ── Sticky-bar glow group (wraps content + close button) ── */
.modal-sticky-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 18px;
}

/* When group contains a title, expand to fill the bar */
.modal-sticky-group:has(.modal-sticky-title) {
  flex: 1;
  min-width: 0;
}

.modal-sticky-title {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.modal-sticky-link {
  color: rgba(var(--accent-blue), 0.9);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(30, 30, 30, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.25s;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-sticky-link:hover {
  background: rgba(50, 50, 50, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(var(--accent-red), 0.85);
  border: 1px solid rgba(var(--accent-red), 0.4);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 20;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(var(--accent-red), 1);
  box-shadow: 0 0 12px rgba(var(--accent-red), 0.6),
              0 0 28px rgba(var(--accent-red), 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   BIOGRAPHY MODAL
   ═══════════════════════════════════════════════════════════════ */
.bio-modal-card {
  max-width: 680px;
}

.bio-modal-card::before,
.bio-modal-card::after {
  content: "";
  display: block;
  position: sticky;
  height: 100px;
  margin-left: -40px;
  margin-right: -40px;
  pointer-events: none;
  z-index: 4;
}

.bio-modal-card::before {
  top: -20px;
  margin-top: -20px;
  background: linear-gradient(to bottom, rgba(18,18,18,1) 0%, transparent 100%);
  margin-bottom: -100px;
}

.bio-modal-card::after {
  bottom: -20px;
  margin-bottom: -20px;
  background: linear-gradient(to top, rgba(18,18,18,1) 0%, transparent 100%);
  margin-top: -100px;
}

html.light-mode .bio-modal-card::before {
  background: linear-gradient(to bottom, rgba(240,240,240,1) 0%, transparent 100%);
}

html.light-mode .bio-modal-card::after {
  background: linear-gradient(to top, rgba(240,240,240,1) 0%, transparent 100%);
}

.bio-modal-card .modal-body h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(var(--accent-yellow), 0.7);
  margin-top: 28px;
  margin-bottom: 12px;
}

.bio-modal-card .modal-body h3:first-child {
  margin-top: 0;
}

.bio-modal-card .modal-body h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.92);
}

.bio-modal-card .modal-body p {
  margin: 8px 0;
}

.bio-modal-card .modal-body hr {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 24px 0;
}

.bio-about {
  margin: 8px 0 0;
}

.bio-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.bio-stat {
  --bio-glow: var(--accent-yellow);
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(var(--bio-glow), 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(var(--bio-glow), 0.15);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.bio-stat:hover {
  box-shadow: 0 0 16px rgba(var(--bio-glow), 0.35), 0 0 32px rgba(var(--bio-glow), 0.12);
  transform: scale(1.03);
}

.bio-stat-active {
  box-shadow: 0 0 12px rgba(var(--bio-glow), 0.30), 0 0 24px rgba(var(--bio-glow), 0.10);
  border-color: rgba(var(--bio-glow), 0.4);
}

.bio-stat-link {
  cursor: pointer;
}

/* ── Bio image viewer (crossfade) ── */
.bio-img-viewer {
  --bio-viewer-glow: var(--accent-yellow);
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(var(--bio-viewer-glow), 0.25);
  aspect-ratio: 16 / 9;
  background: rgba(var(--bio-viewer-glow), 0.06);
  box-shadow:
    0 0 16px rgba(var(--bio-viewer-glow), 0.25),
    0 0 40px rgba(var(--bio-viewer-glow), 0.12),
    inset 0 0 30px rgba(var(--bio-viewer-glow), 0.06);
  transition: border-color 0.5s ease, background 0.5s ease, box-shadow 0.5s ease;
}

.bio-img-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.bio-img-layer.bio-img-active {
  opacity: 1;
}

.bio-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.1;
}

.bio-stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(var(--bio-glow), 0.7);
  margin-top: 4px;
}

@media (max-width: 480px) {
  .bio-stat-row {
    justify-content: center;
  }
}

.bio-section-lead {
  font-style: italic;
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 13px;
  margin-bottom: 16px !important;
}

.bio-symbol-block {
  position: relative;
  margin: 16px 0;
  padding: 16px 20px;
  border-left: 3px solid rgba(var(--accent-blue), 0.3);
  background: linear-gradient(135deg, rgba(var(--accent-blue), 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 0 12px 12px 0;
}

.bio-symbol-block + .bio-symbol-block {
  margin-top: 12px;
}

.bio-symbol-block h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: rgba(var(--accent-blue), 0.85);
}

.bio-symbol-block p {
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13.5px;
  line-height: 1.75;
}

.bio-principle-block {
  position: relative;
  margin: 16px 0;
  padding: 16px 20px;
  border-left: 3px solid rgba(var(--accent-blue), 0.3);
  background: linear-gradient(135deg, rgba(var(--accent-blue), 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 0 12px 12px 0;
}

.bio-principle-block + .bio-principle-block {
  margin-top: 12px;
}

.bio-principle-block > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: rgba(var(--accent-blue), 0.85);
}

.bio-principle-block p {
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13.5px;
  line-height: 1.75;
}

/* ── Bio Tour ── */
.bio-explore-hint {
  position: sticky;
  bottom: 12px;
  margin-top: -60px;
  z-index: 20;
  cursor: pointer;
  transition: opacity 0.3s ease, color 0.25s ease;
  animation: bounce-y 1.8s ease-in-out infinite, tl-glow-pulse 3s ease-in-out infinite;
}

.bio-explore-hint:hover {
  color: rgba(255, 255, 255, 0.85);
}

.bio-explore-hint strong {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.25s ease;
}

.bio-explore-hint:hover strong {
  color: rgba(255, 255, 255, 1);
}

.bio-explore-hint.exploring {
  animation: none;
  color: rgba(255, 255, 255, 1);
}

.bio-explore-hint.exploring strong {
  color: rgba(255, 255, 255, 1);
}

@keyframes bio-tour-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(var(--accent-yellow), 0.25), 0 0 24px rgba(var(--accent-yellow), 0.08); }
  50%      { box-shadow: 0 0 20px rgba(var(--accent-yellow), 0.45), 0 0 40px rgba(var(--accent-yellow), 0.15); }
}

.bio-tour-glow {
  animation: bio-tour-pulse 1.5s ease-in-out infinite;
  border-radius: 12px;
}

.bio-colophon {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(var(--accent-yellow), 0.5);
  margin-top: 28px !important;
  margin-bottom: 0 !important;
  padding-top: 8px;
}

#bio-quilt-img {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

#bio-quilt-img:hover {
  box-shadow: 0 0 20px rgba(var(--accent-yellow), 0.4), 0 0 40px rgba(var(--accent-yellow), 0.15);
  transform: scale(1.01);
}

/* ═══════════════════════════════════════════════════════════════
   MTG DECK MODAL
   ═══════════════════════════════════════════════════════════════ */

.deck-modal-card {
  max-width: 880px;
}

#deck-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

#deck-sections .deck-carousel-wrap {
  min-height: 280px;
}

#deck-sections .deck-carousel {
  width: 180px;
  height: 252px;
}

#deck-sections .deck-card {
  width: 180px;
  height: 252px;
}

/* ═══════════════════════════════════════════════════════════════
   PDF VIEWER MODAL
   ═══════════════════════════════════════════════════════════════ */
.pdf-modal-card {
  max-width: 960px;
  width: 95vw;
  height: 90vh;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-embed-wrap {
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* background: #1a1a1a; */
  position: relative;
}

#pdf-viewer,
#resume-pdf-viewer {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: #555 #222;
}
#pdf-viewer::-webkit-scrollbar,
#resume-pdf-viewer::-webkit-scrollbar { width: 8px; }
#pdf-viewer::-webkit-scrollbar-track,
#resume-pdf-viewer::-webkit-scrollbar-track { background: #222; }
#pdf-viewer::-webkit-scrollbar-thumb,
#resume-pdf-viewer::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

.pdf-spread-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.pdf-spread-row canvas {
  display: block;
  box-shadow: 0 2px 12px rgba(0,0,0,.6);
  background: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   GAME PLAYER MODAL
   ═══════════════════════════════════════════════════════════════ */
.game-modal-card {
  max-width: 1100px;
  width: 95vw;
  height: 90vh;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
}

.game-modal-card .modal-sticky-title {
  color: rgba(var(--accent-yellow), 0.9);
}

.game-embed-wrap {
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  position: relative;
}

.game-embed-wrap iframe {
  border: 0;
  display: block;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
}

/* ═══════════════════════════════════════════════════════════════
   EXTERNAL LINK IFRAME MODAL
   ═══════════════════════════════════════════════════════════════ */
.link-modal-card {
  max-width: 1100px;
  width: 95vw;
  height: 90vh;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
}

.link-modal-card .modal-sticky-title {
  color: rgba(var(--accent-blue), 0.9);
}

.link-embed-wrap {
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #fff;
  position: relative;
}

.link-embed-wrap iframe {
  border: 0;
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

/* ═══════════════════════════════════════════════════════════════
   BITNAUGHTS GALLERY MODAL
   ═══════════════════════════════════════════════════════════════ */
.bitnaughts-modal-card {
  max-width: 1100px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  display: block;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}

.bitnaughts-modal-card::-webkit-scrollbar { width: 8px; }
.bitnaughts-modal-card::-webkit-scrollbar-track { background: transparent; }
.bitnaughts-modal-card::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

.bitnaughts-gallery {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bitnaughts-gallery-item {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bitnaughts-gallery-label {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bitnaughts-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════
   MARP DIAGRAM MODAL
   ═══════════════════════════════════════════════════════════════ */
.marp-modal-card {
  max-width: 1100px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}

.marp-modal-card::-webkit-scrollbar { width: 8px; }
.marp-modal-card::-webkit-scrollbar-track { background: transparent; }
.marp-modal-card::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

/* Legacy static diagram — kept for fallback */
.marp-diagram-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.marp-diagram-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* MARP Bill of Materials */
.marp-bom {
  margin-top: 24px;
}

.marp-bom h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
}

.marp-bom h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.marp-bom h4:first-of-type {
  margin-top: 8px;
}

.marp-bom h5 {
  font-size: 13px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.marp-bom table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}

.marp-bom thead th {
  text-align: left;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.marp-bom tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  vertical-align: top;
}

.marp-bom tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.marp-bom a {
  color: rgba(var(--accent-blue), 0.9);
  text-decoration: none;
}

.marp-bom a:hover {
  text-decoration: underline;
}

/* Commander hero section */
.deck-hero {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 0 -32px 24px;
  padding: 16px 32px 20px;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.deck-hero-img {
  width: 200px;
  height: auto;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

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

.deck-hero-name {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
  color: #fff;
}

.deck-hero-motto {
  font-size: 14px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 12px;
  line-height: 1.5;
}

.deck-hero-bracket {
  font-size: 14px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.55);
  margin: 12px 0 0;
  line-height: 1.5;
}

/* Per-type section */
.deck-section {
  margin-bottom: 28px;
}

.deck-section-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.deck-section-icon {
  font-size: 22px;
}

.deck-section-label {
  font-size: 19px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.deck-section-count {
  font-size: 13px;
  font-weight: 600;
  color: rgba(var(--accent-yellow), 0.9);
  margin-left: 4px;
}

/* Carousel wrapper (per section) */
.deck-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 370px;
  margin-bottom: 8px;
  user-select: none;
}

/* Card stack container */
.deck-carousel {
  position: relative;
  width: 250px;
  height: 350px;
  perspective: 900px;
}

/* Individual card in the stack */
.deck-card {
  position: absolute;
  width: 250px;
  height: 350px;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s;
  cursor: pointer;
  transform-origin: center center;
  backface-visibility: hidden;
}

.deck-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Focused (front) card */
.deck-card[data-pos="0"] {
  z-index: 10;
  transform: translateX(0) scale(1);
  opacity: 1;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* Cards behind — stacked to the right */
.deck-card[data-pos="1"] {
  z-index: 9;
  transform: translateX(30px) scale(0.94);
  opacity: 0.7;
}

.deck-card[data-pos="2"] {
  z-index: 8;
  transform: translateX(55px) scale(0.88);
  opacity: 0.45;
}

.deck-card[data-pos="3"] {
  z-index: 7;
  transform: translateX(75px) scale(0.82);
  opacity: 0.25;
}

/* Cards further back — hidden */
.deck-card[data-pos="hidden"] {
  z-index: 1;
  transform: translateX(90px) scale(0.78);
  opacity: 0;
  pointer-events: none;
}

/* Cards behind — stacked to the left (already seen) */
.deck-card[data-pos="-1"] {
  z-index: 9;
  transform: translateX(-30px) scale(0.94);
  opacity: 0.7;
}

.deck-card[data-pos="-2"] {
  z-index: 8;
  transform: translateX(-55px) scale(0.88);
  opacity: 0.45;
}

.deck-card[data-pos="-hidden"] {
  z-index: 1;
  transform: translateX(-90px) scale(0.78);
  opacity: 0;
  pointer-events: none;
}

/* Card name tooltip on hover */
.deck-card-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  border-radius: 0 0 12px 12px;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.deck-card[data-pos="0"]:hover .deck-card-name {
  opacity: 1;
}

/* Carousel nav buttons */
.deck-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck-carousel-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.deck-prev { left: 0; }
.deck-next { right: 0; }

/* Card counter */
.deck-carousel-counter {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

/* Card-name links in body text */
.deck-body a[data-card-link] {
  color: rgba(var(--accent-blue), 0.9);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dotted rgba(var(--accent-blue), 0.4);
  transition: color 0.2s, border-color 0.2s;
}

.deck-body a[data-card-link]:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

/* Highlight pulse when a card is anchored */
@keyframes card-anchor-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-blue), 0.7); }
  40%  { box-shadow: 0 0 20px 8px rgba(var(--accent-blue), 0.5); }
  100% { box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5); }
}

.deck-card.card-anchored {
  animation: card-anchor-pulse 1.2s ease-out;
}

/* Deck body text */
.deck-body {
  margin-top: 14px;
  padding-top: 0;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER — full-viewport frosted glass pane
   ═══════════════════════════════════════════════════════════════ */
.footer-pane {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-top: 1px solid rgba(255, 255, 255, 0.33);
  border-bottom: 1px solid rgba(255, 255, 255, 0.33);
}

.footer-pane-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 80px 24px 40px;
}

/* Cards inside the pane get a lighter, inset treatment */
.footer-pane .footer-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.footer-pane .footer-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
}

.footer-detail-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-detail-row {
  display: flex;
  gap: 14px;
}

.footer-detail-row .footer-detail-item {
  flex: 1;
  min-width: 0;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.footer-detail-row .footer-detail-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
}

.footer-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

.footer-detail-item strong {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.footer-detail-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(var(--accent-blue), 0.8);
  transition: all 0.3s ease;
}

.footer-detail-item:hover .footer-detail-icon {
  background: rgba(var(--accent-blue), 0.15);
  border-color: rgba(var(--accent-blue), 0.4);
  color: #fff;
  box-shadow: 0 0 8px rgba(var(--accent-blue), 0.3),
              0 0 20px rgba(var(--accent-blue), 0.1);
}

.footer-detail-desc {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}

.footer-detail-desc code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(var(--accent-blue), 0.85);
  transition: all 0.3s ease;
}

.outline-pill {
  display: inline-block;
  padding: 2px 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: inherit;
  line-height: inherit;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.footer-detail-desc a {
  color: inherit;
  text-decoration: none;
}

.footer-detail-desc a:hover code {
  background: rgba(var(--accent-blue), 0.15);
  border-color: rgba(var(--accent-blue), 0.4);
  color: #fff;
  box-shadow: 0 0 8px rgba(var(--accent-blue), 0.25),
              0 0 20px rgba(var(--accent-blue), 0.1);
}

.footer-repo-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.footer-repo-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.footer-repo-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.glass-footer {
  text-align: center;
  padding: 48px 12px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 12px;
}

.glass-footer a {
  color: rgba(var(--accent-blue), 0.6);
}

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE — shared components for any site using this engine
   as a landing page (bootfile.dev, or any fork's landing).
   ═══════════════════════════════════════════════════════════════ */

/* ── Logo dot (pulses through 4 accents) ─────────────────────── */
.logo-dot {
  display: inline-block;
  /* dot-pulse keyframes injected by BOOT.JS from SETTINGS.json accents */
}

/* ── Emoji portrait (no <img>, glyph in a circle) ────────────── */
.emoji-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 140px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 30px rgba(var(--accent-1), 0.5),
               0 0 60px rgba(var(--accent-1), 0.2);
  background: rgba(0, 0, 0, 0.3);
}

html.light-mode .emoji-portrait {
  color: rgba(0, 0, 0, 0.75);
  background: rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 30px rgba(var(--accent-1), 0.3);
}

/* ── Landing body text ────────────────────────────────────────── */
.landing-body {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.7;
  max-width: 720px;
  margin: 0 auto 1.2rem;
  opacity: 0.9;
}

.landing-emphasis {
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
  font-weight: 600;
  text-align: center;
  opacity: 1;
  margin-top: 1.5rem;
}

/* ── Insight callout ──────────────────────────────────────────── */
.landing-insight {
  max-width: 680px;
  margin: 2rem auto 0;
  padding: 1.2rem 1.5rem;
  text-align: center;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.7;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

html.light-mode .landing-insight {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

/* ── Acts grid ────────────────────────────────────────────────── */
.landing-acts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  padding: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.landing-act { text-align: center; }
.landing-act h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.landing-act p { font-size: 0.95rem; line-height: 1.6; opacity: 0.85; }

.landing-act code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}
html.light-mode .landing-act code { background: rgba(0, 0, 0, 0.06); }

.act-number {
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
  background: rgba(var(--tc), 0.15);
  border: 1px solid rgba(var(--tc), 0.3);
  color: rgb(var(--tc));
  box-shadow: 0 0 20px rgba(var(--tc), 0.15);
}

.act-result {
  margin-top: 0.75rem;
  font-weight: 600;
  opacity: 1 !important;
  color: rgb(var(--accent-1));
}
.landing-act:nth-child(2) .act-result { color: rgb(var(--accent-2)); }
.landing-act:nth-child(3) .act-result { color: rgb(var(--accent-4)); }

/* ── Features grid ────────────────────────────────────────────── */
.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 1.5rem auto 0;
  padding: 1.2rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
html.light-mode .landing-features { border-top-color: rgba(0, 0, 0, 0.08); }

.feature-item {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.95rem; opacity: 0.9;
}
.feature-item i { color: rgb(var(--accent-1)); width: 1.25rem; text-align: center; }

/* ── CTA buttons ──────────────────────────────────────────────── */
.landing-cta-row {
  display: flex; gap: 1rem; justify-content: center;
  flex-wrap: wrap; margin-top: 2rem;
}

.landing-cta {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 2rem; border-radius: 12px;
  font-size: 1.05rem; font-weight: 600;
  background: rgba(var(--accent-1), 0.2);
  border: 1px solid rgba(var(--accent-1), 0.4);
  color: rgb(var(--accent-1));
  transition: background 0.25s, box-shadow 0.25s,
              transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.landing-cta:hover {
  background: rgba(var(--accent-1), 0.3);
  box-shadow: 0 0 24px rgba(var(--accent-1), 0.3);
  transform: translateY(-2px);
}

.landing-cta-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}
html.light-mode .landing-cta-secondary {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.7);
}
.landing-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

/* ── Landing link ─────────────────────────────────────────────── */
.landing-link { color: rgb(var(--accent-1)); transition: text-shadow 0.2s; }
.landing-link:hover { text-shadow: 0 0 12px rgba(var(--accent-1), 0.5); }

/* ── Landing footer ───────────────────────────────────────────── */
.landing-footer { padding: 2rem 0; }
.landing-footer-text { text-align: center; font-size: 0.9rem; opacity: 0.6; }

/* ── Hide radio player when not applicable ────────────────────── */
.radio-hidden .radio-player,
.radio-hidden .radio-brand-slot { display: none !important; }

} /* end @layer components */

/* ═══════════════════════════════════════════════════════════════
   SCROLL REVEAL
   ═══════════════════════════════════════════════════════════════ */
@layer utilities {
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════ */
.theme-toggle {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 10px 0 7px;
  color: rgba(255, 255, 255, 0.85);
  transition: opacity 0.35s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  z-index: 5;
  opacity: 1;
  white-space: nowrap;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) scale(1.04);
}

.theme-toggle:active {
  transform: translateY(-50%) scale(0.96);
}

.theme-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: opacity 250ms ease;
}

.theme-toggle-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: opacity 250ms ease;
}

/* When scrolled past hero, hide the toggle and show the brand instead */
.theme-toggle.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Mobile: radio-bar toggle */
.theme-toggle-radio {
  position: static;
  transform: none;
  flex-shrink: 0;
  height: 30px;
  font-size: 14px;
  padding: 0 8px 0 6px;
  display: none; /* shown via media query */
}

.theme-toggle-radio:hover {
  transform: translateY(-50%) scale(1.04);
}

.theme-toggle-radio:active {
  transform: translateY(-50%) scale(0.96);
}

.theme-toggle-radio .theme-toggle-icon {
  font-size: 15px;
}

.theme-toggle-radio .theme-toggle-label {
  font-size: 11px;
}

.theme-toggle-radio.hidden {
  opacity: 0;
  pointer-events: none;
}
} /* end @layer utilities */

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE
   ═══════════════════════════════════════════════════════════════ */
@layer theme {
html.light-mode body {
  color: #1a1a1a;
  background: #ebebeb;
}

html.light-mode ::selection {
  background: rgba(0, 120, 212, 0.25);
  color: #1a1a1a;
}

/* ── Nav & Radio bar ──────────────────────────────────────── */
html.light-mode .glass-nav {
  background: rgba(255, 255, 255, 0.65);
  border-bottom-color: rgba(0, 0, 0, 0.10);
}

html.light-mode .glass-nav a:not(.nav-brand) {
  color: rgba(0, 0, 0, 0.55);
}

html.light-mode .glass-nav a:not(.nav-brand):hover,
html.light-mode .glass-nav a:not(.nav-brand).active {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.08);
}

html.light-mode .glass-nav a:not(.nav-brand).active {
  background: rgba(0, 0, 0, 0.12);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.08),
              inset 0 0 8px rgba(0, 0, 0, 0.04);
  text-shadow: none;
}

html.light-mode .nav-brand {
  color: rgba(0, 0, 0, 0.75);
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.10);
}

html.light-mode .radio-brand {
  color: rgba(0, 0, 0, 0.75);
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.10);
}

html.light-mode .theme-toggle {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.75);
}

html.light-mode .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.25);
}

/* ── Radio player ─────────────────────────────────────────── */
html.light-mode .radio-song-title {
  color: rgba(0, 0, 0, 0.45);
}

html.light-mode .radio-player.playing .radio-song-title {
  color: rgba(0, 0, 0, 0.7);
}

.connect-subtitle {
  color: rgba(255, 255, 255, 0.6);
}
html.light-mode .connect-subtitle {
  color: rgba(0, 0, 0, 0.55);
}

html.light-mode .radio-eq-bar {
  background: rgba(0, 0, 0, 0.18);
}

html.light-mode .radio-btn {
  color: rgba(0, 0, 0, 0.45);
}

html.light-mode .radio-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
}

html.light-mode .radio-btn-play {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.6);
}

html.light-mode .radio-btn-play:hover {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.3);
  color: #1a1a1a;
}

html.light-mode .radio-player.playing .radio-btn-play {
  background: rgba(0, 120, 212, 0.12);
  border-color: rgba(0, 120, 212, 0.35);
  color: rgba(0, 120, 212, 0.9);
  box-shadow: 0 0 15px rgba(0, 120, 212, 0.15);
}

html.light-mode .radio-vol-btn {
  color: rgba(0, 0, 0, 0.35);
}

html.light-mode .radio-vol-btn:hover {
  color: rgba(0, 0, 0, 0.7);
}

html.light-mode .radio-vol-slider {
  /* background managed by JS for gradient fill */
}

html.light-mode .radio-vol-slider::-webkit-slider-thumb {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 0, 0, 0.2);
}

html.light-mode .radio-vol-slider::-moz-range-thumb {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 0, 0, 0.2);
}

/* ── Glass tiles ──────────────────────────────────────────── */
html.light-mode .glass-tile {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06),
              0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

html.light-mode .glass-tile:hover {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10),
              0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  border-color: rgba(0, 0, 0, 0.18);
}

html.light-mode .key-figure-value {
  color: #1a1a1a;
}

html.light-mode .key-figure-label {
  color: rgba(0, 0, 0, 0.45);
}

/* ── Opaque bands ─────────────────────────────────────────── */
html.light-mode .opaque-band {
  background: rgba(255, 255, 255, 0.55);
  border-top-color: rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .opaque-band .glass-tile {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .opaque-band .glass-tile:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

/* ── Footer ───────────────────────────────────────────────── */
html.light-mode .footer-pane {
  background: rgba(255, 255, 255, 0.55);
  border-top-color: rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .footer-pane .footer-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .footer-pane .footer-card:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

html.light-mode .footer-detail-item {
  color: rgba(0, 0, 0, 0.55);
}

html.light-mode .footer-detail-item strong {
  color: rgba(0, 0, 0, 0.85);
}

html.light-mode .footer-detail-icon {
  background: rgba(0, 120, 212, 0.08);
  border-color: rgba(0, 120, 212, 0.18);
  color: rgba(0, 120, 212, 0.8);
}

html.light-mode .footer-detail-item:hover .footer-detail-icon {
  background: rgba(0, 120, 212, 0.15);
  border-color: rgba(0, 120, 212, 0.4);
  color: #0078D4;
  box-shadow: 0 0 8px rgba(0, 120, 212, 0.2);
}

html.light-mode .footer-detail-desc {
  color: rgba(0, 0, 0, 0.4);
}

html.light-mode .footer-detail-desc code {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 120, 212, 0.85);
}

html.light-mode .footer-detail-desc a:hover code {
  background: rgba(0, 120, 212, 0.1);
  border-color: rgba(0, 120, 212, 0.3);
  color: #0078D4;
}

html.light-mode .footer-detail-row .footer-detail-item {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .footer-detail-row .footer-detail-item:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

html.light-mode .footer-repo-btn {
  color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

html.light-mode .footer-repo-btn:hover {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.25);
}

html.light-mode .glass-footer {
  color: rgba(255, 255, 255, 0.3);
}

html.light-mode .glass-footer a {
  color: rgba(var(--accent-blue), 0.6);
}

/* ── Text & heading colors ────────────────────────────────── */
html.light-mode .hero-name {
  background: linear-gradient(135deg, #1a1a1a 0%, rgba(0, 0, 0, 0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html.light-mode .hero-tagline {
  color: rgba(0, 0, 0, 0.6);
}

html.light-mode .hero-tagline strong a {
  color: rgba(0, 120, 212, 0.9);
}

html.light-mode .hero-tagline strong a:hover {
  color: #1a1a1a;
}

html.light-mode .hero-bio {
  color: rgba(0, 0, 0, 0.45);
}

html.light-mode .hero-bio strong a {
  color: rgba(0, 120, 212, 0.8);
}

html.light-mode hr {
  border-top-color: rgba(0, 0, 0, 0.12);
}

html.light-mode .hero-links a {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.5);
}

html.light-mode .hero-links a:hover {
  background: rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.25);
  color: #1a1a1a;
}

html.light-mode .hero-portrait {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

html.light-mode .hero-portrait:hover {
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
}

html.light-mode .hero-portrait-penguin {
  background: #fff;
  border-color: rgba(var(--glow), 0.5);
  box-shadow: 0 0 50px rgba(var(--glow), 0.4),
              0 0 120px rgba(var(--glow), 0.16),
              0 0 240px rgba(var(--glow), 0.06);
}

html.light-mode .section-heading {
  color: #1a1a1a;
}

html.light-mode .section-desc {
  color: rgba(0, 0, 0, 0.55);
}

html.light-mode .section-desc a {
  color: rgba(0, 120, 212, 0.85);
}

html.light-mode .section-blurb {
  color: rgba(0, 0, 0, 0.55);
}

html.light-mode .section-blurb a {
  color: rgba(0, 120, 212, 0.85);
}

html.light-mode .scroll-hint {
  color: rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.6), 0 0 32px rgba(255, 255, 255, 0.3);
  animation: bounce-y 1.8s ease-in-out infinite, tl-glow-pulse-light 3s ease-in-out infinite;
}

html.light-mode a.scroll-hint:hover {
  color: rgba(0, 0, 0, 0.7);
}

html.light-mode a.scroll-hint strong {
  color: rgba(0, 0, 0, 0.6);
}

html.light-mode a.scroll-hint:hover strong {
  color: rgba(0, 0, 0, 0.85);
}

/* ── Section badges ───────────────────────────────────────── */
html.light-mode .section-badge {
  color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

html.light-mode .section-badge:hover {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.25);
}

html.light-mode .section-badge.section-badge-glow {
  color: rgba(var(--accent-yellow), 1);
  background: rgba(var(--accent-yellow), 0.8);
  border-color: rgba(var(--accent-yellow), 0.4);
  box-shadow: 0 0 8px rgba(var(--accent-yellow), 0.25), 0 0 16px rgba(var(--accent-yellow), 0.1);
  animation: win-pulse-light 2s ease-in-out infinite;
}

html.light-mode .section-badge.section-badge-glow:hover {
  color: rgba(var(--accent-yellow), 1);
  background: rgba(var(--accent-yellow), 0.95);
  border-color: rgba(var(--accent-yellow), 0.55);
}

html.light-mode .section-intro-img {
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── Entry cards ──────────────────────────────────────────── */
html.light-mode .entry-card .entry-name {
  color: #1a1a1a;
}

html.light-mode .entry-card .entry-title {
  color: rgba(0, 0, 0, 0.55);
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
}

html.light-mode .entry-card .entry-meta {
  color: rgba(0, 0, 0, 0.55);
}

html.light-mode .entry-card .entry-motto {
  color: rgba(0, 0, 0, 0.4);
}

html.light-mode .entry-card .entry-github {
  color: rgba(0, 120, 212, 0.7);
  background: rgba(0, 120, 212, 0.06);
  border-color: rgba(0, 120, 212, 0.15);
}

html.light-mode .entry-card .entry-github:hover {
  background: rgba(0, 120, 212, 0.12);
  color: #0078D4;
}

html.light-mode .entry-card .entry-logo {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

/* ── Video cards ──────────────────────────────────────────── */
html.light-mode .video-card .video-label {
  color: rgba(0, 0, 0, 0.75);
}

html.light-mode .year-badge {
  color: rgba(0, 0, 0, 0.55);
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
}

/* ── Modals ───────────────────────────────────────────────── */
html.light-mode .modal-overlay {
  background: rgba(0, 0, 0, 0.35);
}

html.light-mode .modal-card .modal-title {
  color: #1a1a1a;
}

html.light-mode .modal-card .modal-body {
  color: rgba(0, 0, 0, 0.7);
}

html.light-mode .modal-card .modal-body a {
  color: rgba(0, 120, 212, 0.85);
}

html.light-mode .modal-card .modal-subtitle .modal-badge {
  color: rgba(0, 0, 0, 0.7);
  background: rgba(240, 240, 240, 0.75);
  border-color: rgba(0, 0, 0, 0.12);
}

html.light-mode .modal-sticky-bar {
}

/* ── Win / Play badges (card + modal) ─────────────────────── */
html.light-mode .entry-card .entry-win,
html.light-mode .modal-card .modal-subtitle .modal-win-badge {
  color: rgba(var(--accent-yellow), 1);
  background: rgba(var(--accent-yellow), 0.8);
  border-color: rgba(var(--accent-yellow), 0.4);
  box-shadow: 0 0 8px rgba(var(--accent-yellow), 0.25), 0 0 16px rgba(var(--accent-yellow), 0.1);
}

html.light-mode .entry-card .entry-play,
html.light-mode .modal-card .modal-subtitle .modal-play-badge {
  color: rgba(var(--accent-yellow), 0.95);
  background: rgba(var(--accent-yellow), 0.12);
  border-color: rgba(var(--accent-yellow), 0.35);
  box-shadow: 0 0 8px rgba(var(--accent-yellow), 0.25), 0 0 16px rgba(var(--accent-yellow), 0.1);
}

html.light-mode .entry-card .entry-play:hover,
html.light-mode .modal-card .modal-subtitle .modal-play-badge:hover {
  background: rgba(var(--accent-yellow), 0.22);
  color: rgba(var(--accent-yellow), 1);
  border-color: rgba(var(--accent-yellow), 0.55);
}

html.light-mode .entry-card .entry-title-highlight {
  color: rgba(var(--accent-yellow), 0.95);
  background: rgba(var(--accent-yellow), 0.12);
  border-color: rgba(var(--accent-yellow), 0.35);
}

/* ── Win / Play badge glow (light mode) ───────────────────── */
html.light-mode .entry-card .entry-win,
html.light-mode .entry-card .entry-title-highlight,
html.light-mode .modal-card .modal-subtitle .modal-win-badge,
html.light-mode .modal-card .modal-subtitle .modal-play-badge {
  animation: win-pulse-light 2s ease-in-out infinite;
}

html.light-mode .entry-card .entry-play {
  animation: win-pulse-light 2s ease-in-out infinite;
}

html.light-mode .card-action-badge {
  animation: badgePulse-light 2.5s ease-in-out infinite;
}

html.light-mode .card-action-badge.badge-dive {
  animation: badgePulseDive-light 2.5s ease-in-out infinite;
}

@keyframes win-pulse-light {
  0%, 100% { box-shadow: 0 0 8px rgba(var(--accent-yellow), 0.25), 0 0 16px rgba(var(--accent-yellow), 0.1); }
  50%      { box-shadow: 0 0 14px rgba(var(--accent-yellow), 0.45), 0 0 24px rgba(var(--accent-yellow), 0.2); }
}

@keyframes badgePulse-light {
  0%, 100% { box-shadow: 0 0 6px rgba(var(--accent-yellow), 0.15), inset 0 0 4px rgba(var(--accent-yellow), 0.05); }
  50%      { box-shadow: 0 0 14px rgba(var(--accent-yellow), 0.35), inset 0 0 6px rgba(var(--accent-yellow), 0.1); }
}

@keyframes badgePulseDive-light {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 120, 212, 0.15), inset 0 0 4px rgba(0, 120, 212, 0.05); }
  50%      { box-shadow: 0 0 14px rgba(0, 120, 212, 0.35), inset 0 0 6px rgba(0, 120, 212, 0.1); }
}

/* ── Deck modal ───────────────────────────────────────────── */
html.light-mode .deck-hero {
  background: rgba(245, 245, 245, 0.95);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

html.light-mode .deck-hero-name { color: #1a1a1a; }
html.light-mode .deck-hero-motto { color: rgba(0, 0, 0, 0.45); }
html.light-mode .deck-hero-bracket { color: rgba(0, 0, 0, 0.45); }

html.light-mode .deck-section-label { color: rgba(0, 0, 0, 0.75); }
html.light-mode .deck-section-heading { border-bottom-color: rgba(0, 0, 0, 0.06); }
html.light-mode .deck-carousel-counter { color: rgba(0, 0, 0, 0.35); }

html.light-mode .deck-carousel-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.5);
}

html.light-mode .deck-carousel-btn:hover {
  background: rgba(0, 0, 0, 0.10);
  color: #1a1a1a;
}

html.light-mode .deck-body a[data-card-link] {
  color: rgba(0, 120, 212, 0.85);
  border-bottom-color: rgba(0, 120, 212, 0.3);
}

/* ── MARP BOM ─────────────────────────────────────────────── */
html.light-mode .marp-bom h4 {
  color: rgba(0, 0, 0, 0.7);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

html.light-mode .marp-bom h5 { color: rgba(0, 0, 0, 0.45); }

html.light-mode .marp-bom thead th {
  color: rgba(0, 0, 0, 0.4);
  border-bottom-color: rgba(0, 0, 0, 0.10);
}

html.light-mode .marp-bom tbody td {
  color: rgba(0, 0, 0, 0.7);
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

html.light-mode .marp-bom tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

html.light-mode .marp-bom a { color: rgba(0, 120, 212, 0.85); }

/* ── Modal sticky-bar light overrides ─────────────────────── */
html.light-mode .modal-sticky-title {
  color: #1a1a1a;
}

html.light-mode .game-modal-card .modal-sticky-title {
  color: rgba(var(--accent-yellow), 0.95);
}

html.light-mode .link-modal-card .modal-sticky-title {
  color: rgba(0, 120, 212, 0.95);
}

html.light-mode .modal-sticky-link {
  color: rgba(0, 120, 212, 0.85);
  background: rgba(240, 240, 240, 0.75);
  border-color: rgba(0, 0, 0, 0.12);
}

html.light-mode .modal-sticky-link:hover {
  background: rgba(225, 225, 225, 0.85);
  border-color: rgba(0, 0, 0, 0.25);
}

/* ── Biography modal light overrides ──────────────────────── */
html.light-mode .bio-modal-card .modal-body h3 {
  color: rgba(var(--accent-yellow), 0.85);
}

html.light-mode .bio-modal-card .modal-body h4 {
  color: rgba(0, 0, 0, 0.85);
}

html.light-mode .bio-stat {
  background: linear-gradient(135deg, rgba(var(--bio-glow), 0.08) 0%, rgba(0, 0, 0, 0.01) 100%);
  border-color: rgba(var(--bio-glow), 0.2);
}

html.light-mode .bio-stat:hover {
  box-shadow: 0 0 16px rgba(var(--bio-glow), 0.25), 0 0 32px rgba(var(--bio-glow), 0.1);
}

html.light-mode .bio-stat-active {
  box-shadow: 0 0 12px rgba(var(--bio-glow), 0.20), 0 0 24px rgba(var(--bio-glow), 0.08);
  border-color: rgba(var(--bio-glow), 0.35);
}

html.light-mode .bio-img-viewer {
  border-color: rgba(var(--bio-viewer-glow), 0.2);
  background: rgba(var(--bio-viewer-glow), 0.05);
  box-shadow:
    0 0 14px rgba(var(--bio-viewer-glow), 0.18),
    0 0 32px rgba(var(--bio-viewer-glow), 0.08);
}

html.light-mode .bio-stat-value {
  color: rgba(0, 0, 0, 0.85);
}

html.light-mode .bio-stat-label {
  color: rgba(var(--bio-glow), 0.85);
}

html.light-mode .bio-section-lead {
  color: rgba(0, 0, 0, 0.45) !important;
}

html.light-mode .bio-symbol-block {
  border-left-color: rgba(0, 120, 212, 0.3);
  background: linear-gradient(135deg, rgba(0, 120, 212, 0.05) 0%, rgba(0, 0, 0, 0.01) 100%);
}

html.light-mode .bio-symbol-block h4 {
  color: rgba(0, 120, 212, 0.85);
}

html.light-mode .bio-symbol-block p,
html.light-mode .bio-symbol-block .step,
html.light-mode .bio-principle-block .step {
  color: rgba(0, 0, 0, 0.65);
}

html.light-mode .bio-principle-block {
  border-left-color: rgba(0, 120, 212, 0.3);
  background: linear-gradient(135deg, rgba(0, 120, 212, 0.05) 0%, rgba(0, 0, 0, 0.01) 100%);
}

html.light-mode .bio-principle-block > strong {
  color: rgba(0, 120, 212, 0.85);
}

html.light-mode .bio-principle-block p {
  color: rgba(0, 0, 0, 0.65);
}

html.light-mode .bio-colophon {
  color: rgba(var(--accent-yellow), 0.55);
}

html.light-mode .bio-tour-glow {
  animation-name: bio-tour-pulse-light;
}

@keyframes bio-tour-pulse-light {
  0%, 100% { box-shadow: 0 0 12px rgba(var(--accent-yellow), 0.2), 0 0 24px rgba(var(--accent-yellow), 0.06); }
  50%      { box-shadow: 0 0 20px rgba(var(--accent-yellow), 0.35), 0 0 40px rgba(var(--accent-yellow), 0.12); }
}

html.light-mode .tl-ruler-year {
  color: rgba(0, 0, 0, 0.65);
}

html.light-mode .tl-ruler-month span {
  color: rgba(0, 0, 0, 0.25);
}

html.light-mode .tl-gridline-season {
  background: rgba(0, 0, 0, 0.06);
}

html.light-mode .tl-gridline-year {
  background: rgba(0, 0, 0, 0.18);
}

html.light-mode .tl-sliver {
  background: rgba(0, 0, 0, 0.03);
}

html.light-mode .tl-sliver:hover {
  background: rgba(var(--tc), 0.06);
  border-color: rgba(var(--tc), 0.45);
  box-shadow: 0 0 16px rgba(var(--tc), 0.18),
              0 0 40px rgba(var(--tc), 0.10),
              0 0 80px rgba(var(--tc), 0.05);
}

html.light-mode .tl-sliver.tl-whisper-glow {
  box-shadow: 0 0 16px rgba(var(--tc), 0.18),
              0 0 40px rgba(var(--tc), 0.10),
              0 0 80px rgba(var(--tc), 0.05);
  border-color: rgba(var(--tc), 0.45);
  background: rgba(var(--tc), 0.06);
}

html.light-mode .tl-sliver-name {
  color: #1a1a1a;
}

html.light-mode .tl-whisper-layer.tl-whisper-show,
html.light-mode .tl-glow {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.6), 0 0 32px rgba(255, 255, 255, 0.3);
  animation: tl-glow-pulse-light 3s ease-in-out infinite;
}

@keyframes tl-glow-pulse-light {
  0%, 100% {
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.6), 0 0 32px rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.75), 0 0 48px rgba(255, 255, 255, 0.4), 0 0 72px rgba(255, 255, 255, 0.15);
  }
}

html.light-mode .tl-whisper-layer.tl-whisper-show {
  color: #000;
}

html.light-mode .tl-sliver-title {
  color: rgba(0, 0, 0, 0.45);
}

html.light-mode .tl-sliver-meta {
  color: rgba(0, 0, 0, 0.35);
}

html.light-mode .tl-win {
  color: rgba(var(--accent-yellow), 1);
  background: rgba(var(--accent-yellow), 0.8);
  border-color: rgba(var(--accent-yellow), 0.4);
  box-shadow: 0 0 4px rgba(var(--accent-yellow), 0.15);
}

/* ── Scrollbar ────────────────────────────────────────────── */
html.light-mode ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

html.light-mode ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
}

/* ── Outline pill ─────────────────────────────────────────── */
html.light-mode .outline-pill {
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.45);
}

/* ── Mobile radio bar light override ──────────────────────── */
@media (max-width: 768px) {
  html.light-mode .radio-player {
    background: rgba(255, 255, 255, 0.7);
    border-top-color: rgba(0, 0, 0, 0.08);
  }
}
} /* end @layer theme */

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@layer responsive {
@media (max-width: 900px) {
  .radio-song { max-width: 100px; }
  .radio-vol-slider { width: 40px; }
}

.radio-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .radio-player {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-top: 1px solid rgba(255, 255, 255, 0.33);
  }

  .nav-brand { display: none; }
  .theme-toggle:not(.theme-toggle-radio) { display: none; }
  .theme-toggle-radio { display: flex; }
  .radio-brand { display: inline-flex; }
  .radio-brand-slot { display: block; min-width: 110px; height: 30px; }
  .brand-surname { display: none; }

  .radio-song { display: flex; max-width: 120px; }
  .radio-vol-slider { width: 50px; }
  #page-content { padding-bottom: 60px; }

  .glass-nav {
    gap: 2px;
    padding: 10px 8px;
    justify-content: flex-start;
    mask-image: linear-gradient(to right, transparent 0%, black 16px, black calc(100% - 16px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 16px, black calc(100% - 16px), transparent 100%);
  }

  .glass-nav a { padding: 6px 12px; font-size: 13px; }
  .hero-card { padding: 36px 24px; flex-direction: column; gap: 20px; }
  .hero-text { text-align: center; }
  .hero-links { justify-content: center; }
  .hero-name { font-size: 36px; }
  .hero-portrait { width: 250px; height: 250px; }
  .band-content { padding: 60px 10px; }
  .section-heading { font-size: 26px; }
  .badge-long { display: none; }
  .badge-short { display: inline; }
  .badge-desktop { display: none; }
  .card-grid { grid-template-columns: 1fr; gap: 16px; }
  .card-grid-wide { grid-template-columns: 1fr; }
  .key-figures-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .key-figure { min-height: 80px; padding: 14px 8px; }
  .key-figure-value { font-size: 22px; }
  .key-figure-label { font-size: 10px; }
  .section-intro { flex-direction: column; text-align: center; }
  .section-intro-img { width: 80px; height: 80px; }
  .glass-tile { padding: 20px 18px; }
  .glass-tile.video-card { padding: 0; }
  .entry-card .entry-logo { width: 48px; height: 48px; }
  .modal-card { padding: 20px 18px; }
  .modal-sticky-bar { margin: -20px -18px 0; padding: 12px 18px 8px; }
  .deck-hero { margin: 0 -18px 24px; padding: 16px 18px 16px; }
  .parallax-window-gap { height: 15vh; min-height: 100px; }
  .footer-pane { min-height: auto; }
  .footer-pane-inner { padding: 48px 18px 32px; }
  .footer-repo-actions { justify-content: center; }
}

@media (max-width: 600px) {
  .pdf-modal-card { max-height: 88vh; width: 98vw; }
  .game-modal-card { max-height: 88vh; width: 98vw; }
  .link-modal-card { max-height: 88vh; width: 98vw; }
  .marp-modal-card { width: 98vw; }
  .bitnaughts-modal-card { width: 98vw; }
  .marp-bom table { display: block; overflow-x: auto; white-space: nowrap; }
  .modal-sticky-title { font-size: 18px; }

  .deck-hero {
    flex-direction: row;
    text-align: left;
    gap: 14px;
    margin: 0 -18px 24px;
    padding: 16px 18px 16px;
  }

  .deck-hero-img { width: 120px; }
  .deck-hero-name { font-size: 18px; }
  .deck-hero-motto { font-size: 12px; margin-bottom: 8px; }
  .deck-body { font-size: 12px; margin-top: 8px; }
  .deck-body p { margin: 4px 0; }
  .deck-body p ~ p { display: none; }
  .deck-carousel-wrap { min-height: 310px; }
  .deck-carousel { width: 200px; height: 280px; }
  .deck-card { width: 200px; height: 280px; }
  .deck-modal-card { max-width: 100%; }
  #deck-sections { grid-template-columns: 1fr; }
  #deck-sections .deck-carousel-wrap { min-height: 310px; }
  #deck-sections .deck-carousel { width: 200px; height: 280px; }
  #deck-sections .deck-card { width: 200px; height: 280px; }
}

@media (max-width: 520px) {
  .radio-vol-slider { width: 36px; }
}

@media (max-width: 420px) {
  .glass-nav a { padding: 5px 8px; font-size: 12px; }
  .hero-card { padding: 28px 16px; gap: 16px; }
  .hero-name { font-size: 24px; margin-bottom: 8px; }
  .hero-tagline { font-size: 18px; line-height: 1.5; }
  .hero-portrait { width: 96px; height: 96px; border-width: 2px; }
  .hero-links a { width: 40px; height: 40px; font-size: 17px; border-radius: 11px; }
  .hero-links { gap: 6px; }
  .hero-bio { font-size: 13px; margin-bottom: 20px; }
  .section-heading { font-size: 22px; }
  .band-content { padding: 48px 8px; }
  .glass-tile { padding: 16px 14px; border-radius: 16px; }
  .glass-tile.video-card { padding: 0; }
  .entry-card .entry-logo { width: 40px; height: 40px; }
  .entry-info .entry-name { font-size: 15px; }
  .entry-info .entry-title { font-size: 12px; }
  .scroll-hint { margin-top: 36px; font-size: 11px; }
  .parallax-window-hero { padding: 100px 16px 60px; }
  .parallax-window-gap { height: 10vh; min-height: 60px; }
  .modal-card { padding: 16px 14px; }
  .modal-sticky-bar { margin: -16px -14px 0; padding: 10px 14px 6px; border-radius: 16px 16px 0 0; }
  .deck-hero { margin: 0 -14px 24px; padding: 16px 14px 12px; gap: 10px; }
  .deck-hero-img { width: 100px; }
  .deck-hero-name { font-size: 16px; }
  .deck-hero-motto { font-size: 11px; }
  .deck-body { font-size: 11px; }
  .footer-detail-icon { width: 28px; height: 28px; font-size: 12px; border-radius: 7px; }
  .footer-detail-item { gap: 10px; }
  .footer-repo-btn { padding: 7px 14px; font-size: 12px; }
}
} /* end @layer responsive */

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION — respect user's OS-level preference
   ═══════════════════════════════════════════════════════════════ */
@layer a11y {
@media (prefers-reduced-motion: reduce) {
  /* Disable smooth scrolling */
  html { scroll-behavior: auto; }

  /* Kill all CSS animations */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Show reveal elements immediately (no slide-up) */
  .reveal {
    opacity: 1;
    transform: none;
  }

  /* Freeze scroll-hint bounce */
  .scroll-hint {
    animation: none;
  }

  /* Disable pulsing badges */
  .entry-win,
  .entry-play,
  .entry-title-highlight,
  .card-action-badge,
  .card-action-badge.badge-dive,
  .tile-glow,
  .modal-play-badge,
  .modal-win-badge {
    animation: none;
  }
}

/* ── Screen-reader only (visually hidden, accessible to AT) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Focus ring for keyboard-navigated viz nodes ───────────── */
.kg-node:focus-visible,
.tl-sliver:focus-visible,
.mm-node:focus-visible {
  outline: 2px solid rgb(var(--accent-blue));
  outline-offset: 3px;
  z-index: 50;
}
} /* end @layer a11y */

/* ═══════════════════════════════════════════════════════════════
   SHARED VISUALIZATION CLASSES — Used by Mermaid, KG & Timeline
   ═══════════════════════════════════════════════════════════════ */
@layer viz {

/* ── Modal card (pan-zoom modals: mermaid & KG) ────────────── */
.viz-modal-card {
  max-width: 960px;
  width: 100%;
  height: 90vh;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Filter group container ───────────────────────────────── */
.viz-filter-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 18px;
  width: 100%;
}

/* Flat variant for timeline (row, not column, no nested rows) */
.viz-filter-group--flat {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  width: auto;
}

/* ── Filter row (inner row inside group — mermaid & KG) ───── */
.viz-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
}

/* ── Filter pill button ───────────────────────────────────── */
.viz-filter {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(30, 30, 30, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.viz-filter:hover {
  color: #fff;
  background: rgba(50, 50, 50, 0.85);
  border-color: rgba(var(--tc), 0.45);
  box-shadow: 0 0 12px rgba(var(--tc), 0.25),
              0 0 30px rgba(var(--tc), 0.10);
}

.viz-filter.active {
  color: #fff;
  background: rgba(var(--tc), 0.14);
  border-color: rgba(var(--tc), 0.55);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(0, 0, 0, 0.25),
              0 0 20px rgba(var(--tc), 0.25),
              0 0 50px rgba(var(--tc), 0.12),
              0 0 100px rgba(var(--tc), 0.06);
}

.viz-filter.active:hover {
  background: rgba(var(--tc), 0.08);
  border-color: rgba(var(--tc), 0.25);
  box-shadow: none;
}

/* ── Light mode — filter pills ────────────────────────────── */
html.light-mode .viz-filter {
  color: rgba(0, 0, 0, 0.5);
  background: rgba(240, 240, 240, 0.75);
  border-color: rgba(0, 0, 0, 0.12);
}

html.light-mode .viz-filter:hover {
  color: #1a1a1a;
  background: rgba(225, 225, 225, 0.85);
  border-color: rgba(var(--tc), 0.35);
  box-shadow: 0 0 10px rgba(var(--tc), 0.15),
              0 0 25px rgba(var(--tc), 0.06);
}

html.light-mode .viz-filter.active {
  color: rgba(0, 0, 0, 0.8);
  background: rgba(var(--tc-light, var(--tc)), 0.25);
  border-color: rgba(var(--tc-light, var(--tc)), 0.45);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4),
              0 0 24px rgba(255, 255, 255, 0.2),
              0 0 16px rgba(var(--tc-light, var(--tc)), 0.18),
              0 0 40px rgba(var(--tc-light, var(--tc)), 0.10),
              0 0 80px rgba(var(--tc-light, var(--tc)), 0.05);
}

html.light-mode .viz-filter.active:hover {
  background: rgba(var(--tc-light, var(--tc)), 0.12);
  border-color: rgba(var(--tc-light, var(--tc)), 0.2);
  box-shadow: none;
}

/* ── Dot indicator (color swatch inside filter) ───────────── */
.viz-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Inactive filter: black dot (dark mode) */
.viz-filter:not(.active) .viz-dot {
  background: rgba(20, 20, 20, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Inactive filter: white dot (light mode) */
html.light-mode .viz-filter:not(.active) .viz-dot {
  background: rgba(240, 240, 240, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.12);
}

/* ── Filter pill glow (explore/traverse tour) ─────────────── */
.viz-filter.viz-filter-glow,
.mtg-filter.viz-filter-glow {
  color: #fff;
  border-color: rgba(var(--tc), 0.9) !important;
  background: rgba(var(--tc), 0.25) !important;
  box-shadow: 0 0 14px rgba(var(--tc), 0.5),
              0 0 36px rgba(var(--tc), 0.25),
              0 0 60px rgba(var(--tc), 0.1) !important;
  animation: viz-pill-glow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

html.light-mode .viz-filter.viz-filter-glow,
html.light-mode .mtg-filter.viz-filter-glow {
  color: rgba(0, 0, 0, 0.9);
  background: rgba(var(--tc-light, var(--tc)), 0.2) !important;
  box-shadow: 0 0 10px rgba(var(--tc-light, var(--tc)), 0.3),
              0 0 28px rgba(var(--tc-light, var(--tc)), 0.15) !important;
}

@keyframes viz-pill-glow {
  0%   { transform: scale(0.92); opacity: 0.5; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

/* ── Viewport (pan/zoom area — mermaid & KG) ──────────────── */
.viz-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  border-radius: 20px;
}

.viz-viewport::after {
  content: "";
  position: absolute;
  inset: 0 0 -1px 0;
  pointer-events: none;
  z-index: 3;
  border-radius: inherit;
  background:
    linear-gradient(to bottom, rgba(18,18,18,0.8) 0%, transparent 100px),
    linear-gradient(to top,    rgba(18,18,18,0.8) 0%, transparent 100px),
    linear-gradient(to right,  rgba(18,18,18,0.8) 0%, transparent 100px),
    linear-gradient(to left,   rgba(18,18,18,0.8) 0%, transparent 100px);
}

html.light-mode .viz-viewport::after {
  background:
    linear-gradient(to bottom, rgba(240,240,240,0.8) 0%, transparent 100px),
    linear-gradient(to top,    rgba(240,240,240,0.8) 0%, transparent 100px),
    linear-gradient(to right,  rgba(240,240,240,0.8) 0%, transparent 100px),
    linear-gradient(to left,   rgba(240,240,240,0.8) 0%, transparent 100px);
}

/* ── World (transform container — mermaid & KG) ───────────── */
.viz-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

/* ── Explore hint (bottom of viewport — mermaid & KG) ─────── */
.viz-explore-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  margin-top: 0;
  cursor: pointer;
  transition: opacity 0.4s ease, color 0.25s ease;
  animation: bounce-y-hero 1.8s ease-in-out infinite, tl-glow-pulse 3s ease-in-out infinite;
}

.viz-explore-hint.exploring {
  animation: none;
  color: rgba(255, 255, 255, 1);
}

.viz-explore-hint.exploring .scroll-arrow {
  font-size: 40px;
}

.viz-explore-hint.exploring strong {
  color: rgba(255, 255, 255, 1);
}

.viz-explore-hint:hover {
  color: rgba(255, 255, 255, 0.9);
}

.viz-explore-hint:hover strong {
  color: #fff;
}

html.light-mode .viz-explore-hint {
  animation: bounce-y-hero 1.8s ease-in-out infinite, tl-glow-pulse-light 3s ease-in-out infinite;
}

html.light-mode .viz-explore-hint.exploring {
  animation: none;
  color: rgba(0, 0, 0, 0.85);
}

html.light-mode .viz-explore-hint.exploring strong {
  color: rgba(0, 0, 0, 0.9);
}

/* ── Layout toggle (Static/Dynamic — all three modals) ────── */
.viz-layout-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff;
  background: rgba(var(--tc), 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--tc), 0.55);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(0, 0, 0, 0.25),
              0 0 20px rgba(var(--tc), 0.25),
              0 0 50px rgba(var(--tc), 0.12),
              0 0 100px rgba(var(--tc), 0.06);
}

.viz-layout-toggle:hover {
  background: rgba(var(--tc), 0.08);
  border-color: rgba(var(--tc), 0.25);
  box-shadow: none;
}

html.light-mode .viz-layout-toggle {
  color: rgba(0, 0, 0, 0.75);
  background: rgba(var(--tc), 0.1);
  border-color: rgba(var(--tc), 0.35);
  box-shadow: 0 0 10px rgba(var(--tc), 0.15),
              0 0 28px rgba(var(--tc), 0.08);
}

html.light-mode .viz-layout-toggle:hover {
  color: rgba(0, 0, 0, 0.9);
  background: rgba(var(--tc), 0.06);
  border-color: rgba(var(--tc), 0.2);
  box-shadow: none;
}

/* ── Mobile — shared viz filter & toggle sizing ───────────── */
@media (max-width: 600px) {
  .viz-modal-card {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0 !important;
  }
  .viz-filter {
    padding: 5px 10px;
    font-size: 11px;
    gap: 4px;
  }
  .viz-dot {
    width: 6px;
    height: 6px;
  }
  .viz-layout-toggle {
    padding: 5px 10px;
    font-size: 11px;
    gap: 4px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MERMAID DIAGRAM VIEWER — Interactive architecture flowchart
   ═══════════════════════════════════════════════════════════════ */

/* Mermaid sticky bar: absolute over viewport */
.mm-modal-card .modal-sticky-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px 8px;
  margin: 0;
  border-radius: 20px 20px 0 0;
  z-index: 30;
}

/* Mermaid filter row: right-aligned */
.mm-modal-card .viz-filter-row {
  justify-content: flex-end;
}

/* Mermaid filter pills container */
.mm-filter-pills {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* Mermaid filters: slightly denser for compact legends */
.mm-modal-card .viz-filter {
  gap: 5px;
  padding: 5px 12px;
  font-size: 11px;
}

/* ── SVG edge layer ───────────────────────────────────────── */
.mm-edges {
  position: absolute;
  top: 0;
  left: 0;
  width: 6000px;
  height: 6000px;
  pointer-events: none;
  overflow: visible;
  z-index: 4;
}

/* ── Edge lines (matches kg-thread neon glow style) ───────── */
.mm-edge {
  transition: opacity 0.4s ease, stroke-width 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 0 4px currentColor);
  pointer-events: stroke;
  cursor: pointer;
}

.mm-edge:hover,
.mm-edge.mm-highlight {
  stroke-width: 4 !important;
  filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 16px currentColor) !important;
  animation: none !important;
}

.mm-edge-label-group {
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mm-edge-label-group.mm-highlight rect {
  fill: rgba(15, 15, 15, 0.95) !important;
  stroke: rgba(255, 255, 255, 0.35) !important;
}

/* Dim non-related elements during hover */
.mm-world.mm-hovering .mm-node:not(.mm-highlight) {
  opacity: 0.3;
}
.mm-world.mm-hovering .mm-edge:not(.mm-highlight) {
  opacity: 0.12;
  animation: none !important;
}
.mm-world.mm-hovering .mm-edge-label-group:not(.mm-highlight) {
  opacity: 0.12;
}
.mm-world.mm-hovering .mm-subgraph:not(.mm-highlight) {
  opacity: 0.4;
}
/* Multi-hover: highlighted nodes look identical to :hover */
.mm-node.mm-highlight {
  background: rgba(0, 0, 0, 0.9) !important;
  border-color: rgba(var(--tc), 0.7) !important;
  box-shadow: 0 0 16px rgba(var(--tc), 0.25),
              0 0 40px rgba(var(--tc), 0.12),
              0 0 80px rgba(var(--tc), 0.06) !important;
  transform: translateY(-1px);
  z-index: 10;
}

.mm-world.mm-hovering .mm-node.mm-highlight {
  opacity: 1 !important;
}

/* Multi-hover: highlighted subgraphs match header :hover look */
.mm-subgraph.mm-highlight {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.mm-subgraph.mm-highlight > .mm-subgraph-header {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.07);
}

.mm-world.mm-hovering .mm-subgraph.mm-highlight {
  opacity: 1;
}

/* ── Explore tour glow — newly-revealed elements pulse ────── */
.mm-node.mm-explore-glow {
  border-color: rgba(var(--tc), 0.8) !important;
  box-shadow: 0 0 18px rgba(var(--tc), 0.4),
              0 0 44px rgba(var(--tc), 0.2),
              0 0 80px rgba(var(--tc), 0.08) !important;
  animation: mm-explore-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  z-index: 10;
}

.mm-subgraph.mm-explore-glow {
  border-color: rgba(255, 255, 255, 0.3) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  animation: mm-explore-sg-pop 0.6s ease both;
}

.mm-edge.mm-explore-glow {
  stroke-width: 3.5 !important;
  filter: drop-shadow(0 0 10px currentColor) drop-shadow(0 0 20px currentColor) !important;
  animation: mm-explore-edge-pop 0.6s ease both;
}

.mm-edge-label-group.mm-explore-glow {
  opacity: 1 !important;
}

.mm-edge-label-group.mm-explore-glow rect {
  fill: rgba(15, 15, 15, 0.95) !important;
  stroke: rgba(255, 255, 255, 0.35) !important;
}

.mm-edge-label-group.mm-explore-glow text {
  fill: rgba(255, 255, 255, 1) !important;
}

@keyframes mm-explore-pop {
  0%   { transform: scale(0.88); opacity: 0; }
  60%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

@keyframes mm-explore-sg-pop {
  0%   { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes mm-explore-edge-pop {
  0%   { stroke-width: 1; opacity: 0.2; }
  50%  { stroke-width: 4; opacity: 1; }
  100% { stroke-width: 3.5; opacity: 1; }
}

/* Suppress hover interactions during explore tour */
.mm-world.mm-exploring .mm-node,
.mm-world.mm-exploring .mm-subgraph-header,
.mm-world.mm-exploring ~ .mm-edges .mm-edge {
  pointer-events: none !important;
  cursor: default;
}

/* ── Neighbour dimming — visible but not primary in filter ── */
.mm-node.mm-neighbour {
  opacity: 0.35;
  filter: saturate(0.3);
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.mm-subgraph.mm-neighbour {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}
.mm-edge.mm-neighbour {
  opacity: 0.18;
  animation: none !important;
  transition: opacity 0.3s ease;
}
.mm-edge-label-group.mm-neighbour {
  opacity: 0.18;
  transition: opacity 0.3s ease;
}

.mm-node.mm-hidden,
.mm-subgraph.mm-hidden,
.mm-edge.mm-hidden,
.mm-edge-label-group.mm-hidden {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mm-thread {
  animation: mm-thread-pulse 3s ease-in-out infinite;
}

@keyframes mm-thread-pulse {
  0%, 100% { stroke-width: 2; }
  50%      { stroke-width: 3; }
}

/* ── Subgraph containers ──────────────────────────────────── */
.mm-subgraph {
  position: absolute;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease;
}

.mm-subgraph-invisible {
  border: none;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.mm-subgraph-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px 14px 0 0;
  background: rgba(255, 255, 255, 0.03);
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
}

.mm-subgraph-header:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.07);
}

/* ── Node tiles (glassmorphic cards) ──────────────────────── */
.mm-node {
  position: absolute;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 15, 15, 0.75);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  padding: 6px 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  z-index: 5;
  cursor: default;
  transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  overflow: visible;
}

.mm-node:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(var(--tc), 0.7);
  box-shadow: 0 0 16px rgba(var(--tc), 0.25),
              0 0 40px rgba(var(--tc), 0.12),
              0 0 80px rgba(var(--tc), 0.06);
  transform: translateY(-1px);
  z-index: 10;
}

.mm-node.mm-actionable {
  cursor: pointer;
  border-style: dashed;
  animation: mm-actionable-pulse 2s ease-in-out infinite;
}
.mm-node.mm-actionable:hover {
  border-style: solid;
  animation: mm-actionable-pulse 1s ease-in-out infinite;
}
@keyframes mm-actionable-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(var(--tc), 0.3), 0 0 40px rgba(var(--tc), 0.15); }
  50%      { box-shadow: 0 0 24px rgba(var(--tc), 0.5), 0 0 60px rgba(var(--tc), 0.25); }
}

/* Color accent glow on left border, similar to timeline slivers */
.mm-node::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: rgba(var(--tc), 0.6);
  border-radius: 10px 0 0 10px;
}

.mm-node-accent {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

.mm-node-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.mm-node-subtitle {
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  line-height: 1.2;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.mm-node-desc {
  font-size: 9px;
  font-weight: 500;
  font-style: italic;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

/* ── Diagram title ────────────────────────────────────────── */
.mm-title {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
}

/* ── Footer ───────────────────────────────────────────────── */
.mm-footer {
  position: absolute;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
}

/* ── Light mode ───────────────────────────────────────────── */
html.light-mode .mm-subgraph {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
}

html.light-mode .mm-subgraph-header {
  color: rgba(0, 0, 0, 0.5);
  border-bottom-color: rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.03);
}

html.light-mode .mm-subgraph-header:hover {
  color: rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.06);
}

html.light-mode .mm-world.mm-hovering .mm-subgraph.mm-highlight {
  border-color: rgba(0, 0, 0, 0.18);
  background: rgba(0, 0, 0, 0.05);
}

html.light-mode .mm-node {
  background: rgba(245, 245, 245, 0.85);
  border-color: rgba(0, 0, 0, 0.12);
}

html.light-mode .mm-node:hover {
  background: #fff;
  border-color: rgba(var(--tc), 0.5);
  box-shadow: 0 0 12px rgba(var(--tc), 0.15),
              0 0 32px rgba(var(--tc), 0.08);
}

html.light-mode .mm-node-title {
  color: rgba(0, 0, 0, 0.85);
}

html.light-mode .mm-node-subtitle {
  color: rgba(0, 0, 0, 0.85);
}

html.light-mode .mm-node-desc {
  color: rgba(0, 0, 0, 0.45);
}

html.light-mode .mm-title {
  color: rgba(0, 0, 0, 0.6);
}

html.light-mode .mm-footer {
  color: rgba(0, 0, 0, 0.3);
}

html.light-mode .mm-arrow-head {
  fill: rgba(0, 0, 0, 0.5);
}

html.light-mode .mm-edge {
  stroke: rgba(0, 0, 0, 0.35) !important;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

html.light-mode .mm-edge:hover {
  stroke: rgba(0, 0, 0, 0.7) !important;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 10px rgba(0, 0, 0, 0.2));
}

html.light-mode .mm-edge.mm-highlight {
  stroke: rgba(0, 0, 0, 0.6) !important;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 14px rgba(0, 0, 0, 0.15));
}

html.light-mode .mm-world.mm-hovering .mm-node.mm-highlight {
  box-shadow: 0 0 12px rgba(var(--tc), 0.2),
              0 0 32px rgba(var(--tc), 0.1);
}

html.light-mode .mm-node.mm-explore-glow {
  box-shadow: 0 0 14px rgba(var(--tc), 0.25),
              0 0 36px rgba(var(--tc), 0.12) !important;
}

html.light-mode .mm-subgraph.mm-explore-glow {
  border-color: rgba(0, 0, 0, 0.2) !important;
  background: rgba(0, 0, 0, 0.05) !important;
}

html.light-mode .mm-edge.mm-explore-glow {
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 10px rgba(0, 0, 0, 0.2)) !important;
}

html.light-mode .mm-edge-label-group.mm-explore-glow text {
  fill: rgba(0, 0, 0, 1) !important;
  opacity: 1 !important;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .mm-node-title {
    font-size: 10px;
  }
  .mm-node-subtitle {
    font-size: 9px;
  }
  .mm-node-desc {
    font-size: 7px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TIMELINE MODAL — Vertical month-resolution swimlane
   ═══════════════════════════════════════════════════════════════ */
.timeline-modal-card {
  max-width: 960px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.timeline-modal-card::before,
.timeline-modal-card::after {
  content: "";
  display: block;
  position: sticky;
  height: 100px;
  margin-left: -40px;
  margin-right: -40px;
  pointer-events: none;
  z-index: 4;
}

.timeline-modal-card::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(18,18,18,1) 0%, transparent 100%);
  margin-bottom: -100px;
}

.timeline-modal-card::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(18,18,18,1) 0%, transparent 100%);
  margin-top: -100px;
}

html.light-mode .timeline-modal-card::before {
  background: linear-gradient(to bottom, rgba(240,240,240,1) 0%, transparent 100%);
}

html.light-mode .timeline-modal-card::after {
  background: linear-gradient(to top, rgba(240,240,240,1) 0%, transparent 100%);
}

.timeline-modal-card .modal-sticky-bar {
  position: sticky;
  top: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: 0 -40px;
  padding: 12px 40px 8px;
  border-radius: 20px 20px 0 0;
}

/* Timeline-specific: filter pulse animation */
@keyframes filter-backoff-pulse {
  0%   { box-shadow: 0 0 10px rgba(255,255,255,0.15); }
  50%  { box-shadow: 0 0 22px rgba(255,255,255,0.5), 0 0 40px rgba(255,255,255,0.2); }
  100% { box-shadow: 0 0 10px rgba(255,255,255,0.15); }
}
.viz-filter.filter-pulse {
  animation: filter-backoff-pulse 100ms ease-in-out;
}

html.light-mode .viz-filter.filter-pulse {
  animation-name: filter-backoff-pulse-light;
}
@keyframes filter-backoff-pulse-light {
  0%   { box-shadow: 0 0 8px rgba(0,0,0,0.1); }
  50%  { box-shadow: 0 0 20px rgba(0,0,0,0.25), 0 0 40px rgba(0,0,0,0.1); }
  100% { box-shadow: 0 0 8px rgba(0,0,0,0.1); }
}

/* ── Timeline scroll hint ─────────────────────────────────── */
.tl-scroll-hint {
  position: sticky;
  bottom: 12px;
  margin-top: -60px;
  z-index: 20;
  cursor: pointer;
  transition: opacity 0.3s ease, color 0.25s ease;
  animation: bounce-y 1.8s ease-in-out infinite, tl-glow-pulse 3s ease-in-out infinite;
}

.tl-scroll-hint:hover {
  color: rgba(255, 255, 255, 0.85);
}

.tl-scroll-hint strong {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.25s ease;
}

.tl-scroll-hint:hover strong {
  color: rgba(255, 255, 255, 1);
}

/* ── Timeline container ───────────────────────────────────── */
.timeline-container {
  position: relative;
  padding: 0;
}

.timeline-entries {
  position: relative;
}

/* ── Ruler: year labels on the left ───────────────────────── */
.tl-ruler-year {
  position: absolute;
  left: 0;
  width: 48px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.75);
  text-align: right;
  padding-right: 6px;
  z-index: 4;
  pointer-events: none;
  line-height: 1;
  transform: translateY(-1px);
}

/* ── Ruler: month ticks on the left ───────────────────────── */
.tl-ruler-month {
  position: absolute;
  left: 0;
  width: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 6px;
  padding-top: 2px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 2;
}

.tl-ruler-month span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

/* ── Horizontal gridlines ─────────────────────────────────── */
.tl-gridline {
  position: absolute;
  left: 52px;
  right: 0;
  height: 1px;
  background: transparent;
  pointer-events: none;
  z-index: 1;
}

.tl-gridline-season {
  background: rgba(255, 255, 255, 0.06);
}

.tl-gridline-year {
  height: 2px;
  background: rgba(255, 255, 255, 0.18);
}

/* ── Slivers (absolutely positioned) ──────────────────────── */
.tl-sliver {
  position: absolute;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
  z-index: 3;
  display: flex;
  flex-direction: column;
  opacity: 0.5;
}

.tl-sliver:hover {
  background: rgba(var(--tc), 0.08);
  border-color: rgba(var(--tc), 0.55);
  box-shadow: 0 0 20px rgba(var(--tc), 0.25),
              0 0 50px rgba(var(--tc), 0.12),
              0 0 100px rgba(var(--tc), 0.06);
  z-index: 10;
  opacity: 1;
}

.tl-sliver.tl-hidden {
  display: none !important;
}

.tl-sliver.tl-whisper-glow {
  box-shadow: 0 0 20px rgba(var(--tc), 0.25),
              0 0 50px rgba(var(--tc), 0.12),
              0 0 100px rgba(var(--tc), 0.06);
  border-color: rgba(var(--tc), 0.55);
  background: rgba(var(--tc), 0.08);
  opacity: 1;
}

/* ── Whisper HUD overlay ──────────────────────────────── */
.tl-whisper-hud {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 205;
  pointer-events: none;
  display: none;
  opacity: 0;
  height: 60px;
}

.tl-whisper-hud.tl-whisper-active {
  display: block;
}

.tl-whisper-col {
  position: absolute;
  top: 0;
  bottom: 0;
  min-height: 60px;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-whisper-layer {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  font-size: 30px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 1px;
  line-height: 1.3;
  text-transform: none;
  text-align: center;
  color: rgba(255, 255, 255, 0);
  white-space: nowrap;
  overflow: visible;
  transition: color 0.5s ease, opacity 0.5s ease, background 0.5s ease, box-shadow 0.5s ease;
  opacity: 0;
  border-radius: 8px;
  max-width: 100%;
}

.tl-whisper-layer.tl-whisper-show,
.tl-glow {
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 0, 0, 0.25);
  animation: tl-glow-pulse 3s ease-in-out infinite;
}

@keyframes tl-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 0, 0, 0.25);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.65), 0 0 60px rgba(0, 0, 0, 0.35), 0 0 90px rgba(0, 0, 0, 0.15);
  }
}

.tl-whisper-layer.tl-whisper-show {
  color: #fff;
  opacity: 1;
}

.tl-whisper-layer sup {
  margin-left: 0.25em;
}

/* Gradient accent */
.tl-sliver-accent {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

/* ── Sliver header ────────────────────────────────────────── */
.tl-sliver-header {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.tl-cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tl-sliver-name {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  min-width: 0;
}

/* ── Sliver details ───────────────────────────────────────── */
.tl-sliver-title {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.tl-sliver-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: auto;
  padding-top: 4px;
}

.tl-sliver-meta .fa {
  margin-right: 3px;
  font-size: 8px;
  opacity: 0.7;
}

/* ── Win badge ────────────────────────────────────────────── */
.tl-win {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  font-size: 8px;
  color: rgba(var(--accent-yellow), 0.95);
  background: rgba(var(--accent-yellow), 0.1);
  border: 1px solid rgba(var(--accent-yellow), 0.3);
  box-shadow: 0 0 4px rgba(var(--accent-yellow), 0.25);
  animation: win-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Tablet ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .timeline-modal-card .modal-sticky-bar {
    margin: 0 -18px;
    padding: 12px 18px 8px;
  }
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .timeline-modal-card {
    padding: 0 8px !important;
  }
  .timeline-modal-card .modal-sticky-bar {
    margin: 0 -8px;
    padding: 10px 8px 6px;
    border-radius: 16px 16px 0 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   GRAPH OF KNOWLEDGE — 2D pannable/zoomable node canvas
   ═══════════════════════════════════════════════════════════════ */

/* KG sticky bar (flex-based, no position override) */
.kg-modal-card .modal-sticky-bar {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px 8px;
  margin: 0;
  border-radius: 20px 20px 0 0;
  z-index: 30;
}

/* KG filter row: min-height for layout stability */
.kg-modal-card .viz-filter-row {
  min-height: 40px;
}

/* KG world: explicit right/bottom for SVG sizing */
.kg-modal-card .viz-world {
  width: 0;
  height: 0;
}

/* ── SVG edge layer ───────────────────────────────────────── */
.kg-edges {
  position: absolute;
  top: -2000px;
  left: -2000px;
  width: 4000px;
  height: 4000px;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

/* ── Theme×quadrant threads (neon glow lines connecting same-theme nodes within a quadrant) ── */
.kg-thread {
  transition: opacity 0.4s ease;
  animation: thread-pulse 3s ease-in-out infinite;
}

@keyframes thread-pulse {
  0%, 100% { stroke-width: 1; }
  50%      { stroke-width: 1.8; }
}

.kg-thread-hidden {
  opacity: 0 !important;
  transition: opacity 0.3s ease;
  animation: none;
}

/* ── Hover highlights: glow connected arrows, dim the rest ── */
.kg-thread.kg-highlight:not(.kg-thread-hidden) {
  stroke-width: 3 !important;
  filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 14px currentColor) !important;
  opacity: 1 !important;
  animation: none !important;
}

.kg-hovering .kg-thread:not(.kg-highlight):not(.kg-thread-hidden) {
  opacity: 0.1 !important;
  animation: none !important;
}

.kg-hovering .kg-node:not(.kg-highlight):not(.kg-hidden) {
  opacity: 0.35;
}

.kg-node.kg-highlight {
  opacity: 1 !important;
  z-index: 10;
}

/* ── Node (positioned absolutely within kg-world) ─────────── */
.kg-node {
  position: absolute;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: var(--kg-size, 70px);
  height: var(--kg-size, 70px);
  border-radius: 50%;
  border: 2px solid rgba(var(--tc), 0.4);
  background: color-mix(in srgb, rgb(var(--tc)) 12%, #191919);
  box-shadow: 0 0 10px rgba(var(--tc), 0.12),
              0 0 30px rgba(var(--tc), 0.05);
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  overflow: visible;
  padding: 2px;
  text-align: center;
}

.kg-node:hover,
.kg-node.kg-in-focus:hover {
  background: #000;
  border-color: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15),
              0 0 50px rgba(255, 255, 255, 0.06);
  z-index: 10;
}

.kg-node.kg-in-focus {
  background: color-mix(in srgb, rgb(var(--tc)) 20%, #191919);
  border-color: rgb(var(--tc));
  box-shadow: 0 0 18px rgba(var(--tc), 0.22),
              0 0 45px rgba(var(--tc), 0.10),
              0 0 90px rgba(var(--tc), 0.05);
  z-index: 5;
}

.kg-node.kg-hidden {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* During touring, hide/show nodes instantly — no fade that could flash the title */
.kg-touring .kg-node.kg-hidden {
  transition: none !important;
}

/* ── Center node (identity) ───────────────────────────────── */
.kg-node-center {
  opacity: 1;
  z-index: 15;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  padding: 0;
  gap: 0;
  width: var(--kg-size, 90px);
  min-width: var(--kg-size, 90px);
  max-width: var(--kg-size, 90px);
  height: var(--kg-size, 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.1),
              0 0 60px rgba(255, 255, 255, 0.05);
  animation: kg-center-pulse 4s ease-in-out infinite;
}

@keyframes kg-center-pulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1),
                0 0 60px rgba(255, 255, 255, 0.05);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.2),
                0 0 80px rgba(255, 255, 255, 0.1),
                0 0 120px rgba(255, 255, 255, 0.05);
  }
}

.kg-node-center .kg-node-icon {
  font-size: calc(var(--kg-size, 90px) * 0.4);
  line-height: 1;
  margin-top: calc(var(--kg-size, 90px) * -0.11);
  transition: transform 0.3s ease;
}

.kg-node-center:hover .kg-node-icon {
  animation: kg-penguin-bounce 1s ease infinite;
}

@keyframes kg-penguin-bounce {
  0%, 100% { transform: translateY(0); }
  30%      { transform: translateY(-6px); }
  50%      { transform: translateY(0); }
  70%      { transform: translateY(-3px); }
}

/* ── Node accent gradient ─────────────────────────────────── */
.kg-node-accent {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

/* ── Node name (crossfade container) ──────────────────────── */
.kg-node-name {
  position: relative;
  font-size: var(--kg-font, 9px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  width: 100%;
  overflow: visible;
  transition: transform 0.3s ease;
}

.kg-node:hover .kg-node-name {
  animation: kg-penguin-bounce 1s ease infinite;
}

/* Crossfade layers: name ↔ whisper */
/* Emoji row: never displayed — nodes show only name or whisper */
.kg-node-emoji {
  display: none;
}

/* ── Dual-face crossfade: whisper (default) ↔ name (on hover) ── */
/* On hover: show name, hide whisper */
.kg-node:hover .kg-name-layer:not(.kg-name-whisper) {
  opacity: 1;
}
.kg-node:hover .kg-name-whisper {
  opacity: 0;
}

.kg-name-layer {
  display: block;
  text-align: center;
  transition: opacity 0.25s ease;
  line-height: 1.15;
  white-space: nowrap;
  overflow: visible;
  text-transform: uppercase;
  color: inherit;
}

/* Suppress crossfade transitions during traverse mode */
.kg-touring .kg-name-layer {
  transition: none !important;
}

/* During touring, show whisper and hide name on ALL nodes.
   Scoped per modal so each tree gets identical behaviour.
   (skip map nodes — they use opacity-based face-flip instead) */
.kg-touring .kg-node:not(.map-node) .kg-name-layer:not(.kg-name-whisper) {
  opacity: 0 !important;
}
.kg-touring .kg-node:not(.map-node) .kg-name-whisper {
  opacity: 1 !important;
}

/* Tour "show names" phase: override touring rules for in-focus nodes
   so the actual text name is visible instead of the whisper emoji. */
.kg-tour-show-names .kg-node.kg-in-focus:not(.map-node) .kg-name-layer:not(.kg-name-whisper) {
  opacity: 1 !important;
}
.kg-tour-show-names .kg-node.kg-in-focus:not(.map-node) .kg-name-whisper {
  opacity: 0 !important;
}

.kg-name-layer sup {
  margin-left: 0.15em;
  margin-top: -0.4em;
}

/* Name layer (not whisper): hidden by default, shown via kg-name-show */
.kg-name-layer:not(.kg-name-whisper) {
  position: relative;
  opacity: 0;
}
.kg-name-layer:not(.kg-name-whisper).kg-name-show {
  opacity: 1;
}

/* Whisper layers: absolute overlay, crossfade pair */
.kg-name-whisper {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
}
.kg-name-whisper.kg-name-show {
  opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════
   GRAPH OF KNOWLEDGE — Light mode
   ═══════════════════════════════════════════════════════════════ */

html.light-mode .kg-node {
  background: color-mix(in srgb, rgb(var(--tc)) 10%, #e6e6e6);
  border-color: rgba(var(--tc), 0.35);
  box-shadow: 0 0 8px rgba(var(--tc), 0.08),
              0 0 24px rgba(var(--tc), 0.04);
}

html.light-mode .kg-node:hover,
html.light-mode .kg-node.kg-in-focus:hover {
  background: #fff;
  border-color: #000;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.12),
              0 0 40px rgba(0, 0, 0, 0.06);
}

html.light-mode .kg-node.kg-in-focus {
  background: color-mix(in srgb, rgb(var(--tc)) 15%, #e6e6e6);
  border-color: rgb(var(--tc));
  box-shadow: 0 0 14px rgba(var(--tc), 0.15),
              0 0 36px rgba(var(--tc), 0.08),
              0 0 70px rgba(var(--tc), 0.04);
}

html.light-mode .kg-node-center {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.06),
              0 0 40px rgba(0, 0, 0, 0.03);
}

html.light-mode .kg-node-name {
  color: #1a1a1a;
}

html.light-mode .kg-name-whisper {
  color: rgba(0, 0, 0, 0.55);
}

html.light-mode .kg-hovering .kg-node:not(.kg-highlight):not(.kg-hidden) {
  opacity: 0.3;
}

html.light-mode .kg-node.kg-highlight {
  background: #fff !important;
  border-color: rgb(var(--tc)) !important;
  box-shadow: 0 0 14px rgba(var(--tc), 0.2),
              0 0 36px rgba(var(--tc), 0.1) !important;
}


/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .kg-node {
    padding: 4px;
  }
  .kg-node-name {
    font-size: 8px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   CONSTELLATION MAP — Tech adjacency network
   ═══════════════════════════════════════════════════════════════ */

/* ── SVG edge layer ───────────────────────────────────────── */
.map-edges {
  position: absolute;
  top: -2000px;
  left: -2000px;
  width: 4000px;
  height: 4000px;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

/* ── Always show names on map nodes (override kg-node defaults) ── */
.map-node .kg-node-name {
  opacity: 1 !important;
  visibility: visible !important;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Dual-face flip: default vs alt label ─────────────────── */
.map-node .map-face-default,
.map-node .map-face-alt {
  opacity: 1 !important;
  display: inline !important;
  transition: opacity 0.25s ease, transform 0.25s ease;
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

/* Default: show default face, hide alt */
.map-node .map-face-default {
  opacity: 1 !important;
}
.map-node .map-face-alt {
  opacity: 0 !important;
  transform: translate(-50%, -50%) scale(0.7);
}

/* On glow / hover / highlight: flip faces */
.map-node.kg-in-focus .map-face-default,
.map-node.kg-highlight .map-face-default {
  opacity: 0 !important;
  transform: translate(-50%, -50%) scale(0.7);
}
.map-node.kg-in-focus .map-face-alt,
.map-node.kg-highlight .map-face-alt {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1);
}

/* ── Tech nodes: slightly different look from project nodes ─ */
.map-tech-node {
  border-style: solid;
  border-width: 2.5px;
}

.map-tech-node .kg-node-name {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.map-tech-node .map-face-default {
  font-size: calc(var(--kg-size, 56px) * 0.38);
  line-height: 1;
}

.map-project-node {
  border-style: dashed;
  border-width: 1.5px;
  opacity: 0.85;
}

.map-project-node .kg-node-name {
  font-weight: 600;
}

.map-project-node .map-face-default {
  font-size: calc(var(--kg-size, 36px) * 0.45);
  line-height: 1;
}

/* ── Filter divider ───────────────────────────────────────── */
.map-filter-divider {
  color: rgba(255,255,255,0.2);
  font-size: 18px;
  line-height: 1;
  user-select: none;
  padding: 0 2px;
  display: flex;
  align-items: center;
}

html.light-mode .map-filter-divider {
  color: rgba(0,0,0,0.15);
}

/* ── Light mode overrides for map nodes ───────────────────── */
html.light-mode .map-tech-node {
  background: color-mix(in srgb, rgb(var(--tc)) 8%, #f5f5f5);
  border-color: rgba(var(--tc), 0.4);
}

html.light-mode .map-project-node {
  background: color-mix(in srgb, rgb(var(--tc)) 5%, #f5f5f5);
  border-color: rgba(var(--tc), 0.3);
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .map-filter-divider {
    padding: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MTG SKILL TREE — Interactive card tree visualization
   ═══════════════════════════════════════════════════════════════ */

/* ── "See MARP" / "See ARCH" badges on the Mermaid tile ──── */
.card-action-badge.badge-mermaid {
  background: rgba(var(--accent-green), 0.18);
  border: 1px solid rgba(var(--accent-green), 0.5);
  box-shadow: 0 0 6px rgba(var(--accent-green), 0.3), inset 0 0 4px rgba(var(--accent-green), 0.08);
  animation: badgePulseMermaid 2.5s ease-in-out infinite;
  cursor: pointer;
  margin-left: 4px;
}

@keyframes badgePulseMermaid {
  0%, 100% { box-shadow: 0 0 6px rgba(var(--accent-green), 0.3), inset 0 0 4px rgba(var(--accent-green), 0.08); }
  50%      { box-shadow: 0 0 14px rgba(var(--accent-green), 0.55), inset 0 0 6px rgba(var(--accent-green), 0.15); }
}

html.light-mode .card-action-badge.badge-mermaid {
  color: rgba(var(--accent-green), 0.9);
  background: rgba(var(--accent-green), 0.1);
  border-color: rgba(var(--accent-green), 0.4);
  box-shadow: 0 0 6px rgba(var(--accent-green), 0.15), inset 0 0 4px rgba(var(--accent-green), 0.05);
}

/* ── "See TENTIMES" badge on the Diagrams tile ────────────── */
.card-action-badge.badge-tentimes {
  background: rgba(var(--accent-blue), 0.18);
  border: 1px solid rgba(var(--accent-blue), 0.5);
  box-shadow: 0 0 6px rgba(var(--accent-blue), 0.3), inset 0 0 4px rgba(var(--accent-blue), 0.08);
  animation: badgePulseTentimes 2.5s ease-in-out infinite;
  cursor: pointer;
  margin-left: 4px;
}

@keyframes badgePulseTentimes {
  0%, 100% { box-shadow: 0 0 6px rgba(var(--accent-blue), 0.3), inset 0 0 4px rgba(var(--accent-blue), 0.08); }
  50%      { box-shadow: 0 0 14px rgba(var(--accent-blue), 0.55), inset 0 0 6px rgba(var(--accent-blue), 0.15); }
}

html.light-mode .card-action-badge.badge-tentimes {
  color: rgba(0, 120, 212, 0.9);
  background: rgba(0, 120, 212, 0.1);
  border-color: rgba(0, 120, 212, 0.4);
  box-shadow: 0 0 6px rgba(0, 120, 212, 0.15), inset 0 0 4px rgba(0, 120, 212, 0.05);
}

/* ── "See MTG" badge on the Skilltree tile ─────────────────── */
.card-action-badge.badge-mtg {
  background: rgba(var(--accent-yellow), 0.18);
  border: 1px solid rgba(var(--accent-yellow), 0.5);
  box-shadow: 0 0 6px rgba(var(--accent-yellow), 0.3), inset 0 0 4px rgba(var(--accent-yellow), 0.08);
  animation: badgePulseMtg 2.5s ease-in-out infinite;
  cursor: pointer;
  margin-left: 4px;
}

@keyframes badgePulseMtg {
  0%, 100% { box-shadow: 0 0 6px rgba(var(--accent-yellow), 0.3), inset 0 0 4px rgba(var(--accent-yellow), 0.08); }
  50%      { box-shadow: 0 0 14px rgba(var(--accent-yellow), 0.55), inset 0 0 6px rgba(var(--accent-yellow), 0.15); }
}

html.light-mode .card-action-badge.badge-mtg {
  color: rgba(var(--accent-yellow), 0.9);
  background: rgba(var(--accent-yellow), 0.1);
  border-color: rgba(var(--accent-yellow), 0.4);
  box-shadow: 0 0 6px rgba(var(--accent-yellow), 0.15), inset 0 0 4px rgba(var(--accent-yellow), 0.05);
}

/* ── MTG modal card ────────────────────────────────────────── */
.mtg-modal-card .modal-sticky-bar {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px 8px;
  margin: 0;
  border-radius: 20px 20px 0 0;
  z-index: 30;
}

.mtg-modal-card .viz-filter-row {
  min-height: 40px;
}

.mtg-modal-card .viz-world {
  width: 0;
  height: 0;
}

/* ── Filter buttons (reuse viz-filter pattern) ─────────────── */
.mtg-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid rgba(var(--tc), 0.35);
  background: rgba(var(--tc), 0.08);
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mtg-filter:hover {
  background: rgba(var(--tc), 0.18);
  border-color: rgba(var(--tc), 0.6);
  color: #fff;
}

.mtg-filter.active {
  background: rgba(var(--tc), 0.22);
  border-color: rgba(var(--tc), 0.7);
  color: #fff;
  box-shadow: 0 0 8px rgba(var(--tc), 0.2);
}

.mtg-filter-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 14px;
  user-select: none;
  padding: 0 2px;
}

html.light-mode .mtg-filter {
  color: rgba(0, 0, 0, 0.5);
  background: rgba(var(--tc), 0.05);
  border-color: rgba(var(--tc), 0.2);
}
html.light-mode .mtg-filter:hover {
  background: rgba(var(--tc), 0.12);
  color: rgba(0, 0, 0, 0.8);
}
html.light-mode .mtg-filter.active {
  background: rgba(var(--tc), 0.15);
  border-color: rgba(var(--tc), 0.5);
  color: rgba(0, 0, 0, 0.85);
}
html.light-mode .mtg-filter-sep {
  color: rgba(0, 0, 0, 0.15);
}

/* ── MTG edge SVG layer ────────────────────────────────────── */
.mtg-edges {
  position: absolute;
  top: -2000px;
  left: -2000px;
  width: 4000px;
  height: 4000px;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

/* ── MTG center node ───────────────────────────────────────── */
.mtg-center {
  cursor: default;
}

/* ── Deck hub nodes ────────────────────────────────────────── */
.mtg-deck-hub {
  cursor: default;
}

/* ── Card tooltip ──────────────────────────────────────────── */
/* ── MTG card-view modal (stacks above skilltree modal) ── */
#mtg-card-modal.open {
  z-index: 250;
}

.mtg-card-view-card {
  max-width: 400px;
  padding: 12px 12px 0;
  overflow: hidden;
}

.mtg-card-view-card .modal-sticky-bar {
  margin: -12px -12px 0;
  padding: 8px 12px 6px;
}

/* ── Color-coded badges (right-justified, left of X) ───── */
.mtg-card-badges {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mtg-badge {
  --bc: 160,160,160;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  background: rgba(var(--bc), 0.45);
  border: 1px solid rgba(var(--bc), 0.55);
  box-shadow: 0 0 8px rgba(var(--bc), 0.35),
              0 0 20px rgba(var(--bc), 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
  transition: box-shadow 0.3s, background 0.3s;
}

.mtg-card-view-art {
  width: 100%;
  display: block;
  border-radius: 0 0 14px 14px;
}

/* Light mode */
html.light-mode .mtg-card-view-card {
  background: rgba(250, 250, 250, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
}
html.light-mode .mtg-badge {
  background: rgba(var(--bc), 0.25);
  border-color: rgba(var(--bc), 0.35);
  box-shadow: 0 0 6px rgba(var(--bc), 0.2),
              0 0 16px rgba(var(--bc), 0.1);
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .mtg-modal-card .viz-filter-row {
    flex-wrap: wrap;
    gap: 4px;
  }
  .mtg-filter {
    padding: 4px 7px;
    font-size: 11px;
  }
  .mtg-card-view-card {
    max-width: 90vw;
  }
  .mtg-badge {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
}
} /* end @layer viz */

/* ═══════════════════════════════════════════════════════════════
   DEV-TOAST — Terminal-style console overlay
   ═══════════════════════════════════════════════════════════════ */
@layer overlay {
#dev-toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  pointer-events: none;
  max-width: 400px;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.dev-toast-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.33);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.33);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.07),
              0 0 40px rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  word-break: break-word;
  max-width: 100%;
  width: fit-content;
  position: relative;
  padding-right: 38px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  margin-bottom: 6px;
  overflow: hidden;
}

.dev-toast-line.dev-toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dev-toast-line.dev-toast-hide {
  opacity: 0;
  transform: translateY(-4px) scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Swipe-dismiss: dragging state (no transition while finger is down) */
.dev-toast-line.dev-toast-dragging {
  transition: none !important;
  cursor: grabbing;
}

/* Swipe-dismiss: released past threshold → fly out */
.dev-toast-line.dev-toast-swipe-right {
  opacity: 0;
  transform: translateX(120%) rotate(5deg) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 1, 1), opacity 0.3s ease;
  pointer-events: none;
}
.dev-toast-line.dev-toast-swipe-left {
  opacity: 0;
  transform: translateX(-120%) rotate(-5deg) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 1, 1), opacity 0.3s ease;
  pointer-events: none;
}

/* Swipe-dismiss: snap back when released before threshold */
.dev-toast-line.dev-toast-snap-back {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

/* ── Toast glow pulses (mirrors tile-glow-pulse pattern) ── */
@keyframes toast-error-glow {
  0%, 100% { box-shadow: 0 0 12px 2px rgba(var(--accent-red), 0.2),  0 0 32px 4px rgba(var(--accent-red), 0.1); }
  50%      { box-shadow: 0 0 20px 6px rgba(var(--accent-red), 0.35), 0 0 48px 10px rgba(var(--accent-red), 0.18); }
}
@keyframes toast-warn-glow {
  0%, 100% { box-shadow: 0 0 12px 2px rgba(var(--accent-yellow), 0.15), 0 0 32px 4px rgba(var(--accent-yellow), 0.08); }
  50%      { box-shadow: 0 0 20px 6px rgba(var(--accent-yellow), 0.28), 0 0 48px 10px rgba(var(--accent-yellow), 0.14); }
}
@keyframes toast-log-glow {
  0%, 100% { box-shadow: 0 0 12px 2px rgba(var(--accent-green), 0.12), 0 0 32px 4px rgba(var(--accent-green), 0.06); }
  50%      { box-shadow: 0 0 20px 6px rgba(var(--accent-green), 0.22), 0 0 48px 10px rgba(var(--accent-green), 0.11); }
}

.dev-toast-prefix {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.3em;
  line-height: 1;
  align-self: center;
}

.dev-toast-msg {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Clickable link toast */
.dev-toast-link .dev-toast-msg {
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-blue), 0.5);
  text-underline-offset: 3px;
}
.dev-toast-link:hover {
  border-color: rgba(var(--accent-blue), 0.6);
  background: rgba(var(--accent-blue), 0.08);
}

/* Log level colors */
.dev-toast-log {
  border-color: rgba(var(--accent-green), 0.35);
  animation: toast-log-glow 2.4s ease-in-out infinite;
}
.dev-toast-log .dev-toast-prefix {
  color: rgba(var(--accent-green), 0.9);
}

.dev-toast-warn {
  border-color: rgba(var(--accent-yellow), 0.4);
  animation: toast-warn-glow 2.4s ease-in-out infinite;
}
.dev-toast-warn .dev-toast-prefix {
  color: rgba(var(--accent-yellow), 0.9);
}
.dev-toast-warn .dev-toast-msg {
  color: rgba(var(--accent-yellow), 0.85);
}

.dev-toast-error {
  border-color: rgba(var(--accent-red), 0.45);
  background: rgba(20, 20, 20, 0.45);
  animation: toast-error-glow 2.4s ease-in-out infinite;
}
.dev-toast-error .dev-toast-prefix {
  color: rgba(var(--accent-red), 0.95);
}
.dev-toast-error .dev-toast-msg {
  color: rgba(var(--accent-red), 0.9);
}
.dev-toast-source {
  display: block;
  margin-top: 2px;
  margin-left: 1.2em;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 0.82em;
  color: rgba(180, 180, 180, 0.7);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.dev-toast-error .dev-toast-source {
  color: rgba(var(--accent-red), 0.8);
  background: rgba(var(--accent-red), 0.1);
}

/* Stack-trace collapsible dropdown */
.dev-toast-details {
  width: 100%;
  font-size: 1em;
}
.dev-toast-details summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  outline: none;
  color: inherit;
  font-style: normal;
}
.dev-toast-details summary::after { display: none; }
.dev-toast-details summary::-webkit-details-marker { display: none; }
.dev-toast-details summary::before { display: none; }

/* Countdown spinner — anchored top-right of tile */
.dev-toast-spinner {
  position: absolute;
  top: 8px;
  right: 8px;
  line-height: 0;
}
.dev-toast-spinner svg {
  display: block;
  transform: rotate(-90deg);     /* start arc from 12 o'clock */
}
.dev-toast-countdown {
  stroke: rgba(255, 255, 255, 0.35);
}

/* Dropdown arrow — anchored bottom-right of tile */
.dev-toast-arrow {
  position: absolute;
  bottom: 10px;
  right: 8px;
  width: 22px;
  height: 1.1em;
  text-align: center;
  font-size: 1.1em;
  line-height: 1;
}
.dev-toast-arrow-down,
.dev-toast-arrow-up {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  transition: opacity 0.25s ease;
}
.dev-toast-arrow-down {
  opacity: 0.5;
}
.dev-toast-arrow-up {
  opacity: 0;
}
.dev-toast-details[open] ~ .dev-toast-arrow .dev-toast-arrow-down {
  opacity: 0;
}
.dev-toast-details[open] ~ .dev-toast-arrow .dev-toast-arrow-up {
  opacity: 0.5;
}


/* Level-tinted spinner arcs */
.dev-toast-error .dev-toast-countdown {
  stroke: rgba(var(--accent-red), 0.6);
}
.dev-toast-warn .dev-toast-countdown {
  stroke: rgba(var(--accent-yellow), 0.6);
}
.dev-toast-log .dev-toast-countdown {
  stroke: rgba(var(--accent-green), 0.5);
}
.dev-toast-stack {
  margin: 8px 0 2px 0;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 0.85em;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
}
.dev-toast-frame {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 1px 4px;
  white-space: nowrap;
}
.dev-toast-frame-fn {
  color: rgba(180, 180, 180, 0.85);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dev-toast-frame-at {
  color: rgba(140, 140, 140, 0.5);
  flex-shrink: 0;
}
.dev-toast-frame-file {
  color: rgba(var(--accent-blue), 0.85);
  margin-left: auto;
  flex-shrink: 0;
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-blue), 0.3);
}
.dev-toast-error .dev-toast-stack {
  background: rgba(30, 30, 30, 0.35);
  border-color: rgba(var(--accent-red), 0.12);
}
.dev-toast-error .dev-toast-frame-fn {
  color: rgba(var(--accent-red), 0.85);
}
.dev-toast-error .dev-toast-frame-at {
  color: rgba(var(--accent-red), 0.4);
}
.dev-toast-error .dev-toast-frame-file {
  color: rgba(var(--accent-red), 0.85);
  text-decoration-color: rgba(var(--accent-red), 0.3);
}
.dev-toast-warn .dev-toast-stack {
  background: rgba(35, 35, 35, 0.3);
  border-color: rgba(var(--accent-yellow), 0.12);
}
.dev-toast-warn .dev-toast-frame-fn {
  color: rgba(var(--accent-yellow), 0.85);
}
.dev-toast-warn .dev-toast-frame-file {
  color: rgba(var(--accent-yellow), 0.85);
  text-decoration-color: rgba(var(--accent-yellow), 0.3);
}

/* Light mode */
html.light-mode #dev-toast .dev-toast-line {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.75);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.04),
              0 0 40px rgba(0, 0, 0, 0.02);
}
html.light-mode .dev-toast-log .dev-toast-prefix {
  color: rgba(var(--accent-green), 0.85);
}
html.light-mode .dev-toast-warn {
  border-color: rgba(var(--accent-yellow), 0.2);
}
html.light-mode .dev-toast-warn .dev-toast-prefix {
  color: rgba(var(--accent-yellow), 0.9);
}
html.light-mode .dev-toast-warn .dev-toast-msg {
  color: rgba(var(--accent-yellow), 0.85);
}
html.light-mode .dev-toast-error {
  background: rgba(250, 250, 250, 0.5);
  border-color: rgba(var(--accent-red), 0.3);
  box-shadow: 0 0 15px rgba(var(--accent-red), 0.06),
              0 0 40px rgba(var(--accent-red), 0.03);
}
html.light-mode .dev-toast-error .dev-toast-prefix {
  color: rgba(var(--accent-red), 0.9);
}
html.light-mode .dev-toast-error .dev-toast-msg {
  color: rgba(var(--accent-red), 0.85);
}
html.light-mode .dev-toast-details summary {
  color: rgba(80, 80, 80, 0.7);
}
html.light-mode .dev-toast-countdown {
  stroke: rgba(0, 0, 0, 0.2);
}
html.light-mode .dev-toast-error .dev-toast-countdown {
  stroke: rgba(var(--accent-red), 0.45);
}
html.light-mode .dev-toast-warn .dev-toast-countdown {
  stroke: rgba(var(--accent-yellow), 0.45);
}
html.light-mode .dev-toast-stack {
  background: rgba(0, 0, 0, 0.05);
}
html.light-mode .dev-toast-frame-fn {
  color: rgba(40, 40, 40, 0.85);
}
html.light-mode .dev-toast-frame-at {
  color: rgba(100, 100, 100, 0.5);
}
html.light-mode .dev-toast-frame-file {
  color: rgba(0, 120, 212, 0.85);
  text-decoration-color: rgba(0, 120, 212, 0.3);
}
html.light-mode .dev-toast-error .dev-toast-stack {
  background: rgba(var(--accent-red), 0.06);
}
html.light-mode .dev-toast-error .dev-toast-frame-fn {
  color: rgba(var(--accent-red), 0.85);
}
html.light-mode .dev-toast-error .dev-toast-frame-file {
  color: rgba(var(--accent-red), 0.85);
}
html.light-mode .dev-toast-warn .dev-toast-stack {
  background: rgba(var(--accent-yellow), 0.06);
}
html.light-mode .dev-toast-warn .dev-toast-frame-fn {
  color: rgba(var(--accent-yellow), 0.85);
}
html.light-mode .dev-toast-warn .dev-toast-frame-file {
  color: rgba(var(--accent-yellow), 0.85);
}

/* Hide on mobile to avoid clutter */
@media (max-width: 600px) {
  #dev-toast { display: none; }
}
} /* end @layer overlay */
