/* ============================================================
   QUR'AN WORLD VIEW — DESIGN SYSTEM
   design.css · v1.0 · Phase 2
   ============================================================
   This file is the single source of truth for all QWV design
   tokens, typography, base resets, theme handling, animations,
   and shared utility classes.

   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.
   ============================================================ */


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

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&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:             #0A0C10;   /* near-black background         */
  --bg-card:        #11151C;   /* card surface                  */
  --bg-surface:     #171C26;   /* elevated surface              */
  --crimson:        #780F00;   /* QWV primary                   */
  --crimson-bright: #9C1400;   /* hover / lighter crimson       */
  --crimson-dim:    #4A0A00;   /* subtle crimson tint           */
  --gold:           #C9A84C;   /* QWV accent                    */
  --gold-dim:       #8A6F2E;   /* muted gold                    */
  --gold-bright:    #DFC06A;   /* hover / lighter gold          */
  --off-white:      #F0EBE0;   /* primary text on dark          */
  --text:           #CEC8BE;   /* body text                     */
  --text-muted:     #68666E;   /* secondary / placeholder text  */
  --border:         rgba(255, 255, 255, 0.07);
  --border-gold:    rgba(201, 168, 76, 0.20);
  --border-crimson: rgba(120, 15, 0, 0.35);

  /* --- Semantic Colours --- */
  --success:        #4CAF7A;
  --success-dim:    rgba(76, 175, 122, 0.15);
  --warning:        #D4A84B;
  --warning-dim:    rgba(212, 168, 75, 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(10, 12, 16, 0.85);
  --scrim-light:    rgba(10, 12, 16, 0.50);

  /* --- Typography --- */
  --font-display:    'Cinzel', serif;
  --font-serif:      'Cormorant Garamond', serif;
  --font-body:       'DM Sans', sans-serif;
  --font-arabic:     'Amiri', serif;
  --font-devanagari: 'Noto Sans Devanagari', sans-serif;

  /* --- Type Scale (fluid, mobile-first) --- */
  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-md:    1.125rem;   /* 18px */
  --text-lg:    1.25rem;    /* 20px */
  --text-xl:    1.5rem;     /* 24px */
  --text-2xl:   2rem;       /* 32px */
  --text-3xl:   2.5rem;     /* 40px */
  --text-4xl:   3.25rem;    /* 52px */
  --text-5xl:   4rem;       /* 64px */

  /* --- Arabic Type Scale --- */
  --arabic-sm:  1.25rem;    /* 20px */
  --arabic-md:  1.75rem;    /* 28px */
  --arabic-lg:  2.25rem;    /* 36px */
  --arabic-xl:  3rem;       /* 48px */
  --arabic-2xl: 4rem;       /* 64px */

  /* --- Spacing --- */
  --space-1:  0.25rem;   /*  4px */
  --space-2:  0.5rem;    /*  8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */

  /* --- 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.4),
                 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.5),
                 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-lg:   0 10px 30px rgba(0, 0, 0, 0.6),
                 0 4px 10px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px rgba(201, 168, 76, 0.15),
                 0 0 40px rgba(201, 168, 76, 0.07);
  --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
   Applied when [data-theme="light"] is set on <html>
   ============================================================ */

[data-theme="light"] {
  --bg:             #F6F1E8;
  --bg-card:        #FFFFFF;
  --bg-surface:     #EDE8DC;
  --crimson:        #780F00;
  --crimson-bright: #9C1400;
  --crimson-dim:    #F9E8E5;
  --gold:           #9A7020;
  --gold-dim:       #C9A84C;
  --gold-bright:    #7A5A10;
  --off-white:      #2A1800;
  --text:           #3A2A18;
  --text-muted:     #8A7860;
  --border:         rgba(0, 0, 0, 0.09);
  --border-gold:    rgba(154, 112, 32, 0.25);
  --border-crimson: rgba(120, 15, 0, 0.20);
  --scrim:          rgba(246, 241, 232, 0.90);
  --scrim-light:    rgba(246, 241, 232, 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(154, 112, 32, 0.12),
                 0 0 40px rgba(154, 112, 32, 0.06);
}


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

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

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);
}

/* --- Links --- */
a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* --- Images --- */
img, video, svg {
  display: block;
  max-width: 100%;
}

/* --- Lists --- */
ul, ol {
  list-style: none;
}

/* --- Buttons (base reset — use .btn-* for styled buttons) --- */
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;
}

/* --- Inputs & Textareas --- */
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(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  box-shadow: 0 0 0 3px rgba(154, 112, 32, 0.12);
}

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

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


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

/* --- Display (Cinzel) — page titles, hero text, labels --- */
.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.02em;
  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); }
}

/* --- Serif (Cormorant Garamond) — pull quotes, subtitles, poetic lines --- */
.font-serif { font-family: var(--font-serif); }

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

.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(--gold);
  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 (Amiri) --- */
.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(--gold); }
.arabic-muted  { color: var(--text-muted); }

/* --- Devanagari (Noto Sans Devanagari) --- */
.font-devanagari {
  font-family: var(--font-devanagari);
}

/* --- Body text utilities --- */
.text-off-white { color: var(--off-white); }
.text-body      { color: var(--text); }
.text-muted     { color: var(--text-muted); }
.text-gold      { color: var(--gold); }
.text-crimson   { color: var(--crimson); }
.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); }

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


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

/* --- Container --- */
.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); }

/* Ensure all container variants inherit base styles */
.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 spacing --- */
.section {
  padding-block: var(--section-gap);
}

.section-sm {
  padding-block: var(--space-10);
}

/* --- Page wrapper (accounts for fixed navbar) --- */
.page-content {
  padding-top: var(--navbar-height);
  min-height: 100vh;
}

/* --- Flex utilities --- */
.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 utilities --- */
.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 alignment --- */
.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

/* --- Visibility --- */
.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
   ============================================================ */

/* Base button — all buttons inherit this */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-md);
  padding: var(--space-3) var(--space-6);
  min-height: 44px;            /* touch target */
  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);
}

/* Primary — gold fill */
.btn-primary {
  background: var(--gold);
  color: #0A0C10;
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  box-shadow: var(--shadow-gold);
  color: #0A0C10;
}

/* Secondary — crimson fill */
.btn-secondary {
  background: var(--crimson);
  color: var(--off-white);
  border-color: var(--crimson);
}

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

/* Outline — gold border, transparent fill */
.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--border-gold);
}

.btn-outline:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* Ghost — no border, subtle hover */
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--off-white);
}

/* Danger */
.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.btn-danger:hover {
  background: #a93226;
  color: #fff;
}

/* Sizes */
.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.08em;
}

/* Full width */
.btn-full { width: 100%; }

/* Disabled state */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Icon button (square) */
.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-gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.card-surface {
  background: var(--bg-surface);
}

.card-gold {
  border-color: var(--border-gold);
}

.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-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px var(--space-3);
  border-radius: var(--r-full);
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-gold {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.10);
  border-color: var(--border-gold);
}

.badge-crimson {
  color: #E05040;
  background: rgba(120, 15, 0, 0.15);
  border-color: var(--border-crimson);
}

.badge-success {
  color: var(--success);
  background: var(--success-dim);
  border-color: rgba(76, 175, 122, 0.25);
}

.badge-muted {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

/* Member tier badges */
.badge-sabiqun {
  color: var(--gold);
  background: linear-gradient(135deg,
    rgba(201, 168, 76, 0.15) 0%,
    rgba(120, 15, 0, 0.15) 100%);
  border-color: var(--border-gold);
}

.badge-core {
  color: var(--off-white);
  background: linear-gradient(135deg,
    rgba(201, 168, 76, 0.20) 0%,
    rgba(201, 168, 76, 0.05) 100%);
  border-color: var(--gold-dim);
}


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

/* Gold ornamental divider — used between sections */
.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-gold),
    transparent);
}

.divider-gold-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-dim);
  flex-shrink: 0;
}

/* Section label — small caps above headings */
.section-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: var(--space-3);
}


/* ============================================================
   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-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.10em;
  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);
}

/* Radio and checkbox groups */
.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(--gold);
}

/* Language toggle pills */
.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-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  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(--gold);
  color: #0A0C10;
}

[data-theme="light"] .lang-toggle-btn.active {
  color: #0A0C10;
}

/* Theme toggle */
.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(255, 255, 255, 0.05);
  color: var(--gold);
  border-color: var(--border-gold);
}

[data-theme="light"] .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}


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

/* Linear progress bar */
.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(--gold-dim), var(--gold));
  border-radius: var(--r-full);
  transition: width var(--transition-slower);
}

/* Thin accent line — stage progress */
.progress-accent {
  height: 2px;
  background: linear-gradient(90deg,
    var(--crimson),
    var(--gold));
  border-radius: var(--r-full);
}

/* Streak pill */
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  color: var(--gold);
  font-weight: 500;
}

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


/* ============================================================
   12. STAGE SYSTEM — LOCKED / ACTIVE / COMPLETE STATES
   ============================================================ */

/* Stage number indicator */
.stage-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.stage-number-active {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #0A0C10;
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.30);
}

.stage-number-complete {
  background: var(--success);
  color: #0A0C10;
}

.stage-number-locked {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Pulsing indicator for current stage */
@keyframes pulse-gold {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.35);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(201, 168, 76, 0);
  }
}

.pulse-gold {
  animation: pulse-gold 2.4s ease-in-out infinite;
}

/* Lock icon state */
.stage-locked {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.stage-silhouette {
  opacity: 0.20;
  pointer-events: none;
  user-select: none;
}


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

/* Skeleton shimmer */
@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;
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  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; }

/* Full-page loader */
.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-gold); }


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

/* --- Entry animations --- */
@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);
  }
}

/* --- Float animation (logo / hero elements) --- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* --- Glow breathe --- */
@keyframes glow-breathe {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* Utility animation classes */
.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; }

/* Stagger delays — use on children */
.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; }

/* Start invisible for animation classes */
.animate-fade-up,
.animate-fade-in,
.animate-fade-down,
.animate-scale-up {
  opacity: 0;
}

/* Intersection Observer hook — add .visible to trigger */
.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);
}

/* Reduced motion — respect user preference */
@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 */
::-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(--gold-dim);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-surface) var(--bg);
}


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

::selection {
  background: rgba(201, 168, 76, 0.25);
  color: var(--off-white);
}

[data-theme="light"] ::selection {
  background: rgba(154, 112, 32, 0.20);
  color: var(--off-white);
}


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

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

[data-theme="light"] :focus-visible {
  outline-color: var(--gold);
}


/* ============================================================
   19. UTILITY CLASSES — SPACING & MISC
   ============================================================ */

/* Margins */
.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); }

/* Padding */
.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); }

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

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

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.inset-0  { inset: 0; }

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

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

/* No-wrap */
.nowrap { white-space: nowrap; }

/* Pointer events */
.pointer-none { pointer-events: none; }


/* ============================================================
   20. RESPONSIVE BREAKPOINTS — REFERENCE
   ============================================================
   Mobile-first. All components default to mobile.
   Expand at these breakpoints:

   @media (min-width: 480px)  → Large phones
   @media (min-width: 640px)  → Small tablets / landscape phones
   @media (min-width: 768px)  → Tablets
   @media (min-width: 1024px) → Laptops / small desktops
   @media (min-width: 1280px) → Large desktops

   Use CSS custom properties and flexible layouts to minimise
   the number of breakpoints needed per component.
   ============================================================ */


/* ============================================================
   END OF design.css
   ============================================================
   Next file: css/components.css
   ============================================================ */
