/* ════════════════════════════════════════════════════════════════════════
   CRTV DEI — Shared design system
   Bauhaus / Constructivist · Brand blue + gold + dark locked
   Loaded on every page before page-specific CSS.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── BRAND (locked) ─────────────────────────────────────────────── */
  --blue: #2563EB;
  --blue-hover: #1D4ED8;
  --gold: #FBBF24;
  --gold-deep: #D69E2E;
  --dark: #0F172A;
  --slate: #1E293B;

  /* ── EXTENDED (derived) ─────────────────────────────────────────── */
  --paper: #F5F1E8;
  --paper-2: #ECE5D2;
  --ink: #0A0A0A;
  --ink-mute: #4A4A4A;
  --rule: #1A1A1A;
  --rule-soft: rgba(10, 10, 10, 0.12);

  /* ── TYPE ───────────────────────────────────────────────────────── */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-body: 'Sora', system-ui, sans-serif;

  /* ── LAYOUT ─────────────────────────────────────────────────────── */
  --container: 1440px;
  --gutter: clamp(1.5rem, 4vw, 4rem);
  --nav-h: 84px; /* fixed nav height — body offset + anchor scroll margin */

  /* Legacy aliases (kept for any inline-styled legal pages) */
  --primary-blue: var(--blue);
  --hover-blue: var(--blue-hover);
  --gold-accent: var(--gold);
  --dark-base: var(--ink);
  --dark-slate: var(--slate);
  --primary-text: var(--ink);
  --secondary-text: var(--ink-mute);
  --muted-text: var(--ink-mute);
  --borders: var(--rule-soft);
  --light-bg: var(--paper);
  --white: var(--paper);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
  background: var(--paper);
  overflow-x: clip;
  overscroll-behavior-y: none;
  color-scheme: light;
}

/* Anchor targets clear the fixed nav when deep-linked (e.g. /pricing#care) */
[id] {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

/* (html::before safe-area layer removed — no viewport-fit=cover means
   iOS reserves the safe-area zone for itself; the page can't render
   into it, so no overlay is needed.) */

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01';
  min-height: 100%;
}

/* Grain overlay for tactile texture — barely visible, sets the mood */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; }

a, button, input, select, textarea, summary { touch-action: manipulation; }

h1, h2, h3 { text-wrap: balance; }

::selection { background: var(--blue); color: var(--paper); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* Respect 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;
  }
}

/* ──────────────────────────────────────────────────────────────────────
   ACCESSIBILITY
   ────────────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  z-index: 10000;
}
.skip-link:focus { left: 1rem; }

.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;
}

/* ──────────────────────────────────────────────────────────────────────
   LAYOUT UTILITIES
   ────────────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ──────────────────────────────────────────────────────────────────────
   .safe-top and .top-stripe are no-ops now — the nav itself paints the
   gold safe-area + 6px stripe via a gradient background. Kept as empty
   rules in case existing HTML still references them; remove later.
   ────────────────────────────────────────────────────────────────────── */
.safe-top, .top-stripe { display: none; }

/* ──────────────────────────────────────────────────────────────────────
   SHARED — Inline word highlights (.pop)
   ────────────────────────────────────────────────────────────────────── */
.pop {
  display: inline-block;
  font-weight: 700;
  position: relative;
  isolation: isolate;
  padding: 0 0.06em;
}
.pop--gold { color: var(--ink); }
.pop--gold::before {
  content: '';
  position: absolute;
  left: -0.04em; right: -0.04em;
  top: 38%; bottom: 16%;
  background: var(--gold);
  z-index: -1;
  transform: skewX(-4deg);
}
.pop--blue { color: var(--blue); }
.pop--blue::after {
  content: '';
  position: absolute;
  left: 0.04em; right: 0.04em;
  bottom: 5%;
  height: 4px;
  background: var(--blue);
}

/* Title-accent: italic blue word with gold underline (used in section titles) */
.title-accent {
  font-style: italic;
  font-weight: 700;
  color: var(--blue);
  position: relative;
  display: inline-block;
  isolation: isolate;
}
.title-accent::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 0.05em;
  height: 0.18em;
  background: var(--gold);
  z-index: -1;
}

/* Generic strong-with-gold-highlight pattern */
.gold-mark {
  font-weight: 700;
  position: relative;
  display: inline-block;
  isolation: isolate;
}
.gold-mark::before {
  content: '';
  position: absolute;
  inset: 65% -0.04em 8% -0.04em;
  background: var(--gold);
  z-index: -1;
}

/* ──────────────────────────────────────────────────────────────────────
   SHARED — Section-level helpers
   ────────────────────────────────────────────────────────────────────── */
.section-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 240px;
  display: block;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
}
.section-label--gold { color: var(--gold-deep); }
.section-label--ink { color: var(--ink); }

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6.5vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.section-intro {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.55;
  max-width: 56ch;
  opacity: 0.82;
}

/* ──────────────────────────────────────────────────────────────────────
   SHARED — Buttons
   ────────────────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1.05rem 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 2px solid var(--ink);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}
.btn--primary {
  background: var(--ink);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-2px);
}
.btn--secondary {
  background: transparent;
  color: var(--ink);
}
.btn--secondary:hover {
  background: var(--gold);
  border-color: var(--ink);
  transform: translateY(-2px);
}
.btn--blue {
  background: var(--blue);
  color: var(--paper);
  border-color: var(--blue);
}
.btn--blue:hover {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-2px);
}
.btn--gold {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.btn--gold:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}
.btn--inverse {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.btn--inverse:hover {
  background: var(--gold);
  border-color: var(--gold);
  transform: translateY(-2px);
}
.btn--large {
  padding: 1.4rem 2.2rem;
  font-size: 1rem;
}
.btn-arrow { font-size: 1.1em; line-height: 1; }

/* Smaller pill CTA — for inline use */
.btn-sm {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.7rem 1rem;
  border: 2px solid var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  transition: background 160ms ease, color 160ms ease;
}
.btn-sm:hover { background: var(--ink); color: var(--paper); }

/* ──────────────────────────────────────────────────────────────────────
   FOOTER (shared across every page)
   ────────────────────────────────────────────────────────────────────── */
.foot {
  background: var(--ink);
  color: var(--paper);
}
.foot__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--gutter);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
}
.foot__brand-mark {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.foot__brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--paper);
}
.foot__brand-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  background: var(--gold);
  color: var(--ink);
  padding: 0.22rem 0.55rem;
  text-transform: uppercase;
}
.foot__brand-tagline {
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.5;
  opacity: 0.85;
  max-width: 38ch;
}
.foot__brand-tagline span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-top: 0.25rem;
}
.foot__col-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
}
.foot__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.foot__list a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--paper);
  transition: color 160ms ease;
}
.foot__list a:hover { color: var(--gold); }

.foot__bottom {
  border-top: 1px solid rgba(245, 241, 232, 0.15);
  padding: 1.5rem var(--gutter);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 241, 232, 0.55);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: var(--container);
  margin: 0 auto;
  flex-wrap: wrap;
}
.foot__bottom-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.foot__bottom-sep { opacity: 0.4; font-size: 0.5rem; }
.foot__version {
  background: var(--blue);
  color: var(--paper);
  padding: 0.3rem 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

/* ──────────────────────────────────────────────────────────────────────
   RESPONSIVE — shared
   ────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .foot__inner {
    grid-template-columns: 1fr 1fr;
  }
  .foot__brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .foot__inner { grid-template-columns: 1fr; }
  .foot__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
