/* QuestSpeak design system -- the tokens every redesigned page builds on.
   Rules and reasoning live in DESIGN.md beside this file. Pages that have
   not been moved over yet still use style.css. */

@font-face {
  font-family: "Anton";
  src: url("fonts/Anton-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  /* Surfaces: background, then two raised levels. Depth comes from these
     steps and a hairline border, never from drop shadows. */
  --bg: #05060a;
  --surface: #101118;
  --surface-2: #181a23;
  --line: #262833;

  --text: #e1e0cc;          /* cream, from questspeak.com */
  --muted: #8b8a7c;
  /* Furigana: readings must be easy to read at their small size, so they
     sit much closer to the text colour than --muted does. */
  --furigana: #cfcdb8;

  /* The ONE brand colour. Only the main action, the studied word and
     progress use it. */
  --accent: #f26b21;
  --accent-hover: #ff7d36;
  --on-accent: #0a0a0a;
  --hl: rgba(242, 107, 33, 0.16);

  /* Grading colours: used on the rating WORDS only, never as fills. */
  --again: #ff5c5c;
  --hard: #ffc93c;
  --good: #3ecf6e;
  --easy: #4aa8ff;

  /* Colour-matched translation pieces (reviewer). Chosen away from the
     orange accent and the four grade colours so a piece never reads as a
     grade or as the studied word. */
  --chunk-0: #ff8fc7;
  --chunk-1: #5fd4dc;
  --chunk-2: #b6e45a;
  --chunk-3: #b9a2ff;
  --chunk-4: #f2d06b;
  --chunk-5: #8fb6ff;

  --font-display: "Anton", "Impact", sans-serif;        /* buttons, labels, logo */
  --font-ui: "Rubik", "Segoe UI", system-ui, sans-serif; /* everything else in English */
  --font-study: "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif; /* the language being learned */

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  /* Aliases for older stylesheets (card_editor.css) that still read the
     previous names. */
  --card-bg: var(--surface);
  --border: var(--line);
  --text-muted: var(--muted);
  --radius: var(--r-lg);
  --shadow: none;
  --pill-bg: var(--surface-2);
  --pill-bg-hover: var(--line);
  --again-hover: var(--again);
  --reading: var(--furigana);
}

/* Light variant: same structure, warm off-white. The grading colours are
   darker shades, because the dark-theme yellow is unreadable on white. */
:root[data-theme="light"] {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0efea;
  --line: #e2e0d8;
  --text: #16161a;
  --muted: #6f6d64;
  --furigana: #3a3934;
  --chunk-0: #d6408a;
  --chunk-1: #12919a;
  --chunk-2: #5f8f12;
  --chunk-3: #7a5ce0;
  --chunk-4: #a8820f;
  --chunk-5: #3f74d6;
  --accent: #e85d12;
  --accent-hover: #d14f08;
  --on-accent: #0a0a0a;
  --hl: rgba(232, 93, 18, 0.13);
  --again: #d93636;
  --hard: #b07800;
  --good: #1e9a4b;
  --easy: #1f76d1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* --- shared components --------------------------------------------------- */

.qs-logo {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
  line-height: 1;
}
.qs-logo small { font-size: 0.78em; }

/* Line icons (inline SVG), one stroke weight everywhere. */
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  flex: none;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.icon-btn.danger:hover { color: var(--again); }
.icon-btn svg, .qs-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-main {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.06em;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: var(--r-md);
  padding: 14px 36px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.05s ease;
}
.btn-main:hover { background: var(--accent-hover); }
.btn-main:active { transform: scale(0.98); }

kbd {
  font: 600 11px var(--font-ui);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.qs-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
