/* ============================================================
   THE BAHT — DESIGN SYSTEM
   v1.0 · May 2026
   ============================================================
   Single source of truth for the site's visual language.
   Import this on every page. Page-specific CSS goes after it.
   ============================================================ */

/* ===== FONTS =================================================
   Add this to the <head> of every page:

   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400;0,6..96,500;0,6..96,700;0,6..96,900;1,6..96,400;1,6..96,500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">

   For production, self-host these via @font-face for speed.
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* COLOUR — Background scale (dark, warm) */
  --bg:           #0d0b08;
  --bg-2:         #14110d;
  --bg-3:         #1c1814;
  --bg-4:         #2a2520;

  /* COLOUR — Borders */
  --border:        #2e2822;
  --border-strong: #423a30;

  /* COLOUR — Text scale */
  --text:       #f0e8d8;
  --text-soft:  #c8bea8;
  --text-muted: #8a8170;
  --text-dim:   #5a5346;

  /* COLOUR — Brand accent */
  --gold:        #c89a3a;
  --gold-bright: #e0b958;
  --gold-deep:   #8a6818;

  /* COLOUR — Secondary accents (use sparingly) */
  --terracotta: #c4623e;
  --teal:       #4a8278;

  /* COLOUR — Semantic (market) */
  --up:       #5fd17b;
  --up-dim:   #2a6b3a;
  --down:     #ff6868;
  --down-dim: #8a2a2a;

  /* TYPOGRAPHY — Stacks */
  --font-display: 'Bodoni Moda', Georgia, serif;
  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-sans:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* SPACING — On an 8px scale */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  80px;
  --s-10: 96px;

  /* LAYOUT */
  --container-max: 1480px;
  --container-pad: 48px;

  /* MOTION */
  --t-fast:   0.15s;
  --t-medium: 0.3s;
  --t-slow:   0.6s;
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   2. RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle film grain (universal) */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.78 0 0 0 0 0.55 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

/* Warm light pool from top */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 100% 60% at 50% -10%, rgba(200, 154, 58, 0.06) 0%, transparent 60%);
}

img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; }

/* ============================================================
   3. CONTAINER
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  position: relative;
  z-index: 2;
}

/* ============================================================
   4. TYPOGRAPHY — Reusable classes
   ============================================================
   USAGE RULES:
   - Bodoni Moda: HEADLINES only (h1, h2 of sections, big numbers)
   - Cormorant Garamond italic: body decks, pull quotes, captions
   - DM Sans: UI, navigation, body copy, labels
   - JetBrains Mono: numbers, codes, market data, tags
   ============================================================ */

/* Display headlines (Bodoni) */
.t-display-xl {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 5.5vw, 76px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--text);
}
.t-display-l {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 4.5vw, 60px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--text);
}
.t-display-m {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
}
.t-display-s {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Italic emphasis inside headlines — use sparingly */
.t-display-xl em, .t-display-l em, .t-display-m em, .t-display-s em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}

/* Editorial body */
.t-body {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-soft);
}
.t-body-l {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.4;
  color: var(--text-soft);
}

/* UI body (forms, navigation, captions) */
.t-ui {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
}
.t-ui-s {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

/* Eyebrows / labels */
.t-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.t-label {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.t-label-gold {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Mono — numbers and codes */
.t-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.t-mono-l {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
}

.up { color: var(--up) !important; }
.down { color: var(--down) !important; }

/* ============================================================
   5. HEADER PRIMITIVES
   ============================================================ */

/* Market status bar (top of every page) */
.market-status {
  background: #000;
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
}
.market-status .status-track {
  display: flex;
  gap: 36px;
  padding: 8px 0;
  white-space: nowrap;
  animation: scrollLeft 80s linear infinite;
  width: max-content;
}
.market-status .status-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.03em;
}
.market-status .status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 8px var(--up);
}
.market-status .status-dot.closed { background: var(--down); box-shadow: 0 0 6px var(--down); }
.market-status .status-dot.gold { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.market-status .status-label { color: var(--text-dim); }
.market-status .status-value { color: var(--text-soft); }
.market-status .status-up { color: var(--up); }
.market-status .status-down { color: var(--down); }
@keyframes scrollLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Issue strip (small bar above masthead) */
.strip {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.strip-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.strip-meta {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.strip-rate {
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
}
.strip-rate em {
  font-style: italic;
  color: var(--text-dim);
  font-family: var(--font-serif);
  font-weight: 400;
  margin-right: 8px;
}

/* Masthead */
.masthead {
  padding: 40px 0 32px;
  text-align: center;
  border-bottom: 3px double var(--border-strong);
  position: relative;
}
.masthead-meta-l, .masthead-meta-r {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  max-width: 180px;
  line-height: 1.5;
}
.masthead-meta-l { left: 0; text-align: left; }
.masthead-meta-r { right: 0; text-align: right; }
.masthead-meta-l strong,
.masthead-meta-r strong {
  display: block;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 2px;
}

/* Wordmark / logo */
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(64px, 9vw, 124px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variation-settings: "opsz" 96;
  text-decoration: none;
  display: inline-block;
}
.wordmark .the {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 0.35em;
  color: var(--gold);
  vertical-align: 0.9em;
  margin-right: 0.05em;
}
.wordmark .symbol {
  color: var(--gold);
  font-weight: 700;
  font-style: italic;
  margin-left: 0.04em;
}

/* Compact wordmark for inner page headers */
.wordmark-sm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}
.wordmark-sm .the {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 0.5em;
  color: var(--gold);
  margin-right: 4px;
}
.wordmark-sm .symbol { color: var(--gold); margin-left: 3px; font-style: italic; }

.tagline {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  color: var(--text-soft);
}

/* Department navigation */
nav.dept-nav {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.dept-list {
  display: flex;
  justify-content: center;
  gap: 56px;
  list-style: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.dept-list a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--t-fast);
  padding: 4px 0;
}
.dept-list a:hover { color: var(--gold); }
.dept-list a.active { color: var(--gold); }
.dept-list .num {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 10px;
  color: var(--gold);
  margin-right: 6px;
  vertical-align: 0.2em;
  letter-spacing: 0;
}

/* Compact header (for non-homepage pages) */
.header-compact {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.header-compact nav.dept-nav-inline {
  border: none;
  padding: 0;
}
.header-compact .dept-list { justify-content: flex-start; gap: 32px; }

/* ============================================================
   6. DEPARTMENT HEADS (section starters)
   ============================================================ */
.dept-head {
  padding: 80px 0 40px;
  text-align: center;
}
.dept-num-display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 12px;
}
.dept-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 4.5vw, 60px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
  color: var(--text);
}
.dept-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--gold-bright);
}
.dept-deck {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  color: var(--text-soft);
  max-width: 580px;
  margin: 0 auto;
}
.dept-rule {
  width: 60px;
  height: 1px;
  background: var(--border-strong);
  margin: 32px auto 0;
  position: relative;
}
.dept-rule::before,
.dept-rule::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateY(-50%);
}
.dept-rule::before { left: -8px; }
.dept-rule::after { right: -8px; }

/* Left-aligned section header (for inner pages) */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  gap: 32px;
}
.section-head-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.section-head-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}
.section-head-link {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1.5px solid var(--text);
  padding-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: gap var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.section-head-link:hover {
  gap: 16px;
  color: var(--gold);
  border-color: var(--gold);
}

/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 22px;
  border-radius: 2px;
  border: 1px solid;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn-primary {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-3);
  border-color: var(--text);
}
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--gold); }
.btn-large {
  padding: 18px 28px;
  font-size: 12px;
  letter-spacing: 0.2em;
}
.btn-block { display: block; width: 100%; }

/* Inline serif-arrow CTA link (editorial feel) */
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--text);
  transition: color var(--t-fast), border-color var(--t-fast), gap var(--t-fast);
}
.cta-link:hover {
  color: var(--gold);
  border-color: var(--gold);
  gap: 20px;
}
.cta-link .arrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0;
}

/* ============================================================
   8. FORMS
   ============================================================ */
.input {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 14px 16px;
  border-radius: 2px;
  width: 100%;
  transition: border-color var(--t-fast);
}
.input:focus { outline: none; border-color: var(--gold); }
.input::placeholder { color: var(--text-dim); }

.input-mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.input-display {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--text-soft);
  padding: 14px 4px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  border-radius: 0;
}
.input-display:focus { border-color: var(--gold); }
.input-display::placeholder {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-dim);
}

/* ============================================================
   9. TERMINAL (the centrepiece, reusable)
   ============================================================ */
.terminal-section { padding: 56px 0 24px; }

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.terminal-title-block .eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.terminal-title-block .eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--up);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--up);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.terminal-title-block h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
}
.terminal-title-block h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}
.terminal-clock {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.6;
}
.terminal-clock .time {
  color: var(--gold);
  font-size: 16px;
  font-weight: 600;
}
.terminal-clock .session { color: var(--up); margin-top: 2px; }

.terminal {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.term-panel {
  background: var(--bg-2);
  padding: 0;
}
.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.panel-head .live {
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.panel-head .live::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  animation: pulse 1.5s infinite;
}

/* Pair row in watchlist */
.pair-row {
  display: grid;
  grid-template-columns: 1fr 1fr 70px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  cursor: pointer;
  transition: background var(--t-fast);
}
.pair-row:last-child { border-bottom: none; }
.pair-row:hover { background: var(--bg-3); }
.pair-row.active {
  background: var(--bg-3);
  border-left: 2px solid var(--gold);
  padding-left: 14px;
}
.pair-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}
.pair-rate {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  transition: color var(--t-medium);
}
.pair-rate.tick-up { color: var(--up); }
.pair-rate.tick-down { color: var(--down); }
.pair-change {
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
  font-weight: 500;
}
.pair-change.up { color: var(--up); }
.pair-change.down { color: var(--down); }

/* Main chart */
.term-main { display: flex; flex-direction: column; }
.main-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.main-pair {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.main-pair .from-curr { color: var(--text); }
.main-pair .slash { color: var(--text-dim); margin: 0 4px; }
.main-pair .to-curr { color: var(--gold); }
.main-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.main-price {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: right;
}
.main-price .frac { color: var(--text-muted); font-size: 0.6em; }
.main-change {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
  text-align: right;
}

.chart-area {
  flex: 1;
  min-height: 320px;
  position: relative;
  padding: 0;
  background:
    linear-gradient(to right, var(--border) 1px, transparent 1px) 0 0 / 80px 100%,
    linear-gradient(to bottom, var(--border) 1px, transparent 1px) 0 0 / 100% 60px;
}
.chart-area::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg-2) 100%);
  opacity: 0.4;
  pointer-events: none;
}
.chart-svg { width: 100%; height: 100%; position: absolute; inset: 0; }
.chart-tf {
  position: absolute;
  bottom: 12px;
  left: 16px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.tf-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--t-fast);
}
.tf-btn:hover { color: var(--text); border-color: var(--border-strong); }
.tf-btn.on {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}

.chart-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
}
.chart-stat {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
}
.chart-stat:last-child { border-right: none; }
.chart-stat-l {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.chart-stat-v {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Convert ticket */
.ticket {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.ticket-row {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}
.ticket-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  padding: 10px 12px;
  width: 100%;
  border-radius: 2px;
  letter-spacing: -0.01em;
}
.ticket-input.out { color: var(--gold-bright); }
.ticket-input:focus { outline: none; border-color: var(--gold); }
.ticket-curr {
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  border-radius: 2px;
}
.ticket-rate {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin: 8px 0 12px;
  letter-spacing: 0.04em;
}
.ticket-rate b { color: var(--gold); font-weight: 600; }

/* Calendar / events */
.events-list { flex: 1; overflow-y: auto; }
.event {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: start;
}
.event:last-child { border-bottom: none; }
.event-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  line-height: 1.3;
}
.event-time small {
  display: block;
  color: var(--text-dim);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}
.event-body {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-soft);
}
.event-body b {
  color: var(--text);
  font-weight: 600;
  display: block;
  font-size: 12.5px;
  margin-bottom: 2px;
}
.event-imp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: middle;
}
.event-imp.high { background: rgba(255,104,104,0.15); color: var(--down); }
.event-imp.med  { background: rgba(200,154,58,0.15); color: var(--gold); }

/* ============================================================
   10. HEATMAP
   ============================================================ */
.heatmap-section { padding: 32px 0 64px; }
.heatmap-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.heatmap-title h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.heatmap-title h3 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.heatmap-legend .swatch {
  display: inline-block;
  width: 80px; height: 12px;
  background: linear-gradient(90deg, var(--down) 0%, var(--bg-3) 50%, var(--up) 100%);
  border: 1px solid var(--border);
}
.heatmap {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.heat-cell {
  background: var(--bg-2);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform var(--t-fast);
  position: relative;
}
.heat-cell:hover {
  transform: scale(1.05);
  z-index: 2;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.heat-pair {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-soft);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.heat-pct {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ============================================================
   11. CARD / PROVIDER ROW (used in compare pages too)
   ============================================================ */
.provider {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  align-items: start;
  padding-top: 32px;
  border-top: 1px solid var(--border-strong);
  position: relative;
}
.prov-rank {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 56px;
  color: var(--text);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.provider.first .prov-rank {
  color: var(--gold);
  font-style: italic;
}
.provider.first::before {
  content: 'Best today';
  position: absolute;
  top: -10px; left: 84px;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.prov-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--text);
}
.prov-tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.prov-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.prov-stat-l {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.prov-stat-v {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
}

/* ============================================================
   12. STORIES / CARDS
   ============================================================ */
.story-art {
  aspect-ratio: 4/5;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.story-art-num {
  position: absolute;
  top: 20px; left: 24px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: rgba(240, 232, 216, 0.85);
  z-index: 2;
}
.story-dept {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.story-dept::before {
  content: '·';
  color: var(--gold);
  font-size: 24px;
  line-height: 0;
}
.story-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.story-title a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--t-fast);
}
.story-title a:hover { color: var(--gold); }
.story-dek {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-soft);
  margin-bottom: 16px;
}
.story-byline {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.story-byline strong { color: var(--text-soft); font-weight: 600; }

/* ============================================================
   13. NEWSLETTER BLOCK
   ============================================================ */
.newsletter {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  padding: 72px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 72px;
  align-items: center;
  margin-bottom: 80px;
  position: relative;
}
.newsletter::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--border);
  pointer-events: none;
}
.news-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--gold);
  margin-bottom: 20px;
}
.news-h {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
  color: var(--text);
}
.news-h em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--gold-bright);
}
.news-deck {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 460px;
  margin-bottom: 24px;
}
.news-readers {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.news-readers strong { color: var(--gold); }
.news-form { display: flex; flex-direction: column; gap: 16px; position: relative; z-index: 2; }
.news-fine {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

/* ============================================================
   14. ARTICLE TYPE (long-form pages)
   ============================================================ */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 0;
}
.article-meta-top {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.article-meta-top::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--gold);
}
.article-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 28px;
  color: var(--text);
}
.article-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}
.article-dek {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.4;
  color: var(--text-soft);
  margin-bottom: 32px;
}
.article-byline {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.article-byline strong { color: var(--text); font-weight: 600; }
.article-byline .pipe { color: var(--border-strong); margin: 0 12px; }

.article-body p {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 24px;
}
.article-body p.lead::first-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 72px;
  float: left;
  line-height: 0.85;
  margin: 4px 12px 0 0;
  color: var(--gold);
}
.article-body h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 48px 0 20px;
}
.article-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--text);
  margin: 36px 0 16px;
}
.article-body blockquote {
  border-left: 3px solid var(--gold);
  padding: 8px 0 8px 28px;
  margin: 32px 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.3;
  color: var(--text);
}
.article-body a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: var(--gold-deep);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-fast);
}
.article-body a:hover { text-decoration-color: var(--gold); }
.article-body ul, .article-body ol {
  margin: 0 0 24px 24px;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.65;
  color: var(--text);
}
.article-body li { margin-bottom: 8px; }
.article-body code {
  font-family: var(--font-mono);
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 0.85em;
  color: var(--gold);
}

/* ============================================================
   15. FOOTER (universal)
   ============================================================ */
footer.site-footer {
  padding: 64px 0 32px;
  border-top: 3px double var(--border-strong);
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
.foot-mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 44px;
  line-height: 1;
  margin-bottom: 16px;
  color: var(--text);
}
.foot-mark .the {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 0.42em;
  color: var(--gold);
  margin-right: 4px;
}
.foot-mark .symbol { color: var(--gold); font-style: italic; }
.foot-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-muted);
  max-width: 280px;
  font-size: 16px;
}
.foot-col h4 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--gold);
  margin-bottom: 18px;
}
.foot-col ul { list-style: none; }
.foot-col li { margin-bottom: 10px; }
.foot-col a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--t-fast);
}
.foot-col a:hover { color: var(--gold); }
.foot-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--text-dim);
}

/* ============================================================
   16. UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.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;
}
.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: var(--s-4); }
.mt-8 { margin-top: var(--s-8); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-8 { margin-bottom: var(--s-8); }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }

/* ============================================================
   17. RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
  :root { --container-pad: 32px; }
  .terminal { grid-template-columns: 280px 1fr 280px; }
}

@media (max-width: 1100px) {
  .terminal { grid-template-columns: 1fr; }
  .term-panel { border-bottom: 1px solid var(--border); }
  .heatmap { grid-template-columns: repeat(5, 1fr); }
  .masthead-meta-l, .masthead-meta-r { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .terminal-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .terminal-clock { text-align: left; }
  .newsletter { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 680px) {
  :root { --container-pad: 20px; }
  .dept-list {
    gap: 24px;
    font-size: 11px;
    overflow-x: auto;
    padding-bottom: 4px;
    justify-content: flex-start;
  }
  .heatmap { grid-template-columns: repeat(3, 1fr); }
  .newsletter { padding: 40px 28px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .strip-inner { flex-direction: column; gap: 8px; text-align: center; }
  .chart-stats { grid-template-columns: repeat(2, 1fr); }
  .chart-stat:nth-child(2) { border-right: none; }
  .chart-stat:nth-child(1),
  .chart-stat:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }
  .section-head { flex-direction: column; align-items: flex-start; }
  .article { padding: 40px 0; }
  .article-body p { font-size: 17px; }
}
