/* ─────────────────────────────────────────────────────────────────────────
   Compass Global Magazine — global stylesheet
   Source of truth for tokens, fonts, base typography, and the masthead.
   All pages on CompassGlobalMagazine.com should <link> this file
   BEFORE any page-specific styles.

   Canonical branding aligns with mockups/compass-global-v3.html
   (the Nikkei Asia / TrendForce / Bloomberg / FT-pattern layout).
   See branding.html for the visual style guide and
   docs/compass-global-branding.md for the text spec.
   ───────────────────────────────────────────────────────────────────────── */

/* ── FONTS — Playfair Display (display), Inter (body), JetBrains Mono (meta) ── */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;0,800;0,900;1,600;1,700;1,800&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

/* ── TOKENS ────────────────────────────────────────────────────────────── */
:root {
  /* Ink — neutral cool black so steel italic pops next to it */
  --ink:        oklch(22% 0.018 250);
  --ink-soft:   oklch(38% 0.018 250);
  --ink-mute:   oklch(56% 0.015 250);

  /* Paper — warm cream surfaces */
  --paper:      oklch(98.5% 0.005 245);
  --paper-warm: oklch(96% 0.010 245);
  --paper-deep: oklch(93% 0.014 245);
  --surface:    #ffffff;
  --rule:       oklch(86% 0.012 245);
  --rule-soft:  oklch(92% 0.010 245);

  /* Brand spine — steel blue */
  --steel:      oklch(48% 0.110 245);
  --steel-deep: oklch(38% 0.125 245);
  --steel-glow: oklch(62% 0.140 240);
  --steel-soft: oklch(90% 0.030 245);

  /* Brand warm — brass gold */
  --brass:      oklch(70% 0.110 75);
  --brass-soft: oklch(92% 0.045 80);

  /* Semantic aliases — keep markup readable, swap meaning underneath */
  --accent:      var(--steel);
  --accent-soft: var(--steel-soft);
  --accent-deep: var(--steel-deep);
  --gold:        var(--brass);
  --gold-soft:   var(--brass-soft);
  --good:        oklch(58% 0.180 145);

  --serif: "Playfair Display", "Fraunces", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", Menlo, monospace;

  --measure: 36rem;
  --max:     1280px;
}

/* ── RESET + BASE ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--ink); color: var(--paper); }

/* Any anchor target should clear the sticky masthead (~88px tall + breathing room) */
[id] { scroll-margin-top: 110px; }

.serif { font-family: var(--serif); }
.sans  { font-family: var(--sans); }
.mono  { font-family: var(--mono); }
.wrap  { max-width: var(--max); margin: 0 auto; padding: 0 32px; }

/* ── EDITORIAL META — kickers, eyebrows, tags ─────────────────────────── */
.kicker, .eyebrow, .meta-mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow.muted, .meta-mono.muted { color: var(--ink-mute); }
.eyebrow.brass { color: var(--brass); }

/* ── UTILITY BAR (Nikkei Asia / FT pattern) ───────────────────────────── */
.utility {
  background: var(--ink);
  color: #fff;
  font-size: 12px;
}
.utility-row {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.utility-left, .utility-right { display: flex; gap: 18px; align-items: center; }
.utility a { opacity: 0.78; transition: opacity 150ms; font-weight: 500; }
.utility a:hover { opacity: 1; }
.utility .sep { opacity: 0.3; }
.lang-active { color: var(--accent-soft); opacity: 1 !important; font-weight: 700; }
.subscribe-link {
  background: var(--accent);
  color: #fff !important;
  opacity: 1 !important;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── MASTHEAD ──────────────────────────────────────────────────────────── */
.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.masthead-row,
.masthead-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
}

/* ── WORDMARK (canonical anatomy from compass-global-v3) ──────────────── */
.wordmark-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}
.wordmark {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.wordmark-global {
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
  font-size: 24px;
}
.wordmark-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 700;
  padding-left: 2px;
}
.wordmark-edition {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 600;
  align-self: center;
}
@media (max-width: 760px) { .wordmark-edition { display: none; } }
@media (max-width: 540px) {
  .wordmark { font-size: 24px; }
  .wordmark-global { font-size: 19px; }
  .wordmark-tag { font-size: 9px; letter-spacing: 0.32em; }
}

/* ── PRIMARY NAV ───────────────────────────────────────────────────────── */
.nav-primary {
  display: flex;
  gap: 22px;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.nav-primary a { transition: color 150ms; white-space: nowrap; }
.nav-primary a:hover,
.nav-primary a.active { color: var(--accent); }
.nav-primary a.active { border-bottom: 2px solid var(--accent); padding-bottom: 4px; }

.nav-right { display: flex; gap: 14px; align-items: center; }
.nav-cta {
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 150ms;
}
.nav-cta:hover { background: var(--accent); }
@media (max-width: 980px) {
  .nav-primary { display: none; }
  .masthead-row,
  .masthead-inner { grid-template-columns: 1fr auto; }
}

/* ── DISPLAY HEADINGS (use anywhere serif heading is needed) ──────────── */
.h-display {
  font-family: var(--serif);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}
.h-display em { font-style: italic; font-weight: 700; color: var(--accent); }

/* ── BUTTONS ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 12px 22px;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 0;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
  text-decoration: none;
}
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--accent); }
.btn-steel { background: var(--accent); color: #fff; }
.btn-steel:hover { background: var(--accent-deep); }
.btn-brass { background: var(--brass); color: var(--ink); }
.btn-brass:hover { filter: brightness(1.08); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-outline:hover { background: var(--ink); color: #fff; }

/* ── MOTION ────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
