/* ============================================
   AI Learning — Design Tokens (warm-natur)
   Default theme. Other themes override these vars.
   ============================================ */

:root {
  /* Color — warm-natur (default) */
  --bg: #f5f0e8;
  --bg-elevated: #faf6ee;
  --fg: #1a2e3e;
  --accent: #2d5e3e;
  --accent-hover: #244c32;
  --accent-soft: #e3ece4;
  --accent-warm: #b8956a;
  --accent-warm-soft: #f0e6d3;
  --muted: #7a7062;
  --muted-strong: #5a5247;
  --card: #ffffff;
  --border: #d8cfbb;
  --border-soft: #e6dfcd;
  --code-bg: #ebe3d3;
  --terminal-bg: #1a1a1a;
  --terminal-fg: #e8dfc9;

  --status-success: #2d5e3e;
  --status-warn: #b8956a;
  --status-danger: #a64438;
  --status-info: #3d6280;

  /* Typography */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;

  --lh-tight: 1.25;
  --lh-snug: 1.4;
  --lh-base: 1.5;
  --lh-reading: 1.65;

  /* Spacing scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Radius */
  --r-sm: 6px;
  --r: 8px;
  --r-card: 12px;
  --r-pill: 999px;

  /* Shadows — warm-tinted, soft */
  --sh-1: 0 1px 2px rgba(122, 112, 98, 0.06);
  --sh-2: 0 2px 6px rgba(122, 112, 98, 0.08), 0 1px 2px rgba(122, 112, 98, 0.04);
  --sh-3: 0 8px 24px rgba(122, 112, 98, 0.10), 0 2px 6px rgba(122, 112, 98, 0.05);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* Layout */
  --header-h: 64px;
  --footer-h: 64px;
  --sidebar-w: 280px;
  --tutor-w: 340px;
}

/* ============================================
   Base
   ============================================ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Subtle paper-grain on body for warm feel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(184, 149, 106, 0.04) 0, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(45, 94, 62, 0.03) 0, transparent 40%);
  z-index: 0;
}

#root { position: relative; z-index: 1; }

/* Scrollbar (subtle, warm) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--r-pill);
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }
