/* ============================================================
   刷刷庫 (ShuaShuaKu) — Design Tokens
   TOEIC question-drilling app · "多益高分加速器"
   Colors + Typography foundation.
   Source of truth: 品牌視覺識別設計.pdf + Figma Color System.
   ============================================================ */

/* ---------- Fonts ----------
   Brand CJK face: 源泉圓體 (GenSenRounded2 TW) — a warm rounded gothic.
   Provided weights: B (Bold→700), M (Medium→500), R (Regular→400).
   Latin / numerals in product UI: Nunito (rounded, friendly) — loaded
   from Google Fonts as the documented companion face. */

@font-face {
  font-family: "GenSenRounded2 TW";
  src: url("fonts/GenSenRounded2TW-R.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "GenSenRounded2 TW";
  src: url("fonts/GenSenRounded2TW-M.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "GenSenRounded2 TW";
  src: url("fonts/GenSenRounded2TW-B.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
/* Nunito companion (Latin/number) — import where used:
   @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap'); */

:root {
  /* ---- Brand font stacks ---- */
  --font-brand: "GenSenRounded2 TW", "Nunito", "PingFang TC",
                "Noto Sans TC", system-ui, sans-serif;
  --font-latin: "Nunito", "GenSenRounded2 TW", system-ui, sans-serif;

  /* =========================================================
     COLOR SYSTEM
     Each family has a 5-step scale: darkest · dark · MAIN · light · lightest
     ========================================================= */

  /* Blue — PRIMARY action (主按鈕 / 下一題 / main CTAs) */
  --blue-darkest: #00007E;
  --blue-dark:    #003296;
  --blue:         #0066CC;   /* main */
  --blue-light:   #99CCFF;
  --blue-lightest:#E2EFFA;

  /* Yellow — brand signature & 鴨鴨 mascot / special highlights */
  --yellow-darkest: #D4AA00;
  --yellow-dark:    #EDBE00;
  --yellow:         #FFCC00;  /* main — logo flame / brand yellow */
  --yellow-light:   #FFE064;
  --yellow-lightest:#FFEEA6;

  /* Orange — marketing emphasis / promo buttons (行銷強調) */
  --orange-darkest: #D35400;
  --orange-dark:    #FF6600;
  --orange:         #FA9600;  /* main */
  --orange-light:   #FFBD59;
  --orange-lightest:#FFE2B6;

  /* Red — error / wrong answer (答錯警示) */
  --red-darkest: #990000;
  --red-dark:    #CC0000;
  --red:         #E63A36;  /* main */
  --red-light:   #EF7C79;
  --red-lightest:#FACCC8;

  /* Green — success / confirm */
  --green-darkest: #0C9500;
  --green-dark:    #24AE18;
  --green:         #56C54C;  /* main */
  --green-light:   #A8E9A2;
  --green-lightest:#D2FFCE;

  /* Cyan — correct answer accent (答對) */
  --cyan-darkest: #2A7780;
  --cyan-dark:    #08A1AB;
  --cyan:         #08B7C2;  /* main */
  --cyan-light:   #6FE3EA;
  --cyan-lightest:#B7FDFD;

  /* Brown — brand text & warm backgrounds (logo colour family) */
  --brown-darkest: #5A4028;
  --brown:         #786450;  /* main — logo wordmark / headings */
  --brown-light:   #AEA296;  /* muted brown text */
  --brown-lightest:#D8D4D0;
  --cream:         #F3EBDE;  /* warm card / panel tint */
  --cream-soft:    #FAFAEE;  /* page background */
  --cream-warm:    #FFF7EC;  /* warm surface / card body */

  /* Neutral / greyscale */
  --ink:        #191919;   /* darkest text */
  --ink-2:      #222222;   /* default body text */
  --grey:       #8E8E8E;   /* secondary text */
  --grey-light: #D9D9D9;   /* borders / dividers */
  --grey-lightest:#F0F0F0; /* fills */
  --white:      #FFFFFF;

  /* =========================================================
     SEMANTIC TOKENS
     ========================================================= */
  --fg:            var(--ink-2);     /* primary text */
  --fg-brand:      var(--brown);     /* branded headings */
  --fg-muted:      var(--brown-light);
  --fg-subtle:     var(--grey);
  --fg-on-color:   var(--white);

  --bg:            var(--cream-soft);
  --bg-surface:    var(--white);
  --bg-warm:       var(--cream-warm);
  --bg-tab:        #FFFCF8;

  --primary:       var(--blue);      /* primary actions */
  --primary-press: var(--blue-dark);
  --accent:        var(--orange);    /* marketing / promo */
  --brand:         var(--yellow);    /* signature brand fill */
  --success:       var(--green);
  --correct:       var(--cyan);      /* quiz: right answer */
  --error:         var(--red);       /* quiz: wrong answer */

  --border:        var(--grey-light);
  --border-strong: var(--brown);     /* chunky card edge */

  /* =========================================================
     RADIUS / SHADOW / SPACING
     ========================================================= */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Signature "chunky" card: solid darker bottom edge, not a blurry shadow */
  --edge-brown: 0 4px 0 0 var(--brown);
  --edge-orange:0 4px 0 0 var(--orange-dark);
  --shadow-sm: 0 2px 6px rgba(90,64,40,.10);
  --shadow-md: 0 8px 24px rgba(90,64,40,.14);
  --shadow-pop:0 12px 32px rgba(90,64,40,.18);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* =========================================================
     TYPE SCALE  (源泉圓體 weights: 400/500/700)
     ========================================================= */
  --text-display: 700 40px/1.2 var(--font-brand);
  --text-h1:      700 32px/1.25 var(--font-brand);
  --text-h2:      700 24px/1.3 var(--font-brand);
  --text-h3:      700 20px/1.35 var(--font-brand);
  --text-title:   500 18px/1.4 var(--font-brand);
  --text-body:    400 16px/1.6 var(--font-brand);
  --text-body-m:  500 16px/1.6 var(--font-brand);
  --text-sm:      400 14px/1.5 var(--font-brand);
  --text-cap:     500 12px/1.4 var(--font-brand);
}

/* ---------- Optional element defaults (opt-in via class) ---------- */
.ssk-type h1, .ssk-h1 { font: var(--text-h1); color: var(--fg-brand); margin: 0; }
.ssk-type h2, .ssk-h2 { font: var(--text-h2); color: var(--fg-brand); margin: 0; }
.ssk-type h3, .ssk-h3 { font: var(--text-h3); color: var(--fg); margin: 0; }
.ssk-type p,  .ssk-p  { font: var(--text-body); color: var(--fg); margin: 0; }
.ssk-cap { font: var(--text-cap); color: var(--fg-muted); }
