/**
 * ConceptRecall — design tokens.
 *
 * The single source of truth for the whole site. Every conceptrecall_*
 * module ships component CSS that consumes these exact values, so the
 * design stays coherent across modules, theme, and admin pages.
 *
 * Aesthetic: current ConceptRecall layout with Academic Prestige color tokens.
 * Only colors are changed here; spacing, typography, layout and component
 * structure remain from the approved current design.
 */

:root {
  /* ---- Surfaces ---- */
  --cr-bg: #f3faf9;            /* page — warm paper */
  --cr-bg-card: #ffffff;       /* raised card surface */
  --cr-bg-sunken: #eef5f4;     /* wells, code, examples */
  --cr-bg-ink: #2b3030;        /* footer, dark strips */

  /* ---- Ink ---- */
  --cr-text: #181c1d;          /* primary text */
  --cr-text-muted: #404945;    /* secondary text */
  --cr-text-faint: #707975;    /* captions, hints */
  --cr-text-invert: #eef1f2;   /* text on dark */

  /* ---- Brand ---- */
  --cr-accent: #003f34;        /* teal — primary action */
  --cr-accent-hover: #005244;
  --cr-accent-soft: #e4f3f0;   /* teal tint — ghost buttons, fills */
  --cr-warm: #c66a3a;          /* clay — topic pills, highlights */
  --cr-warm-hover: #9f512b;
  --cr-warm-soft: #edf5f3;     /* clay tint */
  --cr-gold: #e9c349;          /* sparing — featured, accents */

  /* ---- Lines ---- */
  --cr-border: #d9e5e2;        /* hairline on paper */
  --cr-border-strong: #b9c9c4;
  --cr-focus: #003e33;

  /* ---- Difficulty signals ---- */
  --cr-diff-beginner: #32685a;
  --cr-diff-beginner-bg: #eaf7f3;
  --cr-diff-intermediate: #735c00;
  --cr-diff-intermediate-bg: #eef5f4;
  --cr-diff-advanced: #4e4d48;
  --cr-diff-advanced-bg: #e5e2db;

  /* ---- Typography ---- */
  --cr-font-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --cr-font-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --cr-font-bangla: 'Hind Siliguri', 'Noto Sans Bengali', sans-serif;
  --cr-font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* Fluid type scale — clamps between mobile and desktop. */
  --cr-text-xs: 0.78rem;
  --cr-text-sm: 0.88rem;
  --cr-text-base: 1rem;
  --cr-text-lg: 1.125rem;
  --cr-text-xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --cr-text-2xl: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem);
  --cr-text-3xl: clamp(2rem, 1.5rem + 2.4vw, 3rem);
  --cr-text-4xl: clamp(2.5rem, 1.8rem + 3.4vw, 4rem);

  --cr-leading-tight: 1.18;
  --cr-leading-snug: 1.4;
  --cr-leading-normal: 1.65;
  --cr-leading-bangla: 1.9;     /* Bangla needs more vertical room */

  /* ---- Spacing — 4px base ---- */
  --cr-space-1: 0.25rem;
  --cr-space-2: 0.5rem;
  --cr-space-3: 0.75rem;
  --cr-space-4: 1rem;
  --cr-space-5: 1.5rem;
  --cr-space-6: 2rem;
  --cr-space-7: 3rem;
  --cr-space-8: 4rem;
  --cr-space-9: 6rem;

  /* ---- Radii ---- */
  --cr-radius-sm: 7px;
  --cr-radius-md: 12px;
  --cr-radius-lg: 20px;
  --cr-radius-xl: 28px;
  --cr-radius-full: 9999px;

  /* ---- Elevation — soft, paper-like, never harsh ---- */
  --cr-shadow-sm: 0 1px 2px rgba(33, 31, 27, 0.05);
  --cr-shadow-md: 0 2px 6px rgba(33, 31, 27, 0.06), 0 8px 20px rgba(33, 31, 27, 0.05);
  --cr-shadow-lg: 0 4px 14px rgba(33, 31, 27, 0.08), 0 16px 40px rgba(33, 31, 27, 0.07);
  --cr-shadow-ink: 0 10px 34px rgba(27, 26, 23, 0.22);

  /* ---- Motion ---- */
  --cr-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --cr-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --cr-fast: 0.16s;
  --cr-base: 0.28s;
  --cr-slow: 0.55s;

  /* ---- Layout ---- */
  --cr-measure: 68ch;          /* readable text width */
  --cr-container: 1320px;
  --cr-container-wide: 1440px;
  --cr-header-h: 72px;
}

/* ---- Reset / base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  margin: 0;
  min-height: 100dvh;
  background-color: var(--cr-bg);
  /* A faint paper grain — atmosphere without weight. */
  background-image:
    radial-gradient(circle at 78% 6%, rgba(181, 238, 221, 0.24), transparent 38%),
    radial-gradient(circle at 8% 18%, rgba(232, 247, 244, 0.72), transparent 44%),
    linear-gradient(180deg, #f6fbfb 0%, #edf6f5 48%, #f7fbfa 100%);
  background-attachment: fixed;
  color: var(--cr-text);
  font-family: var(--cr-font-sans);
  font-size: var(--cr-text-base);
  line-height: var(--cr-leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--cr-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--cr-accent-hover);
}

:focus-visible {
  outline: 2px solid var(--cr-focus);
  outline-offset: 2px;
  border-radius: var(--cr-radius-sm);
}

/* Bangla content always gets the Bangla face and looser leading. */
[lang="bn"] {
  font-family: var(--cr-font-bangla);
  line-height: var(--cr-leading-bangla);
}


@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}
