/*
 * 毎日ハングル — Design Tokens
 * Source of truth for all colors, typography, spacing, radius, shadow, animation.
 * Import this file once at the root of the app.
 */

/* ─────────────────────────────────────────
   Color palette
───────────────────────────────────────── */
:root {
  /* Backgrounds */
  --color-bg: #f0f7f6; /* page background (light teal wash) */
  --color-surface: #ffffff; /* card / panel surface */
  --color-surface2: #eaf4f3; /* secondary surface, pill bg, input bg */
  --color-border: #c8e0de; /* dividers, card borders */

  /* Brand — Teal (primary) */
  --color-green: #007a72; /* primary CTA, active state, progress bar */
  --color-green-d: #005c56; /* pressed / shadow under green buttons */
  --color-green-t: #d4eeec; /* teal tint — badges, icon bg */

  /* Amber (intermediate level, secondary CTA) */
  --color-orange: #f5a623;
  --color-orange-t: #fff8ec;

  /* Red (advanced level, error, wrong-answer) */
  --color-red: #e05555;
  --color-red-t: #ffecec;

  /* Blue (sync / cloud action) */
  --color-blue: #1cb0f6;
  --color-blue-d: #0e90d0; /* pressed / shadow */

  /* Text */
  --color-text: #1a1a1a; /* primary text */
  --color-text-inverse: #ffffff;
  --color-text2: #6b7280; /* secondary / meta text */
  --color-muted: #a8bfbd; /* placeholder, disabled, empty state */

  /* Level-specific palettes (used for badges, icons, progress bars) */
  --level-beginner-fg: #005c56;
  --level-beginner-bg: #d4eeec; /* = --color-green-t */
  --level-intermediate-fg: #92400e;
  --level-intermediate-bg: #fef3c7;
  --level-advanced-fg: #991b1b;
  --level-advanced-bg: #fee2e2;
}

/* ─────────────────────────────────────────
   Typography
   Font stack: Nunito (UI) + Noto Sans KR (Korean text)
   Both loaded from Google Fonts.
───────────────────────────────────────── */
/*
  @import url('https://fonts.googleapis.com/css2?
    family=Nunito:wght@400;500;600;700;800;900
    &family=Noto+Sans+KR:wght@400;700;900
    &display=swap');
  @import url('https://fonts.googleapis.com/css2?
    family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');
*/

:root {
  --font-ui: "Nunito", system-ui, sans-serif;
  --font-korean: "Noto Sans KR", sans-serif;
  --font-ja: "Noto Sans JP", sans-serif;
  --font-icon: "Material Symbols Rounded";

  /* Scale (px) */
  --text-xs: 10px;
  --text-sm: 11px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 15px;
  --text-xl: 17px;
  --text-2xl: 18px;
  --text-3xl: 20px;
  --text-4xl: 22px;

  /* Korean headings (card faces) */
  --text-ko-card: 54px; /* listen-mode card */
  --text-ko-flash: 60px; /* flashcard front */
  --text-ko-back: 38px; /* flashcard back main */
  --text-ko-result: 26px; /* result / wordbook list */
  --text-ko-detail: 40px; /* bottom-sheet word detail */

  /* Weights */
  --fw-normal: 400;
  --fw-medium: 600;
  --fw-bold: 700;
  --fw-heavy: 800;
  --fw-black: 900;
}

/* ─────────────────────────────────────────
   Spacing scale
───────────────────────────────────────── */
:root {
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 10px;
  --sp-4: 12px;
  --sp-5: 14px;
  --sp-6: 16px;
  --sp-7: 20px;
  --sp-8: 24px;
  --sp-9: 28px;
  --sp-10: 32px;
  --sp-12: 40px;
  --sp-16: 48px;
}

/* ─────────────────────────────────────────
   Border radius
───────────────────────────────────────── */
:root {
  --radius-sm: 8px; /* small chip, badge */
  --radius-md: 10px; /* icon box, toggle thumb area */
  --radius-lg: 12px; /* card row, input */
  --radius-xl: 14px; /* button, category card */
  --radius-2xl: 16px; /* CTA button */
  --radius-3xl: 18px; /* settings list group */
  --radius-4xl: 24px; /* bottom-sheet corners */
  --radius-card: 26px; /* flashcard */
  --radius-full: 9999px; /* pill / chip */
}

/* ─────────────────────────────────────────
   Elevation / Shadow
───────────────────────────────────────── */
:root {
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.18); /* bottom-sheet */

  /* Pressed-state bottom shadow (simulates 3-D button) */
  --shadow-btn-green: 0 3px 0 var(--color-green-d);
  --shadow-btn-orange: 0 3px 0 #c88010;
  --shadow-btn-blue: 0 3px 0 var(--color-blue-d);
}

/* ─────────────────────────────────────────
   Animation / Transition
───────────────────────────────────────── */
:root {
  --dur-fast: 150ms;
  --dur-normal: 260ms;
  --dur-slow: 500ms;
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* streak pop */
}

@keyframes screenUp {
  from {
    opacity: 0;
    transform: none;
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes streakPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes cardFadeOut {
  to {
    opacity: 0;
    transform: translateY(4px);
  }
}
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes wave1 {
  0%,
  100% {
    height: 4px;
  }
  50% {
    height: 14px;
  }
}
@keyframes wave2 {
  0%,
  100% {
    height: 8px;
  }
  50% {
    height: 4px;
  }
}
@keyframes wave3 {
  0%,
  100% {
    height: 12px;
  }
  50% {
    height: 6px;
  }
}
@keyframes wave4 {
  0%,
  100% {
    height: 5px;
  }
  50% {
    height: 13px;
  }
}

/* ─────────────────────────────────────────
   Global resets (minimal)
───────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  font-family: var(--font-ui);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* Material Symbols helper class */
.icon {
  font-family: var(--font-icon);
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  user-select: none;
  vertical-align: middle;
}

/* App shell: centered 430px column */
.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background: var(--color-surface);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 0 auto;
}
