/* ── Reset & base ───────────────────────────────── */

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Container ──────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-container-x);
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-container-x-lg);
  }
}

/* ── Buttons ─────────────────────────────────────── */

/* Base — shared styles every button gets */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  border: none;
  border-radius: var(--radius-8);
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

/* Sizes */
.btn-sm {
  padding: var(--space-8) var(--space-12);
  font-size: var(--text-xs);
}

.btn-md {
  padding: var(--space-btn-y) var(--space-btn);
}

.btn-lg {
  padding: var(--space-btn-y-lg) var(--space-20);
  font-size: var(--text-base);
}

/* Variants */
.btn-primary {
  background: var(--color-brand);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--color-brand-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-md);
}

.btn-secondary:hover {
  background: var(--color-bg-card);
  border-color: var(--color-brand);
}

.btn-ghost {
  background: var(--color-brand-tint);
  color: var(--color-brand-accent);
  border: 1px solid var(--color-brand-tint-md);
}

.btn-top-left {
  margin-bottom: 6px;
}

.btn-ghost:hover {
  background: var(--color-brand-tint-md);
}

/* Focus — accessible keyboard outline */
.btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
}

/* Disabled state */
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Badges ─────────────────────────────────────── */

/* Base — shared styles every badge gets */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* Variants */

/* Brand — blue tint, used on dark backgrounds */
.badge-brand {
  background: var(--color-brand-tint-md);
  color: var(--color-brand-accent);
}

/* Muted — subtle dark, used on dark backgrounds */
.badge-muted {
  background: var(--color-bg-card);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* Light — used inside light sections */
.badge-light {
  background: var(--color-bg-light-alt);
  color: var(--color-brand);
}

/* ── Cards ──────────────────────────────────────── */

/* Base — shared styles every card gets */
.card {
  /* Shape */
  border-radius: var(--radius-12);

  /* Internal layout — stack children vertically */
  display: flex;
  flex-direction: column;
  gap: var(--space-16);

  /* Internal spacing */
  padding: var(--space-card);

  /* Interactivity */
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

/* Dark variant — used on dark section backgrounds */
.card-dark {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
}

.card-dark:hover {
  border-color: var(--color-border-md);
  box-shadow: var(--shadow-card-hover);
}

/* Light variant — used inside light sections */
.card-light {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-card);
}

.card-light:hover {
  box-shadow: var(--shadow-card-hover);
}

/* ── Card internal elements ──────────────────────── */

/* Eyebrow — small label above the title */
.card-eyebrow {
  color: var(--color-brand-accent);
}

/* Title */
.card-title {
  color: var(--color-text-primary);
  transition: color var(--transition-base);
}

.card-dark:hover .card-title {
  color: var(--color-brand-accent);
}

/* Body text */
.card-body {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  flex: 1;
}

/* Footer — sits at the bottom of the card */
.card-footer {
  margin-top: auto;
  padding-top: var(--space-16);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

/* Light section overrides for text colours */
.card-light .card-title {
  color: var(--color-text-on-light);
}

.card-light .card-body {
  color: var(--color-text-on-light-muted);
}

.card-light .card-footer {
  border-top-color: var(--color-border-light);
}

.card-light .card-eyebrow {
  color: var(--color-brand);
}

/* ── Inputs & Forms ─────────────────────────────── */

/* Base input */
.input {
  display: block;
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-md);
  border-radius: var(--radius-8);
  padding: var(--space-12) var(--space-16);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
  appearance: none;
}

.input::placeholder {
  color: var(--color-text-subtle);
}

.input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-tint);
}

.input:disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* Light variant — inside light sections */
.input-light {
  color: var(--color-text-on-light);
  background: var(--color-bg-white);
  border: 1px solid var(--color-border-light);
}

.input-light::placeholder {
  color: var(--color-text-on-light-muted);
}

.input-light:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-tint);
}

/* Textarea */
.textarea {
  resize: vertical;
  min-height: 120px;
}

/* Select */
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(240,244,248,0.55)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-40);
  cursor: pointer;
}

/* Label */
.label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

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

/* Required asterisk */
.label-required::after {
  content: " *";
  color: var(--color-brand-accent);
}

/* Field wrapper — label + input + error stacked */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Error message */
.field-error {
  font-size: var(--text-xs);
  color: #f87171;
  margin-top: var(--space-4);
}

/* Input error state */
.input-error {
  border-color: #f87171;
}

.input-error:focus {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

/* Hint text */
.field-hint {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
}

.checkbox {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  border-radius: var(--radius-4);
  border: 1px solid var(--color-border-md);
  background: var(--color-bg-secondary);
  cursor: pointer;
  accent-color: var(--color-brand);
}

.checkbox-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  cursor: pointer;
}

/* ── Nav ─────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  padding: var(--space-12) 0;
}

/* The unified pill */
.nav-pill {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-hi);
  border-radius: var(--radius-14);
  padding: var(--space-nav-pill) var(--space-12) var(--space-nav-pill)
    var(--space-nav-pill);
  gap: var(--space-4);
}

/* Wordmark */
.nav-wordmark {
  display: flex;
  align-items: baseline;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-8);
  text-decoration: none;
  flex-shrink: 0;
  transition: background var(--transition-base);
}

.nav-wordmark:hover {
  background: var(--color-bg-card);
}

.nav-wordmark-light {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 300;
  color: var(--color-text-primary);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.nav-wordmark-bold {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Divider inside pill */
.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--color-border-md);
  flex-shrink: 0;
  margin: 0 var(--space-4);
}

/* Links container */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1;
  justify-content: center;
}

/* Individual nav link */
.nav-link {
  font-family: var(--font-sans);
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-nav-y) var(--space-nav-x);
  border-radius: var(--radius-8);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--transition-base),
    color var(--transition-base);
}

.nav-link:hover {
  background: var(--color-bg-card);
  color: var(--color-text-primary);
}

/* Active page state */
.nav-link-active {
  background: var(--color-brand-tint);
  color: var(--color-text-primary);
  box-shadow: inset 0 0 0 1px var(--color-brand-tint-md);
}

/* Nav spacer — pushes content below fixed nav */
.nav-spacer {
  height: 68px;
}

/* Mobile menu button */
.nav-mobile-btn {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
}

.nav-mobile-btn:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-card);
}

/* Mobile menu */
.nav-mobile {
  display: none;
  overflow: hidden;
  max-height: 0;
  transition:
    max-height var(--transition-slow),
    opacity var(--transition-slow);
  opacity: 0;
  border-top: 1px solid var(--color-border);
}

.nav-mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16) 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: color var(--transition-base);
}

.nav-mobile-link:last-of-type {
  border-bottom: none;
}

.nav-mobile-link:hover,
.nav-mobile-link-active {
  color: var(--color-text-primary);
}

/* Responsive — show mobile button, hide pill */
@media (max-width: 1023px) {
  .nav-pill {
    display: none;
  }

  .nav-mobile-btn {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .nav-mobile {
    display: block;
  }
}

/* Mobile menu open state — toggled by JS */
.nav-mobile-open {
  max-height: 500px;
  opacity: 1;
}

/* Mobile hamburger button */
.nav-mobile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
  line-height: 1;
}

.nav-mobile-icon:hover {
  color: var(--color-text-primary);
}

/* ── Footer ──────────────────────────────────────── */

.footer {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
}

/* CTA band */
.footer-cta {
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-section-y-sm) 0;
}

.footer-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-32);
  flex-wrap: wrap;
}

.footer-cta-title {
  color: var(--color-text-primary);
  max-width: 480px;
  margin-top: var(--space-12);
}

.footer-cta-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.7;
  max-width: 400px;
  margin-top: var(--space-8);
}

.footer-cta-actions {
  display: flex;
  gap: var(--space-12);
  flex-wrap: wrap;
}

/* Main footer grid */
.footer-main {
  padding: var(--space-section-y-sm) 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-48);
}

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

/* Brand column */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 260px;
}

.footer-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-8);
}

.footer-detail {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.8;
  display: flex;
  flex-direction: column;
}

.footer-detail a {
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}

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

/* Social icons */
.footer-social {
  display: flex;
  gap: var(--space-8);
}

.footer-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-8);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition:
    color var(--transition-base),
    background var(--transition-base),
    border-color var(--transition-base);
}

.footer-social-btn:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-card);
  border-color: var(--color-border-md);
}

/* Link columns */
.footer-cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-24);
}

@media (max-width: 767px) {
  .footer-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

.footer-col-head {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-16);
  transition: color var(--transition-base);
}

.footer-col-head:hover {
  color: var(--color-brand-accent);
}

.footer-col-link {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: var(--space-12);
  transition: color var(--transition-base);
}

.footer-col-link:hover {
  color: var(--color-text-primary);
}

/* Legal bar */
.footer-legal {
  border-top: 1px solid var(--color-border);
  padding: var(--space-20) 0;
}

.footer-legal-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-12);
}

.footer-legal-text {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

.footer-legal-links {
  display: flex;
  gap: var(--space-20);
}

.footer-legal-link {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  transition: color var(--transition-base);
}

.footer-legal-link:hover {
  color: var(--color-text-muted);
}

/* ── Sections ─────────────────────────────────────── */

/* Base section */
.section {
  padding: var(--space-section-y) 0;
}

.section-sm {
  padding: var(--space-section-y-sm) 0;
}

.section-lg {
  padding: var(--space-section-y-lg) 0;
}

/* Dark backgrounds */
.section-dark-primary {
  background: var(--color-bg-primary);
}

.section-dark-secondary {
  background: var(--color-bg-secondary);
}

/* Light section */
.section-light {
  background: var(--color-bg-light);
}

.section-light h1,
.section-light h2,
.section-light h3,
.section-light h4 {
  color: var(--color-text-on-light);
}

.section-light p {
  color: var(--color-text-on-light-muted);
}

/* Section header — eyebrow + title + subtitle */
.section-header {
  margin-bottom: var(--space-48);
}

.section-header-centered {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-48);
}

.section-eyebrow {
  color: var(--color-brand-accent);
  margin-bottom: var(--space-eyebrow-gap);
}

.section-light .section-eyebrow {
  color: var(--color-brand);
}

.section-title {
  color: var(--color-text-primary);
  margin-bottom: var(--space-heading-gap);
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 560px;
}

.section-header-centered .section-subtitle {
  margin: 0 auto;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--color-border);
  border: none;
  margin: 0;
}

.divider-light {
  background: var(--color-border-light);
}

/* Grid layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-card-gap);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-card-gap);
}

@media (max-width: 1023px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Insights */
#latest-insights {
  align-items: stretch;
}

#latest-insights .insight-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#latest-insights .card-footer {
  margin-top: auto;
}
