/* ============================================================
   Just2Trade — Design System Core
   Reset, tokens, typography, layout, header, footer
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
img, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------------- TOKENS (trading dark) ---------------- */
:root {
  --bg-base: #0B0E11;
  --bg-panel: #181A20;
  --bg-panel-2: #1F2329;
  --bg-elev: #22262E;
  --border: #2A2F38;
  --border-soft: #20242B;

  --text-light: #141820;      /* dark — for use on light surfaces only */
  --text-on-dark: #f4f6f9;
  --text-muted: #9aa4b2;
  --text-dim: #6b7585;

  --bull: #00C582;
  --bear: #FF4A5A;
  --system: #3B82F6;

  --cta: #F0B90B;             /* distinct brand CTA — gold, not bull/bear */
  --cta-ink: #0B0E11;
  --cta-hover: #d9a608;

  --accent: #E8C77A;

  --font-display: "Georgia", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1200px;
  --gap: 1rem;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 28px rgba(0,0,0,0.45);
  --header-h: 116px;
}

/* ---------------- BASE ---------------- */
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-on-dark);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; font-weight: 700; color: var(--text-on-dark); letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }
p { color: var(--text-muted); }
strong { color: var(--text-on-dark); }

.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------------- LAYOUT ---------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-block: 2rem; }
.section-head { max-width: 720px; margin-bottom: 2rem; }
.section-head .eyebrow { display: inline-block; font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cta); font-family: var(--font-body); font-weight: 700; margin-bottom: 0.5rem; }
.section-head p { margin-top: 0.6rem; }
.text-center { text-align: center; }
.center-head { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: var(--gap); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 780px) {
  .grid-3 { grid-template-columns: repeat(3,1fr); }
  .grid-4 { grid-template-columns: repeat(4,1fr); }
}

/* ---------------- BUTTONS ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 1.6rem; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.95rem; line-height: 1; transition: transform .15s ease, background .15s ease, border-color .15s ease; border: 1px solid transparent; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cta); color: var(--cta-ink); }
.btn-primary:hover { background: var(--cta-hover); }
.btn-secondary { background: transparent; color: var(--text-on-dark); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--cta); color: var(--cta); }
.btn-block { width: 100%; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.05rem; }

/* ---------------- SCROLL PROGRESS ---------------- */
#scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--cta); z-index: 1000; transition: width .05s linear; }

/* ---------------- HEADER (dual band) ---------------- */
.site-header { position: sticky; top: 0; z-index: 900; background: var(--bg-base); border-bottom: 1px solid var(--border); }
.header-ticker-strip { background: #06080a; border-bottom: 1px solid var(--border-soft); font-size: 0.78rem; }
.header-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--text-on-dark); }
.brand-mark { width: 32px; height: 32px; border-radius: 7px; background: linear-gradient(135deg, var(--cta), var(--accent)); color: var(--cta-ink); display: grid; place-items: center; font-size: 0.95rem; font-weight: 800; }
.brand-mark * { color: inherit; }

/* Nav */
#main-nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.6rem 0.75rem; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); border-radius: var(--radius-sm); white-space: nowrap; }
.nav-link:hover { color: var(--text-on-dark); }
.has-dropdown > .nav-link::after { content: "\25BE"; font-size: 0.6rem; opacity: 0.7; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.4rem; box-shadow: var(--shadow); z-index: 50; }
.dropdown li a { display: block; padding: 0.55rem 0.7rem; font-size: 0.88rem; color: var(--text-muted); border-radius: var(--radius-sm); }
.dropdown li a:hover { background: var(--bg-elev); color: var(--text-on-dark); }
.nav-cta { margin-left: 0.5rem; }

#hamburger-btn { display: inline-flex; flex-direction: column; gap: 4px; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
#hamburger-btn span { width: 22px; height: 2px; background: var(--text-on-dark); display: block; transition: transform .2s ease, opacity .2s ease; }

/* mobile-first: nav is a drawer */
@media (max-width: 779px) {
  #main-nav {
    position: fixed; inset: 0 0 0 auto; width: min(82vw, 340px);
    flex-direction: column; align-items: stretch; gap: 0.1rem;
    background: var(--bg-panel); border-left: 1px solid var(--border);
    padding: 1.25rem; overflow-y: auto;
    transform: translateX(100%); transition: transform .25s ease;
    z-index: 950;
  }
  #main-nav.is-open { transform: translateX(0); }
  .nav-link { padding: 0.8rem 0.5rem; font-size: 1rem; }
  .dropdown { display: block; position: static; box-shadow: none; border: none; background: transparent; padding-left: 0.75rem; min-width: 0; }
  .has-dropdown > .nav-link::after { margin-left: auto; }
  .nav-cta { margin: 0.75rem 0 0; }
  .nav-cta .btn { width: 100%; }
}
@media (min-width: 780px) {
  #hamburger-btn { display: none; }
  #main-nav { display: flex; align-items: center; justify-content: flex-end; }
  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown { display: block; }
}

.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 940; }
.nav-backdrop.is-visible { display: block; }
@media (min-width: 780px) { .nav-backdrop { display: none !important; } }

/* ---------------- TICKER (shared) ---------------- */
.ticker-viewport { overflow: hidden; }
.ticker-marquee { display: flex; width: max-content; }
.ticker-track { display: flex; gap: 2rem; padding-right: 2rem; flex-shrink: 0; animation: ticker-scroll 32s linear infinite; }
.ticker-viewport:hover .ticker-track,
.ticker-viewport:focus-within .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 0.5rem; padding-block: 0.5rem; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.ticker-item .sym { font-weight: 700; color: var(--text-on-dark); }
.ticker-item .up { color: var(--bull); }
.ticker-item .down { color: var(--bear); }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ---------------- FOOTER ---------------- */
.site-footer { background: #06080a; border-top: 1px solid var(--border); padding-block: 3rem 1.5rem; color: var(--text-muted); }
.site-footer * { color: inherit; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.footer-col h4 { color: var(--text-on-dark); font-size: 0.95rem; margin-bottom: 0.9rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { font-size: 0.88rem; }
.footer-col a:hover { color: var(--cta); }
.footer-brand p { font-size: 0.85rem; margin-top: 0.75rem; max-width: 32ch; }
.footer-bottom { border-top: 1px solid var(--border-soft); margin-top: 2rem; padding-top: 1.25rem; font-size: 0.78rem; color: var(--text-dim); }
.footer-risk { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.75rem; line-height: 1.5; }

/* ---------------- SCROLL REVEAL ---------------- */
.js-ready .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js-ready .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-ready .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------------- UTIL ---------------- */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.tag { display: inline-block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; padding: 0.25rem 0.55rem; border-radius: 999px; }
.tag-bull { background: rgba(0,197,130,0.14); color: var(--bull); }
.tag-bear { background: rgba(255,74,90,0.14); color: var(--bear); }
.tag-system { background: rgba(59,130,246,0.14); color: var(--system); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }


/* agent-nav-patch v1 — #main-nav > .nav-item direct children (no .nav-list) */
.header-logo{font-family:var(--font-display);font-weight:800;font-size:1.35rem;color:var(--brand);text-decoration:none;letter-spacing:-.02em;flex-shrink:0}
.header-logo:hover{text-decoration:none;opacity:.9}
#main-nav .nav-link{white-space:nowrap}
.nav-item.active>.nav-link{color:var(--brand)}
.btn-primary{background:transparent;color:var(--brand);border-color:var(--brand)}
.btn-primary:hover{background:var(--brand);color:var(--brand-ink)}
.btn-sm{padding:.55rem 1rem;font-size:.85rem}
.nav-cta{flex-shrink:0}
@media(min-width:780px){
  #main-nav{display:flex!important;flex:1;align-items:center;justify-content:flex-end;gap:.15rem;min-width:0;margin-left:var(--space-sm)}
  #main-nav .nav-link{font-size:.84rem;padding:.5rem .6rem}
  #main-nav .nav-cta{margin-left:.35rem}
}
@media(min-width:900px){
  #main-nav .nav-link{font-size:.9rem;padding:.55rem .75rem}
}
@media(max-width:779px){
  #main-nav.is-open{display:flex!important;flex-direction:column;align-items:stretch;gap:.2rem}
  #main-nav.is-open .nav-cta{margin-top:var(--space-md);align-self:flex-start}
}
