/* ============================================================================
   aud.forex — shared design system
   Common tokens, layout, header/footer, nav, metrics, tabs, charts, states.
   Page-specific components live in the page's own <style> block.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a08;
  --surface: #111110;
  --surface2: #1a1a18;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --text: #e8e6df;
  --muted: #6b6a64;
  --faint: #333330;
  --gold: #c9a84c;
  --gold-dim: rgba(201,168,76,0.15);
  --gold-faint: rgba(201,168,76,0.06);
  --red: #d45f4a;
  --red-dim: rgba(212,95,74,0.15);
  --green: #5a9e6f;
  --green-dim: rgba(90,158,111,0.15);
  --blue: #4a7fa5;
  --mono: 'DM Mono', monospace;
  --serif: 'Instrument Serif', serif;
}

html { background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 14px; line-height: 1.6; }
body { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Layout ── */
.shell { max-width: 1100px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* ── Header ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 32px 0 28px;
}
.header-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

.wordmark {
  display: flex; flex-direction: column; gap: 2px;
}
.wordmark-top {
  font-family: var(--serif); font-size: 11px; font-style: italic;
  color: var(--gold); letter-spacing: 0.12em; text-transform: uppercase;
}
.wordmark-main {
  font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--text);
  display: flex; align-items: baseline; gap: 10px;
}
.wordmark-main span { font-family: var(--mono); font-size: 11px; font-weight: 300; color: var(--muted); letter-spacing: 0.08em; }

.header-meta { text-align: right; }
.report-date { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
.report-date strong { display: block; font-size: 13px; color: var(--text); font-weight: 400; margin-top: 2px; }

/* ── Top nav ── */
.topnav { border-bottom: 1px solid var(--border); background: var(--bg); }
.topnav-inner { display: flex; gap: 2px; }
.topnav-link {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 14px 16px;
  color: var(--muted); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.topnav-link:hover { color: var(--text); }
.topnav-link.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Main content frame ── */
main { flex: 1; padding: 36px 0 64px; }

/* ── Metric cards ── */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 40px;
}
.metric {
  background: var(--surface);
  padding: 22px 20px 20px;
  position: relative;
}
.metric::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--faint);
}
.metric.accent::before { background: var(--gold); }
.metric-label { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.metric-value { font-size: 26px; font-weight: 300; color: var(--text); line-height: 1; }
.metric-value.up { color: var(--green); }
.metric-value.down { color: var(--red); }
.metric-sub { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.metric-sub.up { color: var(--green); }
.metric-sub.down { color: var(--red); }

/* ── Section headers & tabs ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-title {
  font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--text);
}

.tab-group { display: flex; gap: 0; border: 1px solid var(--border2); border-radius: 3px; overflow: hidden; }
.tab {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  padding: 7px 14px; background: transparent; color: var(--muted);
  border: none; cursor: pointer; border-right: 1px solid var(--border2);
  transition: background 0.15s, color 0.15s;
}
.tab:last-child { border-right: none; }
.tab:hover { background: var(--surface2); color: var(--text); }
.tab.active { background: var(--surface2); color: var(--gold); }

/* ── Chart shell ── */
.chart-section { margin-bottom: 40px; }
.chart-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 24px; position: relative;
}
.chart-canvas-wrap { position: relative; width: 100%; height: 280px; }

.chart-legend {
  display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.legend-dot { width: 8px; height: 2px; border-radius: 1px; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
  font-size: 11px; color: var(--muted);
}
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--text); }

/* ── Loading / error states ── */
.state-overlay {
  display: flex; align-items: center; justify-content: center;
  min-height: 320px; color: var(--muted); font-size: 12px;
  letter-spacing: 0.06em;
}
.spinner {
  width: 18px; height: 18px; border: 1px solid var(--faint);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Fade-in ── */
.fade-in { opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.4s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wordmark-main { font-size: 26px; }
  .topnav-link { padding: 12px 10px; font-size: 10px; }
}
