/* ─────────────────────────────────────────────
   base.css — shared foundation for every page
   ───────────────────────────────────────────── */

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

/* ── Design tokens ── */
:root {
  --white: #ffffff;
  --off-white: #fafafa;
  --gray-50: #f5f5f7;
  --gray-100: #ebebef;
  --gray-200: #d4d4d8;
  --gray-300: #a1a1aa;
  --gray-400: #71717a;
  --gray-500: #52525b;
  --gray-600: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --black: #171821;

  --accent: #4a4aff;
  --accent-muted: rgba(74, 74, 255, 0.08);

  --max-w: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--white);
  color: var(--gray-900);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Typography ── */
h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.04em;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
p {
  color: var(--gray-500);
  font-size: 1rem;
  line-height: 1.65;
}

/* ── Eyebrow label ── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--gray-500);
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 14px 0;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-100);
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.logo img {
  height: 30px;
  width: auto;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  font-size: 0.85rem;
  color: var(--gray-400);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--gray-900);
}
.btn-sm {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
  background: var(--accent);
  padding: 8px 20px;
  border-radius: 7px;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-sm:hover {
  background: #3d3dd9;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--gray-500);
}
.nav-toggle svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--gray-100);
  padding: 64px 0 0;
}

/* Hard reset — prevent global p/a/h styles bleeding in */
footer p,
footer h4 {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: normal;
  color: inherit;
  margin: 0;
}
footer a {
  color: inherit;
  text-decoration: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
}

/* Brand column */
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.footer-logo {
  display: block;
  margin-bottom: 20px;
}
.footer-logo img {
  height: 44px;
  width: auto;
  display: block;
}
.footer-tagline {
  font-size: 0.82rem !important;
  color: var(--gray-400) !important;
  line-height: 1.65 !important;
  margin-bottom: 14px !important;
  max-width: 260px;
}
.footer-email {
  font-size: 0.82rem;
  color: var(--gray-400);
  transition: color 0.15s;
  margin-bottom: 16px;
}
.footer-email:hover { color: var(--accent); }
.footer-social {
  display: flex;
  gap: 10px;
  align-items: center;
}
.footer-social a {
  color: var(--gray-300);
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.footer-social a:hover { color: var(--accent); }

/* Nav columns */
.footer-col {
  display: flex;
  flex-direction: column;
}
.footer-col-heading {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase;
  color: var(--gray-800) !important;
  margin-bottom: 14px !important;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links li {
  font-size: 0.82rem;
  color: var(--gray-400);
  line-height: 1.4;
}
.footer-links a {
  color: var(--gray-400);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }

/* Bottom bar */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px solid var(--gray-100);
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy {
  font-size: 0.72rem !important;
  color: var(--gray-300) !important;
}
.footer-cert {
  display: flex;
  align-items: center;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.footer-cert:hover { opacity: 1; }
.footer-cert img {
  height: 36px;
  width: auto;
  display: block;
}

/* ── Mobile nav ── */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px;
    gap: 0;
    border-bottom: 1px solid var(--gray-100);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-link {
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-50);
    width: 100%;
    font-size: 0.95rem;
  }
  .nav-link:last-of-type {
    border-bottom: none;
  }
  .nav-links .btn-sm {
    margin-top: 8px;
    text-align: center;
    display: block;
    padding: 14px 20px;
  }
  /* Open dropdown sits on a white panel — links must stay readable even on
     pages whose nav forces white link color over a dark hero. */
  .nav-links.open .nav-link {
    color: var(--gray-600) !important;
  }
  .nav-links.open .nav-link:hover,
  .nav-links.open .nav-link.active {
    color: var(--gray-900) !important;
  }
}

/* ── Mobile footer ── */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px 32px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-tagline {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 20px;
  }
  footer {
    padding: 48px 0 0;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
    padding-bottom: 40px;
  }
  .footer-logo img {
    height: 36px;
  }
}

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

/* Glossary article layout (shared across /glossary/*.html) */
.article-hero { padding: 120px 0 72px; background: var(--white); background-image: radial-gradient(circle at 60% 0%, rgba(74,74,255,0.07) 0%, transparent 55%), radial-gradient(circle, rgba(74,74,255,0.25) 1px, transparent 1px); background-size: 100% 100%, 24px 24px; background-position: center top, center top; position: relative; border-bottom: 1px solid var(--gray-100); }
.article-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, var(--white) 92%); pointer-events: none; }
.article-hero .container { position: relative; z-index: 1; max-width: 760px; }
.back-link { display: flex; width: fit-content; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 500; color: var(--gray-400); text-decoration: none; margin-bottom: 36px; transition: color 0.15s; }
.back-link:hover { color: var(--accent); }
.back-link svg { width: 14px; height: 14px; }
.article-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.04em; color: var(--black); margin-bottom: 24px; }
.article-standfirst { font-size: 1.15rem; line-height: 1.65; color: var(--gray-500); max-width: 600px; margin-bottom: 32px; font-weight: 400; }
.article-content { max-width: 760px; margin: 0 auto; padding: 72px 32px 96px; }
.article-body { color: var(--gray-600); font-size: 1.05rem; line-height: 1.85; }
.article-body p { margin-bottom: 24px; }
.article-body p:last-child { margin-bottom: 0; }
.article-body strong { color: var(--gray-900); font-weight: 600; }
.article-body a { color: var(--accent); text-decoration: none; }
.article-body a:hover { text-decoration: underline; }
.article-body .lede { font-size: 1.18rem; color: var(--gray-700, #374151); font-weight: 400; line-height: 1.75; margin-bottom: 32px; }
.section-block { margin: 64px 0 0; }
.section-block:first-of-type { margin-top: 0; }
.section-number { font-size: 5rem; font-weight: 800; line-height: 1; color: var(--gray-100); letter-spacing: -0.06em; margin-bottom: -16px; display: block; user-select: none; }
.section-heading { font-size: 1.3rem; font-weight: 700; color: var(--black); letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 20px; }
.callout { border-left: 3px solid var(--accent); background: var(--gray-50); border-radius: 0 8px 8px 0; padding: 20px 24px; margin: 32px 0; }
.callout p { margin-bottom: 0 !important; font-size: 0.95rem; color: var(--gray-500); line-height: 1.7; }
.callout strong { color: var(--gray-800); }
.article-divider { border: none; border-top: 1px solid var(--gray-100); margin: 64px 0; }
.references { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--gray-100); }
.references-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-300); margin-bottom: 14px; }
.references-list { list-style: decimal; padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.references-list li { font-size: 0.8rem; color: #71717a; line-height: 1.6; }
.references-list a { color: var(--accent); }

/* Glossary article CTA + related terms (shared across /glossary/*.html) */
.cta-block { background: var(--black); border-radius: 16px; padding: 48px 40px; margin-top: 16px; }
.cta-block p { color: rgba(255,255,255,0.6); font-size: 0.95rem; line-height: 1.7; margin-bottom: 24px !important; }
.cta-block p:last-child { margin-bottom: 0 !important; }
.cta-block strong { color: var(--white); }
.cta-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cta-btn-primary { font-size: 0.875rem; font-weight: 600; color: var(--white); background: var(--accent); padding: 12px 24px; border-radius: 8px; text-decoration: none; transition: background 0.15s; display: inline-block; }
.cta-btn-primary:hover { background: #3d3dd9; text-decoration: none !important; color: var(--white) !important; }
.article-body .cta-block a.cta-btn-primary { color: var(--white) !important; }
.article-body .cta-block a.cta-btn-secondary { color: rgba(255,255,255,0.55) !important; }
.cta-btn-secondary { font-size: 0.875rem; font-weight: 500; color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.15s; }
.cta-btn-secondary:hover { color: var(--white); text-decoration: none; }
.related-terms { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--gray-100); }
.related-terms-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-300); margin-bottom: 14px; }
.related-terms-list { display: flex; flex-wrap: wrap; gap: 8px; }
.related-term-link { font-size: 0.8rem; font-weight: 500; color: var(--accent); background: var(--accent-muted); padding: 5px 12px; border-radius: 6px; text-decoration: none; transition: background 0.15s; }
.related-term-link:hover { background: rgba(74,74,255,0.14); text-decoration: none; }

@media (max-width: 640px) {
  .article-hero { padding: 100px 0 56px; }
  .article-hero .container { padding: 0 20px; }
  .article-content { padding: 48px 20px 72px; }
  .cta-block { padding: 32px 24px; }
}
