/* ===== Custom Properties ===== */
:root {
  --bg: #08061a;
  --text: rgba(255,255,255,0.93);
  --muted: rgba(255,255,255,0.65);
  --muted2: rgba(255,255,255,0.45);
  --cyan: #7CF7FF;
  --purple: #B48CFF;
  --pink: #FF7AE5;
  --green: #7CFF9A;
  --r: 24px;
  --glass: blur(26px) saturate(160%) brightness(1.04);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@property --border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* Separate angle property for the cursor rim so it runs at its own speed */
@property --cursor-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@keyframes cursor-rim { to { --cursor-angle: 360deg; } }

/* ── Custom lens cursor ──────────────────────────────────────────────────
   A small precise lens that blurs and slightly distorts the background
   behind it — more like a glass disc than a sphere. The backdrop-filter
   IS the effect; gradients are kept to a bare minimum.
   ──────────────────────────────────────────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
  body, a, button, [role="button"], label, summary,
  .ctrl-btn, .snav-btn, .theme-swatch, .glass-btn,
  .skill-node, .tl-entry, select, textarea, input { cursor: none !important; }
}

#cursor-orb {
  /* Override popover UA stylesheet (it sets inset:0, margin:auto, border,
     padding, background — all must be explicitly reset here)            */
  position: fixed;
  top: 0; left: 0; right: auto; bottom: auto;
  margin: 0; padding: 0; border: none; overflow: visible;
  /* Slightly taller than wide + asymmetric radius = subtle downward lens point */
  width: 22px; height: 24px;
  border-radius: 50% 50% 44% 50% / 50% 50% 57% 50%;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease, box-shadow 0.25s ease;
  will-change: transform;

  /* No backdrop-filter — it blocks the GPU compositor thread and causes
     unavoidable lag. Pure gradient glass instead; the element is fully
     promoted to its own compositor layer via will-change: transform.    */
  background:
    /* primary specular — upper-left glint */
    radial-gradient(ellipse 46% 36% at 32% 26%, rgba(255,255,255,0.55) 0%, transparent 100%),
    /* micro specular pinpoint */
    radial-gradient(ellipse 16% 12% at 36% 29%, rgba(255,255,255,0.90) 0%, transparent 100%),
    /* glass volume — blue-white interior */
    radial-gradient(ellipse 82% 76% at 50% 46%, rgba(160,215,255,0.18) 0%, rgba(100,155,240,0.08) 65%, transparent 100%),
    /* fresnel lower glow */
    radial-gradient(ellipse 64% 40% at 52% 92%, rgba(180,140,255,0.26) 0%, transparent 68%),
    /* very faint base fill so the shape reads in all contexts */
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(130,180,255,0.06) 0%, transparent 100%);

  /* Blend mode makes the orb slightly lighten whatever is beneath it,
     approximating the lens-brightening effect that blur used to give  */
  mix-blend-mode: screen;

  box-shadow:
    inset 0 0 0 0.5px rgba(255,255,255,0.38),
    inset 0 1px 5px rgba(255,255,255,0.12),
    0 3px 14px rgba(0,0,0,0.30),
    0 0  18px rgba(124,247,255,0.14);
}
#cursor-orb.is-visible { opacity: 1; }

/* Hairline iridescent rim — thinner padding, lower alpha than before */
#cursor-orb::before {
  content: '';
  position: absolute;
  inset: -0.5px;
  border-radius: inherit;
  padding: 0.6px;
  background: conic-gradient(
    from var(--cursor-angle),
    rgba(124,247,255,0.75),
    rgba(180,140,255,0.68),
    rgba(255,122,229,0.60),
    rgba(124,255,154,0.55),
    rgba(124,247,255,0.75)
  );
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: destination-out;
  pointer-events: none;
  animation: cursor-rim 3s linear infinite;
}

/* Hover: expand lens area, slightly more glow — scale via JS lerp */
body.cursor-hover #cursor-orb {
  box-shadow:
    inset 0 0 0 0.5px rgba(255,255,255,0.20),
    0 3px 14px rgba(0,0,0,0.28),
    0 0  18px rgba(124,247,255,0.14);
}

/* Touch / no-hover: hide and restore system cursor */
@media (hover: none), (pointer: coarse) {
  #cursor-orb { display: none; }
  body, a, button, [role="button"], input, textarea, select,
  label, summary { cursor: auto !important; }
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Canvas & Background ===== */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#nebula-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(380px 280px at 14% 10%, rgba(130,95,220,0.05), transparent 44%),
    radial-gradient(320px 260px at 84% 8%, rgba(70,120,230,0.04), transparent 42%),
    radial-gradient(280px 220px at 72% 78%, rgba(140,80,220,0.04), transparent 40%),
    radial-gradient(260px 200px at 22% 82%, rgba(65,105,220,0.03), transparent 38%),
    radial-gradient(200px 180px at 50% 45%, rgba(160,110,220,0.03), transparent 36%),
    radial-gradient(1400px 900px at 18% 20%, rgba(60,35,145,0.06), transparent 60%),
    radial-gradient(1200px 850px at 82% 30%, rgba(32,55,165,0.05), transparent 56%),
    radial-gradient(1000px 900px at 50% 78%, rgba(85,40,160,0.04), transparent 58%),
    radial-gradient(1600px 1000px at 50% 50%, rgba(44,22,110,0.04), transparent 65%),
    linear-gradient(155deg, #0b0720 0%, #0d0f30 30%, #090922 60%, #0c0824 100%);
}

#nebula-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(6,4,18,0.40) 100%);
  pointer-events: none;
}

/* ===== Content Layout ===== */
#content {
  position: relative;
  z-index: 1;
}

.chapter {
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
}

.chapter-inner {
  width: 100%;
  max-width: 960px;
}

/* Hero is slightly shorter than the full viewport — the tops of the two summary
   panels below peek up from the bottom edge, hinting there's content to scroll to. */
#ch-hero { min-height: calc(100vh - 120px); min-height: calc(100dvh - 120px); padding-top: 0; padding-bottom: 0; }

/* ===== Glass Panels =====
 *
 * Utility classes:
 *   .glass-panel        — outer shell; hosts iridescent ::before ring + light-sweep ::after.
 *                         Never set overflow-y on this element — use .panel-body instead.
 *   .panel-body         — scrollable inner content container; border stays fixed on outer shell.
 *   .search-bar-wrap    — centers a search bar horizontally inside its panel.
 *   .summary-row        — flex row for side-by-side summary panels (stacks on mobile).
 *   .edge-iris          — semantic alias: same iridescent ring, used for non-.glass-panel
 *                         elements like modals.
 * ===== */
.glass-panel {
  background:
    radial-gradient(
      600px 400px at calc(20% + 50% * var(--scroll-progress, 0)) calc(10% + 30% * var(--scroll-progress, 0)),
      rgba(140,180,255,0.04),
      transparent 55%
    ),
    rgba(16,18,42,0.34);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r);
  padding: 28px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(124,247,255,0.05) inset,
    0 20px 60px rgba(0,0,0,0.4),
    0 0 60px rgba(124,247,255,0.035),
    0 0 120px rgba(124,247,255,0.015),
    0 0 0 0.5px rgba(180,140,255,0.08) inset;
  overflow: hidden;
}

/* Iridescent border ring — sits at inset: 0 so it is never clipped by overflow:hidden */
.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--border-angle),
    rgba(124,247,255,0.65),
    rgba(180,140,255,0.60),
    rgba(255,122,229,0.55),
    rgba(124,255,154,0.55),
    rgba(124,247,255,0.65)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.8;
  animation: border-rotate 25s linear infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes border-rotate { to { --border-angle: 360deg; } }

/* Subtle light sweep */
.glass-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255,255,255,0.012) 46%,
    rgba(124,247,255,0.022) 50%,
    rgba(255,255,255,0.012) 54%,
    transparent 65%
  );
  background-size: 250% 100%;
  animation: light-sweep 14s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes light-sweep {
  0%   { background-position: 250% 0; }
  100% { background-position: -250% 0; }
}

/* ===== Panel Body (scrollable inner container — border ring stays on outer shell) ===== */
.panel-body {
  overflow-y: auto;
  max-height: calc(100vh - 260px);
  scrollbar-width: thin;
  scrollbar-color: rgba(124,247,255,0.3) transparent;
  position: relative;
  z-index: 0;
}

.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-thumb {
  background: rgba(124,247,255,0.3);
  border-radius: 999px;
}

/* ===== Search Bar Wrap (centers search bars inside panels) ===== */
.search-bar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.search-bar-wrap .search-bar {
  max-width: 380px;
  width: 100%;
  margin-bottom: 0;
}

/* ===== Hero ===== */
.hero-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-bottom: 60px;
  position: relative;
  /* New stacking context keeps z-index:-1 ::before above the canvas */
  isolation: isolate;
}

/*
 * Soft backdrop blur behind hero text — separates name/headline/summary
 * from the particle canvas without obscuring them. Uses a radial-gradient
 * mask to feather all edges so there is no hard box outline.
 * z-index: -1 + isolation: isolate keeps it above canvas but under text.
 */
.hero-inner::before {
  content: '';
  position: absolute;
  /* Cover the text stack, centred slightly above middle (scroll hint lives at bottom) */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(780px, 95vw);
  height: min(520px, 72vh);
  backdrop-filter: blur(20px) brightness(0.82);
  -webkit-backdrop-filter: blur(20px) brightness(0.82);
  /* Very faint dark tint to add just a whisper of contrast */
  background: radial-gradient(
    ellipse 60% 55% at 50% 48%,
    rgba(8, 6, 26, 0.18) 0%,
    rgba(8, 6, 26, 0.06) 55%,
    transparent 100%
  );
  /* Feather all edges so it dissolves invisibly into the background */
  mask-image: radial-gradient(
    ellipse 68% 62% at 50% 48%,
    black          20%,
    rgba(0,0,0,.9) 38%,
    rgba(0,0,0,.6) 54%,
    rgba(0,0,0,.2) 68%,
    transparent    80%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 68% 62% at 50% 48%,
    black          20%,
    rgba(0,0,0,.9) 38%,
    rgba(0,0,0,.6) 54%,
    rgba(0,0,0,.2) 68%,
    transparent    80%
  );
  pointer-events: none;
  z-index: -1;
}

.hero-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(255,255,255,0.55), rgba(255,255,255,0.04) 44%,
    rgba(124,247,255,0.18) 60%, rgba(180,140,255,0.14) 80%);
  box-shadow: 0 0 40px rgba(124,247,255,0.15), 0 0 80px rgba(180,140,255,0.08);
  position: relative;
  overflow: hidden;
}

.hero-orb::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(124,247,255,0.25),
    rgba(180,140,255,0.2), rgba(255,122,229,0.18), transparent);
  animation: orb-spin 8s linear infinite;
  filter: blur(8px);
}

@keyframes orb-spin { to { transform: rotate(360deg); } }

.hero-name {
  font-size: clamp(36px, 8vw, 76px);
  font-weight: 800;
  background: linear-gradient(135deg, #e4f9ff 0%, #bceeff 35%, #dfbfff 65%, #ffc2ec 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.5px;
}

.hero-headline {
  font-size: clamp(12px, 2vw, 15px);
  color: var(--muted);
  max-width: 600px;
  line-height: 1.5;
  margin: 0;
  letter-spacing: 0.3px;
}

.hero-summary {
  font-size: clamp(13px, 1.8vw, 15px);
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  line-height: 1.6;
  margin: 8px 0 0;
}

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

/* ── Hero site link ─────────────────────────────────────── */
.hero-site-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.055);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.78);
  font-size: 12.5px;
  font-family: var(--font);
  letter-spacing: 0.025em;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
}
.hero-site-link:hover {
  background: rgba(124,247,255,0.08);
  border-color: rgba(124,247,255,0.32);
  color: #fff;
  box-shadow: 0 0 18px rgba(124,247,255,0.12);
}
.hero-site-arrow {
  font-size: 13px;
  opacity: 0.65;
  transition: opacity 0.18s, transform 0.18s;
}
.hero-site-link:hover .hero-site-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* ── Share button + popup ───────────────────────────────── */
#share-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 92;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

#share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* icon-only circle by default; pill with label on wide screens */
  width: 36px;
  height: 36px;
  padding: 0;
  gap: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(8,6,26,0.72);
  color: rgba(255,255,255,0.80);
  font-size: 12.5px;
  font-family: var(--font);
  letter-spacing: 0.02em;
  cursor: none;
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 2px 16px rgba(0,0,0,0.36),
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 14px 4px rgba(180,140,255,0.18),
    0 0 22px 6px rgba(124,247,255,0.10),
    0 0 28px 8px rgba(255,120,200,0.07);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s,
              width 0.2s, padding 0.2s, border-radius 0.2s, gap 0.2s;
}
#share-btn:hover {
  background: rgba(20,15,45,0.84);
  border-color: rgba(124,247,255,0.28);
  box-shadow:
    0 2px 22px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 0 18px 6px rgba(180,140,255,0.26),
    0 0 28px 8px rgba(124,247,255,0.16),
    0 0 36px 10px rgba(255,120,200,0.10);
  transform: scale(1.06);
}
#share-btn svg {
  width: 15px;
  height: 15px;
  opacity: 0.82;
  flex-shrink: 0;
}
.share-btn-label {
  display: none;
  white-space: nowrap;
}

/* Pill with label on screens wide enough that it won't crowd other UI */
@media (min-width: 768px) {
  #share-btn {
    width: auto;
    padding: 9px 16px 9px 13px;
    gap: 7px;
    border-radius: 999px;
  }
  .share-btn-label {
    display: inline;
  }
}

#share-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(8,6,26,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  min-width: 176px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
#share-popup.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.share-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  font-family: var(--font);
  text-decoration: none;
  cursor: none;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  text-align: left;
}
.share-option:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255,255,255,0.08);
  font-size: 12px;
  font-style: normal;
  flex-shrink: 0;
}
.share-li-icon {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.share-fb-icon {
  font-size: 14px;
  font-weight: 700;
  font-family: Georgia, serif;
}

.share-option.share-copied {
  color: rgba(124,247,255,0.90);
}

/* ── Mobile: tuck share btn higher so it clears the scroll hint ── */
@media (max-width: 600px) {
  #share-wrap {
    bottom: 72px;
    right: 16px;
  }
  #share-btn {
    width: 32px;
    height: 32px;
  }
}

.scroll-hint {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  z-index: 5;
  /* GSAP owns opacity so it can scrub-fade on scroll without CSS conflict */
}

/* Breathing pulse lives on the inner text span, not the container */
.scroll-hint > span {
  color: rgba(255,255,255,0.96);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(124,247,255,0.70),
    0 0 40px rgba(124,247,255,0.30);
  animation: hint-breathe 3.5s ease-in-out infinite;
}

@keyframes hint-breathe {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.68; }
}

.scroll-arrow {
  width: 22px;
  height: 22px;
  border-right: 2.5px solid rgba(255,255,255,0.95);
  border-bottom: 2.5px solid rgba(255,255,255,0.95);
  transform: rotate(45deg);
  filter: drop-shadow(0 0 6px rgba(124,247,255,0.70)) drop-shadow(0 0 16px rgba(124,247,255,0.35));
  animation: scroll-bounce 2.2s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: rotate(45deg) translateY(0);   opacity: 1;    }
  50%       { transform: rotate(45deg) translateY(10px); opacity: 0.65; }
}

/* ===== Section Navigation Bar ===== */
#section-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  transform-origin: top center;
}

#section-nav.nav-visible { pointer-events: auto; }

/* Iridescent rainbow glow that bleeds softly below the bar */
#section-nav::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -10%;
  right: -10%;
  height: 56px;
  background: linear-gradient(to bottom,
    rgba(124,247,255,0.10) 0%,
    rgba(180,140,255,0.07) 28%,
    rgba(255,122,229,0.04) 55%,
    transparent 100%
  );
  pointer-events: none;
}

.section-nav-inner {
  position: relative;
  display: flex;
  gap: 7px;
  justify-content: center;
  align-items: center;
  padding: 8px 16px 9px;
  /* Richer glass: deeper blur + saturation boost so content behind it smears beautifully */
  background: rgba(6, 5, 20, 0.68);
  backdrop-filter: blur(28px) saturate(140%) brightness(0.92);
  -webkit-backdrop-filter: blur(28px) saturate(140%) brightness(0.92);
  flex-wrap: wrap;
  overflow: hidden;
}

/* Rainbow iridescent bottom edge line */
.section-nav-inner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(124,247,255,0.55) 0%,
    rgba(180,140,255,0.55) 25%,
    rgba(255,122,229,0.50) 50%,
    rgba(124,255,154,0.45) 75%,
    rgba(124,247,255,0.55) 100%
  );
  pointer-events: none;
}

.snav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  letter-spacing: 0.2px;
}

.snav-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.26);
  background: rgba(255,255,255,0.09);
}

.snav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.snav-btn:nth-child(1) .snav-dot { background: linear-gradient(90deg, #7CF7FF, #B48CFF); }
.snav-btn:nth-child(2) .snav-dot { background: linear-gradient(90deg, #B48CFF, #FF7AE5); }
.snav-btn:nth-child(3) .snav-dot { background: linear-gradient(90deg, #FF7AE5, #7CFF9A); }
.snav-btn:nth-child(4) .snav-dot { background: linear-gradient(90deg, #7CFF9A, #7CF7FF); }
.snav-btn:nth-child(5) .snav-dot { background: linear-gradient(90deg, #7CF7FF, #FF7AE5); }
.snav-btn:nth-child(6) .snav-dot { background: linear-gradient(90deg, #B48CFF, #7CFF9A); }

/* ===== Summary Row (side-by-side panels — equal height) ===== */
.summary-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  width: 100%;
}

.summary-panel-mvv,
.summary-panel-domains {
  flex: 1;
  min-width: 0;
}

/* ===== Experience Column (Work History full-width above Education) ===== */
.experience-col {
  display: flex;
  flex-direction: column;
  gap: 72px;
  width: 100%;
}

/* Compact panel bodies for the experience panels */
.jobs-panel-body { max-height: 260px; }
.edu-panel-body  { max-height: 220px; }

/* Legacy inner-card styles kept for reference; no longer used as outer panels */
.mvv-block {
  padding: 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 10px;
  text-align: center;
}

.mvv-block:last-child { margin-bottom: 0; }

.mvv-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.mvv-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
}

/* Domains / Focus / Style groups — box-styled to match MVV blocks */
.kpi-group {
  padding: 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 10px;
  text-align: center;
}
.kpi-group:last-child { margin-bottom: 0; }

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  text-align: center;
}

.kpi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.kpi-chip {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
}

/* ===== Section Titles ===== */
.section-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-subtitle {
  text-align: center;
  color: var(--muted2);
  font-size: 12px;
  margin: 0 0 16px;
}

.sub-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.3px;
  margin: 0 0 10px;
  text-transform: uppercase;
}

/* ===== Chips & Tags ===== */
.chip {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.72);
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.22);
  margin-bottom: 16px;
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  width: 100%;
  font-family: var(--font);
}

.search-bar input::placeholder { color: rgba(255,255,255,0.3); }
.search-icon { opacity: 0.4; font-size: 15px; }

/* ===== Job / Education Cards ===== */
.job-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  outline: none;
}

.job-card:hover,
.job-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
}

.job-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(124,247,255,0.4);
}

.job-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.job-title { font-weight: 650; font-size: 13px; }
.job-dates { font-size: 12px; color: var(--muted2); white-space: nowrap; }

.job-preview {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

/* ===== Skills Tree ===== */
.skill-node {
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 6px;
  overflow: hidden;
}

.skill-node summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  user-select: none;
  transition: background 0.12s;
}

.skill-node summary:hover { background: rgba(255,255,255,0.03); }
.skill-node summary::-webkit-details-marker { display: none; }

.skill-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255,255,255,0.4);
  border-bottom: 2px solid rgba(255,255,255,0.4);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.skill-node[open] > summary .skill-caret { transform: rotate(45deg); }

.skill-body {
  padding: 6px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.skill-bullets {
  padding-left: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.skill-bullets li { margin: 2px 0; }
.skill-l2 { margin-left: 12px; }
.skill-l3 { margin-left: 20px; }

/* ===== Horizontal Timeline ===== */
.tl-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.tl-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: nowrap;
}

.tl-btn {
  padding: 4px 11px;
  font-size: 14px;
  font-weight: 500;
  min-width: 30px;
  justify-content: center;
}

#tl-zoom-range {
  width: 90px;
  flex-shrink: 1;
  accent-color: var(--cyan);
  cursor: pointer;
}

.tl-zoom-label {
  font-size: 11px;
  color: var(--muted2);
  min-width: 36px;
  text-align: right;
}

.tl-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 14px;
  margin: 0 -4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,247,255,0.3) transparent;
}

.tl-wrap::-webkit-scrollbar { height: 6px; }
.tl-wrap::-webkit-scrollbar-thumb {
  background: rgba(124,247,255,0.3);
  border-radius: 999px;
}

.tl-track {
  --tl-zoom: 1;
  --tl-card-w: calc(300px * var(--tl-zoom));
  --tl-gap:    calc(28px  * var(--tl-zoom));
  display: flex;
  align-items: flex-start;
  gap: var(--tl-gap);
  width: max-content;
  min-width: 100%;
  padding: 10px 8px 14px;
  position: relative;
}

/* Horizontal iridescent rail line */
.tl-track::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 37px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(124,247,255,0.85),
    rgba(180,140,255,0.80),
    rgba(255,122,229,0.75),
    rgba(124,255,154,0.75),
    rgba(124,247,255,0.85)
  );
  box-shadow: 0 0 14px rgba(124,247,255,0.25);
  pointer-events: none;
}

.tl-entry {
  width: var(--tl-card-w);
  min-width: var(--tl-card-w);
  position: relative;
  flex-shrink: 0;
}

.tl-date {
  font-size: 11px;
  color: var(--muted2);
  text-align: center;
  white-space: nowrap;
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}

.tl-rail {
  position: relative;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  box-shadow: 0 0 10px rgba(124,247,255,0.45), 0 0 0 3px rgba(124,247,255,0.12);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.tl-card {
  border-radius: 14px;
  background: rgba(0,0,0,0.20);
  border: 1px solid rgba(255,255,255,0.09);
  overflow: hidden;
  min-height: 88px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.tl-card:hover { border-color: rgba(255,255,255,0.18); }

.tl-card.tl-card-has-media {
  border-color: rgba(124,247,255,0.15);
}
.tl-card.tl-card-has-media:hover {
  border-color: rgba(124,247,255,0.32);
  background: rgba(124,247,255,0.025);
  box-shadow: 0 0 18px rgba(124,247,255,0.06);
}

/* Summary button — replaces <details><summary> as the card's primary action */
.tl-summary {
  width: 100%;
  padding: 13px 13px 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  transition: background 0.1s;
}

.tl-summary:hover { background: rgba(255,255,255,0.03); }
.tl-summary-text  { flex: 1; min-width: 0; }

.tl-summary-end {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding-top: 1px;
}

.tl-summary-arrow {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.30);
  transition: color 0.15s, transform 0.15s;
}
.tl-summary:hover .tl-summary-arrow {
  color: var(--cyan);
  transform: translateX(2px);
}

/* Media count badge on the card */
.tl-media-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(124,247,255,0.10);
  border: 1px solid rgba(124,247,255,0.22);
  color: var(--cyan);
  line-height: 1;
}
.tl-media-badge-icon { font-size: 9px; opacity: 0.75; }

/* Always-visible pill row below the title */
.tl-pills-preview {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 0 12px 11px;
}

/* Glowing dot on entries that have media */
.tl-dot-media {
  animation: dot-media-pulse 3s ease-in-out infinite;
}
@keyframes dot-media-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(124,247,255,0.45), 0 0 0 3px rgba(124,247,255,0.12); }
  50%       { box-shadow: 0 0 22px rgba(124,247,255,0.75), 0 0 0 6px rgba(124,247,255,0.18); }
}

/* Kept for any legacy detail-modal usage */
.tl-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 6px 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.tl-body {
  padding: 0 12px 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.tl-pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  white-space: nowrap;
}

/* First pill (type label) gets a subtle accent tint */
.tl-pill-type {
  border-color: rgba(180,140,255,0.25);
  background: rgba(180,140,255,0.07);
  color: var(--purple);
}

.tl-hint {
  text-align: center;
  font-size: 11px;
  color: var(--muted2);
  margin: 6px 0 0;
  letter-spacing: 0.3px;
}

/* ===== Year Ruler (tape-measure bar, sits between track and scrollbar) =====
 *
 * Layout (32px tall, bottom-anchored):
 *   ─────  ─────────────── (year labels, top: 2px)
 *     |         |   |   |  (tick marks rising from baseline)
 *   ──────────────────────  (baseline, bottom: 0)
 *
 * .tl-tick          base class — absolutely positioned, width:0, transforms to center
 * .tl-tick-year     tallest tick + visible year label
 * .tl-tick-qtr      medium tick (quarter marks), optional label at high zoom
 * .tl-tick-month    shortest tick, no label
 * ===== */
.tl-ruler {
  position: relative;
  height: 32px;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
}

/* Baseline — the thin horizontal "tape" line */
.tl-ruler::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(255,255,255,0.14);
}

/* Every tick mark */
.tl-tick {
  position: absolute;
  bottom: 0;
  width: 0;
  transform: translateX(-50%);
}

/* The vertical line rising from the baseline */
.tl-tick::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 1px;
  width: 1px;
}

.tl-tick-year::before  { height: 11px; background: rgba(255,255,255,0.42); }
.tl-tick-qtr::before   { height: 6px;  background: rgba(255,255,255,0.20); }
.tl-tick-month::before { height: 3px;  background: rgba(255,255,255,0.13); }

/* Labels sit above their tick mark */
.tl-tick-label {
  position: absolute;
  bottom: 13px;   /* above year tick (11px) + 1px baseline + 1px gap */
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: rgba(255,255,255,0.50);
  white-space: nowrap;
  letter-spacing: 0.35px;
  font-variant-numeric: tabular-nums;
}

/* Quarter/month abbreviated labels sit lower than year labels */
.tl-mo-label {
  bottom: 8px;
  font-size: 8px;
  color: rgba(255,255,255,0.30);
}

/* ===== Gallery Modal ===== */

#gallery-modal {
  /* Explicit top-layer centering: fixed + inset:0 + margin:auto = viewport center.
     position:fixed also creates a containing block for ::before ring and lightbox. */
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  height: fit-content;
  border: 0;
  padding: 0;
  border-radius: 22px;
  /* Translucent background — backdrop-filter provides the frosted-glass depth */
  background: rgba(6, 10, 22, 0.38);
  backdrop-filter: blur(36px) saturate(190%) brightness(0.80);
  -webkit-backdrop-filter: blur(36px) saturate(190%) brightness(0.80);
  color: var(--text);
  box-shadow:
    0 32px 90px rgba(0,0,0,0.50),
    0 0 0 1px rgba(124,247,255,0.08),
    inset 0 1px 0 rgba(255,255,255,0.10);
  overflow: hidden;
}

/* Open — blur clears and modal glides forward */
#gallery-modal[open] {
  animation: gallery-open 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Close — triggered by JS adding .gallery-closing; blur increases as it retreats */
#gallery-modal.gallery-closing {
  animation: gallery-close 0.40s cubic-bezier(0.55, 0, 0.85, 0.05) both;
  pointer-events: none;
}

@keyframes gallery-open {
  0%   { opacity: 0; transform: scale(0.88); filter: blur(22px); }
  55%  { filter: blur(3px); }
  100% { opacity: 1; transform: scale(1);    filter: blur(0px);  }
}

@keyframes gallery-close {
  0%   { opacity: 1; transform: scale(1);    filter: blur(0px);  }
  100% { opacity: 0; transform: scale(0.88); filter: blur(22px); }
}

/* Brighter, more vivid rotating border ring */
#gallery-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--border-angle),
    rgba(124,247,255,0.80),
    rgba(180,140,255,0.72),
    rgba(255,122,229,0.65),
    rgba(124,255,154,0.65),
    rgba(124,247,255,0.80)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.85;
  animation: border-rotate 20s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* Backdrop: dims + blurs the scene behind; animates with the modal */
#gallery-modal::backdrop {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px) brightness(1.45) saturate(140%);
  -webkit-backdrop-filter: blur(10px) brightness(1.45) saturate(140%);
  animation: gallery-backdrop-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
#gallery-modal.gallery-closing::backdrop {
  animation: gallery-backdrop-out 0.40s cubic-bezier(0.55, 0, 0.85, 0.05) both;
}

@keyframes gallery-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes gallery-backdrop-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.gallery-inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  position: relative;
  z-index: 2;
}

.gallery-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-shrink: 0;
}

.gallery-head-content { flex: 1; min-width: 0; }

.gallery-head-date {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.gallery-head-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--text);
}

.gallery-head-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.gallery-body {
  overflow-y: auto;
  padding: 20px 22px 28px;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,247,255,0.25) transparent;
}
.gallery-body::-webkit-scrollbar { width: 5px; }
.gallery-body::-webkit-scrollbar-thumb {
  background: rgba(124,247,255,0.25);
  border-radius: 999px;
}

.gallery-details {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 22px;
  white-space: pre-wrap;
}

/* ── Photo grid ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.gallery-thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), border-color 0.15s, box-shadow 0.15s;
  padding: 0;
}
.gallery-thumb:hover {
  transform: scale(1.03);
  border-color: rgba(124,247,255,0.38);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video thumb */
.gallery-thumb-noposter {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.05);
}

.gallery-thumb-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: rgba(255,255,255,0.88);
  background: rgba(0,0,0,0.30);
  border-radius: inherit;
  pointer-events: none;
}

.gallery-thumb-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 9px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.70));
  font-size: 10.5px;
  color: rgba(255,255,255,0.88);
  line-height: 1.3;
  text-align: left;
  pointer-events: none;
}

/* Empty state */
.gallery-empty {
  text-align: center;
  color: var(--muted2);
  font-size: 13px;
  padding: 32px 0 16px;
  line-height: 1.6;
}
.gallery-empty code {
  font-size: 11px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--cyan);
}

/* ── Links section ── */
.gallery-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.gallery-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(124,247,255,0.08);
  border: 1px solid rgba(124,247,255,0.22);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
  font-family: inherit;
}
.gallery-link-btn:hover {
  background: rgba(124,247,255,0.16);
  border-color: rgba(124,247,255,0.42);
}

/* ── Lightbox overlay (inside the dialog) ── */
.gallery-lightbox {
  position: absolute;
  inset: 0;
  background: rgba(4,6,16,0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 22px;
}
.gallery-lightbox[hidden] { display: none; }

.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 68px 8px;
  width: 100%;
  min-height: 0;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  display: block;
}
.lb-stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  outline: none;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, transform 0.12s;
  z-index: 12;
  font-family: inherit;
}
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-prev:hover { background: rgba(255,255,255,0.20); transform: translateY(-50%) scale(1.08); }
.lb-next:hover { background: rgba(255,255,255,0.20); transform: translateY(-50%) scale(1.08); }

.lb-info {
  display: flex;
  justify-content: center;
  align-items: baseline;
  width: 100%;
  padding: 8px 68px 18px;
  gap: 12px;
}

.lb-caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  flex: 1;
  line-height: 1.4;
}
.lb-counter {
  font-size: 11px;
  color: var(--muted2);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s;
  z-index: 13;
  font-family: inherit;
}
.lb-close:hover { background: rgba(255,255,255,0.22); }

/* ===== Legacy Timeline (kept for compatibility — unused) ===== */
.timeline-entry {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 8px;
  padding-left: 4px;
  padding-right: 4px;
}

.timeline-entry:hover { background: rgba(255,255,255,0.03); }
.timeline-entry:last-child { border-bottom: none; }

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow: 0 0 12px rgba(124,247,255,0.3);
}

.timeline-content { flex: 1; min-width: 0; }
.timeline-date { font-size: 12px; color: var(--muted2); margin-bottom: 2px; }
.timeline-title { font-weight: 600; font-size: 14px; }

.timeline-type {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  margin-top: 6px;
}

/* ===== Passions & Capabilities ===== */
.passions-inner {
  display: flex;
  gap: 16px;
  max-width: 960px;
  width: 100%;
}

.half-panel { flex: 1; min-width: 0; }

.passions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.passion-bubble {
  padding: 14px;
  border-radius: 16px;
  background:
    radial-gradient(120% 160% at 16% 14%, rgba(124,247,255,0.08), transparent 54%),
    radial-gradient(120% 140% at 88% 90%, rgba(255,122,229,0.06), transparent 56%),
    rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.82);
  text-align: center;
  display: grid;
  place-items: center;
}

.cap-group { margin-bottom: 14px; }
.cap-group:last-child { margin-bottom: 0; }

.cap-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 6px;
}

.cap-items {
  padding-left: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.cap-items li { margin: 2px 0; }

/* ===== Ending Statement ===== */
.ending-panel {
  text-align: center;
  padding: 56px 48px;
}

.ending-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted2);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 20px;
}

.ending-headline {
  font-size: clamp(22px, 4vw, 40px);
  font-weight: 800;
  background: linear-gradient(135deg, #e4f9ff 0%, #bceeff 35%, #dfbfff 65%, #ffc2ec 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 28px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.ending-body {
  font-size: clamp(14px, 2vw, 16px);
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  margin: 0 auto 16px;
  line-height: 1.75;
  text-align: left;
}

/* ===== Contact / CTA Panel ===== */
.contact-panel {
  text-align: center;
  padding: 64px 48px;
}

.contact-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted2);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 28px;
}

.contact-headline {
  font-size: clamp(22px, 4.5vw, 46px);
  font-weight: 800;
  background: linear-gradient(135deg, #e4f9ff 0%, #bceeff 35%, #dfbfff 65%, #ffc2ec 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.18;
  letter-spacing: -0.5px;
  max-width: 680px;
  margin: 0 auto 52px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(255,255,255,0.90);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: transform 0.16s cubic-bezier(0.34,1.56,0.64,1), border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
  font-family: var(--font);
}

.contact-link:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(124,247,255,0.38);
  background: rgba(124,247,255,0.09);
  box-shadow: 0 8px 28px rgba(0,0,0,0.28), 0 0 14px rgba(124,247,255,0.12);
  color: #fff;
}

.contact-link-icon {
  font-size: 15px;
  opacity: 0.72;
  flex-shrink: 0;
}

/* ===== Footer ===== */
.footer-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 13px;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
  cursor: pointer;
  font-family: var(--font);
}

.glass-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
}

.footer-copy {
  color: var(--muted2);
  font-size: 11px;
  margin: 0;
}

#btn-std-resume,
.site-switcher {
  position: fixed;
  top: 9px;
  right: 16px;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(8, 6, 26, 0.72);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.site-switch-link {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font);
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.site-switch-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.site-switch-link[aria-current="page"] {
  color: #fff;
  background: rgba(124,247,255,0.14);
  border: 1px solid rgba(124,247,255,0.28);
}

/* ===== Controls ===== */
/* Legacy anchor id kept for nav scroll behavior */
#btn-std-resume { display: none; }

/* Controls cluster — upper left corner */
#controls {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10,14,30,0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255,255,255,0.7);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
  font-family: var(--font);
}

.ctrl-btn:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(10,14,30,0.7);
}

/* ===== Settings modal sections ===== */
.settings-section { margin-bottom: 20px; }
.settings-section:last-of-type { margin-bottom: 0; }

/* ── Color scheme swatches ─────────────────────────────── */
.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.theme-swatch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.70);
  font-size: 12px;
  font-family: var(--font);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.theme-swatch:hover {
  border-color: rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.theme-swatch.active {
  border-color: var(--cyan);
  background: rgba(255,255,255,0.09);
  color: #fff;
  font-weight: 600;
}
.swatch-preview {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(255,255,255,0.15);
}

/* ── Galactic aurora overlay ──────────────────────────────
   Parallax horizontal aurora bands — three layers at
   different scroll speeds, 7 bands total, each with its
   own independently-timed fade + drift animation.
   Renders below the Three.js canvas (z-index: -1).
   ─────────────────────────────────────────────────────── */
#galactic-aurora {
  position: fixed;
  inset: 0;
  overflow: hidden; /* clip parallax layers that extend beyond viewport */
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s ease;
}
[data-color-theme="galactic"] #galactic-aurora { opacity: 0.45; }

/* Parallax container: extends 30vh above & below so bands
   don't pop out as the layer translates upward on scroll */
.ga-layer {
  position: absolute;
  top: -30vh; bottom: -30vh; left: 0; right: 0;
  transform: translateY(calc(var(--scroll-progress, 0) * var(--pa, -0.1) * 100vh));
  will-change: transform;
}

/* All bands: ultra-wide diagonal ribbons spanning the full screen.
   top values are relative to .ga-layer whose top edge is 30vh
   above the viewport, so:  band top:33vh → 3vh from viewport top
                             band top:46vh → 16vh
                             band top:59vh → 29vh  ... etc.
   width:200vw / left:-50vw ensures no raw edge is visible after
   the ~10° rotation applied inside every keyframe transform.    */
.ga-band {
  position: absolute;
  left: -50vw;
  width: 200vw;
  border-radius: 50%;
  will-change: opacity, transform;
}

/* ── 7 bands evenly spaced top→bottom, ~13vh apart ──────── */

/* B1 green main — top of screen */
.ga-b1 {
  top: 33vh; height: 20vh;
  background: radial-gradient(ellipse 70% 100% at 50% 50%,
    rgba(0,235,150,0.40) 0%, rgba(0,200,120,0.16) 42%, transparent 70%);
  filter: blur(28px);
  animation: ga-b1 26s ease-in-out infinite;
}
/* B2 violet — 16vh from top */
.ga-b2 {
  top: 46vh; height: 16vh;
  background: radial-gradient(ellipse 65% 100% at 50% 50%,
    rgba(115,48,248,0.30) 0%, rgba(85,36,195,0.11) 44%, transparent 70%);
  filter: blur(36px);
  animation: ga-b2 35s ease-in-out infinite;
}
/* B3 cyan — 29vh from top */
.ga-b3 {
  top: 59vh; height: 14vh;
  background: radial-gradient(ellipse 62% 100% at 50% 50%,
    rgba(0,205,255,0.26) 0%, rgba(0,168,228,0.09) 44%, transparent 70%);
  filter: blur(42px);
  animation: ga-b3 21s ease-in-out infinite;
}
/* B4 bright needle — screen center (42vh from top) */
.ga-b4 {
  top: 72vh; height: 11vh;
  background: radial-gradient(ellipse 56% 100% at 50% 50%,
    rgba(80,255,175,0.50) 0%, rgba(30,220,130,0.16) 38%, transparent 65%);
  filter: blur(18px);
  animation: ga-b4 17s ease-in-out infinite;
}
/* B5 deep teal — 55vh from top */
.ga-b5 {
  top: 85vh; height: 24vh;
  background: radial-gradient(ellipse 74% 100% at 50% 50%,
    rgba(0,168,108,0.22) 0%, rgba(0,140,88,0.08) 46%, transparent 70%);
  filter: blur(60px);
  animation: ga-b5 46s ease-in-out infinite;
}
/* B6 magenta — 68vh from top */
.ga-b6 {
  top: 98vh; height: 11vh;
  background: radial-gradient(ellipse 58% 100% at 50% 50%,
    rgba(220,55,178,0.24) 0%, rgba(175,36,148,0.08) 44%, transparent 70%);
  filter: blur(50px);
  animation: ga-b6 54s ease-in-out infinite;
}
/* B7 ice blue — bottom of screen (81vh from top) */
.ga-b7 {
  top: 111vh; height: 13vh;
  background: radial-gradient(ellipse 62% 100% at 50% 50%,
    rgba(52,175,255,0.20) 0%, rgba(38,148,228,0.07) 44%, transparent 70%);
  filter: blur(48px);
  animation: ga-b7 39s ease-in-out infinite;
}

/* ── Keyframes ───────────────────────────────────────────
   Every transform includes rotate(~-10°) so the band
   sweeps diagonally. The translate values add the organic
   drift on top of that fixed tilt.
   Opacity pulses independently to mimic aurora timelapse. */

@keyframes ga-b1 {
  0%   { opacity: 0.04; transform: rotate(-11deg) translate(  0vw,  0.0vh); }
  8%   { opacity: 0.60; transform: rotate(-11deg) translate(  2vw, -0.8vh); }
  22%  { opacity: 0.95; transform: rotate(-11deg) translate(  5vw, -2.0vh); }
  38%  { opacity: 0.42; transform: rotate(-11deg) translate(  3vw, -0.5vh); }
  52%  { opacity: 0.88; transform: rotate(-11deg) translate( -2vw, -1.5vh); }
  67%  { opacity: 0.25; transform: rotate(-11deg) translate( -5vw,  0.3vh); }
  80%  { opacity: 0.72; transform: rotate(-11deg) translate( -3vw, -1.0vh); }
  93%  { opacity: 0.08; transform: rotate(-11deg) translate(  0vw,  0.0vh); }
  100% { opacity: 0.04; transform: rotate(-11deg) translate(  0vw,  0.0vh); }
}
@keyframes ga-b2 {
  0%   { opacity: 0.38; transform: rotate(-10deg) translate( -4vw,  0.5vh); }
  15%  { opacity: 0.72; transform: rotate(-10deg) translate( -6vw, -1.5vh); }
  32%  { opacity: 0.18; transform: rotate(-10deg) translate( -2vw,  0.0vh); }
  50%  { opacity: 0.65; transform: rotate(-10deg) translate(  3vw, -0.8vh); }
  68%  { opacity: 0.88; transform: rotate(-10deg) translate(  5vw, -2.0vh); }
  83%  { opacity: 0.28; transform: rotate(-10deg) translate(  3vw,  0.4vh); }
  100% { opacity: 0.38; transform: rotate(-10deg) translate( -4vw,  0.5vh); }
}
@keyframes ga-b3 {
  0%   { opacity: 0.08; transform: rotate(-12deg) translate(  6vw, -0.5vh); }
  14%  { opacity: 0.62; transform: rotate(-12deg) translate(  3vw, -1.5vh); }
  28%  { opacity: 0.18; transform: rotate(-12deg) translate(  0vw,  0.0vh); }
  48%  { opacity: 0.78; transform: rotate(-12deg) translate( -4vw, -1.2vh); }
  63%  { opacity: 0.12; transform: rotate(-12deg) translate( -6vw,  0.2vh); }
  80%  { opacity: 0.55; transform: rotate(-12deg) translate( -2vw, -0.8vh); }
  100% { opacity: 0.08; transform: rotate(-12deg) translate(  6vw, -0.5vh); }
}
@keyframes ga-b4 {
  0%   { opacity: 0.00; transform: rotate(-9deg) translate(  0vw,  0.0vh) scaleX(1.0); }
  10%  { opacity: 0.00; transform: rotate(-9deg) translate(  2vw, -0.3vh) scaleX(1.0); }
  16%  { opacity: 0.88; transform: rotate(-9deg) translate(  6vw, -1.0vh) scaleX(1.2); }
  22%  { opacity: 1.00; transform: rotate(-9deg) translate(  8vw, -1.5vh) scaleX(1.3); }
  28%  { opacity: 0.20; transform: rotate(-9deg) translate(  4vw, -0.3vh) scaleX(1.0); }
  42%  { opacity: 0.00; transform: rotate(-9deg) translate(  0vw,  0.0vh) scaleX(0.9); }
  55%  { opacity: 0.00; transform: rotate(-9deg) translate( -2vw,  0.2vh) scaleX(0.9); }
  63%  { opacity: 0.82; transform: rotate(-9deg) translate( -6vw, -0.8vh) scaleX(1.2); }
  70%  { opacity: 0.15; transform: rotate(-9deg) translate( -3vw,  0.1vh) scaleX(1.0); }
  80%  { opacity: 0.00; transform: rotate(-9deg) translate(  0vw,  0.0vh) scaleX(0.9); }
  100% { opacity: 0.00; transform: rotate(-9deg) translate(  0vw,  0.0vh) scaleX(1.0); }
}
@keyframes ga-b5 {
  0%   { opacity: 0.28; transform: rotate(-11deg) translate(  0vw,  0.0vh); }
  25%  { opacity: 0.55; transform: rotate(-11deg) translate(  4vw, -1.2vh); }
  50%  { opacity: 0.22; transform: rotate(-11deg) translate(  2vw,  0.6vh); }
  75%  { opacity: 0.50; transform: rotate(-11deg) translate( -3vw, -0.8vh); }
  100% { opacity: 0.28; transform: rotate(-11deg) translate(  0vw,  0.0vh); }
}
@keyframes ga-b6 {
  0%   { opacity: 0.00; transform: rotate(-13deg) translate(  0vw,  0.0vh); }
  6%   { opacity: 0.00; transform: rotate(-13deg) translate(  0vw,  0.0vh); }
  13%  { opacity: 0.52; transform: rotate(-13deg) translate( -5vw, -1.0vh); }
  19%  { opacity: 0.72; transform: rotate(-13deg) translate( -8vw, -2.0vh); }
  26%  { opacity: 0.08; transform: rotate(-13deg) translate( -3vw, -0.5vh); }
  32%  { opacity: 0.00; transform: rotate(-13deg) translate(  0vw,  0.0vh); }
  74%  { opacity: 0.00; transform: rotate(-13deg) translate(  0vw,  0.0vh); }
  82%  { opacity: 0.62; transform: rotate(-13deg) translate(  6vw, -1.5vh); }
  90%  { opacity: 0.12; transform: rotate(-13deg) translate(  3vw, -0.3vh); }
  96%  { opacity: 0.00; transform: rotate(-13deg) translate(  0vw,  0.0vh); }
  100% { opacity: 0.00; transform: rotate(-13deg) translate(  0vw,  0.0vh); }
}
@keyframes ga-b7 {
  0%   { opacity: 0.18; transform: rotate(-10deg) translate( -2vw, -0.4vh); }
  28%  { opacity: 0.48; transform: rotate(-10deg) translate( -5vw, -1.4vh); }
  54%  { opacity: 0.12; transform: rotate(-10deg) translate( -1vw,  0.1vh); }
  78%  { opacity: 0.42; transform: rotate(-10deg) translate(  4vw, -1.0vh); }
  100% { opacity: 0.18; transform: rotate(-10deg) translate( -2vw, -0.4vh); }
}

/* Pause aurora when user has requested reduced motion */
@media (prefers-reduced-motion: reduce) { .ga-band { animation: none !important; } }
.reduced-motion .ga-band                { animation-play-state: paused; }

.settings-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted2);
  margin: 0 0 10px;
}

.settings-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 18px 0;
}

.vfx-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.vfx-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  flex: 1;
  min-width: 180px;
  justify-content: flex-start;
}

.vfx-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.vfx-label { flex: 1; text-align: left; }

/* ===== Modal (shared: detail + settings) ===== */
#detail-modal,
#settings-modal {
  width: min(720px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  border-radius: 22px;
  background: rgba(10,14,30,0.92);
  color: var(--text);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

/* Iridescent border ring on modals */
#detail-modal::before,
#settings-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--border-angle),
    rgba(124,247,255,0.50),
    rgba(180,140,255,0.45),
    rgba(255,122,229,0.40),
    rgba(124,255,154,0.40),
    rgba(124,247,255,0.50)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
  animation: border-rotate 30s linear infinite;
  pointer-events: none;
  z-index: 1;
}

#detail-modal::backdrop,
#settings-modal::backdrop {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-head {
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.modal-title { font-weight: 700; font-size: 15px; }
.modal-meta { color: var(--muted2); font-size: 12px; margin-top: 4px; }

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.12s;
}

.modal-close:hover { background: rgba(255,255,255,0.18); }

.modal-body {
  padding: 18px 20px 24px;
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-height: 60vh;
  overflow-y: auto;
  position: relative;
  z-index: 2;
}

/* ===== Settings / Import Modal ===== */
.settings-body {
  white-space: normal;
}

.settings-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.6;
}

.settings-hint strong { color: rgba(255,255,255,0.85); }

#import-json {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px;
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
  resize: vertical;
  margin-bottom: 12px;
  outline: none;
  display: block;
}

#import-json:focus {
  border-color: rgba(124,247,255,0.4);
  box-shadow: 0 0 0 1px rgba(124,247,255,0.2) inset;
}

.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.settings-status {
  font-size: 12px;
  min-height: 18px;
  margin: 0;
  line-height: 1.5;
  transition: color 0.2s;
}

.settings-status.ok { color: var(--green); }
.settings-status.err { color: var(--pink); }

/* ===== Fallback ===== */
#fallback {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  align-items: center;
  justify-content: center;
}

#fallback.active { display: flex; }

.fallback-inner { text-align: center; padding: 40px; }

.fallback-orb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), rgba(124,247,255,0.15) 60%, rgba(180,140,255,0.1) 80%);
  margin: 0 auto 24px;
  box-shadow: 0 0 40px rgba(124,247,255,0.15);
}

.fallback-title {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #e4f9ff, #bceeff, #dfbfff, #ffc2ec);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}

.fallback-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 0;
}

.fallback-msg {
  color: var(--muted2);
  font-size: 14px;
  margin: 24px 0 28px;
}

.fallback-btn {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .chapter { padding: 36px 16px; min-height: auto; }
  #ch-hero { min-height: calc(100vh - 120px); min-height: calc(100dvh - 120px); padding-top: 0; padding-bottom: 0; }
  .glass-panel { padding: 20px; border-radius: 20px; }
  .summary-row { flex-direction: column; align-items: stretch; }
  .jobs-panel-body { max-height: 200px; }
  .edu-panel-body  { max-height: 180px; }
  .passions-inner { flex-direction: column; }
  .skill-l2, .skill-l3 { margin-left: 8px; }
  #btn-std-resume { font-size: 11px; padding: 5px 11px; }
  #controls { top: 10px; left: 10px; }
  .ctrl-btn { width: 34px; height: 34px; font-size: 13px; border-radius: 10px; }
  .vfx-btn { min-width: 140px; font-size: 12px; padding: 8px 12px; }
  .hero-name { font-size: clamp(28px, 10vw, 48px); }
  .hero-orb { width: 54px; height: 54px; }
  .hero-chips { gap: 6px; }
  .hero-chips .chip { font-size: 10px; padding: 3px 7px; }
  .section-title { font-size: 16px; }
  .job-title { font-size: 12px; }
  .job-dates { font-size: 11px; }
  .job-preview { font-size: 11px; }
  .footer-links { gap: 8px; }
  .glass-btn { padding: 8px 14px; font-size: 12px; }
  .ending-panel { padding: 36px 24px; }
  .ending-body { text-align: center; }
  .contact-panel { padding: 40px 20px; }
  .contact-headline { font-size: clamp(20px, 5vw, 32px); margin-bottom: 36px; }
  .panel-body { max-height: calc(100vh - 200px); }
  .search-bar-wrap .search-bar { max-width: 100%; }
  /* Nav scales down on mobile — keep single row, shrink text */
  .snav-btn { padding: 5px 9px; font-size: 10px; gap: 4px; }
  .snav-dot { width: 5px; height: 5px; }
  .section-nav-inner { gap: 5px; padding: 8px 10px 9px; }
  /* Timeline zoom controls wrap on mobile */
  .tl-zoom-controls { flex-wrap: wrap; }
  #tl-zoom-range { width: 70px; }
}

@media (max-width: 480px) {
  .chapter { padding: 48px 12px; }
  .glass-panel { padding: 16px; border-radius: 18px; }
  .kpi-chip { font-size: 11px; padding: 4px 8px; }
  .hero-headline { font-size: 11px; }
  .settings-actions { flex-direction: column; }
  .settings-actions .glass-btn { width: 100%; justify-content: center; }
  /* Gallery: single-column grid on small phones */
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .lb-stage { padding: 50px 48px 8px; }
  .lb-info { padding: 8px 48px 14px; }
  .gallery-head { padding: 14px 16px 12px; }
  .gallery-body { padding: 16px 16px 22px; }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .glass-panel::before,
  .glass-panel::after,
  #detail-modal::before,
  #settings-modal::before,
  #gallery-modal::before,
  #gallery-modal[open],
  #gallery-modal.gallery-closing,
  #gallery-modal::backdrop,
  #gallery-modal.gallery-closing::backdrop,
  .hero-orb::after,
  .scroll-hint,
  .scroll-arrow { animation: none !important; }
  /* Disable the hero blur on low-motion: backdrop-filter can cause jitter */
  .hero-inner::before {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(8,6,26,0.25) !important;
    mask-image: radial-gradient(ellipse 68% 62% at 50% 48%, black 20%, rgba(0,0,0,.6) 55%, transparent 80%) !important;
    -webkit-mask-image: radial-gradient(ellipse 68% 62% at 50% 48%, black 20%, rgba(0,0,0,.6) 55%, transparent 80%) !important;
  }
}

.reduced-motion .glass-panel::before,
.reduced-motion .glass-panel::after,
.reduced-motion #detail-modal::before,
.reduced-motion #settings-modal::before,
.reduced-motion #gallery-modal::before,
.reduced-motion #gallery-modal,
.reduced-motion #gallery-modal::backdrop,
.reduced-motion .hero-orb::after,
.reduced-motion .scroll-hint,
.reduced-motion .scroll-arrow { animation: none !important; }

.reduced-motion .hero-inner::before {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(8,6,26,0.25) !important;
  mask-image: radial-gradient(ellipse 68% 62% at 50% 48%, black 20%, rgba(0,0,0,.6) 55%, transparent 80%) !important;
  -webkit-mask-image: radial-gradient(ellipse 68% 62% at 50% 48%, black 20%, rgba(0,0,0,.6) 55%, transparent 80%) !important;
}

.reduced-motion .chapter .glass-panel,
.reduced-motion .chapter .hero-inner {
  opacity: 1 !important;
  transform: none !important;
}
