/* MBTI313 shared premium visual layer */
:root {
  color-scheme: dark;
  --lab-bg-0: #03040d;
  --lab-bg-1: #070a19;
  --lab-bg-2: #0c1230;
  --lab-glass: rgba(12, 18, 42, 0.72);
  --lab-glass-strong: rgba(16, 24, 56, 0.84);
  --lab-line: rgba(202, 218, 255, 0.15);
  --lab-line-hot: rgba(98, 230, 255, 0.36);
  --lab-text: #f8fbff;
  --lab-soft: rgba(230, 237, 255, 0.76);
  --lab-muted: rgba(161, 177, 214, 0.72);
  --lab-cyan: #35d8ff;
  --lab-blue: #6f8dff;
  --lab-violet: #9d74ff;
  --lab-pink: #e879f9;
  --lab-green: #75f7d2;
  --lab-radius: 22px;
  --lab-radius-lg: 30px;
  --lab-shadow:
    0 34px 100px rgba(0, 0, 0, 0.72),
    0 16px 46px rgba(80, 108, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.11);
  --bg-primary: var(--lab-bg-0);
  --bg-secondary: var(--lab-bg-2);
  --bg-card: var(--lab-glass);
  --bg-elevated: rgba(24, 34, 76, 0.86);
  --accent-primary: var(--lab-violet);
  --accent-secondary: var(--lab-cyan);
  --accent-glow: rgba(53, 216, 255, 0.24);
  --border-subtle: var(--lab-line);
  --border-glow: var(--lab-line-hot);
  --text-primary: var(--lab-text);
  --text-secondary: var(--lab-soft);
  --text-muted: var(--lab-muted);
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--lab-bg-0);
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  color: var(--lab-text);
  background:
    radial-gradient(circle at 14% 12%, rgba(111, 141, 255, 0.24), transparent 30%),
    radial-gradient(circle at 84% 18%, rgba(53, 216, 255, 0.17), transparent 27%),
    radial-gradient(circle at 72% 86%, rgba(157, 116, 255, 0.24), transparent 32%),
    linear-gradient(135deg, rgba(3, 4, 13, 0.98), rgba(8, 12, 30, 0.96) 45%, rgba(6, 9, 22, 0.98)) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.64;
  background:
    linear-gradient(116deg, transparent 0 13%, rgba(111, 141, 255, 0.12) 13.12% 13.32%, transparent 13.5% 100%),
    linear-gradient(58deg, transparent 0 24%, rgba(53, 216, 255, 0.10) 24.1% 24.35%, transparent 24.55% 100%),
    radial-gradient(circle at 18% 32%, rgba(53, 216, 255, 0.52) 0 1px, transparent 2px),
    radial-gradient(circle at 38% 64%, rgba(157, 116, 255, 0.58) 0 1px, transparent 2px),
    radial-gradient(circle at 68% 26%, rgba(117, 247, 210, 0.42) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 70%, rgba(232, 121, 249, 0.38) 0 1px, transparent 2px);
  background-size: 100% 100%, 100% 100%, 124px 124px, 158px 158px, 142px 142px, 172px 172px;
  animation: labNetworkDrift 26s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(169, 187, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 187, 255, 0.026) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
}

body > * {
  position: relative;
  z-index: 1;
}

.floating-orb,
.orb {
  opacity: 0.34 !important;
  filter: blur(90px) !important;
  contain: paint;
}

.orb-1,
.floating-orb.orb-1 {
  background: rgba(111, 141, 255, 0.24) !important;
  right: 0 !important;
}

.orb-2,
.floating-orb.orb-2 {
  background: rgba(53, 216, 255, 0.18) !important;
  left: 0 !important;
}

.orb-3,
.floating-orb.orb-3 {
  background: rgba(157, 116, 255, 0.20) !important;
}

.grid-overlay {
  opacity: 0.42;
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
}

.particles .particle,
.particle {
  background: rgba(53, 216, 255, 0.46) !important;
  box-shadow: 0 0 15px rgba(53, 216, 255, 0.36);
}

header,
.container,
.card,
.content-card,
.story-card,
.stats-section,
.platform-section,
.cta-card,
.social-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.032)),
    radial-gradient(circle at 16% 0%, rgba(53, 216, 255, 0.11), transparent 32%),
    radial-gradient(circle at 84% 10%, rgba(157, 116, 255, 0.14), transparent 38%),
    var(--lab-glass) !important;
  border: 1px solid var(--lab-line) !important;
  border-radius: var(--lab-radius-lg) !important;
  box-shadow: var(--lab-shadow) !important;
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

header,
.about-hero,
.contact-hero,
.container,
.card {
  isolation: isolate;
}

header::before,
.container::before,
.card::before,
.content-card::before,
.story-card::before,
.platform-section::before,
.cta-card::before,
.social-card::before {
  background: linear-gradient(135deg, rgba(117, 247, 210, 0.55), rgba(111, 141, 255, 0.12), rgba(157, 116, 255, 0.48), rgba(232, 121, 249, 0.18)) !important;
}

h1,
.hero-title,
.title-line,
.welcome-title,
.result-type,
.footer-brand,
.stat-number {
  color: var(--lab-text);
  background: linear-gradient(135deg, #ffffff, #dbeafe 26%, var(--lab-cyan), var(--lab-violet), #ffffff) !important;
  background-size: 240% 240% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow:
    0 0 22px rgba(53, 216, 255, 0.20),
    0 0 44px rgba(157, 116, 255, 0.18);
}

p,
.intro-text,
.lead-text,
.story-card p,
.section-desc,
.vision-text,
.result-desc,
.stat-label,
.footer-copy,
#instructions p,
.instruction-list li {
  color: var(--lab-soft) !important;
}

strong,
.hero-badge,
.dropdown-item.active,
.choice-card strong,
#instructions strong,
.instruction-list li::before,
.card-label {
  color: var(--lab-cyan) !important;
}

.hero-badge,
.result-kicker,
.question-counter,
#instructions .highlight,
.card-tag {
  color: rgba(229, 247, 255, 0.92) !important;
  background: rgba(53, 216, 255, 0.075) !important;
  border: 1px solid rgba(53, 216, 255, 0.18) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.menu-dots {
  background:
    linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.035)),
    rgba(11, 16, 36, 0.86) !important;
  border: 1px solid rgba(202, 218, 255, 0.16) !important;
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.54),
    0 0 28px rgba(53, 216, 255, 0.10) !important;
}

.menu-dots:hover {
  border-color: rgba(53, 216, 255, 0.40) !important;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(53, 216, 255, 0.18) !important;
}

#hamburger span {
  background: linear-gradient(90deg, #f8fbff, var(--lab-cyan)) !important;
}

.menu-dots.active #hamburger span {
  background: var(--lab-cyan) !important;
}

.dropdown-menu {
  background:
    linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.035)),
    rgba(10, 15, 34, 0.92) !important;
  border: 1px solid rgba(202, 218, 255, 0.15) !important;
  border-radius: 20px !important;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.dropdown-item {
  color: var(--lab-soft) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  border: 1px solid transparent !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: #ffffff !important;
  background: rgba(53, 216, 255, 0.09) !important;
  border-color: rgba(53, 216, 255, 0.18) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28), 0 0 22px rgba(53, 216, 255, 0.10) !important;
}

button,
.btn,
.test-links a.btn,
.cta-button,
.start-btn,
.nav-btn,
.scale-btn {
  border-radius: 18px !important;
  color: #ffffff;
  border: 1px solid rgba(202, 218, 255, 0.14) !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.032)),
    rgba(14, 21, 50, 0.80) !important;
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease !important;
}

#next-btn,
#start-btn,
#ready-btn,
.start-btn,
.cta-button {
  background: linear-gradient(135deg, var(--lab-blue), var(--lab-violet), var(--lab-cyan)) !important;
  background-size: 220% 220% !important;
  border-color: rgba(117, 247, 210, 0.24) !important;
  box-shadow:
    0 18px 42px rgba(53, 216, 255, 0.22),
    0 10px 30px rgba(111, 141, 255, 0.26) !important;
  animation: labAurora 5.5s ease-in-out infinite;
}

button:hover,
.btn:hover,
.test-links a.btn:hover,
.cta-button:hover,
.start-btn:hover,
.nav-btn:hover:not(:disabled),
.scale-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(53, 216, 255, 0.42) !important;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.38),
    0 0 34px rgba(53, 216, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.13) !important;
}

button:active,
.btn:active,
.test-links a.btn:active,
.cta-button:active,
.start-btn:active,
.nav-btn:active,
.scale-btn:active {
  transform: translateY(1px) scale(0.985) !important;
}

.scale-btn.selected {
  border-color: rgba(117, 247, 210, 0.72) !important;
  background:
    radial-gradient(circle at 14% 20%, rgba(117, 247, 210, 0.22), transparent 30%),
    linear-gradient(145deg, rgba(111, 141, 255, 0.34), rgba(157, 116, 255, 0.25)) !important;
  box-shadow:
    0 0 0 1px rgba(117, 247, 210, 0.20),
    0 16px 38px rgba(0, 0, 0, 0.34),
    0 0 34px rgba(53, 216, 255, 0.27),
    0 0 54px rgba(157, 116, 255, 0.18) !important;
}

.progress-bar,
.score-track,
.split-track {
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    rgba(2, 6, 23, 0.66) !important;
  border: 1px solid rgba(202, 218, 255, 0.11);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.52),
    0 0 30px rgba(53, 216, 255, 0.10) !important;
}

.progress-fill,
.score-fill,
.split-fill {
  background: linear-gradient(90deg, var(--lab-violet), var(--lab-blue), var(--lab-cyan)) !important;
  box-shadow: 0 0 18px rgba(53, 216, 255, 0.42);
}

.choice-card,
.stat-card,
.breakdown-card,
.score-row {
  background:
    linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.026)),
    rgba(8, 13, 31, 0.62) !important;
  border: 1px solid rgba(202, 218, 255, 0.13) !important;
  border-radius: 18px !important;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

#type-matches .score-row:first-child,
.result-type {
  filter: none !important;
}

#type-matches .score-row:first-child {
  border-color: rgba(117, 247, 210, 0.44) !important;
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.32),
    0 0 38px rgba(53, 216, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
}

.platform-icon,
.card-icon,
.visual-circle {
  color: var(--lab-cyan) !important;
  background: linear-gradient(135deg, rgba(53, 216, 255, 0.14), rgba(157, 116, 255, 0.11)) !important;
  border: 1px solid rgba(202, 218, 255, 0.13) !important;
  box-shadow: 0 0 24px rgba(53, 216, 255, 0.12);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--lab-violet), var(--lab-cyan)) !important;
}

::selection {
  background: rgba(53, 216, 255, 0.26);
  color: #ffffff;
}

@keyframes labNetworkDrift {
  from { background-position: 0 0, 0 0, 0 0, 20px 30px, 70px 10px, 10px 80px; }
  to { background-position: 0 0, 0 0, 34px -22px, -18px 42px, 24px 66px, 56px 18px; }
}

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

@media (hover: hover) and (pointer: fine) {
  .container.tilt-enabled,
  .card.tilt-enabled {
    will-change: auto;
  }

  .container.tilt-active,
  .card.tilt-active {
    will-change: transform;
  }
}

/* Performance pass: keep the lab mood while limiting paint-heavy permanent work. */
body::before {
  animation-duration: 52s;
  opacity: 0.46;
}

.floating-orb,
.orb {
  filter: blur(54px) !important;
  transform: translateZ(0);
}

header,
.container,
.card,
.content-card,
.story-card,
.stats-section,
.platform-section,
.cta-card,
.social-card {
  box-shadow:
    0 22px 58px rgba(0, 0, 0, 0.56),
    0 8px 24px rgba(80, 108, 255, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
  backdrop-filter: blur(12px) saturate(128%);
  -webkit-backdrop-filter: blur(12px) saturate(128%);
}

.choice-card,
.stat-card,
.breakdown-card,
.score-row,
.dropdown-item {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.card::before,
.container::before,
.content-card::before,
.story-card::before,
.platform-section::before,
.cta-card::before,
.social-card::before {
  animation: none !important;
}

.card::after,
.container::after,
.dropdown-item::before,
.start-btn::before,
.cta-button::before,
.scale-btn::before,
.nav-btn::before {
  transition-property: transform, opacity !important;
}

#next-btn,
#start-btn,
#ready-btn,
.start-btn,
.cta-button,
.progress-fill,
.score-fill,
.split-fill,
h1,
.hero-title,
.title-line,
.welcome-title,
.result-type,
.footer-brand,
.stat-number {
  animation-duration: 9s !important;
}

.progress-fill {
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.scale-btn.selected {
  animation: choiceConfirm 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}

#hamburger span {
  transition: transform 0.24s ease, opacity 0.18s ease, background 0.2s ease !important;
}

.menu-dots.active #hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg) !important;
}

.menu-dots.active #hamburger span:nth-child(2) {
  opacity: 0 !important;
  transform: scaleX(0.2) !important;
}

.menu-dots.active #hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg) !important;
}

.effects-paused *,
.effects-paused *::before,
.effects-paused *::after {
  animation-play-state: paused !important;
}

.perf-lite body::before,
.touch-motion body::before {
  animation: none !important;
  opacity: 0.30;
}

.perf-lite .particle:nth-of-type(n+5),
.touch-motion .particle,
.perf-lite .particles .particle:nth-child(n+5),
.touch-motion .particles .particle {
  display: none !important;
}

.perf-lite .floating-orb,
.perf-lite .orb,
.touch-motion .floating-orb,
.touch-motion .orb {
  filter: blur(34px) !important;
  opacity: 0.20 !important;
  animation: none !important;
}

.perf-lite header,
.perf-lite .container,
.perf-lite .card,
.perf-lite .content-card,
.perf-lite .story-card,
.perf-lite .stats-section,
.perf-lite .platform-section,
.perf-lite .cta-card,
.perf-lite .social-card,
.touch-motion header,
.touch-motion .container,
.touch-motion .card,
.touch-motion .content-card,
.touch-motion .story-card,
.touch-motion .stats-section,
.touch-motion .platform-section,
.touch-motion .cta-card,
.touch-motion .social-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.026)),
    rgba(10, 16, 38, 0.88) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.perf-lite .card,
.touch-motion .card {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease !important;
}

.perf-lite .fade-in,
.touch-motion .fade-in {
  animation: none !important;
}

.perf-lite #question-text,
.touch-motion #question-text,
.perf-lite .choice-card,
.touch-motion .choice-card,
.perf-lite .scale-btn,
.touch-motion .scale-btn {
  animation: none !important;
}

.result-card {
  animation: resultReveal 0.46s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

.result-type {
  animation: resultReveal 0.52s cubic-bezier(0.16, 1, 0.3, 1) both !important;
  text-shadow:
    0 0 18px rgba(53, 216, 255, 0.34),
    0 0 34px rgba(157, 116, 255, 0.22) !important;
}

.result-type::after {
  filter: none !important;
  opacity: 0.72;
}

.score-fill,
.split-fill {
  animation-duration: 0.52s !important;
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes labPanelIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

@media (max-width: 760px), (hover: none), (pointer: coarse) {
  body {
    background-attachment: scroll !important;
    perspective: none !important;
  }

  .container,
  .card {
    transform: none !important;
  }
}

@media (max-width: 640px) {
  body {
    padding-inline: 10px;
  }

  header,
  .container,
  .card,
  .content-card,
  .story-card,
  .stats-section,
  .platform-section,
  .cta-card,
  .social-card {
    border-radius: 20px !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body::before,
  .grid-overlay {
    animation: none !important;
  }

  .dropdown-menu {
    max-width: calc(100vw - 32px);
  }

  button,
  .btn,
  .test-links a.btn,
  .cta-button,
  .start-btn,
  .nav-btn,
  .scale-btn {
    min-width: 0;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .container,
  .card {
    transform: none !important;
  }
}
