/* DYSHEA v2 — design tokens
   One source of truth. Every value below earns its place.
   Scale is 4px-based. Type scale is 1.2 (minor third) — calm, readable, not shouty. */

:root {
  /* ---- Surface ramp -------------------------------------------------
     Six steps from the page floor up to the highest card. Each step is
     a real elevation, not a random shade. Never invent a seventh.

     Purple-tinted, not grey: the academy is behind the same front door as the
     landing, so the floor is the landing's own --bg-deep. */
  --s-0: #0F0824;   /* page — identical to the landing's background */
  --s-1: #150C2E;   /* section */
  --s-2: #1B1038;   /* card */
  --s-3: #241645;   /* card raised / input */
  --s-4: #2E1D55;   /* hover */
  --s-5: #3C2870;   /* border strong */

  --line: #2A1B4E;
  --line-soft: #1F1440;

  /* ---- Ink ----------------------------------------------------------
     Lavender on deep purple, the same pairing the landing uses. */
  --ink: #F3EAFF;        /* headings */
  --ink-body: #D8C7F0;   /* body text */
  --ink-mute: rgba(233, 213, 255, 0.78);  /* labels, meta — 0.62 measured 2.91:1 */
  --ink-faint: rgba(233, 213, 255, 0.55); /* disabled — still clearly recessive */

  /* ---- Brand --------------------------------------------------------
     Violet is DYSHEA. It marks the ONE thing the learner should do next
     and nothing else. If everything is violet, nothing is. */
  --brand: #A855F7;      /* the landing's --neon, so one violet across the site */
  --brand-lift: #C99BFF;
  --brand-deep: #6D28D9;
  --brand-wash: rgba(168, 85, 247, 0.14);
  --brand-edge: rgba(168, 85, 247, 0.38);

  /* ---- Semantic ----------------------------------------------------
     Green = proven. Amber = needs review. Red = broken. Blue = learning.
     These four never trade places. */
  --ok: #34d399;
  --ok-wash: rgba(52, 211, 153, 0.12);
  --ok-edge: rgba(52, 211, 153, 0.32);

  --warn: #fbbf24;
  --warn-wash: rgba(251, 191, 36, 0.12);
  --warn-edge: rgba(251, 191, 36, 0.32);

  --bad: #f87171;
  --bad-wash: rgba(248, 113, 113, 0.12);
  --bad-edge: rgba(248, 113, 113, 0.32);

  --info: #60a5fa;
  --info-wash: rgba(96, 165, 250, 0.12);

  /* ---- Type ---------------------------------------------------------
     One family, two jobs. Headings are Manrope at 800 and body text is Manrope
     at 400–600: the contrast comes from weight rather than from a second
     typeface, which is quieter to read and one fewer font to download.

     This replaced Anton, and both of its problems are worth remembering.
     Anton is ultra-condensed and single-weight, so at heading size it read as
     shouting; and it has no Cyrillic at all, so Russian fell through to a
     fallback and the two languages never looked like the same product. Manrope
     carries Cyrillic and Latin itself, so there is no fallback to smear.

     JetBrains Mono is code and numbers-that-must-align. */
  --font-display: 'Manrope', system-ui, -apple-system, sans-serif;
  /* Manrope, not Inter: bigger x-height and more open counters at the 15–16px
     a lesson is actually read at, with more character and full Cyrillic. */
  --font-body: 'Manrope', 'Inter', system-ui, sans-serif;
  --font-code: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --t-xs: 0.6875rem;  /* 11 — labels, uppercase only */
  --t-sm: 0.8125rem;  /* 13 — meta, captions */
  --t-md: 0.9375rem;  /* 15 — body. The default. */
  --t-lg: 1.0625rem;  /* 17 — lead paragraph */
  --t-xl: 1.375rem;   /* 22 — card title */
  --t-2xl: 1.75rem;   /* 28 — section title */
  --t-3xl: 2.25rem;   /* 36 — page title */

  --lh-tight: 1.15;   /* display */
  --lh-snug: 1.4;     /* titles */
  --lh-read: 1.65;    /* prose — teaching text needs air */

  /* ---- Space — 4px base --------------------------------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* ---- Radius -------------------------------------------------------
     Three values. Small for controls, medium for cards, pill for chips. */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* ---- Depth --------------------------------------------------------
     Shadows are for things that genuinely float. Two levels, no more. */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-pop: 0 12px 48px rgba(0, 0, 0, 0.5);

  /* ---- Motion -------------------------------------------------------
     Fast for direct manipulation, slower for things that travel.
     Nothing eases linearly except progress that maps to real time. */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-slow: 420ms;

  --maxw: 1180px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--s-0);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: var(--t-md);
  line-height: var(--lh-read);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Weight 800, and the reason changed with the typeface.
   Anton shipped a single weight, so asking for bold made the browser
   synthesise one, and on the Cyrillic fallback that smeared into what read as
   a glow — the old rule pinned 400 to avoid it. Manrope has a real 800 and
   carries Cyrillic itself, so there is no fallback and no synthesis: the
   weight is what gives a heading its presence now that the face is not
   condensed. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: var(--lh-snug);
  letter-spacing: -0.018em;
  margin: 0;
  font-weight: 800;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

code, kbd, pre { font-family: var(--font-code); }

button { font: inherit; color: inherit; }

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

/* Respect the user. Motion is decoration; comprehension is not. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Primitives used on every page ---------------------------------- */

.label {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.card {
  background: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 11px 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: var(--t-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

/* Near-black on the accent, not white. White on #A855F7 measures 3.95:1 —
   under the 4.5 AA threshold — and this is the primary action in the academy.
   The landing already inks its accent buttons this way. */
.btn-primary {
  background: var(--brand);
  color: #12061f;
  border-color: var(--brand-deep);
}

.btn-primary:hover:not([disabled]) { background: var(--brand-lift); }

.btn-ghost {
  background: var(--s-3);
  color: var(--ink-body);
  border-color: var(--line);
}

.btn-ghost:hover:not([disabled]) {
  background: var(--s-4);
  color: var(--ink);
}

.btn-quiet {
  background: transparent;
  color: var(--ink-mute);
  padding: 8px 12px;
}

.btn-quiet:hover:not([disabled]) { color: var(--ink); }

/* Progress bar — the single most-read element on the platform.
   Height 6px: visible at a glance, never dominant. */
.bar {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--s-4);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width var(--dur-slow) var(--ease-out);
}

.bar.is-ok > i { background: var(--ok); }
.bar.is-warn > i { background: var(--warn); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  background: var(--s-3);
  color: var(--ink-mute);
}

.chip.is-ok { background: var(--ok-wash); border-color: var(--ok-edge); color: var(--ok); }
.chip.is-warn { background: var(--warn-wash); border-color: var(--warn-edge); color: var(--warn); }
.chip.is-bad { background: var(--bad-wash); border-color: var(--bad-edge); color: var(--bad); }
.chip.is-brand { background: var(--brand-wash); border-color: var(--brand-edge); color: var(--brand-lift); }

/* Language switcher — present on every page, identical everywhere.
   Three short codes rather than a dropdown: switching is one click, and the
   available languages are visible without opening anything. */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--s-2);
  border: 1px solid var(--line);
}

.lang-switch button {
  padding: 4px 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-mute);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.lang-switch button:hover { color: var(--ink); }

.lang-switch button.active {
  background: var(--brand);
  color: #12061f;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Scrollbars ----------------------------------------------------------
 * The default is a light grey bar on a white track, which on a deep purple
 * page reads as a strip of another website glued to the edge — most visible in
 * the unit room, where the task pane scrolls on its own.
 *
 * Both syntaxes, because they cover different browsers and neither is enough
 * alone: scrollbar-color is the standard one Firefox implements, and the
 * ::-webkit- pseudo-elements are what Chrome and Safari read. Sized to stay
 * grabbable — a 4px hairline looks tidy in a screenshot and is a nuisance to
 * actually use.
 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--s-5) transparent;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
  background: var(--s-5);
  border-radius: var(--r-pill);
  /* Transparent border with background-clip keeps the thumb visually slim
     while leaving the full width as a hit target. */
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover { background: var(--brand); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
