/* =========================================================
   AILEARNIST — BASE / DESIGN TOKENS (loaded on every page)
   One place for theme colours, fonts, resets, buttons and the
   generic page-scaffold classes used by inner pages.
   Light theme on :root, dark on [data-theme="dark"] (set on
   <html> by includes/theme_boot.php before first paint).
   ========================================================= */

:root {
  --sk-lime: #a3e635;
  --sk-cyan: #22d3ee;
  --sk-violet: #8b5cf6;
  --sk-coral: #fb7185;
  --sk-amber: #f59e0b;

  --bg: #f6f7fb;
  --bg-alt: #eef0f7;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #5b6475;
  --border: #e2e5ee;
  --shadow: 0 10px 30px -18px rgba(15, 23, 42, .35);
  --accent: #0891b2;
  --accent-ink: #ffffff;
  --success: #16a34a;
  --error: #e11d48;
  --warning: #d97706;

  --studio-start: #1a1140;
  --studio-end: #0d1030;

  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-head: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --radius: 18px;
  --wrap: 1200px;

  /* Compatibility aliases — older component CSS copied from the
     Sqlism codebase (cookie consent, share, comments, profile…)
     reads these names. They all resolve to the tokens above. */
  --primary: var(--accent);
  --primary-dark: #0e7490;
  --bg-primary: var(--bg-card);
  --bg-secondary: var(--bg-alt);
  --bg-tertiary: var(--border);
  --card-bg: var(--bg-card);
  --text-primary: var(--text);
  --text-secondary: var(--text-muted);
  --shadow-lg: rgba(15, 23, 42, .18);
}

[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-alt: #111727;
  --bg-card: #151c2e;
  --text: #e6e9f2;
  --text-muted: #9aa3b8;
  --border: #252e45;
  --shadow: 0 14px 34px -18px rgba(0, 0, 0, .7);
  --accent: #22d3ee;
  --accent-ink: #04212a;
  --success: #4ade80;
  --error: #fb7185;
  --warning: #fbbf24;
  --primary-dark: #67e8f9;
  --shadow-lg: rgba(0, 0, 0, .55);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0; }
code, pre, kbd { font-family: var(--font-mono); }

.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; left: -999px; top: 8px; z-index: 1001;
  background: var(--sk-lime); color: #1a2e05; padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  font-family: var(--font-body);
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(15, 23, 42, .5); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 14px;
}

/* ---------- Inner-page scaffold (shared by every non-home page) ---------- */
.page-main { min-height: 50vh; }
.page-hero { max-width: var(--wrap); margin: 0 auto; padding: 22px 20px 6px; }
.page-hero-inner {
  position: relative; overflow: hidden; border-radius: 26px; padding: 46px 40px;
  background:
    radial-gradient(520px 260px at 92% -10%, rgba(139, 92, 246, .35), transparent 62%),
    radial-gradient(420px 240px at 0% 120%, rgba(34, 211, 238, .22), transparent 60%),
    linear-gradient(150deg, var(--studio-start), var(--studio-end));
  color: #eef0ff;
}
.page-hero-inner .section-eyebrow { color: #67e8f9; background: rgba(34, 211, 238, .14); }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.02em; margin-bottom: 12px; }
.page-hero p { margin: 0; max-width: 62ch; color: #c8cbe8; font-size: 1.05rem; }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.page-hero-actions .btn-primary { background: #fff; color: #0d1030; }
.page-hero-actions .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .25); }

.page-section { max-width: var(--wrap); margin: 0 auto; padding: 40px 20px; }
.page-section > h2 { font-size: 1.6rem; margin-bottom: 8px; }
.page-section > p.lead { color: var(--text-muted); margin: 0 0 24px; max-width: 70ch; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 10px; transition: transform .2s, border-color .2s;
}
a.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--sk-cyan), var(--sk-violet));
}
.card h3 { font-size: 1.1rem; }
.card p { margin: 0; color: var(--text-muted); font-size: .92rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.chip {
  font-family: var(--font-mono); font-size: .72rem; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted);
}

.prose { max-width: 760px; }
.prose h2 { font-size: 1.35rem; margin: 30px 0 10px; }
.prose h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--text-muted); }
.prose a { color: var(--accent); }

.coming-soon {
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center;
  color: var(--text-muted); background: var(--bg-card);
}
.coming-soon i { font-size: 1.6rem; color: var(--accent); display: block; margin-bottom: 8px; }

@media (max-width: 560px) {
  .page-hero-inner { padding: 32px 22px; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
