/* Gamistu Design System — Plum-led warm
   Locked 2026-05-19. Source of truth.
*/

/* @import Google Fonts GỠ 2026-07-28 — cả ba face đã vendor local: Lora ở
   tokens-v4.css, Inter + JetBrains Mono ở tokens.css. Import này là request
   bên thứ ba chặn render, còn sót vì chỉ trang chủ nạp v3 (creator không). */

:root {
  /* Brand */
  --color-primary:        #8B3A62;
  --color-primary-hover:  #73304F;
  --color-primary-active: #5C2440;
  --color-primary-soft:   #F5E5EC;
  --color-primary-fg:     #FFFFFF;

  --color-accent:         #E8B83E;
  --color-accent-hover:   #C99928;
  --color-accent-soft:    #FCF4DD;
  --color-accent-fg:      #2C2C2A;

  --color-success:        #10B981;
  --color-success-soft:   #ECFDF5;
  --color-warning:        #B8870A;
  --color-error:          #993C1D;
  --color-error-soft:     #FFF1EE;
  --color-info:           #6B5B95;
  --color-info-soft:      #EDEAF5;

  /* Surface */
  --color-bg-base:        #fdf8f3;
  --color-bg-surface:     #FFFFFF;
  --color-bg-muted:       #F5EFE7;
  --color-bg-reading:     #FFFFFF;

  /* Text */
  --color-text-primary:   #2C2C2A;
  --color-text-secondary: #6B5560;
  --color-text-muted:     #B8A89A;
  --color-text-inverse:   #FFFFFF;

  /* Border */
  --color-border-default: #EDE4DC;
  --color-border-strong:  #DDD1C4;
  --color-border-focus:   #8B3A62;

  /* Vector clusters */
  --color-vector-cognitive: #7F77DD;
  --color-vector-social:    #D4537E;
  --color-vector-self:      #1D9E75;
  --color-vector-applied:   #EF9F27;

  /* Shadow warm tonal */
  --shadow-sm:   0 1px 2px rgba(120, 60, 30, 0.06);
  --shadow:      0 2px 8px rgba(120, 60, 30, 0.10);
  --shadow-md:   0 4px 12px rgba(120, 60, 30, 0.12);
  --shadow-lg:   0 8px 24px rgba(120, 60, 30, 0.14);
  --shadow-glow-primary: 0 0 0 3px rgba(139, 58, 98, 0.4);
  --shadow-glow-energy:  0 0 20px rgba(232, 184, 62, 0.4);

  /* Radius */
  --radius-sm:   4px;
  --radius-base: 6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  20px;
  --radius-3xl:  24px;
  --radius-full: 9999px;

  /* Spacing */
  --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; --space-24: 96px;

  /* Font */
  --font-display: 'Lora', Georgia, 'Times New Roman', serif;
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Motion */
  --duration-instant:   75ms;
  --duration-fast:      150ms;
  --duration-base:      200ms;
  --duration-slow:      300ms;
  --duration-page:      500ms;
  --duration-celebrate: 700ms;

  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --ease-inout:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Density (tweakable) */
  --density-scale: 1;
  --font-scale: 1;
}

[data-density="compact"]  { --density-scale: 0.85; }
[data-density="cozy"]     { --density-scale: 1; }
[data-density="spacious"] { --density-scale: 1.15; }

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

html {
  font-size: calc(16px * var(--font-scale));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.625;
  color: var(--color-text-primary);
  background-color: var(--color-bg-base);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; color: var(--color-text-primary); }
h5, h6 { font-family: var(--font-sans); font-weight: 600; color: var(--color-text-primary); }
h1 { font-size: 2.3125rem; line-height: 1.243; }
h2 { font-size: 1.75rem; line-height: 1.286; }
h3 { font-size: 1.5rem; line-height: 1.333; font-weight: 500; }
h4 { font-size: 1.3125rem; line-height: 1.333; font-family: var(--font-sans); }
h5 { font-size: 1.125rem; line-height: 1.444; }
h6 { font-size: 1rem; line-height: 1.625; color: var(--color-text-secondary); }

p { line-height: 1.625; text-wrap: pretty; }
small, .text-sm { font-size: 0.875rem; line-height: 1.571; font-weight: 500; color: var(--color-text-secondary); }
.caption { font-size: 0.75rem; line-height: 1.333; font-weight: 500; color: var(--color-text-muted); }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted);
}
code, pre { font-family: var(--font-mono); }

a { color: var(--color-info); text-decoration: none; transition: color var(--duration-fast) var(--ease-out); }
a:hover { color: var(--color-primary); text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--shadow-glow-primary); }
::selection { background: var(--color-primary-soft); }

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* Scrollbar warm */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: var(--radius-full); border: 2px solid var(--color-bg-base); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Utility helpers used across prototype */
.hover-lift { transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out); }
.hover-lift:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.fade-in { animation: fadeIn var(--duration-slow) var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.slide-in-up { animation: slideInUp var(--duration-slow) var(--ease-out); }
@keyframes slideInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.scale-in { animation: scaleIn var(--duration-base) var(--ease-out); }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

.pulse-saffron { animation: pulseSaffron 2s var(--ease-inout) infinite; }
@keyframes pulseSaffron { 0%, 100% { box-shadow: 0 0 0 0 rgba(232,184,62,0.5); } 50% { box-shadow: 0 0 0 8px rgba(232,184,62,0); } }

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--color-border-strong); border-top-color: var(--color-primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
