:root {
  --brand-navy: #071426;
  --brand-midnight: #0D2138;
  --brand-panel: #142B45;
  --brand-gold: #D4AF37;
  --brand-champagne: #E6C77B;
  --brand-text: #F5F7FA;
  --brand-muted: #A8B8CA;
  --brand-border: #29415B;
  --brand-body: 'Barlow', sans-serif;
  --brand-label: 'Barlow Condensed', sans-serif;
  --brand-data: 'IBM Plex Mono', monospace;
  color-scheme: dark;
}

body {
  font-family: var(--brand-body);
  line-height: 1.65;
}

.font-anton,
.font-display,
.display,
h1, h2, h3, h4 {
  font-family: var(--brand-body) !important;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12 !important;
}

.font-inter {
  font-family: var(--brand-body) !important;
}

.font-mono {
  font-family: var(--brand-data);
}

.marketing .font-mono {
  font-family: var(--brand-body) !important;
}

.eyebrow,
nav,
header .font-mono,
footer .font-mono,
#mobile-menu .font-mono,
button.font-mono,
a.font-mono,
label.font-mono {
  font-family: var(--brand-label) !important;
}

.marketing .technical-preview .font-mono,
.marketing .technical-data {
  font-family: var(--brand-data) !important;
}

nav a, nav button, header .nav-link, #mobile-menu a, #mobile-menu button {
  font-family: var(--brand-label);
  font-size: 0.8125rem !important;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
}

button, input, select, textarea {
  font-family: var(--brand-body);
}

form .font-mono {
  font-family: var(--brand-body) !important;
}

.bg-\[\#0A0A0B\] {
  background-color: var(--brand-navy) !important;
}

.bg-\[\#15161A\] {
  background-color: var(--brand-panel) !important;
}

.bg-\[\#1A1C21\] {
  background-color: var(--brand-midnight) !important;
}

.border-\[\#2A2D34\] {
  border-color: var(--brand-border) !important;
}

button.bg-fi-red,
a.bg-fi-red,
.btn-red,
.bg-fi-gold {
  background-color: var(--brand-gold) !important;
  color: var(--brand-navy) !important;
}

button.bg-fi-red,
a.bg-fi-red,
.btn-red,
button.bg-fi-gold,
a.bg-fi-gold {
  font-family: var(--brand-label) !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  min-height: 44px;
  border-radius: 6px;
}

button.bg-fi-red:hover:not(:disabled),
a.bg-fi-red:hover,
.btn-red:hover:not(:disabled),
button.bg-fi-gold:hover:not(:disabled),
a.bg-fi-gold:hover {
  background-color: var(--brand-champagne) !important;
  filter: none;
}

.btn-ghost,
body .brand-secondary {
  background: var(--brand-midnight);
  border: 1px solid var(--brand-border);
  color: var(--brand-text);
  font-family: var(--brand-label) !important;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  min-height: 44px;
  border-radius: 6px;
}

.btn-ghost:hover,
.brand-secondary:hover {
  background: var(--brand-panel) !important;
  color: var(--brand-champagne) !important;
  border-color: var(--brand-gold) !important;
}

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand-champagne);
  outline-offset: 4px;
}

input[type=radio], input[type=checkbox] {
  accent-color: var(--brand-gold);
}

input[type=range]::-webkit-slider-thumb {
  background: var(--brand-gold) !important;
}

input[type=range]::-moz-range-thumb {
  background: var(--brand-gold);
  border: none;
}

.carbon, .carbon-fiber {
  background-image: linear-gradient(135deg, rgba(41,65,91,0.18), transparent 65%) !important;
  background-size: cover !important;
}

.card-glow:hover, .glow-red:hover {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 1px rgba(212,175,55,0.2) !important;
}

.nav-scrolled {
  background: rgba(7,20,38,0.96) !important;
  border-bottom-color: var(--brand-border);
}

.nav-link:hover,
nav a:hover,
nav a[aria-current=page],
header a[aria-current=page] {
  color: var(--brand-champagne) !important;
}

.choice:not(.wrong):not(.correct):not(.was-correct):hover,
.choice.sel:not(.wrong):not(.correct),
.ans-card:not(.border-fi-red):not(.border-fi-green):not([data-state=wrong]):not([data-state=correct]):hover {
  border-color: var(--brand-gold);
}

.choice.sel:not(.wrong):not(.correct) {
  background: rgba(212,175,55,0.08);
}

.areaBtn.border-fi-red,
.areaBtn.text-fi-red,
.area-pill.border-fi-red,
.area-pill.text-fi-red,
#qMap .border-fi-red,
.gauge-fill {
  color: var(--brand-gold);
  border-color: var(--brand-gold);
  stroke: var(--brand-gold);
}

#firstName,
#continueCard > p.text-fi-red,
#recCard > p.text-fi-red,
a[href="/resources"] .text-fi-red,
a[href^="/resources/"] > p.text-fi-red {
  color: var(--brand-gold);
}

#shopBadge.border-fi-red {
  color: var(--brand-gold);
  border-color: var(--brand-gold);
}

a > span.bg-fi-red {
  background-color: var(--brand-gold);
  color: var(--brand-navy);
}

a.hover\:border-fi-red:hover,
button.hover\:border-fi-red:hover {
  border-color: var(--brand-gold);
}

a.hover\:text-fi-red:hover {
  color: var(--brand-gold);
}

#gate .spin {
  stroke: var(--brand-gold);
}

.bar > i {
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-champagne));
}

.area-pill:hover {
  background: var(--brand-gold);
  color: var(--brand-navy);
  border-color: var(--brand-gold);
}

.invoice-container > section {
  min-width: 0;
}

@media (max-width: 1279px) {
  #mainNav > div:first-child > .lg\:flex {
    display: none;
  }

  #mainNav #mobileMenuBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #mainNav #mobileMenu:not(.hidden) {
    display: block;
  }
}

@media screen and (max-width: 767px) {
  .invoice-container {
    grid-template-columns: minmax(0, 1fr);
  }

  .invoice-paper {
    padding: 24px 16px;
    overflow-x: auto;
  }

  .invoice-paper .stamp {
    top: 24px;
    right: 16px;
    font-size: 18px;
  }
}

.preview-link {
  opacity: 1;
  transform: none;
}

.marketing .brand-hero {
  min-height: auto;
  padding-top: clamp(8rem, 12vw, 11rem);
  padding-bottom: clamp(4rem, 7vw, 7rem);
}

.brand-hero h1 {
  font-size: clamp(2.6rem, 5.6vw, 4.4rem);
  line-height: 1.08 !important;
}

.brand-hero .hero-background {
  background: radial-gradient(ellipse at 85% 40%, rgba(20,43,69,0.8), transparent 65%), var(--brand-navy);
}

.brand-hero .technical-preview {
  min-width: 0;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.brand-hero .hero-gauge {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  width: 100%;
  max-width: 380px;
  height: auto;
}

.brand-hero .hero-gauge > svg {
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  max-width: 340px;
  justify-self: center;
}

.brand-hero .hero-reading,
.brand-hero .hero-question {
  position: static;
  width: auto;
  align-self: start;
  border-radius: 8px;
}

.brand-hero .animate-pulse {
  animation: none;
}

@media (max-width: 639px) {
  #library .flex.items-baseline.justify-between {
    flex-wrap: wrap;
    gap: 8px;
  }

  #mainNav > div:first-child > a:first-child {
    gap: 8px;
  }

  #mainNav > div:first-child > a:first-child > svg {
    width: 32px;
    height: 32px;
  }

  #mainNav > div:first-child > a:first-child > .font-anton {
    font-size: 1rem;
  }

  #mainNav > div:first-child > a:first-child > .font-anton > span {
    display: block;
    font-size: 0.875rem;
    letter-spacing: 0.08em;
  }

  #mainNav > div:first-child > div:last-child {
    flex-shrink: 0;
    gap: 8px;
  }

  #mainNav > div:first-child > div:last-child > a.bg-fi-gold {
    padding-inline: 10px;
    white-space: nowrap;
  }

  #mainNav button,
  header button[aria-label="Open menu"],
  nav button[aria-label="Open menu"] {
    min-width: 44px;
    min-height: 44px;
  }

  .marketing .brand-hero {
    padding-top: 7rem;
    padding-bottom: 3.5rem;
  }

  .brand-hero .technical-preview {
    width: 100%;
    max-width: 340px;
    margin-inline: auto;
    padding-block: 0;
  }

  .brand-hero .hero-actions > a {
    justify-content: center;
    width: 100%;
  }

  .marketing h1 {
    overflow-wrap: break-word;
  }

  .brand-wrap-nav > div {
    height: auto;
    padding-block: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .brand-wrap-nav nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
