:root {
  color-scheme: light;
  --slate-950: hsl(222 47% 11%);
  --slate-900: hsl(222 47% 15%);
  --slate-800: hsl(215 28% 22%);
  --slate-700: hsl(215 20% 35%);
  --slate-600: hsl(215 16% 47%);
  --slate-300: hsl(213 27% 84%);
  --slate-200: hsl(214 32% 91%);
  --slate-100: hsl(210 40% 96%);
  --slate-50: hsl(210 40% 98%);
  --brand: hsl(188 92% 38%);
  --brand-dark: hsl(192 82% 31%);
  --brand-light: hsl(185 96% 90%);
  --wealth: hsl(142 72% 35%);
  --wealth-light: hsl(141 84% 93%);
  --indigo: hsl(243 75% 59%);
  --ring: hsl(188 92% 45% / 0.32);
  --glass: hsl(0 0% 100% / 0.78);
  --glass-strong: hsl(0 0% 100% / 0.9);
  --border: hsl(214 32% 91% / 0.85);
  --shadow-soft: 0 20px 60px hsl(222 47% 11% / 0.12);
  --shadow-card: 0 18px 50px hsl(222 47% 11% / 0.1);
  --shadow-glow: 0 24px 80px hsl(188 92% 42% / 0.24);
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
}

.dark {
  color-scheme: dark;
  --slate-950: hsl(222 84% 5%);
  --slate-900: hsl(222 47% 11%);
  --slate-800: hsl(217 33% 17%);
  --slate-700: hsl(215 25% 27%);
  --slate-600: hsl(215 20% 65%);
  --slate-300: hsl(213 27% 84%);
  --slate-200: hsl(214 32% 91%);
  --slate-100: hsl(222 47% 13%);
  --slate-50: hsl(222 84% 5%);
  --brand: hsl(188 86% 53%);
  --brand-dark: hsl(188 92% 38%);
  --brand-light: hsl(188 86% 18%);
  --wealth: hsl(142 70% 45%);
  --wealth-light: hsl(142 60% 14%);
  --indigo: hsl(243 75% 68%);
  --ring: hsl(188 86% 53% / 0.38);
  --glass: hsl(222 47% 11% / 0.68);
  --glass-strong: hsl(222 47% 11% / 0.9);
  --border: hsl(0 0% 100% / 0.12);
  --shadow-soft: 0 24px 70px hsl(0 0% 0% / 0.36);
  --shadow-card: 0 20px 56px hsl(0 0% 0% / 0.3);
  --shadow-glow: 0 26px 90px hsl(188 92% 42% / 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
div,
a,
button,
label,
legend,
input,
textarea,
select,
article,
section,
li,
td,
th {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

img,
video,
canvas {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
  filter: grayscale(0.2);
}

[hidden],
.hidden {
  display: none !important;
}

::selection {
  color: white;
  background: hsl(188 92% 32%);
}

.dark ::selection {
  color: hsl(222 84% 5%);
  background: hsl(188 86% 60%);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: hsl(210 40% 96%);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, hsl(188 92% 38%), hsl(142 72% 35%));
  border: 3px solid hsl(210 40% 96%);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, hsl(192 82% 31%), hsl(142 76% 30%));
}

.dark ::-webkit-scrollbar-track {
  background: hsl(222 84% 5%);
}

.dark ::-webkit-scrollbar-thumb {
  border-color: hsl(222 84% 5%);
  background: linear-gradient(180deg, hsl(188 86% 53%), hsl(142 70% 45%));
}

:focus-visible {
  outline: 3px solid hsl(188 92% 38% / 0.85);
  outline-offset: 3px;
}

.dark :focus-visible {
  outline-color: hsl(188 86% 60% / 0.9);
}

#appShell {
  isolation: isolate;
}

#backgroundLayer {
  contain: layout paint;
}

#backgroundLayer > div:nth-child(n + 3) {
  animation: floatOrb 11s ease-in-out infinite alternate;
  will-change: transform;
}

#backgroundLayer > div:nth-child(4) {
  animation-duration: 14s;
  animation-delay: -3s;
}

#backgroundLayer > div:nth-child(5) {
  animation-duration: 16s;
  animation-delay: -6s;
}

#siteHeader {
  box-shadow: 0 1px 0 hsl(0 0% 100% / 0.55), 0 10px 34px hsl(222 47% 11% / 0.07);
}

.dark #siteHeader {
  box-shadow: 0 1px 0 hsl(0 0% 100% / 0.08), 0 12px 38px hsl(0 0% 0% / 0.28);
}

#brandLogoLink,
#desktopNavigationLinks a,
#mobileNavigationPanel a,
#headerActions button,
#heroActions a,
#heroActions button,
#scenarioActions button,
#chartViewToggleGroup button,
#advancedSettingsToggle,
#faqAccordion button {
  position: relative;
  overflow: hidden;
}

#brandLogoLink::after,
#desktopNavigationLinks a::after,
#mobileNavigationPanel a::after,
#headerActions button::after,
#heroActions a::after,
#heroActions button::after,
#scenarioActions button::after,
#chartViewToggleGroup button::after,
#advancedSettingsToggle::after,
#faqAccordion button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 20%, hsl(0 0% 100% / 0.34), transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

#brandLogoLink:hover::after,
#desktopNavigationLinks a:hover::after,
#mobileNavigationPanel a:hover::after,
#headerActions button:hover::after,
#heroActions a:hover::after,
#heroActions button:hover::after,
#scenarioActions button:hover::after,
#chartViewToggleGroup button:hover::after,
#advancedSettingsToggle:hover::after,
#faqAccordion button:hover::after {
  transform: translateX(120%);
}

#brandLogoLink span:first-child {
  background-image: radial-gradient(circle at 30% 20%, hsl(188 86% 60% / 0.45), transparent 38%),
    linear-gradient(135deg, hsl(222 47% 11%), hsl(188 92% 28%));
}

.dark #brandLogoLink span:first-child {
  background-image: linear-gradient(135deg, hsl(188 86% 60%), hsl(142 70% 55%));
}

#mobileNavigationPanel {
  animation: slideDown 0.24s ease both;
}

#top,
#calculator,
#insights,
#faq {
  animation: fadeUp 0.7s ease both;
}

#calculator {
  animation-delay: 0.08s;
}

#insights {
  animation-delay: 0.12s;
}

#faq {
  animation-delay: 0.16s;
}

#heroTitle {
  letter-spacing: -0.055em;
  line-height: 0.94;
  text-wrap: balance;
}

#heroDescription,
#calculator p,
#insights p,
#faq p {
  text-wrap: pretty;
}

#heroContent > div:first-child {
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.88), 0 12px 36px hsl(188 92% 38% / 0.12);
}

#heroTrustStats > div,
#heroPreviewCard > div,
#calculatorForm,
#chartCard,
#recommendationsCard,
#insights article,
#faqAccordion article {
  position: relative;
  overflow: hidden;
}

#heroTrustStats > div::before,
#heroPreviewCard > div::before,
#calculatorForm::before,
#chartCard::before,
#recommendationsCard::before,
#insights article::before,
#faqAccordion article::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, hsl(0 0% 100% / 0.68), transparent 38%, hsl(188 92% 70% / 0.12));
  opacity: 0.85;
}

.dark #heroTrustStats > div::before,
.dark #heroPreviewCard > div::before,
.dark #calculatorForm::before,
.dark #chartCard::before,
.dark #recommendationsCard::before,
.dark #insights article::before,
.dark #faqAccordion article::before {
  background: linear-gradient(135deg, hsl(0 0% 100% / 0.12), transparent 42%, hsl(188 86% 53% / 0.08));
}

#heroTrustStats > div > *,
#heroPreviewCard > div > *,
#calculatorForm > *,
#chartCard > *,
#recommendationsCard > *,
#insights article > *,
#faqAccordion article > * {
  position: relative;
  z-index: 1;
}

#heroTrustStats > div,
#heroPreviewCard > div,
#calculatorForm,
#chartCard,
#recommendationsCard,
#insights article,
#faqAccordion article {
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background-color 0.28s ease;
}

#heroTrustStats > div:hover,
#heroPreviewCard > div:hover,
#chartCard:hover,
#recommendationsCard:hover,
#insights article:hover,
#faqAccordion article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: hsl(188 92% 55% / 0.36);
}

#heroPreviewCard .bg-gradient-to-br,
#primaryResultsCard {
  background-image: radial-gradient(circle at 15% 10%, hsl(188 86% 60% / 0.28), transparent 34%),
    radial-gradient(circle at 86% 0%, hsl(142 70% 50% / 0.18), transparent 36%),
    linear-gradient(135deg, hsl(222 47% 11%), hsl(192 82% 24%));
}

#heroPreviewBalance,
#finalBalanceResult {
  text-shadow: 0 12px 34px hsl(0 0% 0% / 0.22);
}

#heroPreviewProgressBar {
  position: relative;
  overflow: hidden;
  animation: progressGrow 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#heroPreviewProgressBar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, hsl(0 0% 100% / 0.55), transparent);
  transform: translateX(-100%);
  animation: shimmer 2.2s ease-in-out infinite;
}

#scenarioActions button,
#heroStartButton,
#loadSampleScenarioButton,
#calculateButton,
#resetCalculatorButton,
#themeToggleButton,
#mobileMenuButton {
  min-height: 44px;
}

#calculateButton,
#heroStartButton,
#mobileMenuButton {
  color: white;
  background-image: linear-gradient(135deg, hsl(222 47% 11%), hsl(188 92% 32%));
  box-shadow: 0 18px 44px hsl(188 92% 32% / 0.28);
}

#calculateButton:hover,
#heroStartButton:hover,
#mobileMenuButton:hover {
  background-image: linear-gradient(135deg, hsl(188 92% 28%), hsl(142 72% 30%));
}

.dark #calculateButton,
.dark #heroStartButton,
.dark #mobileMenuButton {
  color: hsl(222 84% 5%);
  background-image: linear-gradient(135deg, hsl(188 86% 60%), hsl(142 70% 58%));
  box-shadow: 0 18px 48px hsl(188 86% 53% / 0.22);
}

.dark #calculateButton:hover,
.dark #heroStartButton:hover,
.dark #mobileMenuButton:hover {
  background-image: linear-gradient(135deg, hsl(185 96% 72%), hsl(142 76% 66%));
}

#loadSampleScenarioButton,
#resetCalculatorButton,
#themeToggleButton {
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.78), 0 10px 24px hsl(222 47% 11% / 0.08);
}

.dark #loadSampleScenarioButton,
.dark #resetCalculatorButton,
.dark #themeToggleButton {
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.12), 0 10px 26px hsl(0 0% 0% / 0.24);
}

fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

legend {
  max-width: 100%;
}

label {
  display: block;
  min-width: 0;
}

input,
textarea,
select {
  max-width: 100%;
  min-width: 0;
  caret-color: var(--brand);
}

input::placeholder,
textarea::placeholder {
  color: hsl(215 16% 47% / 0.78);
}

.dark input::placeholder,
.dark textarea::placeholder {
  color: hsl(213 27% 84% / 0.58);
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

#calculatorForm input,
#calculatorForm .flex.rounded-2xl {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

#calculatorForm input:hover,
#calculatorForm .flex.rounded-2xl:hover {
  border-color: hsl(188 92% 38% / 0.62);
}

#calculatorForm input:focus,
#calculatorForm .flex.rounded-2xl:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px var(--ring), 0 12px 28px hsl(188 92% 38% / 0.08);
}

#advancedSettingsPanel {
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.72);
}

.dark #advancedSettingsPanel {
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.08);
}

#advancedSettingsContent {
  animation: fadeUp 0.24s ease both;
}

#primaryResultsCard {
  position: relative;
  overflow: hidden;
}

#primaryResultsCard::before {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  background: radial-gradient(circle at 20% 0%, hsl(188 86% 60% / 0.34), transparent 32%),
    radial-gradient(circle at 90% 30%, hsl(142 70% 55% / 0.2), transparent 30%);
}

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

#primaryResultsCard .bg-white\/10,
#heroPreviewCard .bg-white\/10 {
  border: 1px solid hsl(0 0% 100% / 0.12);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.12);
}

#projectionChartContainer {
  position: relative;
  min-width: 0;
  background-image: linear-gradient(hsl(222 47% 11% / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, hsl(222 47% 11% / 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

.dark #projectionChartContainer {
  background-image: linear-gradient(hsl(0 0% 100% / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, hsl(0 0% 100% / 0.06) 1px, transparent 1px);
}

#projectionChartCanvas {
  display: block;
}

#chartFallback {
  animation: pulseSoft 2.4s ease-in-out infinite;
}

#chartViewToggleGroup {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

#chartViewToggleGroup::-webkit-scrollbar {
  display: none;
}

#chartViewToggleGroup button {
  white-space: nowrap;
}

#recommendationsList > div,
#insights article {
  transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

#recommendationsList > div:hover,
#insights article:hover {
  transform: translateY(-3px);
}

#insights article div:first-child {
  box-shadow: 0 14px 30px hsl(222 47% 11% / 0.16);
}

#insightEmployerMatch div:first-child {
  background-image: linear-gradient(135deg, hsl(142 72% 35%), hsl(160 84% 30%));
}

#insightCompounding div:first-child {
  background-image: linear-gradient(135deg, hsl(188 92% 34%), hsl(192 82% 26%));
}

#insightInflation div:first-child {
  background-image: linear-gradient(135deg, hsl(243 75% 45%), hsl(266 85% 48%));
}

#faqAccordion article {
  scroll-margin-top: 110px;
}

#faqAccordion button {
  border-radius: 1.25rem;
  padding: 0.25rem;
}

#faqAccordion button span:first-child {
  line-height: 1.25;
}

#faqAccordion p[id^="faqAnswer"] {
  animation: fadeUp 0.24s ease both;
}

a,
button {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter;
  transition-duration: 180ms;
  transition-timing-function: ease;
}

a:hover,
button:hover {
  text-decoration: none;
}

a:active,
button:active {
  transform: scale(0.98);
}

@supports (backdrop-filter: blur(18px)) {
  #siteHeader,
  #mobileNavigationPanel,
  #heroTrustStats > div,
  #heroPreviewCard > div,
  #calculatorForm,
  #chartCard,
  #recommendationsCard,
  #insights article,
  #faqAccordion article {
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
  }
}

@supports not (backdrop-filter: blur(18px)) {
  #siteHeader,
  #mobileNavigationPanel,
  #heroTrustStats > div,
  #heroPreviewCard > div,
  #calculatorForm,
  #chartCard,
  #recommendationsCard,
  #insights article,
  #faqAccordion article {
    background-color: var(--glass-strong) !important;
  }
}

.loading,
[aria-busy="true"] {
  pointer-events: none;
  position: relative;
}

.loading::before,
[aria-busy="true"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  border-radius: inherit;
  background: hsl(0 0% 100% / 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.loading::after,
[aria-busy="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 21;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid hsl(188 92% 38% / 0.25);
  border-top-color: hsl(188 92% 38%);
  border-radius: 999px;
  animation: spin 0.85s linear infinite;
}

.dark .loading::before,
.dark [aria-busy="true"]::before {
  background: hsl(222 84% 5% / 0.58);
}

.modal,
[role="dialog"],
[aria-modal="true"] {
  z-index: 9999;
}

.modal.hidden,
[role="dialog"].hidden,
[aria-modal="true"].hidden,
.modal[hidden],
[role="dialog"][hidden],
[aria-modal="true"][hidden] {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

@media (max-width: 1023px) {
  #siteHeader {
    position: sticky;
  }

  #heroTitle {
    line-height: 0.98;
  }

  #primaryResultsCard,
  #chartCard,
  #recommendationsCard,
  #calculatorForm {
    border-radius: 1.6rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  #mainNavigation {
    gap: 0.65rem;
  }

  #brandLogoLink {
    max-width: calc(100vw - 160px);
  }

  #brandLogoLink span:first-child {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 1rem;
  }

  #themeToggleButton,
  #mobileMenuButton {
    padding-inline: 0.85rem;
  }

  #heroTitle {
    font-size: clamp(2.55rem, 13vw, 4rem);
    letter-spacing: -0.045em;
  }

  #heroDescription {
    font-size: 1rem;
    line-height: 1.75;
  }

  #heroActions a,
  #heroActions button,
  #scenarioActions button {
    width: 100%;
  }

  #heroPreviewBalance,
  #finalBalanceResult {
    font-size: clamp(2.35rem, 11vw, 3.65rem);
  }

  #chartViewToggleGroup {
    width: 100%;
  }

  #chartViewToggleGroup button {
    flex: 1 0 auto;
  }

  #projectionChartContainer,
  #chartFallback {
    min-height: 16rem;
  }

  #projectionChartCanvas {
    height: 16rem;
  }
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatOrb {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(22px, -18px, 0) scale(1.08);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-110%);
  }

  55%,
  100% {
    transform: translateX(110%);
  }
}

@keyframes progressGrow {
  from {
    width: 0;
  }
}

@keyframes pulseSoft {
  0%,
  100% {
    opacity: 0.72;
  }

  50% {
    opacity: 1;
  }
}

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