/* Bloguu design system — Indigo & slate
   All colour, spacing and type decisions live here as custom properties.
   Never hardcode a colour anywhere else in the project. */

:root {
  /* Brand ramp */
  --c-primary: #312E81;
  --c-primary-mid: #4F46E5;
  --c-primary-light: #818CF8;
  --c-primary-tint: #EEF0FF;
  --c-accent: #F59E0B;
  --c-accent-tint: #FEF3C7;

  /* Surfaces */
  --bg-page: #F7F8FC;
  --bg-surface: #FFFFFF;
  --bg-sunken: #F1F2F9;

  /* Text */
  --text-strong: #1F2340;
  --text-body: #3F4460;
  --text-muted: #6B7086;
  --text-invert: #FFFFFF;
  --text-on-tint: #312E81;

  /* Lines */
  --line: #E2E4F0;
  --line-strong: #C9CCE0;

  /* Status */
  --c-error: #DC2626;
  --c-error-tint: #FEF2F2;
  --c-success: #059669;
  --c-success-tint: #ECFDF5;
  --c-warn: #B45309;
  --c-warn-tint: #FFFBEB;

  /* Chart series — used by canvas drawing in utils.js */
  --chart-1: #4F46E5;
  --chart-2: #F59E0B;
  --chart-3: #818CF8;
  --chart-4: #312E81;
  --chart-5: #059669;
  --chart-grid: #E2E4F0;

  /* Type */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* 8px spacing grid */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s6: 48px;
  --s8: 64px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow-card: 0 1px 2px rgba(31, 35, 64, .06);
  --shadow-raise: 0 4px 16px rgba(31, 35, 64, .10);

  --maxw: 1200px;
}

body.dark {
  --bg-page: #12121C;
  --bg-surface: #1E1E2E;
  --bg-sunken: #171725;

  --text-strong: #F2F3F9;
  --text-body: #C7C9DA;
  --text-muted: #8E92AB;
  --text-on-tint: #C7CBFF;

  --line: #2E2F45;
  --line-strong: #414263;

  --c-primary: #A5B4FC;
  --c-primary-mid: #6366F1;
  --c-primary-light: #818CF8;
  --c-primary-tint: #23233C;
  --c-accent-tint: #33280F;

  --c-error: #F87171;
  --c-error-tint: #341A1A;
  --c-success: #34D399;
  --c-success-tint: #12301F;
  --c-warn: #FBBF24;
  --c-warn-tint: #33280F;

  --chart-1: #818CF8;
  --chart-2: #FBBF24;
  --chart-3: #A5B4FC;
  --chart-4: #6366F1;
  --chart-5: #34D399;
  --chart-grid: #2E2F45;

  --shadow-card: none;
  --shadow-raise: 0 4px 16px rgba(0, 0, 0, .4);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.3; margin: 0 0 var(--s2); font-weight: 600; }
h1 { font-size: 2.5rem; letter-spacing: -.02em; }
h2 { font-size: 2rem; letter-spacing: -.015em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }
p { margin: 0 0 var(--s2); }
a { color: var(--c-primary-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .small { font-size: .875rem; }

:focus-visible {
  outline: 3px solid var(--c-primary-mid);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--c-primary); color: var(--text-invert);
  padding: var(--s1) var(--s2); border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s3); }
.narrow { max-width: 780px; }

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 68px;
}
.logo {
  font-size: 1.375rem; font-weight: 700; letter-spacing: -.03em;
  color: var(--text-strong); text-decoration: none; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo span { color: var(--c-primary-mid); }

.main-nav { display: flex; gap: var(--s3); margin-left: auto; align-items: center; }
.main-nav a { color: var(--text-body); font-size: .9375rem; font-weight: 500; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--c-primary-mid); text-decoration: none; }

.header-tools { display: flex; gap: var(--s1); align-items: center; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text-body); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-sunken); border-color: var(--line-strong); }
.icon-btn svg { width: 20px; height: 20px; }

.currency-select {
  height: 40px; padding: 0 var(--s2); font-family: inherit; font-size: .875rem;
  background: transparent; color: var(--text-body);
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}

.nav-toggle { display: none; }

/* Breadcrumb */
.breadcrumb { font-size: .8125rem; color: var(--text-muted); padding: var(--s3) 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1); margin: 0; padding: 0; }
.breadcrumb li::after { content: "/"; margin-left: var(--s1); color: var(--line-strong); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--text-muted); }

/* Hero */
.hero { padding: var(--s8) 0 var(--s6); text-align: center; }
.hero h1 { max-width: 18ch; margin-inline: auto; }
.hero p { max-width: 60ch; margin-inline: auto; color: var(--text-muted); font-size: 1.125rem; }
.hero-actions { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; margin-top: var(--s3); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  min-height: 48px; padding: 0 var(--s3);
  font-family: inherit; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-lg); border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background-color .12s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--c-primary-mid); color: #FFFFFF; box-shadow: var(--shadow-card); }
.btn-primary:hover { background: var(--c-primary); transform: scale(1.02); }
.btn-secondary { background: var(--bg-surface); color: var(--text-strong); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--bg-sunken); transform: scale(1.02); }
.btn-ghost {
  background: transparent; color: var(--text-body); border-color: var(--line);
  min-height: 40px; padding: 0 var(--s2); font-size: .875rem; border-radius: var(--radius-sm);
}
.btn-ghost:hover { background: var(--bg-sunken); }
.btn-block { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Section headings */
.section { padding: var(--s6) 0; }
.section-head { margin-bottom: var(--s4); }
.section-head h2 { margin-bottom: var(--s1); }
.section-head p { color: var(--text-muted); margin: 0; }

/* Card grid */
.grid { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.tool-card {
  display: flex; flex-direction: column; gap: var(--s1);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c-primary-mid);
  border-radius: var(--radius);
  padding: var(--s3);
  color: inherit; text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.tool-card:hover { text-decoration: none; box-shadow: var(--shadow-raise); border-color: var(--line-strong); }
.tool-card .ico { color: var(--c-primary-mid); margin-bottom: var(--s1); }
.tool-card .ico svg { width: 28px; height: 28px; }
.tool-card h3 { font-size: 1.0625rem; margin: 0; }
.tool-card p { font-size: .875rem; color: var(--text-muted); margin: 0; }

.tool-card.featured { border-top-color: var(--c-accent); }
.tool-card.featured .ico { color: var(--c-accent); }

/* Trust strip */
.trust { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.trust div { text-align: center; }
.trust svg { width: 28px; height: 28px; color: var(--c-primary-mid); margin-bottom: var(--s1); }
.trust h3 { font-size: 1rem; margin-bottom: 4px; }
.trust p { font-size: .875rem; color: var(--text-muted); margin: 0; }

/* Ad slots — fixed reserved height prevents layout shift (CLS) */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  margin: var(--s4) auto; overflow: hidden;
  background: var(--bg-sunken); border-radius: var(--radius-sm);
}
.ad-slot::before {
  content: "Advertisement"; font-size: .6875rem; color: var(--text-muted); letter-spacing: .04em;
}
.ad-slot:has(ins) ::before { content: none; }
.ad-leaderboard { width: 100%; max-width: 728px; min-height: 90px; }
.ad-rectangle { width: 100%; max-width: 336px; min-height: 280px; }
@media (max-width: 767px) {
  .ad-leaderboard { max-width: 320px; min-height: 100px; }
}

/* Article prose */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.625rem; margin-top: var(--s6); }
.prose h3 { font-size: 1.25rem; margin-top: var(--s4); }
.prose ul, .prose ol { padding-left: var(--s3); margin: 0 0 var(--s2); }
.prose li { margin-bottom: var(--s1); }

/* FAQ */
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-surface); padding: var(--s2) var(--s3); margin-bottom: var(--s1);
}
.faq summary {
  cursor: pointer; font-weight: 600; color: var(--text-strong); list-style: none;
  display: flex; justify-content: space-between; gap: var(--s2); align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.25rem; color: var(--c-primary-mid); flex-shrink: 0; }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { margin-bottom: var(--s1); }
.faq p:last-child { margin-bottom: 0; }

/* Related links */
.related { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Disclaimer callouts */
.callout {
  border-radius: var(--radius); border-radius: 0;
  padding: var(--s2) var(--s3); margin: var(--s3) 0;
  font-size: .9375rem;
}
.callout-warn { background: var(--c-warn-tint); border-left: 4px solid var(--c-warn); color: var(--text-body); }
.callout-info { background: var(--c-primary-tint); border-left: 4px solid var(--c-primary-mid); color: var(--text-body); }
.callout strong { color: var(--text-strong); }
.callout p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer {
  background: var(--bg-surface); border-top: 1px solid var(--line);
  padding: var(--s6) 0 var(--s3); margin-top: var(--s8);
}
.footer-grid { display: grid; gap: var(--s4); grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.footer-grid h4 { font-size: .9375rem; margin-bottom: var(--s1); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--text-muted); font-size: .875rem; }
.footer-grid a:hover { color: var(--c-primary-mid); }
.footer-tagline { color: var(--text-muted); font-size: .875rem; max-width: 34ch; }
.footer-bottom {
  border-top: 1px solid var(--line); margin-top: var(--s4); padding-top: var(--s3);
  display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap;
  font-size: .8125rem; color: var(--text-muted);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  .hero { padding: var(--s4) 0 var(--s3); }
  .section { padding: var(--s4) 0; }
  .wrap { padding: 0 var(--s2); }
  .nav-toggle { display: grid; }
  .main-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-surface); border-bottom: 1px solid var(--line);
    padding: var(--s1) var(--s2) var(--s2);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: var(--s1) 0; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  .site-header, .site-footer, .ad-slot, .btn, .faq, .related, .breadcrumb { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
}

.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;
}
