/* ============================================================
   Rafael M. - Design Tokens
   Modern fintech, Mercury/Robinhood-adjacent. Original.
   ============================================================ */

/* i18n EN/PT toggle in nav */
.i18n-toggle {
  display: inline-flex;
  border: 1px solid var(--border, #e1e7ef);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  margin-right: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: .04em;
  background: color-mix(in srgb, var(--surface, #fff) 88%, var(--line-soft, #eef3f7));
  flex-shrink: 0;
}
.i18n-toggle button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 6px 9px;
  cursor: pointer;
  color: var(--fg-soft, #44607a);
  font: inherit;
  text-transform: uppercase;
  line-height: 1;
}
.i18n-toggle button.on {
  background: var(--navy-800, #0a2540);
  color: #fff;
  box-shadow: 0 2px 8px rgba(10, 37, 64, .16);
}
[data-theme="dark"] .i18n-toggle button.on {
  background: var(--mint-500, #00d4a8);
  color: var(--navy-900, #050b14);
}
.i18n-toggle button:focus-visible {
  outline: 2px solid var(--mint-500, #00d4a8);
  outline-offset: 2px;
}

:root {
  /* Brand */
  --navy-900: #050b14;
  --navy-800: #0a2540;
  --navy-700: #11304d;
  --navy-600: #1f4368;
  --mint-500: #00d4a8;
  --mint-600: #00b894;
  --mint-100: #d6f5ec;
  --off-white: #f6f9fc;
  --paper: #ffffff;
  --ink: #0a2540;
  --ink-soft: #44607a;
  --ink-muted: #8198b0;
  --line: #e1e7ef;
  --line-soft: #eef2f7;
  --warn: #f5a524;
  --danger: #e5484d;

  /* Type */
  --font-sans: "Geist", "Söhne", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", "Tiempos", "Times New Roman", serif;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-card: 0 1px 2px rgba(10, 37, 64, 0.04), 0 4px 16px rgba(10, 37, 64, 0.04);
  --shadow-pop: 0 8px 32px rgba(10, 37, 64, 0.10);
  --shadow-deep: 0 24px 60px rgba(10, 37, 64, 0.18);

  /* Container */
  --container: 1200px;
  --gutter: 32px;

  /* Surface defaults (light) */
  --bg: var(--off-white);
  --surface: var(--paper);
  --surface-2: #fbfcfe;
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --fg-muted: var(--ink-muted);
  --border: var(--line);
}

[data-theme="dark"] {
  --bg: var(--navy-900);
  --surface: #0c1a2a;
  --surface-2: #122236;
  --fg: #eaf1f8;
  --fg-soft: #a8bdd1;
  --fg-muted: #6e8499;
  --border: #1c2f47;
  --line: #1c2f47;
  --line-soft: #14253a;
  --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-pop: 0 8px 32px rgba(0,0,0,.45);
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--mint-500); color: var(--navy-900); }

/* Type */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
h1 { font-size: clamp(40px, 6vw, 80px); }
h2 { font-size: clamp(28px, 4vw, 44px); }
h3 { font-size: clamp(20px, 2vw, 26px); }
h4 { font-size: 16px; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum", "zero"; }
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
}
.lede { font-size: 18px; color: var(--fg-soft); line-height: 1.55; }

/* ============================================================
   Layout
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-wide { max-width: 1440px; }
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
}
.nav-brand .logo-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--navy-800);
  display: grid; place-items: center;
  color: var(--mint-500);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
[data-theme="dark"] .nav-brand .logo-mark { background: var(--mint-500); color: var(--navy-900); }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-link {
  font-size: 14px; color: var(--fg-soft);
  padding: 8px 12px; border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--fg); background: var(--line-soft); }
.nav-link.active { color: var(--fg); }
.nav-cta { margin-left: 12px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy-800); color: white; }
.btn-primary:hover { background: var(--navy-700); }
[data-theme="dark"] .btn-primary { background: var(--mint-500); color: var(--navy-900); }
[data-theme="dark"] .btn-primary:hover { background: var(--mint-600); }
.btn-accent { background: var(--mint-500); color: var(--navy-900); }
.btn-accent:hover { background: var(--mint-600); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--fg-soft);
}
.icon-btn:hover { background: var(--line-soft); color: var(--fg); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--mint-500) 40%, var(--border)); }

/* ============================================================
   Tags / Pills
   ============================================================ */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--line-soft);
  color: var(--fg-soft);
  border: 1px solid var(--border);
}
.tag-mint { background: color-mix(in srgb, var(--mint-500) 14%, transparent); color: var(--mint-600); border-color: color-mix(in srgb, var(--mint-500) 30%, transparent); }
.tag-navy { background: var(--navy-800); color: white; border-color: var(--navy-800); }
[data-theme="dark"] .tag-mint { color: var(--mint-500); }

/* Status dot */
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint-500); display: inline-block; }
.dot.live { box-shadow: 0 0 0 0 rgba(0, 212, 168, .6); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 212, 168, .55); }
  70% { box-shadow: 0 0 0 8px rgba(0, 212, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 212, 168, 0); }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 40px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer h5 { font-size: 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--fg-muted); margin: 0 0 16px; font-weight: 500; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--fg-soft); }
.footer ul a:hover { color: var(--fg); }
.footer-base {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 56px; padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--fg-muted);
  font-family: var(--font-mono);
}

/* ============================================================
   Utilities
   ============================================================ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.grid { display: grid; }
.hidden { display: none !important; }

/* Subtle ticker animation */
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Decorative grid bg */
.grid-bg {
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--fg) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--fg) 6%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* Mini sparkline */
.spark { height: 28px; width: 80px; }

/* Responsive */
@media (max-width: 840px) {
  :root { --gutter: 20px; }
  .section { padding: 64px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-cta { display: inline-flex; }
}
