/**
 * AFROTOOLS DESIGN SYSTEM
 * =====================================================================
 * The single source of truth for every visual decision on AfroTools.com.
 * Every page imports this file FIRST, before any other stylesheet.
 *
 * Architecture:
 *   1. CSS Custom Properties (tokens)
 *   2. Base Reset & Typography
 *   3. Layout Utilities
 *   4. Component Classes
 *   5. Animation Classes
 *   6. Dark Mode
 *   7. Responsive Breakpoints
 *
 * Rules:
 *   - Never hardcode a color in page CSS. Use tokens.
 *   - Never hardcode a font. Use tokens.
 *   - Never hardcode spacing. Use the scale.
 *   - Keep this file framework-free. Plain CSS only.
 * =====================================================================
 */

/* =====================================================================
   1. CSS CUSTOM PROPERTIES (TOKENS)
   ===================================================================== */

:root {
  /* ── PRIMARY COLORS (Apple Blue) ─────────────────────────────────── */
  --color-primary:        #007AFF;
  --color-primary-dark:   #0063D1;
  --color-primary-light:  #4DA3FF;
  --color-primary-pale:   rgba(0, 122, 255, 0.08);
  --color-primary-rgb:    0, 122, 255;
  --color-secondary:      #0063D1;
  --color-secondary-rgb:  0, 99, 209;

  /* ── ACCENT (AfroTools Blue — brand moments only) ───────────────── */
  --color-accent:         #0063D1;
  --color-accent-light:   #E8F2FF;
  --color-accent-hover:   #004BA0;
  --color-accent-rgb:     0, 99, 209;

  /* ── BACKGROUND ─────────────────────────────────────────────────── */
  --color-bg:             #F8FAFD;
  --color-bg-subtle:      #F1F5F9;
  --color-bg-dark:        #0A1628;
  --color-bg-dark-alt:    #111D30;
  --color-bg-card:        #ffffff;
  --color-bg-hero:        linear-gradient(135deg, #F0F7FF 0%, #E8F4FD 50%, #F5F0FF 100%);

  /* ── GLASS / FROSTED ────────────────────────────────────────────── */
  --glass-bg:             rgba(255, 255, 255, 0.72);
  --glass-border:         rgba(255, 255, 255, 0.3);
  --glass-shadow:         0 8px 32px rgba(0, 0, 0, 0.04);
  --glass-blur:           blur(20px);
  --glass-saturate:       saturate(180%);

  /* ── TEXT ────────────────────────────────────────────────────────── */
  --color-text:           #1E293B;
  --color-text-muted:     #64748B;
  --color-text-subtle:    #94A3B8;
  --color-text-inverse:   #ffffff;
  --color-text-link:      #007AFF;

  /* ── BORDER ─────────────────────────────────────────────────────── */
  --color-border:         #E2E8F0;
  --color-border-strong:  #CBD5E1;
  --color-border-subtle:  #F1F5F9;

  /* ── STATUS ─────────────────────────────────────────────────────── */
  --color-error:          #EF4444;
  --color-error-pale:     rgba(239, 68, 68, 0.08);
  --color-warning:        #F59E0B;
  --color-warning-pale:   rgba(245, 158, 11, 0.08);
  --color-success:        #3B82F6;
  --color-success-pale:   rgba(59, 130, 246, 0.08);
  --color-info:           #3B82F6;
  --color-info-pale:      rgba(59, 130, 246, 0.08);

  /* ── ACCENT (GOLD) ─────────────────────────────────────────────── */
  --color-gold:           #F5A623;
  --color-gold-pale:      #fff3cd;
  --color-gold-rgb:       245, 166, 35;

  /* ── ON-DARK SURFACES ───────────────────────────────────────────── */
  --color-ondark-primary:   #4DA3FF;
  --color-ondark-secondary: rgba(255, 255, 255, 0.6);
  --color-ondark-muted:     rgba(255, 255, 255, 0.35);
  --color-ondark-border:    rgba(255, 255, 255, 0.1);

  /* ── TYPOGRAPHY ─────────────────────────────────────────────────── */
  --font-heading: 'Instrument Serif', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* Aliases for backward compatibility */
  --font-display: var(--font-body);

  /* Font sizes (modular scale ~1.25) */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */

  /* Display sizes */
  --display-sm: 1.75rem;
  --display-md: 2.25rem;
  --display-lg: 3rem;
  --display-xl: 4rem;

  /* Font weights */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-black:    800;

  /* Line heights */
  --leading-tight:   1.1;
  --leading-snug:    1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.65;
  --leading-loose:   1.8;

  /* Letter spacing */
  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.05em;
  --tracking-wider:  0.1em;
  --tracking-widest: 0.15em;

  /* ── SPACING SCALE ──────────────────────────────────────────────── */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Numeric aliases */
  --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;

  /* ── LAYOUT ─────────────────────────────────────────────────────── */
  --max-width:        1200px;
  --max-width-narrow: 800px;
  --max-width-wide:   1400px;
  --max-width-tool:   1100px;
  --nav-height:       64px;

  /* ── BORDER RADIUS ──────────────────────────────────────────────── */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  24px;
  --radius-pill:  9999px;
  --radius-round: 50%;

  /* ── SHADOWS (Apple-style, layered) ─────────────────────────────── */
  --shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg:    0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl:    0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-2xl:   0 25px 50px -12px rgba(0, 0, 0, 0.12);
  --shadow-brand: 0 4px 20px rgba(0, 122, 255, 0.2);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.04);

  /* Card-specific shadows */
  --shadow-card:       0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);

  /* ── TRANSITIONS ────────────────────────────────────────────────── */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-expo:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:       cubic-bezier(0.22, 0.61, 0.36, 1);

  /* ── Z-INDEX SCALE ──────────────────────────────────────────────── */
  --z-base:    1;
  --z-raised:  10;
  --z-dropdown: 50;
  --z-overlay: 100;
  --z-nav:     200;
  --z-modal:   300;
  --z-toast:   400;

  /* ── BACKWARD COMPATIBILITY ALIASES ─────────────────────────────── */
  --color-brand:        var(--color-primary);
  --color-brand-dark:   var(--color-primary-dark);
  --color-brand-light:  var(--color-primary-light);
  --color-brand-pale:   var(--color-primary-pale);
  --color-brand-subtle: rgba(0, 122, 255, 0.15);
  --max-width-content:  var(--max-width);
}


/* =====================================================================
   2. BASE RESET & TYPOGRAPHY
   ===================================================================== */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

ul, ol { list-style: none; }

/* ── TYPOGRAPHY ────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-text);
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-3xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: var(--weight-semibold); }

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ── FOCUS VISIBLE ─────────────────────────────────────────────────── */

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

/* ── SCROLLBAR ─────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-subtle); }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }


/* =====================================================================
   3. LAYOUT UTILITIES
   ===================================================================== */

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--narrow {
  max-width: var(--max-width-narrow);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--wide {
  max-width: var(--max-width-wide);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--tool {
  max-width: var(--max-width-tool);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

/* Section spacing */
.section { padding-block: var(--space-3xl); }
.section--sm { padding-block: var(--space-2xl); }
.section--lg { padding-block: 96px; }

/* Grid */
.grid {
  display: grid;
  gap: var(--space-lg);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }
.gap-xl  { gap: var(--space-xl); }

/* Screen reader only */
.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;
}

/* Text utilities */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.text-primary { color: var(--color-primary); }
.text-error  { color: var(--color-error); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }

.font-mono { font-family: var(--font-mono); }
.font-heading { font-family: var(--font-heading); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Section labels / eyebrows */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-primary);
  display: block;
  margin-bottom: var(--space-sm);
}
.eyebrow--ondark { color: var(--color-ondark-primary); }


/* =====================================================================
   4. COMPONENT CLASSES
   ===================================================================== */

/* ── BUTTONS ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all var(--transition-normal);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 122, 255, 0.3);
}
.btn-primary:hover {
  background: var(--color-primary-light);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-bg-subtle);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-ghost-light {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-ghost-light:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
  border-color: var(--color-error);
}
.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--text-base);
}

.btn-icon {
  padding: 0.625rem;
  line-height: 0;
}

/* Legacy aliases */
.btn--primary { composes: btn-primary; }
.btn--ghost-light { composes: btn-ghost-light; }
.btn--ghost-dark { composes: btn-ghost; }

/* ── INPUTS ───────────────────────────────────────────────────────── */

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input::placeholder { color: var(--color-text-subtle); }
.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}
.input:disabled { opacity: 0.5; cursor: not-allowed; }

.select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

/* ── CARDS ─────────────────────────────────────────────────────────── */

.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.card-hover {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

/* ── BADGES & CHIPS ───────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  line-height: 1;
}
.badge-green  { background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary); border: 1px solid rgba(var(--color-primary-rgb), 0.25); }
.badge-gold   { background: rgba(var(--color-gold-rgb), 0.12); color: var(--color-gold); border: 1px solid rgba(var(--color-gold-rgb), 0.25); }
.badge-blue   { background: rgba(59, 130, 246, 0.12); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-red    { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-grey   { background: rgba(100, 116, 139, 0.08); color: var(--color-text-muted); border: 1px solid rgba(100, 116, 139, 0.15); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.chip:hover, .chip.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.06);
}

/* ── ALERTS ───────────────────────────────────────────────────────── */

.alert {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}
.alert-info    { background: var(--color-info-pale); color: #1e40af; border: 1px solid rgba(59, 130, 246, 0.2); }
.alert-warning { background: var(--color-warning-pale); color: #92400e; border: 1px solid rgba(245, 158, 11, 0.2); }
.alert-error   { background: var(--color-error-pale); color: #991b1b; border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-success { background: var(--color-success-pale); color: #1E40AF; border: 1px solid rgba(59, 130, 246, 0.2); }

/* ── TOOLTIP ──────────────────────────────────────────────────────── */

.tooltip {
  position: relative;
  cursor: help;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  padding: 6px 12px;
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: var(--z-dropdown);
}
.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── MODAL ─────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: modal-enter 0.25s var(--ease-out-expo);
}

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

/* ── DRAWER ────────────────────────────────────────────────────────── */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: var(--z-modal);
  display: none;
  backdrop-filter: blur(4px);
}
.drawer-backdrop.open { display: block; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--color-bg-card);
  z-index: calc(var(--z-modal) + 1);
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-out-expo);
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}
.drawer.open { transform: translateX(0); }

/* ── SKELETON ──────────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, #E8EDF2 25%, #F4F7FA 50%, #E8EDF2 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 1em; width: 100%; }
.skeleton-heading { height: 1.5em; width: 60%; }
.skeleton-circle { border-radius: var(--radius-round); }

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── DIVIDER ──────────────────────────────────────────────────────── */

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}
.divider--subtle { border-color: var(--color-border-subtle); }

/* ── TIER BADGES ──────────────────────────────────────────────────── */

.tier-badge {
  font-size: 0.65rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.tier-badge--1 { background: var(--color-gold-pale); color: #7a5c00; }
.tier-badge--2 { background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary-dark); }
.tier-badge--3 { background: var(--color-bg-subtle); color: var(--color-text-muted); }


/* ── HERO SECTIONS ────────────────────────────────────────────────── */

.hero {
  background: var(--color-bg-hero);
  padding: var(--space-24) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: hero-float 20s ease-in-out infinite;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  animation: hero-float 25s ease-in-out infinite reverse;
  pointer-events: none;
}

@keyframes hero-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -20px); }
}

.hero .container { position: relative; z-index: 1; }

/* ── FROSTED GLASS NAVBAR ─────────────────────────────────────────── */

.navbar-glass {
  background: rgba(248, 250, 253, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}


/* =====================================================================
   5. ANIMATION CLASSES
   ===================================================================== */

/* ── SCROLL REVEAL ─────────────────────────────────────────────────── */

.fade-in {
  opacity: 0;
  transition: opacity 0.5s var(--ease-spring);
}
.fade-in.is-visible { opacity: 1; }

.slide-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease-spring), transform 0.55s var(--ease-spring);
}
.slide-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Legacy aliases */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.rv { opacity: 0; transform: translateY(22px); transition: opacity 0.55s var(--ease-spring), transform 0.55s var(--ease-spring); will-change: opacity, transform; }
.rv.in { opacity: 1; transform: translateY(0); }

/* Staggered delays */
.delay-1, .rv.d1, .reveal-delay-1 { transition-delay: 0.08s; }
.delay-2, .rv.d2, .reveal-delay-2 { transition-delay: 0.16s; }
.delay-3, .rv.d3, .reveal-delay-3 { transition-delay: 0.24s; }
.delay-4, .rv.d4, .reveal-delay-4 { transition-delay: 0.32s; }
.delay-5, .rv.d5, .reveal-delay-5 { transition-delay: 0.40s; }
.delay-6, .rv.d6, .reveal-delay-6 { transition-delay: 0.48s; }

/* Scale-in variant */
.rv-scale { opacity: 0; transform: translateY(16px) scale(0.97); transition: opacity 0.5s var(--ease-spring), transform 0.5s var(--ease-spring); will-change: opacity, transform; }
.rv-scale.in { opacity: 1; transform: translateY(0) scale(1); }

/* ── PULSE ─────────────────────────────────────────────────────────── */

.pulse {
  animation: pulse-anim 2s ease-in-out infinite;
}
@keyframes pulse-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── SKELETON LOADING (alias) ──────────────────────────────────────── */

.skeleton-loading {
  background: linear-gradient(90deg, #E8EDF2 25%, #F4F7FA 50%, #E8EDF2 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ── SPIN ──────────────────────────────────────────────────────────── */

.spin { animation: spin-anim 1s linear infinite; }
@keyframes spin-anim { to { transform: rotate(360deg); } }

/* ── REDUCED MOTION ────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .rv, .rv-scale, .slide-up, .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}


/* =====================================================================
   6. DARK MODE
   ===================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:           #0B1120;
    --color-bg-subtle:    #131D2E;
    --color-bg-card:      #131D2E;
    --color-bg-dark:      #060D18;
    --color-text:         #E2E8F0;
    --color-text-muted:   #8B9CB8;
    --color-text-subtle:  #5A6F8A;
    --color-border:       #1E2D40;
    --color-border-strong: #2A3D55;
    --color-border-subtle: #162236;
    --glass-bg:           rgba(11, 17, 32, 0.8);
    --glass-border:       rgba(255, 255, 255, 0.06);
    --shadow-card:        0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-card-hover:  0 8px 24px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}


/* =====================================================================
   7. RESPONSIVE BREAKPOINTS
   ===================================================================== */

@media (max-width: 640px) {
  .container, .container--narrow, .container--wide, .container--tool {
    padding-inline: var(--space-md);
  }
  .section { padding-block: var(--space-2xl); }
  .section--lg { padding-block: var(--space-3xl); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
}

@media (min-width: 640px) {
  .sm\:grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .md\:grid-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:grid-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
  .xl\:grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── PRINT ─────────────────────────────────────────────────────────── */

@media print {
  body { background: #fff; color: #000; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  afro-navbar, afro-footer, .btn, .drawer, .modal-backdrop, .skeleton { display: none !important; }
}
