/* ==========================================================================
   Stepify — Base Styles
   Shared across all pages: variables, reset, brand bar, footer, toggle.
   ========================================================================== */

/* ---- Brand design tokens ---- */
:root {
  --stepify-primary: #0891B2;
  --stepify-primary-light: #22D3EE;
  --stepify-primary-dark: #0E7490;
  --stepify-accent: #E8590C;
  --stepify-accent-light: #FB923C;
  --stepify-success: #047857;
  --stepify-gray-50: #F8FAFC;
  --stepify-gray-100: #F1F5F9;
  --stepify-gray-200: #E2E8F0;
  --stepify-gray-500: #64748B;
  --stepify-gray-700: #334155;
  --stepify-gray-800: #1E293B;
  --stepify-gray-900: #0F172A;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Theme variables (light) ---- */
:root {
  --bg: #f8fafc; --surface: #fff; --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --text: #1e293b; --body: #334155; --muted: #475569; --heading: #0E7490;
  --focus: #0E7490; --link: #0E7490;
  --footer: #475569; --footer-link: #0E7490;
  --bar-bg: #0f172a;
  --badge-accent: #E8590C;
  --bc-link: #64748b; --bc-current: #334155; --bc-sep: #FB923C; --bc-border: #e2e8f0;
}

/* ---- Theme variables (dark) ---- */
[data-theme="dark"] {
  --bg: #0F172A; --surface: #1E293B; --border: #475569;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --text: #F1F5F9; --body: #cbd5e1; --muted: #94A3B8; --heading: #22D3EE;
  --focus: #22D3EE; --link: #22D3EE;
  --footer: #94A3B8; --footer-link: #22D3EE;
  --bar-bg: #020617;
  --badge-accent: #FB923C;
  --bc-link: #94A3B8; --bc-current: #CBD5E1; --bc-sep: #FB923C; --bc-border: #334155;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0F172A; --surface: #1E293B; --border: #475569;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --text: #F1F5F9; --body: #cbd5e1; --muted: #94A3B8; --heading: #22D3EE;
    --focus: #22D3EE; --link: #22D3EE;
    --footer: #94A3B8; --footer-link: #22D3EE;
    --bar-bg: #020617;
    --badge-accent: #FB923C;
    --bc-link: #94A3B8; --bc-current: #CBD5E1; --bc-sep: #FB923C; --bc-border: #334155;
  }
}

/* ---- Reset & base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-body);
  color: var(--text); line-height: 1.6; background: var(--bg);
}

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

.skip-link {
  position: absolute; top: -40px; left: 0; background: var(--focus); color: white;
  padding: 0.5rem 1rem; text-decoration: none; border-radius: 0 0 4px 0; z-index: 100;
  font-family: var(--font-body); font-weight: 500;
}
.skip-link:focus { top: 0; outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- Brand bar ---- */
.brand-bar {
  background: var(--bar-bg); color: white; padding: 0.6rem 1.5rem;
  display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem;
}
.brand-link { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 0.75rem; }
.brand-link:hover { opacity: 0.9; text-decoration: none; }
.brand-bar .logo-text {
  font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.brand-bar .sep { opacity: 0.4; }
.brand-bar .label { opacity: 0.8; font-weight: 400; font-family: var(--font-body); }

/* ---- Theme toggle ---- */
.theme-toggle {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: #94a3b8; padding: 6px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; width: 36px; height: 36px;
}
.theme-toggle:hover { color: #f1f5f9; background: rgba(255,255,255,0.1); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: block; }
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  padding: 0.5rem 1.5rem; font-size: 0.8rem; font-family: var(--font-body);
  font-weight: 500; border-bottom: 1px solid var(--bc-border); background: var(--bg);
}
.breadcrumb ol {
  list-style: none; display: flex; align-items: center; gap: 0.4rem;
  max-width: 1060px; margin: 0 auto;
}
.breadcrumb a { color: var(--bc-link); text-decoration: none; }
.breadcrumb a:hover { color: var(--link); text-decoration: underline; }
.breadcrumb .bc-sep { color: var(--bc-sep); font-size: 0.7rem; }
.breadcrumb [aria-current] { color: var(--bc-current); }

/* ---- Page container ---- */
.container { max-width: 1060px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
@media (max-width: 640px) { .container { padding: 1.25rem 1rem 2rem; } }

/* ---- Footer ---- */
footer {
  text-align: center; padding: 2rem 1rem; color: var(--footer); font-size: 0.8rem;
  font-family: var(--font-body);
}
footer a { color: var(--footer-link); text-decoration: none; font-weight: 500; }
footer a:hover { text-decoration: underline; }
footer .sub { font-size: 0.75rem; margin-top: 0.25rem; }

/* ---- Focus ---- */
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
