/* ==========================================================================
   Curio design tokens.

   One primary action colour per screen. Semantic colours are reserved: green
   only ever means correct or mastered, coral only ever means "not quite".
   Topic accents tint chrome (an icon, a rule, a card edge) and never compete
   with the primary button.

   The app is deliberately single-theme. `color-scheme: only light` stops
   Chrome on Android auto-darkening and mangling the palette; the accessibility
   answer here is the explicit high-contrast mode below, not a second theme.
   ========================================================================== */

@font-face {
  font-family: 'Baloo 2';
  src: url('../assets/fonts/baloo2-var.woff2') format('woff2-variations');
  font-weight: 400 800;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Nunito';
  src: url('../assets/fonts/nunito-var.woff2') format('woff2-variations');
  font-weight: 200 1000;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Lexend';
  src: url('../assets/fonts/lexend-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

:root {
  color-scheme: only light;

  /* Ink -------------------------------------------------------------- */
  --ink: #26244A;
  --ink-soft: #55527E;
  --ink-faint: #817EA6;

  /* Ground ----------------------------------------------------------- */
  --paper: #FFFCF6;
  --surface: #FFFFFF;
  --surface-sunken: #F7F4FD;
  --line: #E6E0F2;
  --line-strong: #CFC6E4;

  /* The one action colour -------------------------------------------- */
  --primary: #5A46D6;
  --primary-press: #4636B4;
  --primary-tint: #EFEBFE;
  --on-primary: #FFFFFF;

  /* Semantic. Reserved. Never decorative. ---------------------------- */
  --correct: #12805A;
  --correct-tint: #E2F5EC;
  --nearly: #B4530C;
  --nearly-tint: #FDF0E2;
  --notyet: #C43B57;
  --notyet-tint: #FDECEF;

  /* Topic accents. Chrome only. -------------------------------------- */
  --accent-coral: #E8536D;
  --accent-teal: #16867F;
  --accent-violet: #7B4FD1;
  --accent-amber: #B7761A;
  --accent-sky: #2A7FA8;
  --accent-moss: #4A8033;

  /* Type ------------------------------------------------------------- */
  --font-display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-read: var(--font-body);
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.4375rem;
  --step-3: 1.75rem;
  --step-4: 2.125rem;
  --leading-body: 1.65;

  /* Shape and space -------------------------------------------------- */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --shadow-1: 0 1px 2px rgba(38, 36, 74, .06);
  --shadow-2: 0 6px 20px -8px rgba(38, 36, 74, .18);
  --shadow-3: 0 18px 42px -18px rgba(38, 36, 74, .28);

  --tap: 44px;                       /* minimum touch target */
  --shell-max: 760px;
  --focus: 3px solid var(--primary);
  --focus-offset: 3px;
  --motion: 180ms cubic-bezier(.2, .7, .3, 1);
}

/* Age-band theming. The same app, aged up. ---------------------------- */
#app[data-band='young'] {
  --radius: 24px;
  --radius-sm: 16px;
  --radius-lg: 32px;
  --step-0: 1.125rem;
  --step-1: 1.3125rem;
  --step-2: 1.625rem;
  --step-3: 2rem;
  --leading-body: 1.75;
}
#app[data-band='senior'] {
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --step-0: 0.96875rem;
  --leading-body: 1.6;
}

/* Learner settings ---------------------------------------------------- */
#app[data-text='large'] { font-size: 112.5%; }
#app[data-text='xlarge'] { font-size: 131.25%; }
#app[data-text='small'] { font-size: 93.75%; }

#app[data-easyread='on'] {
  --font-read: 'Lexend', system-ui, sans-serif;
  --font-body: 'Lexend', system-ui, sans-serif;
  --font-display: 'Lexend', system-ui, sans-serif;
  letter-spacing: .012em;
  word-spacing: .06em;
}

#app[data-contrast='on'] {
  --ink: #000000;
  --ink-soft: #1A1A1A;
  --ink-faint: #2E2E2E;
  --paper: #FFFFFF;
  --surface: #FFFFFF;
  --surface-sunken: #F2F2F2;
  --line: #000000;
  --line-strong: #000000;
  --primary: #2B0F91;
  --primary-press: #1C0868;
  --primary-tint: #EDE9FB;
  --correct: #0A5C3E;
  --notyet: #9B0E2C;
  --nearly: #7A3300;
  --shadow-1: none;
  --shadow-2: none;
  --shadow-3: none;
}
#app[data-contrast='on'] .card,
#app[data-contrast='on'] .btn,
#app[data-contrast='on'] .chip { border-width: 2px; }

@media (prefers-reduced-motion: reduce) {
  :root { --motion: 1ms; }
}
#app[data-motion='reduced'] { --motion: 1ms; }
