@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;600;700;800&family=DM+Sans:wght@400;500;700&display=swap");

:root {
  color-scheme: light;
  --color-navy: #0b1120;
  --color-offwhite: #f8f7f4;
  --color-teal: #00d4aa;
  --color-amber: #f59e0b;
  --color-slate: #64748b;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text-primary: #0f172a;
  --color-text-muted: #64748b;
  --dark-color-navy: #020617;
  --dark-color-offwhite: #f8f7f4;
  --dark-color-teal: #2ae8bf;
  --dark-color-amber: #fbbf24;
  --dark-color-slate: #94a3b8;
  --dark-color-surface: #1e293b;
  --dark-color-border: #334155;
  --dark-color-text-primary: #f8f7f4;
  --dark-color-text-muted: #cbd5e1;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 28px 64px rgba(15, 23, 42, 0.14);
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --container-width: 1200px;
  --nav-height: 64px;
  --page-background:
    radial-gradient(circle at top left, rgba(0, 212, 170, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--color-offwhite) 100%);
}

html.dark {
  color-scheme: dark;
  --color-offwhite: #0b1120;
  --color-surface: #1e293b;
  --color-border: #334155;
  --color-text-primary: #f8f7f4;
  --color-text-muted: #cbd5e1;
  --page-background:
    radial-gradient(circle at top left, rgba(0, 212, 170, 0.12), transparent 35%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 30%),
    linear-gradient(180deg, #020617 0%, #0b1120 100%);
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 320px;
  font-family: "DM Sans", sans-serif;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--page-background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

img,
picture,
svg,
canvas {
  display: block;
  max-width: 100%;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Bricolage Grotesque", sans-serif;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
}

p {
  color: var(--color-text-muted);
}

::selection {
  color: var(--color-navy);
  background: rgba(0, 212, 170, 0.28);
}

:focus-visible {
  outline: 3px solid rgba(0, 212, 170, 0.35);
  outline-offset: 3px;
}

.container {
  width: min(100%, var(--container-width));
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--nav-height);
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

html.dark .site-header {
  background: rgba(11, 17, 32, 0.9);
}

.nav-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-lg);
  min-height: var(--nav-height);
}

.brand,
.nav-logo {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-navy);
}

.brand-accent,
.logo-accent {
  color: var(--color-teal);
}

html.dark .brand,
html.dark .nav-logo {
  color: var(--color-text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.nav-links a {
  position: relative;
  color: var(--color-text-muted);
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--color-text-primary);
}

.nav-links a.active {
  color: var(--color-text-primary);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.4rem;
  width: 100%;
  height: 2px;
  background: var(--color-teal);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-base);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

.nav-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.82);
  color: var(--color-text-primary);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

html.dark .nav-toggle,
html.dark .theme-toggle {
  background: rgba(30, 41, 59, 0.82);
}

.nav-toggle:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--color-teal);
}

.nav-toggle {
  display: none;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  display: grid;
  justify-items: stretch;
  padding: calc(var(--nav-height) + var(--space-xl)) 1.5rem 1.5rem;
  background: rgba(11, 17, 32, 0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-panel {
  margin-left: auto;
  width: min(100%, 24rem);
  height: 100%;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  background: #111827;
  box-shadow: var(--shadow-lg);
  transform: translateX(110%);
  transition: transform var(--transition-slow);
}

.mobile-menu.is-open .mobile-menu-panel {
  transform: translateX(0);
}

.mobile-menu .nav-links {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-md);
}

.mobile-menu .nav-links a {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.5rem;
  color: var(--dark-color-offwhite);
}

.hero,
.section,
.category-page,
.calculator-page {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
}

.homepage-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  overflow: clip;
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(100, 116, 139, 0.24) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.05;
  pointer-events: none;
}

.hero-grid,
.calculator-layout {
  display: grid;
  gap: var(--space-xl);
  align-items: start;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.hero-copy,
.page-hero {
  display: grid;
  gap: var(--space-md);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-title {
  max-width: 11ch;
}

.hero-subtitle {
  max-width: 32rem;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.stat-card {
  display: grid;
  gap: 0.45rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
}

html.dark .stat-card {
  background: rgba(30, 41, 59, 0.88);
}

.stat-value {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-primary);
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.hero-text,
.section-heading,
.intro-copy,
.placeholder-copy {
  max-width: 65ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-amber);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.hero-panel,
.category-card,
.calculator-card,
.calculator-panel,
.placeholder-panel,
.error-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md);
}

html.dark .hero-panel,
html.dark .category-card,
html.dark .calculator-card,
html.dark .calculator-panel,
html.dark .placeholder-panel,
html.dark .error-card {
  background: rgba(30, 41, 59, 0.92);
}

.hero-panel,
.calculator-panel,
.placeholder-panel,
.error-card {
  padding: clamp(1.5rem, 4vw, 2rem);
}

.category-grid,
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
}

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

.category-icon {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
  align-self: flex-start;
}

.category-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.category-arrow,
.feature-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-teal);
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
}

.feature-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
}

.feature-card,
.value-card {
  display: grid;
  gap: var(--space-sm);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

html.dark .feature-card,
html.dark .value-card {
  background: rgba(30, 41, 59, 0.92);
}

.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
}

.tool-card {
  display: grid;
  gap: var(--space-md);
  align-content: start;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

html.dark .tool-card {
  background: rgba(30, 41, 59, 0.92);
}

.tool-card h2,
.tool-card h3 {
  margin-bottom: 0;
}

.tool-input-list {
  display: grid;
  gap: 0.45rem;
  padding-left: 1rem;
  color: var(--color-text-muted);
}

.tool-input-list li::marker {
  color: var(--color-teal);
}

.category-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: var(--space-sm);
  color: var(--color-amber);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
}

.value-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background: rgba(0, 212, 170, 0.12);
  color: #0f766e;
  font-size: 1.35rem;
}

.eyebrow + h1,
.section-kicker + h2 {
  margin-top: 0.25rem;
}

.category-card,
.calculator-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.category-card .category-meta {
  margin-top: auto;
}

.category-card:hover,
.calculator-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 212, 170, 0.45);
  box-shadow: var(--shadow-lg);
}

.page-hero {
  margin-bottom: var(--space-xl);
}

.category-hero-compact {
  display: grid;
  align-content: center;
  gap: var(--space-sm);
  min-height: 280px;
  margin-bottom: var(--space-xl);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid rgba(11, 17, 32, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(11, 17, 32, 0.04), rgba(0, 212, 170, 0.04)),
    rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
}

html.dark .category-hero-compact {
  border-color: rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(135deg, rgba(148, 163, 184, 0.06), rgba(0, 212, 170, 0.08)),
    rgba(30, 41, 59, 0.92);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.breadcrumb a:hover {
  color: var(--color-text-primary);
}

.calculator-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
}

.placeholder-panel {
  background:
    linear-gradient(180deg, rgba(0, 212, 170, 0.1), rgba(255, 255, 255, 0.78)),
    rgba(255, 255, 255, 0.82);
}

html.dark .placeholder-panel {
  background:
    linear-gradient(180deg, rgba(0, 212, 170, 0.12), rgba(30, 41, 59, 0.92)),
    rgba(30, 41, 59, 0.92);
}

.site-footer {
  margin-top: auto;
  color: rgba(248, 247, 244, 0.82);
  background: #0b1120;
}

.footer-shell {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  padding: clamp(2.5rem, 5vw, 4rem) 0 var(--space-xl);
}

.footer-shell h2,
.footer-shell h3,
.footer-shell h4,
.footer-shell p,
.footer-shell a {
  color: inherit;
}

.footer-column {
  display: grid;
  align-content: start;
  gap: var(--space-sm);
}

.footer-column > .footer-link {
  display: block;
}

.footer-column ul {
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.footer-column a:hover {
  color: var(--color-teal);
}

.footer-bottom {
  padding: var(--space-md) 0 var(--space-xl);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: rgba(248, 247, 244, 0.6);
  font-size: 0.95rem;
}

.footer-legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: var(--space-md) 0 var(--space-xl);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: rgba(248, 247, 244, 0.6);
  font-size: 0.95rem;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-legal-links a {
  color: rgba(248, 247, 244, 0.82);
}

.footer-legal-links a:hover {
  color: var(--color-teal);
}

.site-footer .brand {
  color: var(--color-offwhite);
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-xl) 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

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

.select-wrapper {
  position: relative;
  display: block;
}

.select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding-right: 2.5rem;
  background: transparent;
  cursor: pointer;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  pointer-events: none;
  transform: translateY(-50%) rotate(45deg);
  transition: border-color var(--transition-fast);
}

html.dark .select-wrapper::after {
  border-color: #94a3b8;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(0, 212, 170, 0.18);
  border-radius: var(--radius-full);
  background: rgba(0, 212, 170, 0.1);
  color: #0f766e;
  font-size: 0.85rem;
  font-weight: 700;
}

html.dark .badge {
  color: var(--dark-color-teal);
  background: rgba(0, 212, 170, 0.14);
}

.btn-primary,
.button.primary,
.button.secondary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-weight: 700;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.btn-primary,
.button.primary {
  color: var(--color-navy);
  background: var(--color-teal);
  box-shadow: 0 14px 30px rgba(0, 212, 170, 0.24);
}

.btn-primary:hover,
.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(0, 212, 170, 0.32);
}

.btn-secondary,
.button.secondary {
  color: var(--color-text-primary);
  background: transparent;
  border-color: var(--color-border);
}

.btn-secondary:hover,
.button.secondary:hover {
  transform: translateY(-2px);
  border-color: var(--color-teal);
  background: rgba(0, 212, 170, 0.08);
}

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(100, 116, 139, 0.35) 20%,
    rgba(100, 116, 139, 0.35) 80%,
    transparent 100%
  );
}

@media (max-width: 960px) {
  .nav-shell {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .site-header .nav-links,
  .site-header .nav-actions .btn-primary,
  .site-header .nav-actions .btn-secondary,
  .site-header .nav-actions .button.primary,
  .site-header .nav-actions .button.secondary {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero-grid,
  .calculator-layout,
  .footer-shell {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .value-grid,
  .hero-stats-grid,
  .tool-card-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 1rem;
  }

  .category-grid,
  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .homepage-hero {
    min-height: 600px;
  }

  .homepage-category-grid,
  .feature-grid,
  .value-grid {
    grid-template-columns: 1fr;
  }

  .tool-card-grid {
    grid-template-columns: 1fr;
  }

  .feature-rail {
    grid-auto-flow: column;
    grid-auto-columns: minmax(84%, 1fr);
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x proximity;
  }

  .feature-card {
    scroll-snap-align: start;
  }
}

@media (min-width: 721px) and (max-width: 1024px) {
  .tool-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .footer-shell {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .button.primary,
  .button.secondary,
  .btn-secondary {
    width: 100%;
  }
}
