/* Pramana design tokens: the one place where type, spacing, radius, shadow and colour are defined.
   Every other stylesheet reads them with var(--name) and never declares :root itself.
   Paper, ink, and one accent that always means "this came from a source". No web fonts: the
   stacks below use what the device already has, so the site opens the same inside China. */
:root {
  color-scheme: light;
  font-size: 100%;
  --button-hover: #3a3835;
  --on-accent: #fffdf8;
  --viewer-surround: #e9e5d9;
  --document-paper: #ffffff; /* Image pixels and their page sheet never invert. */
  --print-ink: #1d1c1a;
  --print-line: #777777;
  --mask-opaque: #000000;
  --clear: rgba(0, 0, 0, 0);
  --modality-text: #817966;
  --modality-vision: #5a6ad0;
  --modality-speech: #237951;
  --log-bg: #23211e;
  --log-ink: #e9e4d6;
  --avatar-bg: #5d564a;
  --avatar-ink: #f7f3ea;
  --weak-line: #e3b5ae;
  --ok-line: #a9d6c1;
  --focus-quiet: rgba(29, 28, 26, .12);
  --inverse-soft: rgba(255, 255, 255, .12);
  --inverse-line: rgba(255, 255, 255, .2);
  --shadow-ink: rgba(0, 0, 0, .08);
  --shadow-strong: rgba(0, 0, 0, .25);
  --shadow-heavy: rgba(0, 0, 0, .35);
  --highlight-fill: rgba(240, 130, 30, .20);
  --highlight-line: rgba(164, 66, 9, .9);
  --highlight-pulse: rgba(164, 66, 9, .5);
  --weak-pulse: rgba(165, 52, 46, .35);
  --ink-pulse: rgba(29, 28, 26, .28);
  --backdrop: rgba(29, 28, 26, .38);
  --video-bg: #050505;
  --video-ink: #f3efe6;
  --video-badge: rgba(6, 6, 6, .85);
  --video-badge-hover: rgba(6, 6, 6, .95);
  --video-shade: rgba(8, 8, 8, .6);
  --video-panel: rgba(8, 8, 8, .8);
  --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%23fffdf8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* colour: surfaces and ink */
  --paper: #f5f2ea;
  --paper-2: #efebe0;          /* the sidebar and the phone's top bar */
  --card: #fffdf8;
  --ink: #1d1c1a;
  --ink-2: #55524c;
  --ink-3: #625e55;
  --line: #e6e1d4;
  --line-2: #d3ccbb;
  --soft: #ece7da;             /* chips, track backgrounds, segmented controls */
  --paper-3: #f0ece1;          /* quiet fills: notes, drop zones, refusals */
  --hover: #e8e3d6;
  --active: #e0dac9;

  /* colour: meaning */
  --cite: #a44209;             /* citations and evidence from the course */
  --cite-soft: #fbe9d9;
  --cite-line: #edc7a6;
  --indigo: #2f3c8f;           /* checks, interactive marks */
  --indigo-soft: #eceef8;
  --indigo-line: #c9cdea;
  --link: #2a62c9;
  --outside: #7d5208;          /* general knowledge from outside the course: amber, never orange */
  --outside-soft: #fcf6e7;
  --outside-line: #e6d4a4;
  --outside-dot: #805708;
  --ai: #2f4c42;               /* the "AI generated" mark */
  --ai-soft: #e3ebe5;
  --ok: #1f6b4f;
  --ok-soft: #e8f3ed;
  --weak: #a5342e;
  --weak-soft: #fbeceb;
  --developing: #815b09;
  --warn: #8a6208;
  --warn-soft: #f9eccd;
  --mastered: #216a4f;
  --unknown: #b9b3a5;

  /* type: serif for headings, sans for everything that is read */
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-1: 0.6875rem;                /* marks and badges */
  --fs-2: 0.75rem;                /* captions, hints */
  --fs-3: 0.8125rem;                /* secondary text, small buttons */
  --fs-4: 0.875rem;                /* lists, menus */
  --fs-5: 0.9375rem;                /* interface body */
  --fs-6: 1rem;                /* answers */
  --fs-7: 1.125rem;                /* card titles */
  --fs-8: 1.25rem;                /* section titles */
  --fs-9: 1.75rem;                /* page titles */
  --fs-10: clamp(2rem, 3.6vw, 2.75rem);   /* the home and course hero */
  --lh-tight: 1.2;
  --lh-snug: 1.4;
  --lh-base: 1.55;
  --composer-min: 40px;
  --lh-prose: 1.75;
  --track-title: -0.015em;
  --track-label: 0.06em;

  /* space, on a 4px grid */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* radius */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;
  --radius: var(--r-md);

  /* shadow */
  --sh-1: 0 1px 2px rgba(29, 28, 26, .05);
  --sh-2: 0 8px 30px rgba(29, 28, 26, .07);
  --sh-3: 0 14px 44px rgba(29, 28, 26, .18), 0 2px 6px rgba(29, 28, 26, .06);
  --sh-modal: 0 24px 80px rgba(0, 0, 0, .25);
  --focus: 0 0 0 3px rgba(47, 60, 143, .22);

  /* layout and motion */
  --touch: 40px;
  --phone-bar: 52px;
  --chat-w: 720px;
  --menu-w: 280px;
  --catalogue-w: 340px;
  --composer-draft: 80px;
  --composer-max: 180px;
  --composer-home-space: 232px;
  --r-composer: 24px;
  --control-line: #827b70;
  --rail-w: 248px;
  --w-read: 780px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: .16s;
}

@media (max-width: 767.98px) {
  body { --touch: 44px; }       /* phones: every control at least 44 x 44 px to press (inherited by everything on the page) */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
  --control-line: #87919f;
  --paper: #171c22;
  --paper-2: #1d232b;
  --card: #222a33;
  --ink: #f0eee8;
  --ink-2: #d2cec5;
  --ink-3: #bcb7ad;
  --line: #404b57;
  --line-2: #596573;
  --soft: #303944;
  --paper-3: #29323d;
  --hover: #35404c;
  --active: #404d5b;
  --cite: #ffb878;
  --cite-soft: #3c2c21;
  --cite-line: #8c6040;
  --indigo: #b9c5ff;
  --indigo-soft: #30374c;
  --indigo-line: #6571a0;
  --link: #accaff;
  --outside: #f4d187;
  --outside-soft: #372f1d;
  --outside-line: #8b7543;
  --outside-dot: #f4d187;
  --ai: #b2ddc3;
  --ai-soft: #263e34;
  --ok: #a0dfbc;
  --ok-soft: #253d31;
  --weak: #ffb6ae;
  --weak-soft: #412b2d;
  --developing: #edce86;
  --warn: #edce86;
  --warn-soft: #3d321e;
  --mastered: #a0dfbc;
  --unknown: #7d8896;
  --button-hover: #d2cec5;
  --on-accent: #171c22;
  --viewer-surround: #11171e;
  --document-paper: #ffffff;
  --mask-opaque: #000000;
  --clear: rgba(0, 0, 0, 0);
  --modality-text: #bcb7ad;
  --modality-vision: #b9c5ff;
  --modality-speech: #a0dfbc;
  --log-bg: #10151b;
  --log-ink: #e9e4d6;
  --avatar-bg: #4b5867;
  --avatar-ink: #f7f3ea;
  --weak-line: #946059;
  --ok-line: #4b8266;
  --focus-quiet: rgba(240, 238, 232, .2);
  --inverse-soft: rgba(23, 28, 34, .12);
  --inverse-line: rgba(23, 28, 34, .3);
  --shadow-ink: rgba(0, 0, 0, .3);
  --shadow-strong: rgba(0, 0, 0, .5);
  --shadow-heavy: rgba(0, 0, 0, .6);
  --highlight-fill: rgba(240, 130, 30, .20);
  --highlight-line: rgba(164, 66, 9, .9);
  --highlight-pulse: rgba(164, 66, 9, .5);
  --weak-pulse: rgba(255, 182, 174, .35);
  --ink-pulse: rgba(240, 238, 232, .28);
  --backdrop: rgba(0, 0, 0, .65);
  --video-bg: #050505;
  --video-ink: #f3efe6;
  --video-badge: rgba(6, 6, 6, .85);
  --video-badge-hover: rgba(6, 6, 6, .95);
  --video-shade: rgba(8, 8, 8, .6);
  --video-panel: rgba(8, 8, 8, .8);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .25);
  --sh-2: 0 8px 30px rgba(0, 0, 0, .3);
  --sh-3: 0 14px 44px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  --sh-modal: 0 24px 80px rgba(0, 0, 0, .6);
  --focus: 0 0 0 3px rgba(185, 197, 255, .5);
  --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%23171c22' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --control-line: #87919f;
  --paper: #171c22;
  --paper-2: #1d232b;
  --card: #222a33;
  --ink: #f0eee8;
  --ink-2: #d2cec5;
  --ink-3: #bcb7ad;
  --line: #404b57;
  --line-2: #596573;
  --soft: #303944;
  --paper-3: #29323d;
  --hover: #35404c;
  --active: #404d5b;
  --cite: #ffb878;
  --cite-soft: #3c2c21;
  --cite-line: #8c6040;
  --indigo: #b9c5ff;
  --indigo-soft: #30374c;
  --indigo-line: #6571a0;
  --link: #accaff;
  --outside: #f4d187;
  --outside-soft: #372f1d;
  --outside-line: #8b7543;
  --outside-dot: #f4d187;
  --ai: #b2ddc3;
  --ai-soft: #263e34;
  --ok: #a0dfbc;
  --ok-soft: #253d31;
  --weak: #ffb6ae;
  --weak-soft: #412b2d;
  --developing: #edce86;
  --warn: #edce86;
  --warn-soft: #3d321e;
  --mastered: #a0dfbc;
  --unknown: #7d8896;
  --button-hover: #d2cec5;
  --on-accent: #171c22;
  --viewer-surround: #11171e;
  --document-paper: #ffffff;
  --mask-opaque: #000000;
  --clear: rgba(0, 0, 0, 0);
  --modality-text: #bcb7ad;
  --modality-vision: #b9c5ff;
  --modality-speech: #a0dfbc;
  --log-bg: #10151b;
  --log-ink: #e9e4d6;
  --avatar-bg: #4b5867;
  --avatar-ink: #f7f3ea;
  --weak-line: #946059;
  --ok-line: #4b8266;
  --focus-quiet: rgba(240, 238, 232, .2);
  --inverse-soft: rgba(23, 28, 34, .12);
  --inverse-line: rgba(23, 28, 34, .3);
  --shadow-ink: rgba(0, 0, 0, .3);
  --shadow-strong: rgba(0, 0, 0, .5);
  --shadow-heavy: rgba(0, 0, 0, .6);
  --highlight-fill: rgba(240, 130, 30, .20);
  --highlight-line: rgba(164, 66, 9, .9);
  --highlight-pulse: rgba(164, 66, 9, .5);
  --weak-pulse: rgba(255, 182, 174, .35);
  --ink-pulse: rgba(240, 238, 232, .28);
  --backdrop: rgba(0, 0, 0, .65);
  --video-bg: #050505;
  --video-ink: #f3efe6;
  --video-badge: rgba(6, 6, 6, .85);
  --video-badge-hover: rgba(6, 6, 6, .95);
  --video-shade: rgba(8, 8, 8, .6);
  --video-panel: rgba(8, 8, 8, .8);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .25);
  --sh-2: 0 8px 30px rgba(0, 0, 0, .3);
  --sh-3: 0 14px 44px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  --sh-modal: 0 24px 80px rgba(0, 0, 0, .6);
  --focus: 0 0 0 3px rgba(185, 197, 255, .5);
  --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%23171c22' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-font-size="large"] { font-size: 112.5%; }
:root[data-font-size="extra-large"] { font-size: 137.5%;
  --composer-min: calc(2em * var(--lh-base) + 18px);   /* the placeholder wraps on a phone: room for its second line */
}
