/* ==========================================================================
   AI Trade Lab — SHARED THEME  (assets/css/theme.css)
   Single source of truth for fonts, colours, background and shared chrome
   across ALL THREE properties: the main site, /blog/, and /markets/ briefings.

   Any page that wants to look like AI Trade Lab imports THIS file first.
   Do not redefine these tokens elsewhere — change them here.
   Palette anchors taken from Axi's published tokens (warm charcoal + crimson)
   without copying their brand identity.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Surfaces — warm near-black */
  --bg-primary:   #0b0a0a;
  --bg-secondary: #121011;
  --bg-card:      #171415;
  --bg-hover:     #221e1f;

  /* Type — warm off-white through warm greys */
  --text-primary:   #f6f3f0;
  --text-secondary: #b9b1ab;
  --text-muted:     #837a74;

  /* Accent — Axi crimson */
  --accent:        #e4002e;
  --accent-hover:  #ff3745;
  --accent-active: #b20024;
  --accent-glow:   rgba(228, 0, 46, 0.12);
  --accent-soft:   #ff6974;

  /* Semantic */
  --green:    #2ea36b;
  --green-bg: rgba(46, 163, 107, 0.12);
  --orange:   #f5a00b;
  --orange-bg: rgba(245, 160, 11, 0.12);
  --red:      #e4002e;

  /* Warm borders */
  --border:       #2a2526;
  --border-light: #3d3638;

  /* Radii */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow:    0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --max-width: 1140px;
  --transition: 0.2s ease;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-soft); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

img, svg { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ==========================================================================
   SHARED CHROME — identical header, logo, nav, buttons and footer everywhere
   ========================================================================== */

/* ---- Header ---- */
.site-header,
header.site-header,
header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 10, 10, 0.86);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.site-header .container,
header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}

/* ---- Logo (identical across all three properties) ---- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}
.logo:hover { color: var(--text-primary); }
.logo .logo-mark { width: 30px; height: 30px; flex-shrink: 0; }
/* Image lockup (brand master) — height-driven, keeps its aspect ratio. */
.logo .logo-img { height: 32px; width: auto; display: block; }
.logo .logo-word { display: inline-block; }
.logo .logo-word em { font-style: normal; color: var(--accent); }

@media (max-width: 480px) {
  .logo .logo-img { height: 27px; }
}

/* ---- Nav ---- */
.site-nav,
nav { display: flex; align-items: center; gap: 30px; }
.site-nav a,
nav a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.site-nav a:hover,
nav a:hover { color: var(--text-primary); }
.site-nav a.active,
nav a.active { color: var(--text-primary); }

/* The monetisation button — identical everywhere, always visible */
.btn-axi,
.site-nav a.btn-axi,
nav a.btn-axi {
  padding: 9px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn-axi:hover,
.site-nav a.btn-axi:hover,
nav a.btn-axi:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 30px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  border: none; cursor: pointer;
}
.btn-primary:hover {
  background: var(--accent-hover); color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(228, 0, 46, 0.28);
}
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 30px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.btn-secondary:hover {
  background: var(--bg-card); border-color: var(--accent);
  color: var(--text-primary); transform: translateY(-2px);
}

/* ---- Broker CTA card — the same block on every property ---- */
.axi-cta {
  text-align: center;
  margin: 28px 0;
  padding: 26px 20px;
  background: var(--accent-glow);
  border: 1px solid rgba(228, 0, 46, 0.28);
  border-radius: var(--radius);
}
.axi-cta p { margin: 0 0 14px; font-weight: 600; font-size: 1.02rem; color: var(--text-primary); }
.axi-cta .axi-code {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}
.axi-cta .axi-code strong { color: var(--text-secondary); }

/* ---- Footer ---- */
.site-footer,
footer.site-footer,
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 56px 0 28px;
  margin-top: 56px;
}
.site-footer .footer-grid,
footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.site-footer .footer-brand h3 { font-size: 1.1rem; margin: 0 0 14px; }
.site-footer .footer-brand p { color: var(--text-secondary); font-size: 0.85rem; max-width: 300px; line-height: 1.65; }
.site-footer .footer-col h4 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin: 0 0 16px; font-weight: 600;
}
.site-footer .footer-col a { display: block; color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 11px; }
.site-footer .footer-col a:hover { color: var(--text-primary); }
.site-footer .footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  font-size: 0.78rem; color: var(--text-muted);
}

/* ---- Responsive chrome ---- */
@media (max-width: 768px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .site-footer .footer-bottom { flex-direction: column; text-align: center; }
  .site-nav { display: none; }
  .mobile-toggle { display: flex; }
}

.mobile-toggle {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 6px;
}
.mobile-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--text-primary); border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .site-header.nav-open .site-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 70px; left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .site-header.nav-open .site-nav a {
    padding: 15px 24px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .site-header.nav-open .site-nav a:last-child { border-bottom: none; }
  .site-header.nav-open .site-nav a.btn-axi {
    margin: 12px 24px;
    text-align: center;
    border-bottom: none;
    justify-content: center;
  }
}
