/* Ragafied design tokens. Canonical source for Rails and React. See design/design-system.md. */
:root {
  color-scheme: light;
  --color-paper: #fbf7ef;
  --brand-logo-filter: none;
  --color-audience-learners: #f5ecdd;
  --color-audience-teachers: #f0e6d7;
  --color-surface: #fffaf2;
  --color-surface-raised: #f1e7d9;
  --color-surface-hover: #e9dcc9;
  --color-ink: #29150b;
  --color-ink-soft: #6a5b4e;
  --color-muted: #6a5b4e;
  --color-neutral: #7b6b5d;
  --color-rule: #ded1bf;
  --color-rule-strong: #aa9380;
  --color-button: #29150b;
  --color-button-ink: #fff6e9;
  --color-accent: #754522;
  --color-accent-soft: #f4e4cf;
  --color-accent-ink: #fffaf2;
  --color-focus: #754522;
  --color-error: #b42318;
  --color-error-surface: #fff0ee;
  --color-success: #217346;
  --color-success-surface: #edf7f0;
  --color-guru: oklch(60% 0.17 42);
  --color-guru-soft: oklch(92% 0.035 42);
  --color-student: oklch(51% 0.105 188);
  --color-student-soft: oklch(91% 0.03 188);
  --color-slide: oklch(58% 0.17 244);
  --color-slide-soft: oklch(94% 0.032 244);
  --color-title: oklch(60% 0.16 344);
  --color-title-soft: oklch(95% 0.028 344);
  --color-overlay: oklch(15% 0.012 250 / 0.4);
  --color-glass: rgb(251 247 239 / .72);
  --color-shadow: oklch(20% 0.015 250 / 0.11);
  --color-shadow-float: oklch(20% 0.015 250 / 0.16);

  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-data: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --space-3xs: 0.125rem;
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 9rem;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.25rem;
  --text-lg: 1.5625rem;
  --text-xl: 1.953rem;
  --text-2xl: 2.441rem;
  --text-3xl: 3.052rem;
  --text-display: clamp(2.4rem, 4.5vw, 4.25rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 200ms;
  --dur-long: 420ms;

  --rule-hairline: 0.0625rem;
  --radius-small: 0.625rem;
  --radius-medium: 1rem;
  --radius-large: 1.5rem;
  --radius-round: 999px;

  --color-paper-2: var(--color-surface);
  --color-paper-3: var(--color-surface-raised);
  --color-accent-strong: #573019;
  --color-error-paper: var(--color-error-surface);
  --color-success-paper: var(--color-success-surface);
  --color-focus-inner: var(--color-surface);
  --font-mono: var(--font-data);
  --text-4xl: 3.815rem;
  --shell-width: 70rem;
  --page-gutter: clamp(1.5rem, 4vw, 3rem);
  --section-space: clamp(4.5rem, 8vw, 7.5rem);
  --header-height: 4rem;
  --control-height: 2.75rem;
  --control-height-small: 2.5rem;
  --control-padding: 1.5rem;
  /* The drop-down chevron (controls.css). The grey reads on light and dark surfaces. */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8b8b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --select-chevron-size: 1rem;
  --select-chevron-inset: 1rem;
  --shadow-surface: 0 1px 3px rgb(0 0 0 / 0.04), 0 8px 28px rgb(0 0 0 / 0.04);
  --shadow-overlay: 0 12px 40px rgb(0 0 0 / 0.14);

  --z-base: 1;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;
}

/* Text size (RFC 0018). text-size.js sets --interface-scale from the saved choice before paint;
   pages that follow it carry data-text-size. text-size.js also multiplies the width and height in
   each media query by the same scale, so a page moves to its narrower layout once the larger text
   needs the room, as browser zoom would. Media queries ignore the root font size on their own. */
html[data-text-size] {
  --page-scale: var(--interface-scale, 1);
  /* Reading text grows with the choice. Section spacing and display headings grow half as much
     (1.5x at 200%), as the player's outer spacing does. Page gutters stay in pixels, so the text keeps the width. */
  --grow-half: calc((1 + var(--page-scale)) / (2 * var(--page-scale)));
  --heading-scale: var(--grow-half);
  --space-md: calc(1rem * var(--grow-half));
  --space-lg: calc(1.5rem * var(--grow-half));
  --space-xl: calc(2.5rem * var(--grow-half));
  --space-2xl: calc(4rem * var(--grow-half));
  --space-3xl: calc(6rem * var(--grow-half));
  --space-4xl: calc(9rem * var(--grow-half));
  --page-gutter: clamp(24px, 4vw, 48px);
  font-size: calc(100% * var(--page-scale));
}
/* Buttons wrap rather than run past the window, and long words in headings and term lists hyphenate. A word too
   long for its line (an email address) breaks rather than spills; no other line changes. */
html[data-text-size] body { overflow-wrap: break-word; }
html[data-text-size] :is(.ui-button, .button, .control, .landing-button, .listening-button, .landing-text-link) { max-width: 100%; white-space: normal; }
html[data-text-size] :is(h1, h2, h3, dt) { hyphens: auto; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-studio-theme="light"]) {
  color-scheme: dark;
  --color-paper: #21140e;
  --brand-logo-filter: brightness(0) invert(1);
  --color-audience-learners: #35251a;
  --color-audience-teachers: #35251a;
  --color-surface: #2c1d14;
  --color-surface-raised: #37271c;
  --color-surface-hover: #463225;
  --color-ink: #fbf0de;
  --color-ink-soft: #ccbaa5;
  --color-muted: #ccbaa5;
  --color-neutral: #baa68f;
  --color-rule: #594330;
  --color-rule-strong: #947a5f;
  --color-button: #e8b87b;
  --color-button-ink: #29150b;
  --color-accent: #e8b87b;
  --color-accent-strong: #f4cea0;
  --color-accent-soft: #483020;
  --color-accent-ink: #21140e;
  --color-focus: #e8b87b;
  --color-error: #ffb4ab;
  --color-error-surface: #3b2324;
  --color-success: #88d6a7;
  --color-success-surface: #1c3226;
  --color-overlay: rgb(0 0 0 / 0.65);
  --color-glass: rgb(33 20 14 / .82);
  --shadow-surface: 0 1px 3px rgb(0 0 0 / 0.12), 0 8px 28px rgb(0 0 0 / 0.12);
  --shadow-overlay: 0 12px 40px rgb(0 0 0 / 0.35);
  }
}
:root[data-theme="dark"]:not([data-studio-theme="light"]), :root[data-studio-theme="dark"] {
  color-scheme: dark;
  --color-paper: #21140e;
  --brand-logo-filter: brightness(0) invert(1);
  --color-audience-learners: #35251a;
  --color-audience-teachers: #35251a;
  --color-surface: #2c1d14;
  --color-surface-raised: #37271c;
  --color-surface-hover: #463225;
  --color-ink: #fbf0de;
  --color-ink-soft: #ccbaa5;
  --color-muted: #ccbaa5;
  --color-neutral: #baa68f;
  --color-rule: #594330;
  --color-rule-strong: #947a5f;
  --color-button: #e8b87b;
  --color-button-ink: #29150b;
  --color-accent: #e8b87b;
  --color-accent-strong: #f4cea0;
  --color-accent-soft: #483020;
  --color-accent-ink: #21140e;
  --color-focus: #e8b87b;
  --color-error: #ffb4ab;
  --color-error-surface: #3b2324;
  --color-success: #88d6a7;
  --color-success-surface: #1c3226;
  --color-overlay: rgb(0 0 0 / 0.65);
  --color-glass: rgb(33 20 14 / .82);
  --shadow-surface: 0 1px 3px rgb(0 0 0 / 0.12), 0 8px 28px rgb(0 0 0 / 0.12);
  --shadow-overlay: 0 12px 40px rgb(0 0 0 / 0.35);
}

/* Explicit choices also apply when the operating system prefers dark mode. */
:root[data-theme="light"]:not([data-studio-theme="dark"]), :root[data-studio-theme="light"] {
  color-scheme: light;
  --color-paper: #fbf7ef;
  --brand-logo-filter: none;
  --color-audience-learners: #f5ecdd;
  --color-audience-teachers: #f0e6d7;
  --color-surface: #fffaf2;
  --color-surface-raised: #f1e7d9;
  --color-surface-hover: #e9dcc9;
  --color-ink: #29150b;
  --color-ink-soft: #6a5b4e;
  --color-muted: #6a5b4e;
  --color-neutral: #7b6b5d;
  --color-rule: #ded1bf;
  --color-rule-strong: #aa9380;
  --color-button: #29150b;
  --color-button-ink: #fff6e9;
  --color-accent: #754522;
  --color-accent-soft: #f4e4cf;
  --color-accent-ink: #fffaf2;
  --color-focus: #754522;
  --color-error: #b42318;
  --color-error-surface: #fff0ee;
  --color-success: #217346;
  --color-success-surface: #edf7f0;
  --color-guru: oklch(60% 0.17 42);
  --color-guru-soft: oklch(92% 0.035 42);
  --color-student: oklch(51% 0.105 188);
  --color-student-soft: oklch(91% 0.03 188);
  --color-slide: oklch(58% 0.17 244);
  --color-slide-soft: oklch(94% 0.032 244);
  --color-title: oklch(60% 0.16 344);
  --color-title-soft: oklch(95% 0.028 344);
  --color-overlay: oklch(15% 0.012 250 / 0.4);
  --color-glass: rgb(251 247 239 / .72);
  --color-shadow: oklch(20% 0.015 250 / 0.11);
  --color-shadow-float: oklch(20% 0.015 250 / 0.16);
  --color-paper-2: var(--color-surface);
  --color-paper-3: var(--color-surface-raised);
  --color-accent-strong: #573019;
  --color-error-paper: var(--color-error-surface);
  --color-success-paper: var(--color-success-surface);
  --color-focus-inner: var(--color-surface);
  --shadow-surface: 0 1px 3px rgb(0 0 0 / 0.04), 0 8px 28px rgb(0 0 0 / 0.04);
  --shadow-overlay: 0 12px 40px rgb(0 0 0 / 0.14);
}
