/* ============================================================
   Exness Trading Bridge — Core Design System
   styles.css : reset, variables, typography, layout, header, footer
   LIGHT ONLY (no black backgrounds) — glass-depth archetype
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Tokens ---------- */
:root {
  --bg-base: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #eef1f6;
  --text-light: #141820;        /* DARK ink — use ONLY on light bg */
  --text-muted: #5a6472;
  --bull: #00C582;
  --bear: #FF4A5A;
  --system: #3B82F6;
  --dark-section: #141820;
  --dark-ink: #f4f6f9;

  --border: rgba(20,24,32,0.10);
  --border-strong: rgba(20,24,32,0.18);
  --shadow-sm: 0 1px 3px rgba(20,24,32,0.06), 0 1px 2px rgba(20,24,32,0.04);
  --shadow-md: 0 6px 20px rgba(20,24,32,0.08);
  --shadow-lg: 0 18px 48px rgba(20,24,32,0.12);
  --glass: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.55);
  --glass-blur: blur(14px);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --maxw: 1200px;
  --gap: clamp(16px, 3vw, 28px);
  --pad-section: clamp(48px, 7vw, 96px);

  --header-h: 72px;
  --header-h-compact: 56px;

  --ff-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ff-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --t-fast: 160ms ease;
  --t-med: 280ms cubic-bezier(.4,0,.2,1);
}

/* ---------- Base typography ---------- */
body {
  font-family: var(--ff-body);
  background: var(--bg-base);
  color: var(--text-light);
  font-size: 16px;
}
body.brand-exness.theme-light { background: var(--bg-base); color: var(--text-light); }

h1, h2, h3, h4, h5 { font-family: var(--ff-display); line-height: 1.15; font-weight: 700; color: var(--text-light); letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p { color: var(--text-muted); }
strong { color: var(--text-light); }
small { font-size: 0.82rem; }

/* ---------- Layout primitives ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.section { padding-block: var(--pad-section); }
.section--tight { padding-block: clamp(28px, 4vw, 48px); }
.section--alt { background: var(--panel-2); }
.section-head { max-width: 720px; margin-bottom: clamp(24px, 4vw, 44px); }
.section-head .eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--system); margin-bottom: 10px; }
.section-head p { margin-top: 10px; font-size: 1.05rem; }
.text-center { text-align: center; }
.text-center.section-head { margin-inline: auto; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 0.98rem; padding: 12px 22px; border-radius: var(--r-pill); transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); border: 1px solid transparent; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--bull); color: #05291f; box-shadow: 0 8px 22px rgba(0,197,130,0.32); }
.btn-primary:hover { background: #00b074; box-shadow: 0 12px 30px rgba(0,197,130,0.42); transform: translateY(-2px); }
.btn-secondary { background: var(--panel); color: var(--text-light); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--panel-2); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--system); border-color: rgba(59,130,246,0.4); }
.btn-ghost:hover { background: rgba(59,130,246,0.08); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--border); transition: height var(--t-med), background var(--t-med), box-shadow var(--t-med); }
.site-header.is-compact { box-shadow: var(--shadow-md); background: rgba(255,255,255,0.92); }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); transition: height var(--t-med); }
.site-header.is-compact .header-inner { height: var(--header-h-compact); }
.header-logo { display: none; } /* hidden per brand rule */
.brand-mark { font-family: var(--ff-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--text-light); display: inline-flex; align-items: center; gap: 8px; }
.brand-mark::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--bull); box-shadow: 0 0 0 4px rgba(0,197,130,0.18); }

/* ---------- Navigation ---------- */
#hamburger-btn { display: inline-flex; flex-direction: column; gap: 5px; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--panel); }
#hamburger-btn span { display: block; width: 20px; height: 2px; background: var(--text-light); border-radius: 2px; transition: transform var(--t-fast), opacity var(--t-fast); }
#hamburger-btn.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#hamburger-btn.is-active span:nth-child(2) { opacity: 0; }
#hamburger-btn.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

#main-nav { position: fixed; inset: var(--header-h) 0 0 auto; width: min(86vw, 340px); background: var(--panel); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 18px; overflow-y: auto; transform: translateX(100%); transition: transform var(--t-med); display: flex; flex-direction: column; gap: 4px; }
#main-nav.is-open { transform: translateX(0); }

.nav-item { border-bottom: 1px solid var(--border); }
.nav-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 6px; font-weight: 600; color: var(--text-light); }
.has-dropdown > .nav-link::after { content: "\203A"; transform: rotate(90deg); transition: transform var(--t-fast); color: var(--text-muted); }
.has-dropdown.is-open > .nav-link::after { transform: rotate(-90deg); }
.dropdown { max-height: 0; overflow: hidden; transition: max-height var(--t-med); padding-left: 8px; }
.has-dropdown.is-open > .dropdown { max-height: 460px; }
.dropdown li a { display: block; padding: 10px 8px; color: var(--text-muted); font-size: 0.94rem; border-radius: var(--r-sm); }
.dropdown li a:hover { color: var(--system); background: var(--panel-2); }
.nav-cta { margin-top: 14px; }
.nav-cta .btn { width: 100%; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark-section); color: var(--dark-ink); padding-block: clamp(40px, 6vw, 72px) 28px; }
.site-footer * { color: inherit; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.footer-col h4 { color: var(--dark-ink); font-size: 0.95rem; margin-bottom: 14px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.9; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a { color: rgba(244,246,249,0.72); font-size: 0.92rem; transition: color var(--t-fast); }
.footer-col ul li a:hover { color: var(--bull); }
.footer-brand p { color: rgba(244,246,249,0.7); margin-top: 12px; font-size: 0.92rem; max-width: 320px; }
.footer-risk { max-width: var(--maxw); margin: 32px auto 0; padding: 20px clamp(16px,4vw,32px) 0; border-top: 1px solid rgba(244,246,249,0.14); font-size: 0.78rem; color: rgba(244,246,249,0.6); }
.footer-bottom { max-width: var(--maxw); margin-inline: auto; padding: 18px clamp(16px,4vw,32px) 0; font-size: 0.8rem; color: rgba(244,246,249,0.55); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

/* ---------- Scroll progress bar ---------- */
#scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: linear-gradient(90deg, var(--bull), var(--system)); z-index: 200; transition: width 80ms linear; }

/* ---------- Risk banner ---------- */
.risk-banner { background: var(--dark-section); color: var(--dark-ink); font-size: 0.84rem; padding: 10px clamp(16px,4vw,32px); display: flex; align-items: center; gap: 14px; justify-content: center; text-align: center; }
.risk-banner * { color: inherit; }
.risk-banner strong { color: var(--bear); }
.risk-banner .risk-dismiss { margin-left: auto; flex-shrink: 0; border: 1px solid rgba(244,246,249,0.35); border-radius: var(--r-pill); padding: 4px 12px; font-size: 0.78rem; color: var(--dark-ink); }
.risk-banner .risk-dismiss:hover { background: rgba(244,246,249,0.12); }
.risk-banner[hidden] { display: none; }

/* ---------- Scroll reveal (scoped under .js-ready) ---------- */
html.js-ready .reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms ease, transform 600ms cubic-bezier(.2,.7,.2,1); }
html.js-ready .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Utility ---------- */
.muted { color: var(--text-muted); }
.bull { color: var(--bull); }
.bear { color: var(--bear); }
.system { color: var(--system); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { 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); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }

  #hamburger-btn { display: none; }
  #main-nav {
    position: static; width: auto; inset: auto; transform: none;
    background: transparent; border: none; box-shadow: none; padding: 0;
    overflow: visible;
    display: flex; align-items: center; justify-content: flex-end;
    flex-direction: row; gap: 4px;
  }
  .nav-item { border-bottom: none; position: relative; }
  .nav-link { padding: 8px 12px; border-radius: var(--r-sm); }
  .has-dropdown > .nav-link::after { transform: rotate(90deg) scale(.8); }
  .dropdown {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md);
    box-shadow: var(--shadow-lg); padding: 8px; max-height: none; overflow: visible;
    opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast); padding-left: 8px;
  }
  .nav-item.has-dropdown:hover > .dropdown,
  .nav-item.has-dropdown:focus-within > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-cta { margin-top: 0; margin-left: 10px; }
  .nav-cta .btn { width: auto; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  html.js-ready .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, #scroll-progress, .risk-banner, .sticky-cta, .ticker-viewport { display: none !important; }
  body { background: #fff; color: #000; }
  .print-block { break-inside: avoid; }
}


/* 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}
}
