@font-face { font-family: 'Geist'; font-style: normal; font-weight: 300; font-display: swap; src: url('/assets/fonts/geist-300.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/geist-400.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/geist-500.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/geist-600.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/geist-700.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/jetbrains-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/jetbrains-mono-500.woff2') format('woff2'); }

:root {
  --bg: oklch(0.985 0.003 240);
  --bg-elev: oklch(0.965 0.004 240);
  --bg-elev-2: oklch(0.94 0.005 240);
  --fg: oklch(0.18 0.03 258);
  --fg-dim: oklch(0.38 0.02 258);
  --fg-faint: oklch(0.48 0.015 258);
  --hairline: oklch(0.18 0.03 258 / 0.10);
  --hairline-strong: oklch(0.18 0.03 258 / 0.18);
  --accent: oklch(0.50 0.14 258);
  --accent-dim: oklch(0.72 0.07 258);
  --navy: oklch(0.18 0.03 258);
  --font-sans: 'Geist', system-ui, -apple-system, sans-serif;
  --font-display: 'Geist', system-ui, sans-serif;
}

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
* { box-sizing: border-box; }
::selection { background: var(--accent); color: var(--bg); }

em { font-style: normal; }
.serif { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.035em; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'zero'; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }

.gridbg {
  background-image:
    linear-gradient(to right, color-mix(in oklch, var(--fg) 5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklch, var(--fg) 5%, transparent) 1px, transparent 1px);
  background-size: 80px 80px;
}

.line-reveal { position: relative; }
.line-reveal::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.line-reveal:hover::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .nav-mobile-panel { transition: none !important; }
}

/* ─── BrandMap focus + sr-only utility (was inline <style> in
   src/pages/brands.jsx via dangerouslySetInnerHTML; lifted here so we
   can enable Trusted Types in the CSP without an exception). */
button[data-brand-pin]:focus-visible,
a[data-brand-pin]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.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;
}
@media (max-width: 1024px) {
  [data-brand-network-grid] {
    grid-template-columns: 1fr !important;
  }
}

/* ─── Skip-to-content link (a11y, first focusable on every page) ──── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 1000;
  padding: 14px 20px;
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: top 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Focus-visible for every interactive element ─────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex="0"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── 44×44 touch-target floor on the global nav links + footer links */
nav a, nav button, header a, header button,
footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Footer links live inside grids; force min-height via inline-flex */
footer a {
  padding: 4px 8px;
  min-width: 44px;
  justify-content: flex-start;
  margin-left: -8px;
}
/* Footer bottom row legal links need explicit hit area */
footer [data-footer-bottom] a {
  padding: 12px 14px;
  margin: -12px -14px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Mobile-first responsive layer ───────────────────────────────── */
/* Tablet portrait and below: collapse multi-column grids to one. */
@media (max-width: 1024px) {
  [data-responsive-grid] {
    grid-template-columns: 1fr !important;
    gap: clamp(24px, 4vw, 48px) !important;
  }
  [data-responsive-section] {
    padding-left: clamp(16px, 4vw, 32px) !important;
    padding-right: clamp(16px, 4vw, 32px) !important;
  }
}
@media (max-width: 768px) {
  /* Reduce extreme inline section padding on every <section> in <main>.
     The vertical clamp was clamp(48px, 14vw, 100px) — at 360px that's
     ~50px top + 50px bottom = 100px gap between adjacent sections,
     which read as wasted whitespace. Tightened. */
  main section {
    padding-top: clamp(32px, 8vw, 70px) !important;
    padding-bottom: clamp(32px, 8vw, 70px) !important;
    padding-left: clamp(16px, 4vw, 32px) !important;
    padding-right: clamp(16px, 4vw, 32px) !important;
  }
  /* Headline shrink on narrow viewports — applies to inline-styled
     hero h1 / large h2 / feature copy without changing copy. */
  main h1 {
    font-size: clamp(36px, 9vw, 56px) !important;
    line-height: 1.05 !important;
  }
  main h2 {
    font-size: clamp(24px, 6vw, 36px) !important;
    line-height: 1.15 !important;
  }
  main h3 {
    font-size: clamp(18px, 4.6vw, 24px) !important;
  }
  /* Footer top-row on narrow widths: brand block on its own row,
     four link columns paired into a 2-column grid below it.
     Looks more considered than a tall single column of everything. */
  footer [data-footer-grid] {
    grid-template-columns: 1fr 1fr !important;
    gap: clamp(24px, 5vw, 36px) clamp(16px, 4vw, 28px) !important;
  }
  footer [data-footer-grid] > :first-child {
    grid-column: 1 / -1 !important;
  }
  /* Stack footer bottom row (copyright + legal links) vertically */
  footer [data-footer-bottom] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }
  /* Tables / role-row grids that use heavy fixed columns: collapse
     to a flex-stack. Targets PR #72 careers role rows + PR #73
     cookie inventory table. */
  [data-stack-on-mobile] {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    padding: 18px 0 !important;
  }
  [data-stack-on-mobile] > * {
    text-align: left !important;
  }
  /* Catch-all: any inline grid-template-columns value inside a main
     section collapses to a single column on narrow viewports.
     Excludes layout-grids that opt out via [data-keep-grid]. */
  main section div[style*="grid-template-columns"]:not([data-keep-grid]) {
    grid-template-columns: 1fr !important;
    gap: clamp(16px, 4vw, 32px) !important;
  }
  main section a[style*="grid-template-columns"]:not([data-keep-grid]) {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
  /* Preserve thin (1px) hairline-partition gap when those grids
     collapse — without this, the catch-all above turns the 1px
     hairline divider into a 16–32px grey block on mobile. */
  main section div[style*="grid-template-columns"][style*="gap:1px"]:not([data-keep-grid]),
  main section div[style*="grid-template-columns"][style*="gap: 1px"]:not([data-keep-grid]) {
    gap: 1px !important;
  }
  /* Disable sticky title columns on mobile. With the grid collapsed
     to a single column, a sticky child overlaps the content that
     follows it as the user scrolls. */
  main section div[style*="position:sticky"],
  main section div[style*="position: sticky"] {
    position: static !important;
    top: auto !important;
  }
  /* Force any Cookies-page table (PR #73) to scroll horizontally so
     it cannot push viewport width. */
  [data-cookie-table] {
    overflow-x: auto !important;
  }
  /* Body inputs / selects: 44px min height for touch */
  input, select, textarea, button {
    min-height: 44px;
  }
  /* Generic opt-in: any element with [data-hide-on-mobile] disappears
     at <=768px. Used by PageHero to hide /brands subtitle on mobile. */
  [data-hide-on-mobile] {
    display: none !important;
  }
  /* Generic: every PageHero section gets a smaller bottom-padding on
     mobile. Default desktop padding is clamp(48,8vw,80) — at 360px
     that's 48px floor, way too generous when the next section also
     has its own top padding. Reduces the visible-subtitle-pages gap
     (careers, news, about, services, contact, privacy, terms,
     cookies) on mobile without hiding the subtitle. */
  section[data-page-hero] {
    padding-bottom: clamp(20px, 5vw, 40px) !important;
  }
  /* Even tighter when there's no visible mobile subtitle (no subtitle
     prop OR subtitleHideOnMobile=true). Kills H1 bottom margin too
     since nothing follows the H1 in the hero. */
  section[data-page-hero-tight] {
    padding-bottom: 8px !important;
  }
  section[data-page-hero-tight] h1 {
    margin-bottom: 0 !important;
  }
  section[data-page-hero-tight] + main > section:first-of-type {
    padding-top: clamp(24px, 6vw, 48px) !important;
  }
  /* Trim the gap between the BrandMap section and whatever follows it.
     The post-map column is the last visible thing in the brand-network
     section on mobile — the default 14vw padding is too generous. */
  main section:has([data-brand-map]) {
    padding-bottom: clamp(20px, 5vw, 40px) !important;
  }
  main section:has([data-brand-map]) + section {
    padding-top: clamp(24px, 6vw, 48px) !important;
  }
}

/* Body min-font-size 16px (WCAG 1.4.4) */
body { font-size: 16px; }

/* Make all SVG-based maps fit narrow viewports while preserving
   aspect ratio (BrandMap + CoverageMap are SVGs with viewBox; the
   constraint forbids redrawing them, so we just let CSS scale them). */
[data-brand-map-column] svg,
[data-coverage-map] svg {
  max-width: 100%;
  height: auto;
}

/* On touch devices, make BrandMap dot focus reveal the same card
   the desktop hover does. (PR #69 already wires this via JS — this
   rule just makes the pin halos visibly larger on coarse pointers
   so they're easier to tap, without changing desktop visuals.) */
@media (pointer: coarse) {
  [data-brand-pin] { touch-action: manipulation; }
}

/* ─── Mobile nav (hamburger) styles, used by Nav.jsx ───────────────── */
.hamburger-button {
  display: none;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  cursor: pointer;
  color: var(--fg);
  min-width: 44px;
  min-height: 44px;
}
.nav-desktop-row { display: flex; }
@media (max-width: 768px) {
  .hamburger-button { display: inline-flex; }
  .nav-desktop-row { display: none; }
}
.nav-mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(360px, 86vw);
  background: var(--bg);
  border-left: 1px solid var(--hairline-strong);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  padding: 84px 24px 24px;
  gap: 14px;
  box-shadow: -16px 0 40px rgba(0,0,0,.08);
}
.nav-mobile-panel[data-open="true"] {
  transform: translateX(0);
}
.nav-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.32);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.nav-mobile-backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}
.nav-mobile-panel a {
  font-size: 18px;
  color: var(--fg);
  text-decoration: none;
  padding: 12px 4px;
  border-bottom: 1px solid var(--hairline);
  min-height: 44px;
  display: flex;
  align-items: center;
}
body[data-scroll-lock="true"] {
  overflow: hidden;
}
