/* ──────────────────────────────────────────────────────────────────
   Mimelax Design System — Brand tokens (single source of truth)

   Mimelax is a children's learning + bedtime app for ages 3–7.
   Two coexisting moods, one brand:

   • Day mode  — playful, joyful, candy-bright primaries on cream.
                 Used for game cards, the home dashboard, marketing.
   • Night mode — calm, storybook, deep indigo→violet with amber gold.
                 Used for "Bugünün Masalı" (Today's Tale) bedtime flow.

   Type pairs Quicksand (rounded sans, UI + headings in day mode)
   with Fraunces (warm serif, used for storytelling + editorial moments).

   Source of truth lives in src/app/globals.css in the codebase. Keep this
   file in lockstep when tokens change.
   ────────────────────────────────────────────────────────────────── */

@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&display=swap");

:root {
  /* ── DAY PALETTE — candy primaries ──────────────────────────── */
  --turuncu:        #ff6b35;  /* primary brand orange */
  --turuncu-koyu:   #e8551e;  /* deep orange — used for the wordmark */
  --pembe:          #ff4d8d;
  --pembe-koyu:     #e83373;
  --sari:           #ffd93d;  /* star/reward gold */
  --sari-koyu:      #f5c518;
  --yesil:          #6bcb77;
  --yesil-koyu:     #4cb35c;
  --mavi:           #4d96ff;
  --mavi-koyu:      #3380ff;
  --mor:            #aa55e5;
  --mor-koyu:       #9038cc;

  /* ── DAY NEUTRALS — cream stack ─────────────────────────────── */
  --krem:           #fff8e7;  /* default page background */
  --krem-koyu:      #fff0d4;
  --krem-soft:      #fff4d6;  /* upper end of the radial bg gradient */
  --krem-pembe:     #ffe8f1;  /* lower end (warm pink wash) */

  /* ── INK — the only "text on cream" colour ──────────────────── */
  --ink:            #2d1b4e;  /* deep indigo-violet, never pure black */
  --ink-soft:       #6b7280;  /* secondary text */
  --ink-faint:      #9ca3af;  /* tertiary / disabled */

  /* ── NIGHT PALETTE — bedtime / storytelling ─────────────────── */
  --night-base:     #0f1132;  /* deepest sky behind everything */
  --night-deep:     #1e1b4b;  /* indigo-950 */
  --night-mid:      #4c1d95;  /* violet-900 */
  --night-violet:   #6b21a8;  /* purple-800 */
  --night-glow:     #a78bfa;  /* violet-400 — for nebula highlights */

  --gold-soft:      #fef3c7;  /* amber-100 — moonlight text */
  --gold-bright:    #fde68a;  /* amber-200 */
  --gold-warm:      #fbbf24;  /* amber-400 — primary night accent */
  --gold-deep:      #f59e0b;  /* amber-500 */
  --gold-shadow:    #d97706;  /* amber-600 — moon shadow side */

  --indigo-mist:    rgba(199, 210, 254, 0.60); /* secondary night text */

  /* ── REWARD / SYSTEM ────────────────────────────────────────── */
  --star:           #ffd93d;  /* the universal "you earned this" yellow */
  --success:        #6bcb77;
  --danger:         #ff4d8d;

  /* ── TYPOGRAPHY ────────────────────────────────────────────── */
  --font-sans:  "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-extra:    800;  /* Quicksand tops out at 700 — use font-weight: 800 only on system fallback */

  /* Type scale — mobile-first. Children's app: generous, never tiny. */
  --text-xs:    12px;  /* small labels only */
  --text-sm:    13px;  /* secondary / hint copy */
  --text-base:  15px;  /* body */
  --text-md:    16px;  /* buttons, inputs */
  --text-lg:    18px;  /* card titles */
  --text-xl:    20px;
  --text-2xl:   24px;  /* section headers */
  --text-3xl:   30px;  /* page H1 (mobile) */
  --text-4xl:   36px;
  --text-5xl:   48px;  /* marketing hero (desktop) */
  --text-6xl:   64px;

  --leading-tight:   1.15;
  --leading-snug:    1.30;
  --leading-normal:  1.50;
  --leading-relaxed: 1.65;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-caps:   0.16em;  /* "BUGÜNÜN MASALI" eyebrow */

  /* ── RADII — soft, rounded, kid-friendly ───────────────────── */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  24px;   /* card default */
  --radius-3xl:  28px;   /* hero cards */
  --radius-pill: 9999px;

  /* ── SHADOWS — depth ladder ────────────────────────────────── */
  --shadow-xs:    0 1px 2px rgba(45, 27, 78, 0.06);
  --shadow-sm:    0 2px 8px rgba(45, 27, 78, 0.08);
  --shadow-md:    0 6px 16px rgba(45, 27, 78, 0.10);
  --shadow-lg:    0 12px 28px rgba(45, 27, 78, 0.14);
  --shadow-xl:    0 20px 48px rgba(45, 27, 78, 0.20);

  /* Branded shadows — drop with brand colour, used on key buttons/cards */
  --shadow-orange: 0 8px 24px rgba(255, 107, 53, 0.35);
  --shadow-pink:   0 8px 24px rgba(255, 77, 141, 0.30);
  --shadow-gold:   0 8px 24px rgba(251, 191, 36, 0.40);
  --shadow-violet: 0 8px 24px rgba(76, 29, 149, 0.35);

  /* ── SPACING — 4px base ────────────────────────────────────── */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
  --space-16:  64px;
  --space-20:  80px;

  /* ── MOTION ────────────────────────────────────────────────── */
  --ease-out-soft:  cubic-bezier(0.16, 1, 0.3, 1);     /* default UI */
  --ease-out-pop:   cubic-bezier(0.34, 1.56, 0.64, 1); /* spring-y, used on appear */
  --duration-fast:  150ms;
  --duration-base:  300ms;
  --duration-slow:  600ms;

  /* ── LAYERED GRADIENTS — reach for these named, don't re-author ── */
  --grad-day-bg:    radial-gradient(ellipse at top, #fff4d6 0%, #fff8e7 50%, #ffe8f1 100%);
  --grad-night-bg:  linear-gradient(180deg, #0f1132 0%, #1e1b4b 60%, #2d1b4e 100%);
  --grad-orange:    linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
  --grad-gold:      linear-gradient(135deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  --grad-moon:      radial-gradient(circle at 35% 35%, #fef3c7 0%, #fbbf24 60%, #d97706 100%);
  --grad-bedtime:   linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #6b21a8 100%);

  /* Glass — iOS-26-esinli, used sparingly on the night side */
  --glass-fill:    linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  --glass-border:  1px solid rgba(255, 255, 255, 0.10);
  --glass-blur:    blur(20px) saturate(180%);
}

/* ── UTILITY CLASSES — drop-in, no Tailwind required ─────────── */
.font-sans  { font-family: var(--font-sans); }
.font-serif { font-family: var(--font-serif); }

.bg-day    { background: var(--grad-day-bg); }
.bg-night  { background: var(--grad-night-bg); }

.glass {
  background: var(--glass-fill);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
}

/* SVG noise texture — overlay on any element with .grain */
.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.30;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Reduce motion — children's app respects accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
