/* =========================================================================
   Raka Markets AI — Design System
   Dark-first, institutional, minimal. No external fonts/CDNs (system font
   stack only — this repo has no build-time or run-time network access).
   ========================================================================= */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
input, textarea { font: inherit; }

@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; scroll-behavior: auto !important; }
}

/* ---------- 2. Design tokens ---------- */
:root {
  --bg: #0A0B0F;
  --bg-raised: #121319;
  --bg-raised-2: #191B22;
  --bg-overlay: rgba(10, 11, 15, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #F4F5F7;
  --text-secondary: #A6AAB4;
  --text-tertiary: #7C808A;

  --accent: #4C7EFF;
  --accent-strong: #7AA2FF;
  --accent-dim: rgba(76, 126, 255, 0.14);
  --accent-dim2: rgba(76, 126, 255, 0.55);

  --success: #2FB380;
  --success-dim: rgba(47, 179, 128, 0.14);
  --danger: #E5555F;
  --danger-dim: rgba(229, 85, 95, 0.14);
  --warning: #D9A441;
  --warning-dim: rgba(217, 164, 65, 0.14);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -24px rgba(0,0,0,0.6);
  --shadow-pop: 0 30px 60px -20px rgba(0,0,0,0.55);

  --container-w: 1180px;
  --header-h: 76px;
}

[data-theme="light"] {
  --bg: #F7F8FA;
  --bg-raised: #FFFFFF;
  --bg-raised-2: #F0F1F4;
  --bg-overlay: rgba(247, 248, 250, 0.86);
  --border: rgba(10, 11, 15, 0.08);
  --border-strong: rgba(10, 11, 15, 0.14);
  --text-primary: #14151A;
  --text-secondary: #52565F;
  --text-tertiary: #6B6F7A;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.6) inset, 0 20px 40px -28px rgba(20,21,26,0.18);
  --shadow-pop: 0 30px 60px -24px rgba(20,21,26,0.22);
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ---------- 3. Typography ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

h1, .h1 { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4.3rem); font-weight: 650; letter-spacing: -0.03em; line-height: 1.04; }
h2, .h2 { font-size: clamp(1.8rem, 1.5rem + 1.4vw, 2.6rem); font-weight: 650; letter-spacing: -0.025em; line-height: 1.12; }
h3, .h3 { font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
p.lede { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem); color: var(--text-secondary); line-height: 1.6; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.mono { font-family: var(--font-mono); }

/* ---------- 4. Layout ---------- */
.container { width: 100%; max-width: var(--container-w); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(64px, 8vw, 128px); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-top: 14px; }
.section-head p.lede { margin-top: 16px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 980px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

.divider { height: 1px; background: var(--border); border: none; margin: 0; }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-full);
  font-size: 0.94rem; font-weight: 600;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow .18s ease;
}
.btn--small { padding: 9px 16px; font-size: 0.85rem; }
.btn--primary { background: var(--text-primary); color: var(--bg); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.btn--accent { background: var(--accent); color: #08101F; }
.btn--accent:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border-strong); }
.btn--ghost:hover { border-color: var(--text-secondary); background: var(--bg-raised); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- 6. Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-overlay);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.02rem; letter-spacing: -0.01em; }
.brand__ai { color: var(--accent-strong); }
.primary-nav { display: flex; align-items: center; gap: 28px; }
.nav-link { font-size: 0.92rem; color: var(--text-secondary); position: relative; padding: 6px 0; transition: color 0.15s ease; }
.nav-link:hover, .nav-link--active { color: var(--text-primary); }
.nav-link--active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--accent); border-radius: 2px; }
.site-header__actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); color: var(--text-secondary); }
.theme-toggle:hover { color: var(--text-primary); border-color: var(--border-strong); }
.icon-sun, .icon-moon { grid-area: 1/1; }
[data-theme="dark"] .icon-sun, body:not([data-theme]) .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

.nav-toggle { display: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.nav-toggle span { width: 16px; height: 1.5px; background: var(--text-primary); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }

.mobile-nav { display: none; }

@media (max-width: 900px) {
  .primary-nav { display: none; }
  .site-header__actions .btn { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
    background: var(--bg); overflow-y: auto;
    padding: 28px 24px 40px;
    display: flex; flex-direction: column; gap: 28px;
  }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav nav { display: flex; flex-direction: column; gap: 4px; }
  .mobile-nav .nav-link { font-size: 1.1rem; padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .mobile-nav__actions { display: flex; flex-direction: column; gap: 12px; }
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #08101F; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 7. Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(72px, 10vw, 140px) clamp(56px, 8vw, 100px);
  border-bottom: 1px solid var(--border);
}
.hero__field {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(600px 400px at 82% 8%, var(--accent-dim), transparent 60%),
    radial-gradient(500px 360px at 10% 30%, rgba(47,179,128,0.08), transparent 60%);
}
.hero__grid-lines {
  position: absolute; inset: 0; z-index: 0; opacity: 0.5;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 0%, transparent 75%);
}
.hero__inner { position: relative; z-index: 1; max-width: 780px; }
.hero h1 { margin-top: 18px; }
.hero p.lede { margin-top: 20px; max-width: 620px; }
.hero .btn-row { margin-top: 34px; }
.hero__meta { margin-top: 46px; display: flex; flex-wrap: wrap; gap: 28px 40px; }
.hero__meta-item { display: flex; flex-direction: column; gap: 2px; }
.hero__meta-item strong { font-size: 1.3rem; letter-spacing: -0.01em; }
.hero__meta-item span { font-size: 0.82rem; color: var(--text-tertiary); }

.hero__panel {
  position: relative; z-index: 1;
  margin-top: 56px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-raised-2));
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  overflow: hidden;
}
.hero__panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hero__panel-head .dots { display: flex; gap: 6px; }
.hero__panel-head .dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.hero__panel-body { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 780px) { .hero__panel-body { grid-template-columns: repeat(2, 1fr); } }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 var(--success-dim);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47,179,128,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(47,179,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,179,128,0); }
}

/* ---------- 8. Logo/marquee strip ---------- */
.marquee-strip { padding-block: 28px; border-bottom: 1px solid var(--border); }
.marquee-strip__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--text-tertiary); font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.marquee-strip__row span { font-weight: 600; }

/* ---------- 9. Cards: agent architecture ---------- */
.agent-card {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-raised);
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.agent-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.agent-card__icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-dim); color: var(--accent-strong);
}
.agent-card__num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-tertiary); }
.agent-card h3 { margin-top: 2px; }
.agent-card p { font-size: 0.9rem; color: var(--text-secondary); }
.agent-card__tag { display: inline-flex; align-self: flex-start; font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-full); background: var(--bg-raised-2); color: var(--text-tertiary); margin-top: auto; }

.flow-arrow { display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }

/* ---------- 10. Market cards ---------- */
.market-card {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-raised);
  padding: 20px; position: relative; overflow: hidden;
  transition: transform .22s ease, border-color .22s ease;
}
.market-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.market-card__top { display: flex; align-items: center; justify-content: space-between; }
.market-card__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-raised-2); font-weight: 700; font-size: 0.8rem; letter-spacing: -0.02em; }
.market-card__class { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.market-card h3 { margin-top: 16px; font-size: 1.15rem; }
.market-card p { margin-top: 6px; font-size: 0.85rem; color: var(--text-secondary); }
.market-card__spark { margin-top: 16px; height: 36px; }
.market-card__spark path { fill: none; stroke: var(--accent-strong); stroke-width: 1.6; opacity: 0.85; }

/* ---------- 11. Timeline (how it works) ---------- */
.timeline { display: flex; flex-direction: column; }
.timeline-step { display: grid; grid-template-columns: 44px 1fr; gap: 20px; padding-block: 22px; position: relative; }
.timeline-step__rail { display: flex; flex-direction: column; align-items: center; }
.timeline-step__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bg-raised-2); border: 2px solid var(--border-strong); flex-shrink: 0; }
.timeline-step:last-child .timeline-step__line { display: none; }
.timeline-step__line { width: 1px; flex: 1; background: var(--border); margin-top: 6px; }
.timeline-step__content h3 { display: flex; align-items: center; gap: 10px; }
.timeline-step__index { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-strong); }
.timeline-step__content p { margin-top: 6px; color: var(--text-secondary); font-size: 0.92rem; max-width: 560px; }
.timeline-step.is-active .timeline-step__dot { background: var(--accent); border-color: var(--accent); }

/* ---------- 12. Stat / performance ---------- */
.stat-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-raised); padding: 22px; }
.stat-card__label { font-size: 0.8rem; color: var(--text-tertiary); }
.stat-card__value { margin-top: 10px; font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); font-weight: 650; letter-spacing: -0.02em; }
.stat-card__value.up { color: var(--success); }
.stat-card__value.down { color: var(--danger); }
.stat-card__sub { margin-top: 4px; font-size: 0.8rem; color: var(--text-tertiary); }

.demo-banner {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--warning-dim); background: var(--warning-dim);
  color: var(--warning); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 0.85rem; font-weight: 500;
  margin-bottom: 28px;
}

/* ---------- 13. Signal archive table/cards ---------- */
.signal-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-raised);
  padding: 20px 22px; display: grid; gap: 16px; grid-template-columns: 1.1fr repeat(6, 0.8fr) 1.2fr; align-items: center;
}
.signal-card__market { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.signal-card__market .market-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; padding: 5px 10px; border-radius: var(--radius-full); text-transform: uppercase; }
.badge--buy { background: var(--success-dim); color: var(--success); }
.badge--sell { background: var(--danger-dim); color: var(--danger); }
.badge--win { background: var(--success-dim); color: var(--success); }
.badge--loss { background: var(--danger-dim); color: var(--danger); }
.badge--be { background: var(--bg-raised-2); color: var(--text-tertiary); }
.signal-card__label { font-size: 0.7rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; display: block; margin-bottom: 3px; }
.signal-card__value { font-family: var(--font-mono); font-size: 0.92rem; }
.signal-card__reason { font-size: 0.82rem; color: var(--text-secondary); }
@media (max-width: 1100px) {
  .signal-card { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 620px) {
  .signal-card { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 14. Pricing ---------- */
.price-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised);
  padding: 30px 28px; display: flex; flex-direction: column; gap: 22px;
  position: relative;
}
.price-card--featured { border-color: var(--accent-dim2); background: linear-gradient(180deg, var(--bg-raised-2), var(--bg-raised)); box-shadow: var(--shadow-card); }
.price-card--featured::before {
  content: "Most popular"; position: absolute; top: -12px; left: 28px;
  background: var(--accent); color: #08101F; font-size: 0.7rem; font-weight: 700;
  padding: 5px 12px; border-radius: var(--radius-full); letter-spacing: 0.03em; text-transform: uppercase;
}
.price-card__name { font-size: 1rem; font-weight: 650; }
.price-card__price { display: flex; align-items: baseline; gap: 6px; }
.price-card__price .amount { font-size: 2.4rem; font-weight: 650; letter-spacing: -0.03em; }
.price-card__price .period { color: var(--text-tertiary); font-size: 0.9rem; }
.price-card__desc { font-size: 0.88rem; color: var(--text-secondary); }
.price-card ul { display: flex; flex-direction: column; gap: 12px; }
.price-card li { display: flex; gap: 10px; font-size: 0.9rem; align-items: flex-start; }
.price-card li svg { flex-shrink: 0; margin-top: 3px; color: var(--accent-strong); }

/* ---------- 15. FAQ accordion ---------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 0; text-align: left; font-size: 1.02rem; font-weight: 550;
}
.faq-item__icon { flex-shrink: 0; transition: transform .25s ease; color: var(--text-tertiary); }
.faq-item[aria-expanded="true"] .faq-item__icon { transform: rotate(45deg); color: var(--accent-strong); }
.faq-item__a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-item__a-inner { padding-bottom: 22px; color: var(--text-secondary); font-size: 0.95rem; max-width: 700px; }

/* ---------- 16. Roadmap / future integrations ---------- */
.roadmap-card {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-raised); opacity: 0.88;
}
.roadmap-card__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-raised-2); display: grid; place-items: center; color: var(--text-tertiary); }
.roadmap-card .badge { background: var(--bg-raised-2); color: var(--text-tertiary); align-self: flex-start; }

/* ---------- 17. About / philosophy ---------- */
.philosophy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .philosophy-grid { grid-template-columns: 1fr; } }
.philosophy-card { padding: 24px 0; border-top: 1px solid var(--border); }
.pull-quote {
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem); font-weight: 550; letter-spacing: -0.015em; line-height: 1.4;
  border-left: 2px solid var(--accent); padding-left: 24px; margin-block: 8px;
}

/* ---------- 18. Legal ---------- */
.legal-content { max-width: 760px; }
.legal-content h2 { margin-top: 40px; margin-bottom: 12px; font-size: 1.25rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { color: var(--text-secondary); font-size: 0.95rem; margin-top: 12px; }
.legal-content ul, .legal-content ol { display: flex; flex-direction: column; gap: 8px; padding-left: 20px; list-style: disc; }
.legal-content ol { list-style: decimal; }
.legal-updated { color: var(--text-tertiary); font-size: 0.85rem; }

/* ---------- 19. CTA band ---------- */
.cta-band {
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg-raised), var(--bg-raised-2));
  padding: clamp(32px, 5vw, 56px); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.cta-band .btn-row { justify-content: center; }

/* ---------- 20. Reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ---------- 21. Misc ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { font-size: 0.78rem; padding: 6px 12px; border-radius: var(--radius-full); border: 1px solid var(--border); color: var(--text-secondary); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.list-check { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.list-check li { display: flex; gap: 10px; font-size: 0.95rem; color: var(--text-secondary); }
.list-check svg { flex-shrink: 0; margin-top: 3px; color: var(--success); }
