/* ============================================================
   QUR'AN WORLD VIEW — DESIGN SYSTEM
   design.css · v2.0 · QWV Identity System
   ============================================================
   Single source of truth for all QWV design tokens, typography,
   base resets, theme handling, animations, and shared utilities.

   RULES:
   - Never override tokens in component files — override here.
   - All Arabic text uses .arabic-text or ArabicText.js.
   - All theme logic is driven by [data-theme] on <html>.
   - Mobile-first. Every breakpoint is a min-width expansion.
   - Gold (#C9A84C) is RETIRED. --gold aliases --crimson for compat.
   - Cinzel is RETIRED. Display font is Spectral.
   - DM Sans is RETIRED. Body font is Inter.
   ============================================================ */


/* ============================================================
   0. GOOGLE FONTS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Spectral:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@300;400;500;600&family=Amiri:ital,wght@0,400;0,700;1,400&family=Noto+Sans+Devanagari:wght@300;400;500;600&display=swap');


/* ============================================================
   1. DESIGN TOKENS — DARK MODE (DEFAULT)
   ============================================================ */

:root {
  /* --- Colour Palette --- */
  --bg:               #0F0805;   /* warm abyss — page background   */
  --bg-card:          #1A1008;   /* card surface                   */
  --bg-surface:       #241810;   /* elevated surface               */
  --crimson:          #780F00;   /* QWV brand — buttons, accents   */
  --crimson-bright:   #9C1400;   /* hover state                    */
  --crimson-dim:      #4A0A00;   /* subtle crimson tint            */
  --crimson-on-dark:  #D4614A;   /* readable warm crimson on dark bg */

  /* Gold is retired — aliased to crimson for backward compat.
     Never use --gold intentionally in new code. */
  --gold:             #D4614A;   /* bright warm crimson — readable on dark bg */
  --gold-dim:         #4A0A00;
  --gold-bright:      #E8745A;   /* hover — lighter warm crimson */

  --off-white:        #F5EDE0;   /* primary text — headings        */
  --text:             #B8A898;   /* body text                      */
  --text-muted:       #7A6858;   /* labels, placeholders           */
  --border:           rgba(255, 255, 255, 0.07);
  --border-gold:      rgba(120, 15, 0, 0.30);
  --border-crimson:   rgba(120, 15, 0, 0.35);

  /* --- Semantic Colours --- */
  --success:        #4CAF7A;
  --success-dim:    rgba(76, 175, 122, 0.15);
  --warning:        #C9824C;
  --warning-dim:    rgba(201, 130, 76, 0.15);
  --error:          #C0392B;
  --error-dim:      rgba(192, 57, 43, 0.15);
  --info:           #5B8DB8;
  --info-dim:       rgba(91, 141, 184, 0.15);

  /* --- Overlay & Scrim --- */
  --scrim:          rgba(15, 8, 5, 0.85);
  --scrim-light:    rgba(15, 8, 5, 0.50);

  /* --- Typography --- */
  --font-display:    'Spectral', serif;
  --font-serif:      'Spectral', serif;
  --font-body:       'Inter', sans-serif;
  --font-arabic:     'Amiri', serif;
  --font-devanagari: 'Noto Sans Devanagari', sans-serif;

  /* --- Type Scale (fluid, mobile-first) --- */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-md:    1.125rem;
  --text-lg:    1.25rem;
  --text-xl:    1.5rem;
  --text-2xl:   2rem;
  --text-3xl:   2.5rem;
  --text-4xl:   3.25rem;
  --text-5xl:   4rem;

  /* --- Arabic Type Scale --- */
  --arabic-sm:  1.25rem;
  --arabic-md:  1.75rem;
  --arabic-lg:  2.25rem;
  --arabic-xl:  3rem;
  --arabic-2xl: 4rem;

  /* --- Spacing --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* --- Border Radius --- */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.5);
  --shadow-lg:   0 10px 30px rgba(0, 0, 0, 0.7), 0 4px 10px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 0 20px rgba(212, 97, 74, 0.25), 0 0 40px rgba(212, 97, 74, 0.12);
  --text-shadow-gold: 0 0 18px rgba(212, 97, 74, 0.45), 0 0 36px rgba(212, 97, 74, 0.20);
  --shadow-crimson: 0 0 20px rgba(120, 15, 0, 0.25), 0 0 40px rgba(120, 15, 0, 0.12);

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-slower: 600ms cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Z-index layers --- */
  --z-below:   -1;
  --z-base:     0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;
  --z-top:      999;

  /* --- Layout --- */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --navbar-height: 64px;
  --section-gap:   var(--space-16);
}


/* ============================================================
   2. LIGHT MODE TOKENS
   ============================================================ */

[data-theme="light"] {
  --bg:               #FFFFFF;
  --bg-card:          #FFFFFF;
  --bg-surface:       #FAFAF8;
  --crimson:          #780F00;
  --crimson-bright:   #9C1400;
  --crimson-dim:      #F9E8E5;
  --crimson-on-dark:  #780F00;

  --gold:             #780F00;
  --gold-dim:         #F9E8E5;
  --gold-bright:      #9C1400;

  --off-white:        #1A0800;
  --text:             #5A3820;
  --text-muted:       #9A7860;
  --border:           rgba(0, 0, 0, 0.09);
  --border-gold:      rgba(120, 15, 0, 0.20);
  --border-crimson:   rgba(120, 15, 0, 0.20);
  --scrim:            rgba(255, 255, 255, 0.90);
  --scrim-light:      rgba(255, 255, 255, 0.60);

  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-lg:   0 10px 30px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.10);
  --shadow-gold: 0 0 20px rgba(120, 15, 0, 0.10), 0 0 40px rgba(120, 15, 0, 0.05);
}


/* ============================================================
   3. BASE RESET & DEFAULTS
   ============================================================ */

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

* {
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
}

input, textarea, [contenteditable],
.blog-post-body, .lib-gem-text,
.arabic-text, .ayah-arabic, .ayah-translation,
.testimonial-text, .about-founder-bio {
  -webkit-user-select: text;
  -webkit-touch-callout: default;
  user-select: text;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

a {
  color: var(--crimson-on-dark);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--crimson-bright); }

[data-theme="light"] a { color: var(--crimson); }
[data-theme="light"] a:hover { color: var(--crimson-bright); }

img, video, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: inherit;
  color: inherit;
  line-height: 1;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus, textarea:focus, select:focus {
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px rgba(120, 15, 0, 0.12);
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  box-shadow: 0 0 0 3px rgba(120, 15, 0, 0.10);
}

textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

hr { border: none; border-top: 1px solid var(--border); margin: var(--space-8) 0; }


/* ============================================================
   4. TYPOGRAPHY SYSTEM
   ============================================================ */

.font-display { font-family: var(--font-display); }

h1, h2, h3, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--off-white);
  line-height: 1.15;
  letter-spacing: 0.01em;
  transition: color var(--transition-slow);
}

h1, .h1 { font-size: var(--text-2xl); }
h2, .h2 { font-size: var(--text-xl); }
h3, .h3 { font-size: var(--text-lg); }
h4, .h4 { font-size: var(--text-md); font-family: var(--font-body); font-weight: 500; color: var(--off-white); }
h5, .h5 { font-size: var(--text-base); font-family: var(--font-body); font-weight: 500; color: var(--text); }

@media (min-width: 768px) {
  h1, .h1 { font-size: var(--text-3xl); }
  h2, .h2 { font-size: var(--text-2xl); }
  h3, .h3 { font-size: var(--text-xl); }
}

.font-serif { font-family: var(--font-serif); }

.subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--crimson-on-dark);
  line-height: 1.4;
}

[data-theme="light"] .subtitle { color: var(--crimson); }

.pull-quote {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--off-white);
  line-height: 1.4;
  border-left: 2px solid var(--crimson);
  padding-left: var(--space-5);
  margin: var(--space-6) 0;
}

@media (min-width: 768px) {
  .subtitle   { font-size: var(--text-xl); }
  .pull-quote { font-size: var(--text-2xl); }
}

.arabic-text {
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
  line-height: 1.8;
  font-weight: 400;
  color: var(--off-white);
}

.arabic-sm  { font-size: var(--arabic-sm); }
.arabic-md  { font-size: var(--arabic-md); }
.arabic-lg  { font-size: var(--arabic-lg); }
.arabic-xl  { font-size: var(--arabic-xl); }
.arabic-2xl { font-size: var(--arabic-2xl); }

.arabic-gold   { color: var(--crimson-on-dark); }
.arabic-muted  { color: var(--text-muted); }

[data-theme="light"] .arabic-gold { color: var(--crimson); }

.font-devanagari { font-family: var(--font-devanagari); }

.text-off-white { color: var(--off-white); }
.text-body      { color: var(--text); }
.text-muted     { color: var(--text-muted); }
.text-gold      { color: var(--crimson-on-dark); }
.text-crimson   { color: var(--crimson-on-dark); }
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }

[data-theme="light"] .text-gold    { color: var(--crimson); }
[data-theme="light"] .text-crimson { color: var(--crimson); }

.font-300 { font-weight: 300; }
.font-400 { font-weight: 400; }
.font-500 { font-weight: 500; }
.font-600 { font-weight: 600; }


/* ============================================================
   5. LAYOUT UTILITIES
   ============================================================ */

.container { width: 100%; max-width: var(--container-lg); margin-inline: auto; padding-inline: var(--space-5); }
.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-xl { max-width: var(--container-xl); }
.container-sm, .container-md, .container-xl { width: 100%; margin-inline: auto; padding-inline: var(--space-5); }

@media (min-width: 768px) {
  .container, .container-sm, .container-md, .container-xl { padding-inline: var(--space-8); }
}

.section    { padding-block: var(--section-gap); }
.section-sm { padding-block: var(--space-10); }
.page-content { padding-top: var(--navbar-height); min-height: 100vh; }

.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-start   { display: flex; align-items: center; justify-content: flex-start; }
.flex-end     { display: flex; align-items: center; justify-content: flex-end; }
.flex-wrap    { flex-wrap: wrap; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid      { display: grid; }
.grid-2    { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3    { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); }

.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden  { display: none !important; }


/* ============================================================
   6. BUTTON SYSTEM
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--r-md);
  padding: var(--space-3) var(--space-6);
  min-height: 44px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition-base), color var(--transition-base),
              border-color var(--transition-base), box-shadow var(--transition-base),
              transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--crimson); color: var(--off-white); border-color: var(--crimson); }
.btn-primary:hover { background: var(--crimson-bright); border-color: var(--crimson-bright); box-shadow: var(--shadow-crimson); color: var(--off-white); }

.btn-secondary { background: var(--bg-surface); color: var(--off-white); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-card); border-color: var(--border-crimson); color: var(--off-white); }

.btn-outline { background: transparent; color: var(--crimson-on-dark); border-color: var(--border-crimson); }
.btn-outline:hover { background: rgba(120, 15, 0, 0.08); border-color: var(--crimson-bright); color: var(--off-white); }

[data-theme="light"] .btn-primary { color: #FFFFFF; }
[data-theme="light"] .btn-primary:hover { color: #FFFFFF; }
[data-theme="light"] .btn-outline { color: var(--crimson); border-color: rgba(120, 15, 0, 0.30); }
[data-theme="light"] .btn-outline:hover { background: rgba(120, 15, 0, 0.06); color: var(--crimson-bright); }

.btn-ghost { background: transparent; color: var(--text); border-color: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--off-white); }
[data-theme="light"] .btn-ghost:hover { background: rgba(120, 15, 0, 0.05); color: var(--crimson); }

.btn-danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger:hover { background: #a93226; color: #fff; }

.btn-sm { font-size: var(--text-xs); padding: var(--space-2) var(--space-4); min-height: 36px; border-radius: var(--r-sm); }
.btn-lg { font-size: var(--text-base); padding: var(--space-4) var(--space-8); min-height: 52px; border-radius: var(--r-lg); letter-spacing: 0.06em; }
.btn-full { width: 100%; }

.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: var(--r-md); flex-shrink: 0; }


/* ============================================================
   7. CARD SYSTEM
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  transition: background var(--transition-slow), border-color var(--transition-slow),
              box-shadow var(--transition-base), transform var(--transition-base);
}

.card-hover:hover { border-color: var(--border-crimson); box-shadow: var(--shadow-crimson); transform: translateY(-2px); }
.card-surface { background: var(--bg-surface); }
.card-gold    { border-color: var(--border-crimson); }
.card-crimson { border-color: var(--border-crimson); background: rgba(120, 15, 0, 0.08); }
.card-sm { padding: var(--space-4); border-radius: var(--r-md); }
.card-lg { padding: var(--space-8); }


/* ============================================================
   8. BADGE & PILL SYSTEM
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px var(--space-3);
  border-radius: var(--r-full);
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-gold { color: var(--crimson-on-dark); background: rgba(120, 15, 0, 0.12); border-color: var(--border-crimson); }
[data-theme="light"] .badge-gold { color: var(--crimson); background: rgba(120, 15, 0, 0.07); }

.blog-editorial-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-family: var(--font-body);
  color: var(--crimson-on-dark);
  border: 1px solid var(--border-crimson);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  letter-spacing: 0.04em;
}
[data-theme="light"] .blog-editorial-badge { color: var(--crimson); }

.blog-list-card-top-row, .blog-post-header-top {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2);
}

.badge-crimson { color: var(--crimson-on-dark); background: rgba(120, 15, 0, 0.15); border-color: var(--border-crimson); }
[data-theme="light"] .badge-crimson { color: var(--crimson); }

.badge-success { color: var(--success); background: var(--success-dim); border-color: rgba(76, 175, 122, 0.25); }
.badge-outline { color: var(--text-muted); background: transparent; border-color: var(--border); }
.badge-muted   { color: var(--text-muted); background: rgba(255, 255, 255, 0.04); border-color: var(--border); }

.badge-sabiqun { color: var(--crimson-on-dark); background: rgba(120, 15, 0, 0.12); border-color: var(--border-crimson); }
.badge-core    { color: var(--off-white); background: rgba(120, 15, 0, 0.15); border-color: var(--border-crimson); }
[data-theme="light"] .badge-sabiqun,
[data-theme="light"] .badge-core { color: var(--crimson); }


/* ============================================================
   9. DIVIDER & ORNAMENT
   ============================================================ */

.divider-gold {
  display: flex; align-items: center; gap: var(--space-4); margin-block: var(--space-8);
}
.divider-gold::before, .divider-gold::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-crimson), transparent);
}
.divider-gold-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--crimson-dim); flex-shrink: 0; }

.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--crimson-on-dark);
  display: block;
  margin-bottom: var(--space-3);
}
[data-theme="light"] .section-label { color: var(--crimson); }


/* ============================================================
   10. FORM ELEMENTS
   ============================================================ */

.form-group { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }

.form-label { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.form-hint  { font-size: var(--text-sm); color: var(--text-muted); line-height: 1.5; }
.form-error { font-size: var(--text-sm); color: var(--error); }

.form-check { display: flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width: 18px; height: 18px; min-width: 18px; cursor: pointer; accent-color: var(--crimson); }

.lang-toggle { display: flex; gap: 2px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 3px; }

.lang-toggle-btn {
  font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: var(--space-1) var(--space-3); border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer; border: none; background: none; min-height: 30px;
}
.lang-toggle-btn:hover { color: var(--text); }
.lang-toggle-btn.active { background: var(--crimson); color: var(--off-white); }
[data-theme="light"] .lang-toggle-btn.active { background: var(--crimson); color: #FFFFFF; }

.theme-toggle {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.theme-toggle:hover { background: rgba(120, 15, 0, 0.08); color: var(--crimson-on-dark); border-color: var(--border-crimson); }
[data-theme="light"] .theme-toggle:hover { background: rgba(120, 15, 0, 0.06); color: var(--crimson); }


/* ============================================================
   11. PROGRESS INDICATORS
   ============================================================ */

.progress-bar { width: 100%; height: 4px; background: var(--bg-surface); border-radius: var(--r-full); overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--crimson-dim), var(--crimson)); border-radius: var(--r-full); transition: width var(--transition-slower); }
.progress-accent { height: 2px; background: var(--crimson); border-radius: var(--r-full); }

.streak-pill { display: inline-flex; align-items: center; gap: var(--space-2); background: rgba(120, 15, 0, 0.10); border: 1px solid var(--border-crimson); border-radius: var(--r-full); padding: var(--space-1) var(--space-3); font-size: var(--text-sm); color: var(--crimson-on-dark); font-weight: 500; }
[data-theme="light"] .streak-pill { color: var(--crimson); }

.streak-flame { font-size: var(--text-md); line-height: 1; }


/* ============================================================
   12. STAGE SYSTEM
   ============================================================ */

.stage-number { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600; flex-shrink: 0; }
.stage-number-active  { background: var(--crimson); color: var(--off-white); box-shadow: 0 0 12px rgba(120, 15, 0, 0.40); }
.stage-number-complete { background: var(--success); color: #0A0C10; }
.stage-number-locked  { background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border); }

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(120, 15, 0, 0.40); }
  50%       { box-shadow: 0 0 0 8px rgba(120, 15, 0, 0); }
}
.pulse-gold { animation: pulse-gold 2.4s ease-in-out infinite; }

.stage-locked     { opacity: 0.55; filter: grayscale(0.4); }
.stage-silhouette { opacity: 0.20; pointer-events: none; user-select: none; }


/* ============================================================
   13. LOADING STATES
   ============================================================ */

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-surface) 50%, var(--bg-card) 75%); background-size: 800px 100%; animation: shimmer 1.6s infinite linear; border-radius: var(--r-sm); color: transparent; pointer-events: none; user-select: none; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner    { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--crimson); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
.spinner-sm { width: 16px; height: 16px; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

.page-loader { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: var(--space-6); z-index: var(--z-top); transition: opacity var(--transition-slow); }
.page-loader.fade-out { opacity: 0; pointer-events: none; }


/* ============================================================
   14. TOAST / NOTIFICATION SYSTEM
   ============================================================ */

.toast-container { position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--space-3); z-index: var(--z-toast); width: min(calc(100vw - var(--space-8)), 400px); pointer-events: none; }

.toast { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--space-4) var(--space-5); display: flex; align-items: center; gap: var(--space-3); box-shadow: var(--shadow-lg); pointer-events: all; font-size: var(--text-sm); animation: toast-in var(--transition-slower) forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-success { border-color: rgba(76, 175, 122, 0.30); }
.toast-error   { border-color: rgba(192, 57, 43, 0.30); }
.toast-gold    { border-color: var(--border-crimson); }


/* ============================================================
   15. ANIMATION LIBRARY
   ============================================================ */

@keyframes fade-up   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scale-up  { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@keyframes float     { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes glow-breathe { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

.animate-fade-up   { animation: fade-up   0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-fade-in   { animation: fade-in   0.5s ease forwards; }
.animate-fade-down { animation: fade-down 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-scale-up  { animation: scale-up  0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-float     { animation: float 4s ease-in-out infinite; }

.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }
.delay-6 { animation-delay: 600ms; }
.delay-7 { animation-delay: 700ms; }
.delay-8 { animation-delay: 800ms; }

.animate-fade-up, .animate-fade-in, .animate-fade-down, .animate-scale-up { opacity: 0; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .animate-float { animation: none; }
  .pulse-gold    { animation: none; }
}


/* ============================================================
   16. SCROLLBAR STYLING
   ============================================================ */

::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--bg-surface); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--crimson-dim); }
* { scrollbar-width: thin; scrollbar-color: var(--bg-surface) var(--bg); }


/* ============================================================
   17. SELECTION STYLING
   ============================================================ */

::selection { background: rgba(120, 15, 0, 0.25); color: var(--off-white); }
[data-theme="light"] ::selection { background: rgba(120, 15, 0, 0.15); color: var(--off-white); }


/* ============================================================
   18. FOCUS VISIBLE — ACCESSIBILITY
   ============================================================ */

:focus-visible { outline: 2px solid var(--crimson); outline-offset: 3px; border-radius: var(--r-sm); }


/* ============================================================
   19. UTILITY CLASSES
   ============================================================ */

.mt-0  { margin-top: 0; }
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }
.px-4 { padding-inline: var(--space-4); }
.py-4 { padding-block: var(--space-4); }

.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-prose { max-width: 65ch; }

.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }
.opacity-100 { opacity: 1; }

.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.inset-0  { inset: 0; }

.border-gold    { border: 1px solid var(--border-crimson); }
.border-crimson { border: 1px solid var(--border-crimson); }
.rounded-full   { border-radius: var(--r-full); }

.text-gradient-gold {
  background: linear-gradient(135deg, var(--crimson-dim), var(--crimson), var(--crimson-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nowrap       { white-space: nowrap; }
.pointer-none { pointer-events: none; }


/* ============================================================
   END OF design.css — QWV Identity System v2.0
   Spectral + Inter · Crimson on warm dark · Gold retired
   ============================================================ */
