/* global.css — shared chrome: tokens, theme, layout, nav, footer, typography, ad slots */

:root {
  --blue: #2563eb;
  --blue-600: #1d4ed8;
  --green: #16a34a;
  --green-600: #15803d;
  --teal: #14b8a6;

  /* Light theme (default) */
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #64748b;
  --accent: var(--blue);
  --accent-hover: var(--blue-600);
  --success: var(--green);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.10);
  --chart-track: #e2e8f0;
  --focus: #2563eb;
  --radius: 12px;
}

[data-theme='dark'] {
  --bg: #0b1120;
  --surface: #131c2e;
  --surface-2: #1c283f;
  --border: #2a3650;
  --text: #e9eef7;
  --text-muted: #aebbcf;
  --text-faint: #8595af;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --success: #22c55e;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.5);
  --chart-track: #2a3650;
  --focus: #60a5fa;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 0.5rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }

.container { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 1rem; }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* Header / nav */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 1rem; max-width: 920px; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff; font-weight: 800; font-size: 0.95rem;
}
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current='page'] { color: var(--accent); }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.35rem 0.75rem; cursor: pointer; font-size: 0.85rem;
}
.theme-toggle:hover { color: var(--text); }

/* Footer */
.site-footer {
  margin-top: 3rem; border-top: 1px solid var(--border);
  background: var(--surface); color: var(--text-faint); font-size: 0.9rem;
}
.site-footer .container { padding-top: 2rem; padding-bottom: 2rem; }
.site-footer a { color: var(--text-muted); }
.footer-disclaimer { font-size: 0.82rem; margin-top: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent); color: #fff; border: none;
  padding: 0.7rem 1.2rem; border-radius: 10px; font-size: 1rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

/* Trust badges */
.trust-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.trust-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); padding: 0.4rem 0.7rem; border-radius: 999px; font-size: 0.85rem;
}
.trust-badge svg { flex: none; }

/* Ad slots — placeholders during development.
   To activate later: remove the .dev styling and drop in AdSense markup. */
.ad-slot {
  /* set `display: none` to hide all ad slots entirely until launch */
  display: flex; align-items: center; justify-content: center;
  margin: 1.5rem auto; max-width: 728px; min-height: 90px;
  border: 1px dashed var(--border); border-radius: 8px;
  color: var(--text-faint); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, var(--surface-2) 10px, var(--surface-2) 20px);
}
.ad-slot::before { content: 'Advertisement'; }
@media (max-width: 768px) {
  .ad-slot { max-width: 100%; min-height: 100px; }
}

/* Cards (shared) */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}

/* Focus visibility */
:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px;
}

/* Utility */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 0.9rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: fade-up 0.35s ease both; }
  @keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}
