/*
  Design tokens
  - Keep everything driven by variables to make theme + future changes easy.
*/
:root {
  color-scheme: light;
  --bg: #f7fbff;
  --fg: #0f172a;
  --muted: #5b6b86;
  --border: rgba(15, 23, 42, 0.1);
  --surface: rgba(255, 255, 255, 0.52);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  --radius: 14px;
  --radius-sm: 12px;
  --pad: 14px;
  --pad-sm: 10px;
  --max: 1040px;
  --accent: #7c3aed;
  --accent-2: #22d3ee;
  --accent-3: #34d399;
  --button-bg: rgba(255, 255, 255, 0.66);
  --button-fg: var(--fg);
  --button-border: rgba(15, 23, 42, 0.14);
  --primary-bg: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(34, 211, 238, 0.92), rgba(52, 211, 153, 0.86));
  --primary-fg: #ffffff;
  --focus: rgba(34, 211, 238, 0.44);
  --glass-blur: blur(14px) saturate(140%);
  --glow-aurora: 0 0 0 1px rgba(34, 211, 238, 0.12), 0 0 30px rgba(124, 58, 237, 0.12), 0 0 24px rgba(34, 211, 238, 0.1),
    0 0 20px rgba(52, 211, 153, 0.08);
  --header-h: 64px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050814;
  --fg: #e5e7eb;
  --muted: #a7b3c8;
  --border: rgba(229, 231, 235, 0.16);
  --surface: rgba(7, 10, 22, 0.5);
  --surface-strong: rgba(7, 10, 22, 0.74);
  --shadow: 0 26px 88px rgba(0, 0, 0, 0.55);
  --button-bg: rgba(7, 10, 22, 0.62);
  --button-fg: var(--fg);
  --button-border: rgba(229, 231, 235, 0.2);
  --primary-bg: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(34, 211, 238, 0.88), rgba(52, 211, 153, 0.78));
  --primary-fg: #040611;
  --focus: rgba(34, 211, 238, 0.46);
  --glass-blur: blur(16px) saturate(150%);
  --glow-aurora: 0 0 0 1px rgba(34, 211, 238, 0.16), 0 0 34px rgba(124, 58, 237, 0.18), 0 0 28px rgba(34, 211, 238, 0.14),
    0 0 22px rgba(52, 211, 153, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -30%;
  background: radial-gradient(circle at 18% 8%, rgba(124, 58, 237, 0.22), transparent 48%),
    radial-gradient(circle at 72% 0%, rgba(34, 211, 238, 0.22), transparent 50%),
    radial-gradient(circle at 46% 78%, rgba(52, 211, 153, 0.18), transparent 54%),
    linear-gradient(90deg, rgba(34, 211, 238, 0.055) 0%, rgba(34, 211, 238, 0.055) 1px, transparent 1px,
        transparent 110px);
  background-size: auto, auto, auto, 110px 110px;
  opacity: 1;
  pointer-events: none;
  z-index: -1;
}

:root[data-theme="dark"] body::before {
  opacity: 0.3;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 24px);
}

img {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--fg);
}

.skip-link:focus {
  left: 16px;
  z-index: 50;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: var(--glass-blur);
}

:root[data-theme="dark"] .site-header {
  background: rgba(7, 10, 18, 0.45);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 28% 28%, rgba(34, 211, 238, 0.95), rgba(124, 58, 237, 0.92), rgba(52, 211, 153, 0.88));
  box-shadow: 0 0 28px rgba(124, 58, 237, 0.28), 0 0 28px rgba(34, 211, 238, 0.22), 0 0 22px rgba(52, 211, 153, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  color: var(--fg);
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  color: var(--button-fg);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08), var(--glow-aurora);
}

:root[data-theme="dark"] .nav-links {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.nav-link:hover {
  border-color: var(--button-border);
  background: var(--surface-strong);
}

.nav-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.nav-link[aria-current="true"] {
  border-color: rgba(34, 211, 238, 0.32);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(34, 211, 238, 0.14), rgba(52, 211, 153, 0.1));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section {
  padding: 22px 0;
  scroll-margin-top: calc(var(--header-h) + 18px);
}

.hero {
  padding-top: 22px;
}

.card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow), var(--glow-aurora);
  padding: var(--pad);
  overflow: clip;
}

.card.connection-card {
  overflow: visible !important;
}

.connection-section {
  overflow: visible;
}

.connection-section .container {
  overflow: visible;
}

:root[data-theme="dark"] .card {
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.92), rgba(10, 14, 26, 0.78));
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 16% 18%, rgba(124, 58, 237, 0.14), transparent 42%),
    radial-gradient(circle at 78% 0%, rgba(34, 211, 238, 0.14), transparent 46%),
    radial-gradient(circle at 44% 88%, rgba(52, 211, 153, 0.1), transparent 52%);
  opacity: 0.9;
}

.card > * {
  position: relative;
}

.section-header {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.heading {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.muted {
  color: var(--muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 14px;
}

.about-copy {
  display: grid;
  gap: 10px;
  max-width: 70ch;
}

.about-copy p {
  margin: 0;
}

.quote {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.12), rgba(14, 165, 233, 0.1));
}

.quote-mark {
  font-weight: 900;
}

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

.details {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.3);
  overflow: clip;
}

:root[data-theme="dark"] .details {
  background: rgba(10, 14, 26, 0.35);
}

.details + .details {
  margin-top: 10px;
}

.details-summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-weight: 800;
}

.details-summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.details-summary::-webkit-details-marker {
  display: none;
}

.details[open] .details-summary {
  border-bottom: 1px solid var(--border);
}

.details-body {
  padding: 10px 12px 12px;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.list strong {
  color: var(--fg);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
  padding: 12px;
}

:root[data-theme="dark"] .mini {
  background: rgba(10, 14, 26, 0.4);
}

.mini-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mini-value {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.mini-note {
  margin: 6px 0 0;
  color: var(--muted);
}

.snapshot-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.snapshot-card::before {
  content: "";
  position: absolute;
  inset: -30% auto auto -20%;
  width: 280px;
  height: 280px;
  background: conic-gradient(from 120deg, rgba(124, 58, 237, 0.4), rgba(34, 211, 238, 0.35), rgba(52, 211, 153, 0.32), rgba(124, 58, 237, 0.4));
  filter: blur(70px);
  opacity: 0.9;
  z-index: -1;
}

.snapshot-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: var(--radius);
  background: radial-gradient(circle at 82% 8%, rgba(34, 211, 238, 0.14), transparent 40%),
    radial-gradient(circle at 12% 84%, rgba(124, 58, 237, 0.12), transparent 46%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.06), rgba(124, 58, 237, 0.06) 40%, transparent 72%);
  z-index: -1;
  pointer-events: none;
}

.snapshot-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.snapshot-body {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 14px;
  align-items: stretch;
}

.snapshot-primary {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(124, 58, 237, 0.2);
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.12), rgba(34, 211, 238, 0.12), rgba(52, 211, 153, 0.1));
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18), var(--glow-aurora);
  padding: 14px;
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.snapshot-primary::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  height: 220px;
  width: 220px;
  background: radial-gradient(circle at 70% 20%, rgba(34, 211, 238, 0.22), transparent 55%);
  filter: blur(30px);
  opacity: 0.9;
  pointer-events: none;
}

.snapshot-kicker {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--muted);
}

.snapshot-number-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.snapshot-number {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.snapshot-caption {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.3;
}

.snapshot-line {
  margin: 0;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.4;
}

.snapshot-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.snapshot-pill {
  border-color: rgba(124, 58, 237, 0.28);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(34, 211, 238, 0.18));
  color: var(--fg);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  padding: 6px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.snapshot-meter {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
  border: 1px solid rgba(124, 58, 237, 0.18);
}

.snapshot-meter-fill {
  position: absolute;
  inset: 0;
  width: 82%;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.8), rgba(34, 211, 238, 0.9), rgba(52, 211, 153, 0.85));
  border-radius: inherit;
}

.snapshot-meter-glow {
  position: absolute;
  inset: -14px;
  width: 82%;
  background: radial-gradient(circle at 40% 50%, rgba(34, 211, 238, 0.22), transparent 60%);
  filter: blur(16px);
  opacity: 0.9;
  pointer-events: none;
}

.aura-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: rgba(124, 58, 237, 0.2);
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.08), rgba(34, 211, 238, 0.08), rgba(52, 211, 153, 0.07));
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.16), var(--glow-aurora);
}

.aura-card::before {
  content: "";
  position: absolute;
  inset: -30% auto auto -20%;
  width: 280px;
  height: 280px;
  background: conic-gradient(from 90deg, rgba(124, 58, 237, 0.28), rgba(34, 211, 238, 0.26), rgba(52, 211, 153, 0.22), rgba(124, 58, 237, 0.28));
  filter: blur(70px);
  opacity: 0.8;
  z-index: -1;
}

.aura-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: var(--radius);
  background: radial-gradient(circle at 80% 12%, rgba(34, 211, 238, 0.12), transparent 44%),
    radial-gradient(circle at 16% 82%, rgba(124, 58, 237, 0.1), transparent 48%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.06), rgba(124, 58, 237, 0.06) 36%, transparent 72%);
  z-index: -1;
  pointer-events: none;
}

.aura-tiles .tile {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

:root[data-theme="dark"] .aura-tiles .tile {
  background: rgba(10, 14, 26, 0.5);
  border-color: rgba(229, 231, 235, 0.12);
}

.influences-card {
  display: grid;
  gap: 12px;
  position: relative;
  overflow: visible;
}

.influence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  overflow: visible;
  position: static;
}

.influence-controls {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

:root[data-theme="dark"] .influence-controls {
  background: rgba(10, 14, 26, 0.55);
  border-color: rgba(229, 231, 235, 0.12);
}

.influence-chip-row,
.influence-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.influence-filter,
.influence-shuffle {
  border-color: rgba(124, 58, 237, 0.2);
  background: rgba(124, 58, 237, 0.12);
  color: var(--fg);
  letter-spacing: 0.08em;
  font-size: 11px;
  text-transform: uppercase;
  padding: 6px 10px;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.influence-filter.is-active {
  border-color: rgba(34, 211, 238, 0.36);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(34, 211, 238, 0.2));
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18), var(--glow-aurora);
}

.influence-shuffle {
  border-color: rgba(52, 211, 153, 0.32);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(34, 211, 238, 0.2));
  font-weight: 800;
}

.influence-status {
  font-size: 13px;
}

.influence-card {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  padding: 12px;
  display: grid;
  gap: 8px;
  position: static;
  overflow: visible;
  isolation: isolate;
  order: var(--card-order, 0);
  z-index: 0;
  transition: box-shadow 200ms ease, border-color 200ms ease, opacity 180ms ease, filter 200ms ease;
}

:root[data-theme="dark"] .influence-card {
  background: rgba(10, 14, 26, 0.55);
  border-color: rgba(229, 231, 235, 0.12);
}

.influence-card:hover {
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2), var(--glow-aurora);
}

.influence-card[data-favorites-open="true"] {
  z-index: 8000;
}

.influence-card:is(:hover, :focus-within) {
  z-index: 5000;
}

.influence-card > *:not(.influence-favorites) {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 120ms ease;
  will-change: transform;
}

.influence-card:hover > *:not(.influence-favorites),
.influence-card:focus-within > *:not(.influence-favorites) {
  transform: perspective(900px) translateY(-2px) scale(1.0) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.influence-card.is-spotlit {
  border-color: rgba(34, 211, 238, 0.36);
  box-shadow: 0 20px 52px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(34, 211, 238, 0.2), var(--glow-aurora);
}

.influence-card[data-hidden="true"] {
  display: none;
}

.influence-card.is-shuffling > *:not(.influence-favorites) {
  animation: influence-pop 180ms ease;
}

@keyframes influence-pop {
  0% {
    transform: perspective(900px) scale(0.94);
  }
  60% {
    transform: perspective(900px) scale(1.03);
  }
  100% {
    transform: perspective(900px) scale(1);
  }
}

.influence-favorites {
  --favorites-frame: clamp(16px, 2.6vw, 24px);
  isolation: isolate;
  position: fixed;
  z-index: 12000;
  top: calc(var(--header-h) + 2 * var(--favorites-frame));
  left: 50%;
  width: min(var(--max), calc(100vw - 2 * var(--favorites-frame)));
  min-height: 360px;
  height: calc(100vh - var(--header-h) - 4 * var(--favorites-frame));
  max-height: calc(100vh - var(--header-h) - 4 * var(--favorites-frame));
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  padding: clamp(10px, 2vw, 16px);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(124, 58, 237, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22), var(--glow-aurora);
  opacity: 0;
  transform: translateX(-50%) scale(0.94);
  transform-origin: center;
  pointer-events: none;
  transition: opacity 150ms ease, transform 200ms ease, box-shadow 200ms ease;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

:root[data-theme="dark"] .influence-favorites {
  background: rgba(10, 14, 26, 0.8);
  border-color: rgba(34, 211, 238, 0.22);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.5), var(--glow-aurora);
}

.influence-card[data-favorites-open="true"] .influence-favorites {
  isolation: isolate;
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.favorites-label {
  display: none;
}

.favorites-grid {
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  justify-items: stretch;
  align-items: stretch;
}

.favorites-grid a {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--radius-sm) - 2px);
  border: 1px solid rgba(124, 58, 237, 0.18);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

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

.favorites-toggle {
  align-self: start;
  border: 1px solid rgba(124, 58, 237, 0.22);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(34, 211, 238, 0.16));
  color: var(--fg);
  letter-spacing: 0.08em;
  font-size: 11px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.favorites-toggle:hover,
.favorites-toggle:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14), var(--glow-aurora);
  border-color: rgba(34, 211, 238, 0.32);
}

.favorites-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--fg);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

:root[data-theme="dark"] .favorites-close {
  background: rgba(10, 14, 26, 0.82);
  border-color: rgba(229, 231, 235, 0.14);
}

.favorites-chip {
  border: 1px solid rgba(124, 58, 237, 0.2);
  isolation: isolate;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(34, 211, 238, 0.14));
  color: var(--fg);
  letter-spacing: 0.04em;
  font-size: 12px;
  padding: 6px 10px;
}

.influence-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.influence-name {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.influence-tagline {
  margin: 0;
  color: var(--muted);
}

.influence-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.influence-pill {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(124, 58, 237, 0.12);
  color: var(--fg);
  letter-spacing: 0.08em;
  font-size: 11px;
  text-transform: uppercase;
  padding: 6px 10px;
}

.influence-link {
  border-color: rgba(124, 58, 237, 0.32);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.24), rgba(34, 211, 238, 0.22));
  color: var(--fg);
  font-weight: 800;
}

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

.snapshot-metric {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 12px;
  display: grid;
  gap: 6px;
}

:root[data-theme="dark"] .snapshot-metric {
  background: rgba(10, 14, 26, 0.55);
  border-color: rgba(229, 231, 235, 0.12);
}

.snapshot-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.snapshot-value {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.snapshot-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.3;
}

@media (max-width: 900px) {
  .snapshot-body {
    grid-template-columns: 1fr;
  }

  .snapshot-metrics {
    grid-template-columns: 1fr;
  }
}

.spotlight-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: -10% -20% auto auto;
  width: 320px;
  height: 320px;
  background: conic-gradient(from 60deg, rgba(34, 211, 238, 0.32), rgba(124, 58, 237, 0.32), rgba(52, 211, 153, 0.26), rgba(34, 211, 238, 0.32));
  filter: blur(70px);
  opacity: 0.8;
  z-index: -1;
}

.spotlight-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: var(--radius);
  background: radial-gradient(circle at 18% 16%, rgba(34, 211, 238, 0.12), transparent 44%),
    radial-gradient(circle at 84% 80%, rgba(124, 58, 237, 0.12), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(124, 58, 237, 0.08) 32%, transparent 70%);
  z-index: -1;
}

.spotlight-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.spotlight-shell {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 211, 238, 0.2);
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.12), rgba(124, 58, 237, 0.12), rgba(52, 211, 153, 0.1));
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18), var(--glow-aurora);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.rotator {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.16);
}

:root[data-theme="dark"] .rotator {
  background: rgba(10, 14, 26, 0.5);
  border-color: rgba(229, 231, 235, 0.14);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.55);
}

.spotlight-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.spotlight-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.spotlight-line {
  margin: 0;
  max-width: 54ch;
  color: var(--fg);
  line-height: 1.35;
}

.spotlight-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .spotlight-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

.grid.cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tile {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
  padding: 12px;
}

.connection-popups {
  position: relative;
  overflow: visible;
  isolation: isolate;
  z-index: 2000;
}

.connection-card .grid.cards {
  overflow: visible;
}

.popup-card {
  position: relative;
  overflow: visible;
  isolation: isolate;
  z-index: 1;
}

.popup-card.is-open {
  z-index: 3000;
}

.popup-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.popup-trigger:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.popup-panel {
  position: fixed;
  left: 50%;
  top: 10vh;
  transform: translate(-50%, 0);
  width: min(560px, 90vw);
  max-height: 80vh;
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow), var(--glow-aurora);
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 0ms linear 140ms;
  z-index: 10000;
  isolation: isolate;
  pointer-events: none;
}

:root[data-theme="dark"] .popup-panel {
  background: #0b0f1b;
}

.popup-card.is-open .popup-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.popup-panel .list {
  margin: 0;
}

@media (max-width: 720px) {
  .popup-card {
    overflow: hidden;
  }

  .popup-panel {
    position: fixed;
    left: 50%;
    top: 10vh;
    width: min(560px, 90vw);
    max-height: 80vh;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    margin-top: 0;
    transition: none;
  }
}

:root[data-theme="dark"] .tile {
  background: rgba(10, 14, 26, 0.4);
}

.tile-title {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.grid.projects {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rotator {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

:root[data-theme="dark"] .rotator {
  background: rgba(10, 14, 26, 0.4);
}

.rotator-stage {
  display: grid;
  gap: 10px;
  perspective: 900px;
  position: relative;
  isolation: isolate;
}

.rotator-card {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
  padding: 12px;
  display: grid;
  gap: 10px;
  --rotator-zoom: 1.05;
  transform-style: flat;
  backface-visibility: hidden;
  transform: rotateX(calc(var(--p-y, 0) * -6deg)) rotateY(calc(var(--p-x, 0) * 5deg)) rotateZ(calc(var(--p-z, 0) * 2.5deg))
    translateZ(var(--p-pop, 0px)) scale(var(--rotator-zoom));
  transition: transform 260ms ease, box-shadow 220ms ease;
  will-change: transform;
}

/* Prevent occasional GPU z-fighting artifacts during 3D transforms. */
.rotator-card,
.rotator-card * {
  backface-visibility: hidden;
}

/* While actively tracking the pointer, avoid transform transitions (they feel like stutter/lag). */
.rotator-card.is-parallaxing {
  transition: box-shadow 220ms ease;
}

.rotator-card:hover,
.rotator-card:focus-within {
  box-shadow: var(--shadow);
  z-index: 5;
}

.rotator-card.is-parallaxing {
  z-index: 5;
}

.character-media {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  height: var(--character-media-h, 124px);
  transition: height 220ms ease;
}

.character-media img {
  display: block;
  width: 110%;
  height: 110%;
  margin-left: -5%;
  margin-top: -5%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: translateX(var(--p-tx, 0%)) translateY(var(--p-ty, 0%));
  transition: transform 160ms ease;
  will-change: transform;
}

/* Spotlight: treat the image like a "looking glass".
   Keep it fully within the frame, but allow vertical parallax to pan the view.
   (Rolodex keeps the shared cropped/oversized behavior above.) */
.rotator-card .character-media img {
  width: 100%;
  height: 100%;
  margin: 0;
  object-position: 50% 22%;
  transform-origin: 50% 50%;
  transform: translateX(var(--p-tx, 0%)) translateY(var(--p-ty, 0%)) scale(1.14);
}

.rolodex-card .character-media {
  --character-media-h: 100%;
  height: 100%;
}

.rolodex-card .character-media img {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: 50% 50%;
  transform-origin: 50% 50%;
  transform: translateX(var(--p-tx, 0%)) translateY(var(--p-ty, 0%)) scale(1.08);
}

.rotator-card .character-media {
  --character-media-h: clamp(240px, 34vh, 320px);
}

.rolodex-card.is-active:hover,
.rolodex-card.is-active:focus-within {
  z-index: 999;
  --hover-pop: 46px;
  box-shadow: var(--shadow);
}

/* Rolodex image fills remaining card space (no hover expansion). */

.rotator-card:hover .character-media,
.rotator-card:focus-within .character-media {
  --character-media-h: clamp(280px, 42vh, 380px);
}

:root[data-theme="dark"] .rotator-card {
  background: rgba(10, 14, 26, 0.4);
}

.rotator-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rotator-title {
  margin: 0;
  font-size: 16px;
}

.rolodex {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
  padding: 12px;
  margin-top: 10px;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.12), var(--glow-aurora);
}

.characters-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.character-viewer {
  position: relative;
  top: auto;
}

.character-viewer .character-media {
  height: auto;
  --character-media-h: auto;
  max-width: min(820px, 100%);
  margin: 0 auto;
}

.character-viewer .character-media img {
  width: 100%;
  height: auto;
  margin: 0;
  object-fit: contain;
  object-position: 50% 50%;
  transform: none;
  max-height: clamp(300px, 60vh, 640px);
}

.character-viewer [data-character-viewer-body] {
  display: grid;
  gap: 12px;
}

.character-viewer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.character-viewer-media {
  min-width: 0;
  display: flex;
  justify-content: center;
}

.character-viewer-info {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.character-viewer [data-view-section="notes"] {
  display: none;
}

.character-viewer[data-view-mode="notes"] [data-view-section="notes"] {
  display: grid;
}

.character-viewer[data-view-mode="notes"] [data-view-section="image"] {
  display: none;
}

.character-viewer-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.viewer-toggle-button {
  padding: 8px 10px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .character-viewer-grid {
    grid-template-columns: 1fr;
  }

  .character-viewer .character-media img {
    max-height: clamp(320px, 62vh, 640px);
  }
}

.character-viewer-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.character-viewer-sub {
  margin: 0;
}

.character-card-meta {
  display: grid;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.character-card-meta-label {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.character-card-meta-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.character-card-meta-grid dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-card-meta-grid dd {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

.character-card-notes {
  display: grid;
  gap: 4px;
  width: 100%;
}

.character-card-notes-text {
  margin: 0;
  width: 100%;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.3;
  font-size: 13.5px;
}

.character-card-notes-code {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  overflow: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  max-height: 220px;
}

.character-card-notes-code code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11.75px;
  line-height: 1.35;
  white-space: pre;
  max-width: 100%;
}

:root[data-theme="dark"] .rolodex {
  background: rgba(10, 14, 26, 0.4);
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.5), var(--glow-aurora);
}

.rolodex::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at 18% 14%, rgba(34, 211, 238, 0.12), transparent 42%),
    radial-gradient(circle at 78% 0%, rgba(124, 58, 237, 0.12), transparent 46%),
    radial-gradient(circle at 44% 92%, rgba(52, 211, 153, 0.1), transparent 52%);
  opacity: 0.85;
}

.rolodex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.rolodex-search {
  flex: 1 1 240px;
  min-width: 180px;
  max-width: 520px;
}

.rolodex-label {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
}

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

.rolodex-viewport {
  position: relative;
  min-height: 520px;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.25);
  overflow: clip;
  max-width: 100%;
  perspective: 1100px;
  --rolodex-card-w: clamp(160px, 22vw, 240px);
  --rolodex-overlap: clamp(-70px, -6vw, -32px);
  --rolodex-card-h: clamp(320px, 52vh, 410px);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.12), inset 0 0 28px rgba(124, 58, 237, 0.12),
    inset 0 0 22px rgba(34, 211, 238, 0.1), inset 0 0 18px rgba(52, 211, 153, 0.08);
}

:root[data-theme="dark"] .rolodex-viewport {
  background: rgba(10, 14, 26, 0.32);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.16), inset 0 0 34px rgba(124, 58, 237, 0.16),
    inset 0 0 28px rgba(34, 211, 238, 0.12), inset 0 0 22px rgba(52, 211, 153, 0.1);
}

.rolodex-wheel {
  display: flex;
  align-items: center;
  gap: 0;
  height: auto;
  padding: 38px 28px 24px;
  min-height: calc(var(--rolodex-card-h) + 56px);
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 28px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  transform-style: preserve-3d;
  cursor: grab;
}

.rolodex-wheel:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.rolodex-wheel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.rolodex-wheel::-webkit-scrollbar {
  height: 10px;
}

.rolodex-wheel::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}

:root[data-theme="dark"] .rolodex-wheel::-webkit-scrollbar-thumb {
  background: rgba(229, 231, 235, 0.18);
}

.rolodex-card {
  flex: 0 0 var(--rolodex-card-w);
  scroll-snap-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
  padding: 10px;
  display: grid;
  gap: 8px;
  grid-template-rows: 1fr auto auto auto auto;
  height: var(--rolodex-card-h);
  transform-style: preserve-3d;
  transform: rotateY(var(--ry, 0deg)) translateZ(calc(var(--tz, 0px) + var(--hover-pop, 0px))) scale(var(--scale, 1));
  opacity: var(--opacity, 1);
  z-index: var(--z, 1);
  transition: transform 640ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 360ms ease, box-shadow 220ms ease,
    filter 220ms ease;
  will-change: transform, opacity, filter;
}

/* Parallax updates transform every frame; disable transform transitions to prevent jitter. */
.rolodex-card.is-parallaxing {
  transition: opacity 360ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.rolodex-card .project-title {
  font-size: 14px;
}

.rolodex-card .pill {
  padding: 4px 8px;
  font-size: 10px;
}

.rolodex-card .muted {
  font-size: 12px;
  line-height: 1.25;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rolodex-card .tag-row {
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.rolodex-card .tag {
  font-size: 10px;
  padding: 4px 8px;
  white-space: nowrap;
}

.rolodex-card .project-actions {
  gap: 8px;
}

.rolodex-card .button {
  padding: 8px 10px;
  font-size: 12px;
}

.rolodex-card.is-active {
  opacity: 1;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  filter: brightness(1.06) saturate(1.04);
}

:root[data-theme="dark"] .rolodex-card.is-active {
  background: var(--surface-strong);
}

.rolodex-card + .rolodex-card {
  margin-left: var(--rolodex-overlap);
}

:root[data-theme="dark"] .rolodex-card {
  background: rgba(10, 14, 26, 0.4);
}

.rolodex-card.is-hidden {
  pointer-events: none;
}

.rolodex-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .rolodex-card {
    transition: none;
    animation: none;
    --swing: 0deg;
  }

  .rotator-card {
    transition: none;
    transform: none;
  }

  .character-media img {
    transition: none;
    transform: none;
  }
}

@media (max-width: 700px) {
  .rolodex-viewport {
    min-height: 460px;
    --rolodex-card-w: clamp(132px, 46vw, 190px);
    --rolodex-overlap: clamp(-58px, -12vw, -26px);
    --rolodex-card-h: clamp(300px, 56vh, 380px);
  }
}

.project {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
  padding: 12px;
  display: grid;
  gap: 10px;
}

:root[data-theme="dark"] .project {
  background: rgba(10, 14, 26, 0.4);
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-title {
  margin: 0;
  font-size: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(34, 211, 238, 0.12), rgba(52, 211, 153, 0.1));
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.tag {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
  color: var(--muted);
}

:root[data-theme="dark"] .tag {
  background: rgba(10, 14, 26, 0.35);
}

.project-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.label {
  font-weight: 800;
}

.input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--button-border);
  background: rgba(255, 255, 255, 0.65);
  color: var(--fg);
  padding: 10px 12px;
  font: inherit;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06), var(--glow-aurora);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

:root[data-theme="dark"] .input {
  background: rgba(10, 14, 26, 0.5);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.help {
  margin: 0;
  min-height: 18px;
  color: var(--muted);
}

.help.error {
  color: #ef4444;
}

.input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: rgba(109, 40, 217, 0.35);
  filter: brightness(1.01);
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  appearance: none;
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  color: var(--button-fg);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08), var(--glow-aurora);
  transition: transform 140ms ease, filter 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

:root[data-theme="dark"] .button {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(34, 211, 238, 0.18), 0 0 36px rgba(124, 58, 237, 0.16),
    0 0 28px rgba(34, 211, 238, 0.14), 0 0 22px rgba(52, 211, 153, 0.12);
}

.button:active {
  transform: translateY(1px);
  filter: brightness(1.01);
}

.button[aria-disabled="true"]:hover {
  filter: none;
}

.button[aria-disabled="true"]:active {
  transform: none;
}

.button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.button.primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: transparent;
  box-shadow: 0 18px 56px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(34, 211, 238, 0.18), 0 0 44px rgba(124, 58, 237, 0.2),
    0 0 34px rgba(34, 211, 238, 0.18), 0 0 26px rgba(52, 211, 153, 0.14);
}

.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .input {
    transition: none;
  }
}

.to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.site-footer .container {
  padding-top: 18px;
  padding-bottom: 26px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 900px) {
  .grid.stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(var(--header-h) - 6px);
    right: 16px;
    left: 16px;
    border-radius: 14px;
    padding: 10px;
    background: var(--surface-strong);
  }

  :root[data-theme="dark"] .nav-links {
    background: var(--surface-strong);
  }

  .site-nav.is-open .nav-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .grid.cards {
    grid-template-columns: 1fr;
  }

  .grid.projects {
    grid-template-columns: 1fr;
  }
}
