/* =========================================================================
   Citadelx Sovereign — shared.css
   Loaded by all 3 variations. Palette, typography, reset, utilities.
   ========================================================================= */

/* ------ Fonts (self-hosted via @font-face, never Google <link>) ------ */
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('../fonts/CabinetGrotesk-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('../fonts/CabinetGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ------ Tokens ------ */
:root {
  /* Brand */
  --sovereign-orange: oklch(62% 0.175 35);
  --sovereign-ink:    oklch(22% 0.018 195);
  --sovereign-teal:   oklch(38% 0.05  188);

  /* Surfaces */
  --bone:        oklch(98% 0.005 80);
  --parchment:   oklch(94% 0.012 75);
  --ink-deep:    oklch(16% 0.015 195);

  /* Text */
  --ink-body:       oklch(28% 0.018 200);
  --ink-muted:      oklch(50% 0.012 215);
  --cream-on-dark:  oklch(92% 0.008 80);

  /* Alpha helpers (hex equivalents for rgba use) */
  --orange-rgb: 224 85 42;
  --teal-rgb:   31 95 92;
  --ink-rgb:    15 42 45;

  /* Type */
  --f-display: 'Cabinet Grotesk', system-ui, sans-serif;
  --f-body:    'Manrope', system-ui, sans-serif;

  /* Scale (modular, ratio 1.333) */
  --fs-xs:   12px;
  --fs-sm:   14px;
  --fs-base: 17px;
  --fs-md:   20px;
  --fs-lg:   clamp(22px, 1.6vw + 12px, 32px);
  --fs-xl:   clamp(28px, 2.2vw + 14px, 48px);
  --fs-2xl:  clamp(40px, 4vw + 16px, 72px);
  --fs-3xl:  clamp(56px, 7vw + 16px, 120px);
  --fs-hero: clamp(64px, 9vw + 16px, 156px);

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: clamp(80px, 10vw, 160px);
  --sp-11: clamp(120px, 14vw, 200px);

  /* Layout */
  --container-max: 1240px;
  --container-px:  clamp(20px, 4vw, 48px);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-fast: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 220ms;
  --t-base: 420ms;
  --t-slow: 800ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}
body {
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--ink-body);
  background: var(--bone);
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ------ Typography defaults ------ */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--sovereign-ink);
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { max-width: 68ch; }
.lead { font-size: var(--fs-md); color: var(--ink-body); }
.eyebrow {
  font-family: var(--f-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sovereign-teal);
}

/* ------ Container ------ */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}
.container--wide { max-width: 1480px; }

/* ------ Buttons (shared base; variations restyle) ------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 16px 28px;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  border-radius: 2px;
  transition: transform var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out);
}
.btn svg { width: 16px; height: 16px; transition: transform var(--t-fast) var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }

.btn--primary {
  background: var(--sovereign-orange);
  color: var(--bone);
}
.btn--primary:hover { background: oklch(58% 0.18 35); }

.btn--ghost {
  background: transparent;
  color: var(--sovereign-ink);
  border: 1px solid color-mix(in oklch, var(--sovereign-ink) 20%, transparent);
}
.btn--ghost:hover { background: color-mix(in oklch, var(--sovereign-ink) 5%, transparent); }

/* ------ Icon sizing helper ------ */
.icon { width: 24px; height: 24px; flex-shrink: 0; }
.icon--lg { width: 32px; height: 32px; }
.icon--xl { width: 48px; height: 48px; }

/* ------ Nav (shared shell, variations override colors/effects) ------ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 72px;
  display: flex;
  align-items: center;
  transition: background var(--t-base) var(--ease-out),
              backdrop-filter var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in oklch, var(--bone) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: color-mix(in oklch, var(--sovereign-ink) 8%, transparent);
}
.nav__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}
.nav__logo { display: flex; align-items: center; }
.nav__logo img { height: 36px; width: auto; }
.nav__menu {
  display: none;
  gap: var(--sp-6);
  align-items: center;
}
.nav__menu a {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-body);
  transition: color var(--t-fast) var(--ease-out);
}
.nav__menu a:hover { color: var(--sovereign-orange); }
.nav__cta { display: none; }
.nav__toggle {
  display: flex;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--sovereign-ink);
}
@media (min-width: 1024px) {
  .nav__menu { display: flex; }
  .nav__cta { display: inline-flex; }
  .nav__toggle { display: none; }
}

/* ------ Footer (shared base) ------ */
.footer {
  background: var(--ink-deep);
  color: var(--cream-on-dark);
  padding: var(--sp-10) 0 var(--sp-7);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-7);
}
@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer h4 {
  color: var(--bone);
  font-size: var(--fs-sm);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: var(--sp-5);
}
.footer__brand img { height: 44px; margin-bottom: var(--sp-5); }
.footer__brand p { color: color-mix(in oklch, var(--cream-on-dark) 75%, transparent); max-width: 38ch; }
.footer__list li { margin-bottom: var(--sp-3); }
.footer__list a { color: color-mix(in oklch, var(--cream-on-dark) 80%, transparent); transition: color var(--t-fast) var(--ease-out); }
.footer__list a:hover { color: var(--sovereign-orange); }
.footer__bottom {
  margin-top: var(--sp-9);
  padding-top: var(--sp-5);
  border-top: 1px solid color-mix(in oklch, var(--cream-on-dark) 15%, transparent);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: color-mix(in oklch, var(--cream-on-dark) 60%, transparent);
}
.footer__social {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.footer__social a {
  display: inline-flex;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in oklch, var(--cream-on-dark) 20%, transparent);
  border-radius: 50%;
  transition: border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.footer__social a:hover { border-color: var(--sovereign-orange); color: var(--sovereign-orange); }

/* ------ Utility: reveal on scroll (used by shared.js IntersectionObserver) ------ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 80ms; }
.reveal--delay-2 { transition-delay: 160ms; }
.reveal--delay-3 { transition-delay: 240ms; }
.reveal--delay-4 { transition-delay: 320ms; }

/* ------ Reduced motion ------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ------ Selection ------ */
::selection { background: var(--sovereign-orange); color: var(--bone); }

/* ------ Focus visible ------ */
:focus-visible {
  outline: 2px solid var(--sovereign-orange);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ------ Skip link (a11y) ------ */
.skip-link {
  position: absolute;
  top: -100px; left: var(--sp-5);
  background: var(--sovereign-ink);
  color: var(--bone);
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--fs-sm);
  z-index: 200;
  transition: top var(--t-fast) var(--ease-out);
}
.skip-link:focus { top: var(--sp-5); }
