/* ==========================================================================
   SwiftCap EAs — Shared Design System
   Brand: Ink #080C18 · Ember #E8A537 · Signal #3DDC97 · Bone #F7F5F0
   Type:  Inter (sans) · JetBrains Mono (mono) · Source Serif 4 (display)
   ========================================================================== */

:root {
  /* Typography */
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --f-serif: 'Source Serif 4', ui-serif, Georgia, serif;

  --fs-xs: 0.72rem;
  --fs-sm: 0.82rem;
  --fs-md: 0.94rem;
  --fs-lg: 1.06rem;
  --fs-xl: 1.28rem;
  --fs-2xl: 1.6rem;
  --fs-3xl: 2.2rem;
  --fs-4xl: clamp(2.4rem, 4.2vw, 3.8rem);
  --fs-5xl: clamp(2.8rem, 5.2vw, 4.6rem);

  /* Shape & motion */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --bw: 1px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 140ms;

  /* Layout */
  --wrap: 1440px;
  --pad-section: clamp(88px, 9vw, 136px);

  /* ================================================================
     DARK theme (default — used for most sections)
     ================================================================ */
  --bg:          oklch(0.17 0.008 250);  /* primary background */
  --bg-elev:     oklch(0.21 0.010 250);  /* cards, elevated surfaces */
  --bg-sunk:     oklch(0.14 0.008 250);  /* deeper sections */
  --bg-inverse:  oklch(0.97 0.005 85);   /* for light blocks */

  --ink:         oklch(0.96 0.005 85);   /* primary text */
  --ink-2:       oklch(0.85 0.008 85);   /* secondary text */
  --ink-3:       oklch(0.68 0.010 85);   /* muted labels */
  --ink-4:       oklch(0.52 0.008 85);   /* disabled / hints */
  --ink-inverse: oklch(0.17 0.012 250);

  --line:        oklch(0.28 0.010 250);
  --line-2:      oklch(0.34 0.012 250);
  --line-strong: oklch(0.48 0.014 250);

  /* Brand accents — Ember for brand/CTAs, Signal green for live data */
  --ember:       oklch(0.78 0.14 75);                 /* #E8A537-ish, warm amber */
  --ember-soft:  oklch(0.28 0.08 75);
  --ember-ink:   oklch(0.14 0.02 75);                 /* text ON ember */

  --signal:      oklch(0.76 0.18 150);                /* mint green for positive/live */
  --signal-soft: oklch(0.28 0.06 150);

  --danger:      oklch(0.70 0.20 25);
  --danger-soft: oklch(0.28 0.08 25);

  /* Shadows (used sparingly on dark) */
  --shadow-md: 0 4px 16px oklch(0 0 0 / .45), 0 1px 2px oklch(0 0 0 / .35);
  --shadow-lg: 0 16px 50px oklch(0 0 0 / .55), 0 2px 4px oklch(0 0 0 / .35);
}

/* ===================================================================
   LIGHT sections — applied via .sec-light modifier on any section
   =================================================================== */
.sec-light {
  --bg:          oklch(0.985 0.005 85);
  --bg-elev:     oklch(1 0 0);
  --bg-sunk:     oklch(0.96 0.006 85);
  --bg-inverse:  oklch(0.17 0.012 250);

  --ink:         oklch(0.18 0.015 260);
  --ink-2:       oklch(0.32 0.012 260);
  --ink-3:       oklch(0.48 0.010 260);
  --ink-4:       oklch(0.62 0.008 260);
  --ink-inverse: oklch(0.98 0.005 85);

  --line:        oklch(0.90 0.006 85);
  --line-2:      oklch(0.83 0.008 85);
  --line-strong: oklch(0.72 0.010 85);

  --ember:       oklch(0.68 0.16 65);                 /* deeper on light */
  --ember-soft:  oklch(0.95 0.05 75);
  --ember-ink:   oklch(0.98 0.005 85);

  --signal:      oklch(0.52 0.16 150);
  --signal-soft: oklch(0.94 0.04 150);

  --shadow-md: 0 4px 16px oklch(0 0 0 / .06), 0 1px 2px oklch(0 0 0 / .04);
  --shadow-lg: 0 14px 40px oklch(0 0 0 / .08), 0 2px 4px oklch(0 0 0 / .04);

  background: var(--bg);
  color: var(--ink);
}

/* ===================================================================
   Reset & base
   =================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
ul, ol { list-style: none; }

::selection { background: var(--ember); color: var(--ember-ink); }

/* ===================================================================
   Layout primitives
   =================================================================== */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 40px);
}

.sec {
  padding: var(--pad-section) 0;
  border-top: var(--bw) solid var(--line);
  position: relative;
}

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.sec-head-center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sec-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
}

.sec-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--ink-3);
}

.sec-head-center .sec-eyebrow {
  justify-content: center;
}

.sec-head-center .sec-eyebrow::after {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--ink-3);
}

.sec-title {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: var(--fs-4xl);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
}

.sec-head-center .sec-title { max-width: 26ch; margin-inline: auto; }

.sec-title em {
  font-style: italic;
  color: var(--ember);
  font-weight: 400;
}

.sec-lede {
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 52ch;
}

.sec-head-center .sec-lede { max-width: 58ch; margin: 20px auto 0; }

/* ===================================================================
   Typography utilities
   =================================================================== */
.num {
  font-family: var(--f-mono);
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
}

.num-pos { color: var(--signal); }
.num-neg { color: var(--danger); }
.ember   { color: var(--ember); }
.signal  { color: var(--signal); }

/* ===================================================================
   Buttons
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  border: var(--bw) solid transparent;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  line-height: 1;
  font-family: var(--f-sans);
}

.btn-lg { padding: 14px 24px; font-size: var(--fs-md); }
.btn-sm { padding: 7px 14px; font-size: var(--fs-xs); }

/* Primary — ember filled (the main CTA) */
.btn-primary {
  background: var(--ember);
  color: var(--ember-ink);
  border-color: var(--ember);
  font-weight: 600;
}
.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px color-mix(in oklch, var(--ember) 35%, transparent);
}

/* Secondary — outlined on any bg */
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover {
  border-color: var(--ink);
  background: var(--bg-elev);
}

/* Ghost — no chrome */
.btn-ghost {
  color: var(--ink-2);
  padding: 10px 12px;
}
.btn-ghost:hover { color: var(--ink); }

/* ===================================================================
   Navigation
   =================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: var(--bw) solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--ember);
  background: var(--bg-elev);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-wm {
  font-family: var(--f-serif);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  font-weight: 500;
  line-height: 1;
}

.brand-wm .tm {
  font-family: var(--f-mono);
  font-size: 0.55em;
  color: var(--ink-3);
  vertical-align: top;
  margin-left: 1px;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  transition: color var(--t-fast);
}

.nav-links a:hover { color: var(--ink); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-actions .btn-ghost { display: none; }
  .nav-hamburger { display: inline-flex; }
}

/* ===================================================================
   Mobile menu overlay
   =================================================================== */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: color-mix(in oklch, var(--bg) 96%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  flex-direction: column;
  padding: 0;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.mobile-menu.is-open {
  display: flex;
  opacity: 1;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 clamp(20px, 3vw, 40px);
  border-bottom: var(--bw) solid var(--line);
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
}

.mobile-menu-close:hover { color: var(--ink); }

.mobile-menu-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px clamp(20px, 3vw, 40px);
  gap: 8px;
  overflow-y: auto;
}

.mobile-menu-body a {
  display: block;
  font-size: 1.2rem;
  font-family: var(--f-serif);
  color: var(--ink-2);
  padding: 14px 0;
  border-bottom: var(--bw) solid var(--line);
  transition: color var(--t-fast);
}

.mobile-menu-body a:hover { color: var(--ember); }

.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px clamp(20px, 3vw, 40px);
  border-top: var(--bw) solid var(--line);
}

.mobile-menu-actions .btn { justify-content: center; }

@media (max-width: 720px) {
  .sec-title { font-size: clamp(1.6rem, 5vw, 2rem); }
}

/* ===================================================================
   Tags, chips, badges
   =================================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--ink-2);
  padding: 6px 12px;
  background: var(--bg-elev);
  border: var(--bw) solid var(--line);
  border-radius: 999px;
  line-height: 1;
}

.tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--signal) 25%, transparent);
  animation: pulse 2s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklch, var(--signal) 25%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in oklch, var(--signal) 0%, transparent); }
}

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  padding: 4px 9px;
  border: var(--bw) solid var(--line-2);
  background: var(--bg-sunk);
  color: var(--ink-2);
  border-radius: var(--r-xs);
  line-height: 1.4;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  padding: 4px 10px;
  border-radius: var(--r-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.badge-ember  { background: var(--ember-soft); color: var(--ember); }
.badge-signal { background: var(--signal-soft); color: var(--signal); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ===================================================================
   Segmented control
   =================================================================== */
.seg {
  display: inline-flex;
  background: var(--bg-sunk);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding: 7px 14px;
  border-radius: 2px;
  transition: all var(--t-fast);
  font-weight: 500;
}

.seg-btn:hover { color: var(--ink); }

.seg-btn.is-active {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: 0 1px 3px oklch(0 0 0 / .15);
}

/* ===================================================================
   Footer — shared across pages
   =================================================================== */
.site-foot {
  background: var(--bg);
  border-top: var(--bw) solid var(--line);
  padding: 64px 0 32px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}

.foot-brand p {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: 1.7;
  max-width: 36ch;
  margin-top: 16px;
}

.foot-brand .foot-socials {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.foot-brand .foot-socials a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-3);
  transition: all var(--t-fast);
}

.foot-brand .foot-socials a:hover {
  color: var(--ember);
  border-color: var(--ember);
}

.foot-col h5 {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  font-weight: 500;
}

.foot-col li { margin-bottom: 10px; }

.foot-col a {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  transition: color var(--t-fast);
}

.foot-col a:hover { color: var(--ember); }

.foot-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: var(--bw) solid var(--line);
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  color: var(--ink-3);
  flex-wrap: wrap;
  gap: 16px;
}

.foot-brand .foot-brand-mark {
  background: transparent;
  border: none;
  padding: 0;
}

.foot-brand .foot-brand-mark img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.foot-brand .foot-socials a.mql5-text-icon {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

@media (max-width: 820px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .foot-brand { grid-column: 1 / -1; }
  .foot-bot { flex-direction: column; text-align: center; align-items: center; }
}
