/* opco-tokens.css — Shared design tokens for Codex Corp OpCo sites
   Imported by: site/studios/, site/digital/, site/labs/, site/systems/
   DO NOT import in HoldCo (site/ root).
*/

/* ─── BASE ─────────────────────────────────────────────────── */
:root {
  --color-bg:               #0d0d10;
  --color-bg-footer:        #0a0a0c;
  --color-surface:          rgba(255, 255, 255, 0.05);
  --color-surface-hover:    rgba(255, 255, 255, 0.09);
  --color-border:           rgba(255, 255, 255, 0.08);
  --color-text-primary:     #f2f2f5;
  --color-text-secondary:   #aaaabc;
  --color-text-muted:       #555566;

  /* HoldCo gold — ONLY for "Codex Corp" nav item, consistent across all OpCos */
  --color-holdco-gold:      #f5a623;

  /* ─── NAV ─────────────────────────────────────────────── */
  /* Fix 3: 56 × 1.30 = 72.8 → 72px | 52 × 1.30 = 67.6 → 68px */
  --nav-height:             72px;
  --nav-height-mobile:      68px;
  /* Fix 2: 1.5× more translucent (alpha 0.75 → 0.50), stronger blur */
  --nav-bg:                 rgba(13, 13, 16, 0.50);
  --nav-blur:               saturate(200%) blur(28px);
  --nav-bg-fallback:        rgba(13, 13, 16, 0.88);
  --nav-z:                  1000;

  /* ─── DROPDOWN ──────────────────────────────────────────── */
  /* Same RGB base as nav (13,13,16) to avoid blue-cast at full opacity */
  --dropdown-bg:            rgba(13, 13, 16, 0.97);
  --dropdown-border:        1px solid rgba(255, 255, 255, 0.08);
  --dropdown-radius:        10px;
  --dropdown-shadow:        0 12px 40px rgba(0, 0, 0, 0.7);

  /* ─── FOOTER GLASS (Fix 2) ───────────────────────────────── */
  --footer-bg:              rgba(10, 10, 12, 0.55);
  --footer-blur:            saturate(160%) blur(24px);
  --footer-bg-fallback:     rgba(10, 10, 12, 0.94);

  /* ─── TYPOGRAPHY ─────────────────────────────────────────── */
  --font-wordmark:          'Syne', sans-serif;
  --font-nav:               'Syne', sans-serif;
  --font-body:              'DM Sans', sans-serif;

  /* ─── SPACING ────────────────────────────────────────────── */
  --nav-px:                 clamp(24px, 4vw, 64px);
  --footer-px:              clamp(24px, 6vw, 120px);

  /* ─── MOTION ─────────────────────────────────────────────── */
  --ease-out-expo:          cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast:          150ms;
  --duration-base:          240ms;

  /* ─── FLUID TYPE SCALE ───────────────────────────────────── */
  --text-hero:              clamp(2rem, 6vw, 5rem);
  --text-hero-sub:          clamp(1rem, 2.5vw, 1.375rem);
  --text-section-title:     clamp(1.5rem, 4vw, 3rem);
}

/* ─── PER-OPCO ACCENT (set data-brand on <html>) ─────────── */
/* Dark mode: exact brand colors from each OpCo's hero typography */
[data-brand="studios"]  { --color-accent: #CF7468; }
[data-brand="digital"]  { --color-accent: #A87FD4; }
[data-brand="labs"]     { --color-accent: #5B9E7B; }
[data-brand="systems"]  { --color-accent: #6A8FCC; }

/* Light mode per-OpCo accents: html[data-brand] sets on html,
   body.light-mode sets closer to leaf → wins the cascade */
html[data-brand="studios"] body.light-mode { --color-accent: #B85A4E; }
html[data-brand="digital"] body.light-mode { --color-accent: #7B5CAB; }
html[data-brand="labs"]    body.light-mode { --color-accent: #3D7A5C; }
html[data-brand="systems"] body.light-mode { --color-accent: #4A72B0; }

/* ─── LIGHT MODE (Fix 4) ────────────────────────────────────
   Theme toggle adds .light-mode to <body>.
   Override CSS variables so nav + footer glass switch to light.
──────────────────────────────────────────────────────────── */
body.light-mode {
  --color-bg:              #f4f4f6;
  --color-bg-footer:       #ededf0;
  --color-text-primary:    #0d0d14;
  --color-text-secondary:  #55556a;
  --color-text-muted:      #9999aa;
  --color-border:          rgba(0, 0, 0, 0.10);
  --color-surface:         rgba(0, 0, 0, 0.04);
  --color-surface-hover:   rgba(0, 0, 0, 0.07);

  /* Light glass nav */
  --nav-bg:                rgba(244, 244, 246, 0.60);
  --nav-bg-fallback:       rgba(244, 244, 246, 0.95);
  --nav-blur:              saturate(180%) blur(28px);

  /* Light glass footer */
  --footer-bg:             rgba(237, 237, 240, 0.65);
  --footer-bg-fallback:    rgba(237, 237, 240, 0.97);

  /* Light dropdown */
  --dropdown-bg:           rgba(248, 248, 250, 0.96);
  --dropdown-border:       1px solid rgba(0, 0, 0, 0.10);
  --dropdown-shadow:       0 12px 40px rgba(0, 0, 0, 0.15);
  --color-holdco-gold:     #c47d0a;
}

/* ═══════════════════════════════════════════════════════════
   COMPONENT OVERRIDES
   These selectors have higher specificity than the matching
   rules in each page's <style> block, so they win the cascade.
═══════════════════════════════════════════════════════════ */

/* ── Nav & footer typography: match each OpCo's body font system ── */

/* Wordmark: Syne 800, tight tracking (matches hero typography) */
html .opco-nav-wordmark {
  font-family: var(--font-wordmark);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.10em;
}
html .opco-footer-wordmark {
  font-family: var(--font-wordmark);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.10em;
}

/* Nav links: Syne small uppercase tracked (original .nav-link style) */
html .opco-nav-link {
  font-family: var(--font-nav);
  font-size: 0.60rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Holdco "Codex Corp" button: same label treatment */
html .opco-nav-holdco {
  font-family: var(--font-nav);
  font-size: 0.60rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* CTA button: Syne, uppercase, tracked, square corners (not rounded) */
html .opco-nav-cta {
  font-family: var(--font-nav);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* Mobile CTA button: square corners to match desktop */
html .mobile-cta-btn {
  font-family: var(--font-nav);
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* Footer col headings: Syne (not body DM Sans) — uppercase tracked labels */
html .opco-footer-col-heading {
  font-family: var(--font-nav);
}

/* Footer tagline "A Codex Corp Company": Syne uppercase tracked */
html .opco-footer-tagline {
  font-family: var(--font-nav);
}

/* Footer bottom bar: Syne small */
html .opco-footer-bottom {
  font-family: var(--font-nav);
}

/* Fix 1: Dropdown OpCo names use Syne wordmark font
   Specificity: html + 2 classes = (0,2,1) > .dd-item = (0,1,0) */
html .opco-nav-dropdown .dd-item {
  font-family: var(--font-wordmark);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.65rem;
}

/* Fix 2: Footer glass — override solid background
   Specificity: html + 1 class = (0,1,1) > .opco-footer = (0,1,0) */
html .opco-footer {
  background: var(--footer-bg-fallback);
}
@supports (backdrop-filter: blur(1px)) {
  html .opco-footer {
    background: var(--footer-bg);
    backdrop-filter: var(--footer-blur);
    -webkit-backdrop-filter: var(--footer-blur);
  }
}

/* Fix 5a: Dropdown hover uses per-OpCo accent tint via color-mix
   Specificity: (0,2,1) */
html .opco-nav-dropdown .dd-item:hover {
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-text-primary);
  filter: none;
}

/* Fix 5b: Per-OpCo dropdown row colors — always, using exact brand hex.
   Specificity: html + .opco-nav-dropdown + [attr] = (0,2,2) */
html .opco-nav-dropdown a[href*="studios.codexcorp.ca"] {
  color: #CF7468;
}
html .opco-nav-dropdown a[href*="digital.codexcorp.ca"] {
  color: #A87FD4;
}
html .opco-nav-dropdown a[href*="labs.codexcorp.ca"] {
  color: #5B9E7B;
}
html .opco-nav-dropdown a[href*="systems.codexcorp.ca"] {
  color: #6A8FCC;
}
/* Hover: brighten slightly */
html .opco-nav-dropdown a[href*="studios.codexcorp.ca"]:hover { filter: brightness(1.15); }
html .opco-nav-dropdown a[href*="digital.codexcorp.ca"]:hover  { filter: brightness(1.15); }
html .opco-nav-dropdown a[href*="labs.codexcorp.ca"]:hover     { filter: brightness(1.15); }
html .opco-nav-dropdown a[href*="systems.codexcorp.ca"]:hover  { filter: brightness(1.15); }
/* Active row: full brightness, no pointer */
html .opco-nav-dropdown .dd-item.dd-active {
  filter: brightness(1.2);
  pointer-events: none;
  cursor: default;
}

/* Fix 5c: Per-OpCo footer Companies link colors — mirrors dropdown colors.
   Specificity: html + .opco-footer + [attr] = (0,2,2) */
html .opco-footer a[href*="studios.codexcorp.ca"] { color: #CF7468; }
html .opco-footer a[href*="digital.codexcorp.ca"] { color: #A87FD4; }
html .opco-footer a[href*="labs.codexcorp.ca"]    { color: #5B9E7B; }
html .opco-footer a[href*="systems.codexcorp.ca"] { color: #6A8FCC; }
html .opco-footer a[href*="studios.codexcorp.ca"]:hover { filter: brightness(1.15); }
html .opco-footer a[href*="digital.codexcorp.ca"]:hover { filter: brightness(1.15); }
html .opco-footer a[href*="labs.codexcorp.ca"]:hover    { filter: brightness(1.15); }
html .opco-footer a[href*="systems.codexcorp.ca"]:hover { filter: brightness(1.15); }

/* Fix 6: Single source of truth for accent on wordmark + CTA
   These already use var(--color-accent) but this enforces no drift.
   Specificity: (0,2,1) and (0,1,1) */
html .opco-nav-wordmark .wm-brand {
  color: var(--color-accent);
  opacity: 1;
  filter: none;
}
html .opco-nav-cta {
  background-color: var(--color-accent);
  opacity: 1;
  filter: none;
}

/* Fix 4: Light mode nav text adjustments */
body.light-mode .opco-nav-link { color: var(--color-text-secondary); }
body.light-mode .opco-nav-link:hover { color: var(--color-text-primary); }
body.light-mode .wm-codex { color: var(--color-text-primary); }
body.light-mode .opco-nav-cta { color: #ffffff; }
body.light-mode .opco-footer-col a { color: var(--color-text-secondary); }
body.light-mode .opco-footer-tagline { color: var(--color-text-muted); }
body.light-mode .opco-footer-col-heading { color: var(--color-text-muted); }
body.light-mode .opco-footer-bottom { color: var(--color-text-muted); }
