/* ============================================================
   PhoneMatch India — Global Design System
   style.css | Version 1.0
   ============================================================ */

/* ── Google Fonts Import ───────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap");

/* ── CSS Custom Properties (Design Tokens) ─────────────────── */
:root {
  /* Backgrounds */
  --bg-base: #0d0f12;
  --bg-surface: #12161a;
  --bg-elevated: #181d23;
  --bg-glass: rgba(255, 255, 255, 0.035);
  --bg-glass-hover: rgba(255, 255, 255, 0.065);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.055);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(139, 92, 246, 0.4);

  /* Accent Colors */
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Accent Glows */
  --glow-purple: rgba(139, 92, 246, 0.35);
  --glow-cyan: rgba(6, 182, 212, 0.35);
  --glow-emerald: rgba(16, 185, 129, 0.35);

  /* Gradients */
  --grad-purple-cyan: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --grad-purple-rose: linear-gradient(135deg, #8b5cf6 0%, #f43f5e 100%);
  --grad-surface: linear-gradient(180deg, #12161a 0%, #0d0f12 100%);
  --grad-hero: radial-gradient(
    ellipse 80% 60% at 50% -10%,
    rgba(139, 92, 246, 0.18) 0%,
    transparent 70%
  );

  /* Typography */
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;

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

  /* Text Colors */
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.62);
  --text-muted: rgba(255, 255, 255, 0.35);
  --text-accent: var(--accent-purple);

  /* Spacing Scale */
  --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 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-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 16px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-glow-purple:
    0 0 32px var(--glow-purple), 0 0 8px rgba(139, 92, 246, 0.2);
  --shadow-glow-cyan: 0 0 32px var(--glow-cyan), 0 0 8px rgba(6, 182, 212, 0.2);
  --shadow-glow-emerald:
    0 0 32px var(--glow-emerald), 0 0 8px rgba(16, 185, 129, 0.2);

  /* Transitions */
  --ease-snappy: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 0.15s var(--ease-snappy);
  --transition-base: 0.2s var(--ease-snappy);
  --transition-slow: 0.35s var(--ease-smooth);

  /* Layout */
  --max-width: 1200px;
  --content-width: 900px;
  --nav-height: 64px;

  /* Z-index layers */
  --z-base: 1;
  --z-raised: 10;
  --z-overlay: 100;
  --z-modal: 200;
  --z-toast: 300;
}

/* ── CSS Reset & Base ───────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-base);
  background-image: var(--grad-hero);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Noise texture overlay for depth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}
input,
textarea,
select {
  font-family: var(--font-body);
}
ul,
ol {
  list-style: none;
}

/* ── Typography System ──────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl));
  font-weight: 800;
}
h2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
}
h3 {
  font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
}
h4 {
  font-size: var(--text-xl);
  font-weight: 600;
}
h5 {
  font-size: var(--text-lg);
  font-weight: 600;
}
h6 {
  font-size: var(--text-base);
  font-weight: 600;
}

p {
  color: var(--text-secondary);
  line-height: 1.75;
}

.text-gradient {
  background: var(--grad-purple-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted {
  color: var(--text-muted);
}
.text-accent {
  color: var(--accent-purple);
}
.text-cyan {
  color: var(--accent-cyan);
}
.text-emerald {
  color: var(--accent-emerald);
}
.text-amber {
  color: var(--accent-amber);
}
.text-rose {
  color: var(--accent-rose);
}

/* ── Layout Utilities ───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: var(--content-width);
}

.section {
  padding: var(--space-20) 0;
  position: relative;
  z-index: var(--z-base);
}

.section--sm {
  padding: var(--space-12) 0;
}
.section--lg {
  padding: var(--space-24) 0;
}

/* Flex helpers */
.flex {
  display: flex;
}
.flex-col {
  display: flex;
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: var(--space-2);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-6 {
  gap: var(--space-6);
}
.gap-8 {
  gap: var(--space-8);
}

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

/* Text align */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* ── Glassmorphism Card ─────────────────────────────────────── */
.card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--transition-base),
    background var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

/* Backdrop filter with fallback */
@supports (backdrop-filter: blur(12px)) {
  .card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--bg-glass);
  }
}

@supports not (backdrop-filter: blur(12px)) {
  .card {
    background: var(--bg-elevated);
  }
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-glass-hover);
}

.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card--glow-purple {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-purple);
}
.card--glow-cyan {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: var(--shadow-glow-cyan);
}
.card--glow-emerald {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: var(--shadow-glow-emerald);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

/* Shimmer effect on buttons */
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.4s var(--ease-smooth);
}
.btn:hover::after {
  left: 100%;
}

.btn--primary {
  background: var(--grad-purple-cyan);
  color: #fff;
  box-shadow: 0 4px 20px var(--glow-purple);
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}
.btn--primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 8px 32px var(--glow-purple),
    0 4px 12px rgba(6, 182, 212, 0.2);
}
.btn--primary:active {
  transform: translateY(0) scale(0.98);
}

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

.btn--cyan {
  background: var(--accent-cyan);
  color: #0d0f12;
  box-shadow: 0 4px 20px var(--glow-cyan);
}
.btn--cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--glow-cyan);
}

.btn--emerald {
  background: var(--accent-emerald);
  color: #0d0f12;
  box-shadow: 0 4px 20px var(--glow-emerald);
}
.btn--emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--glow-emerald);
}

.btn--danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}
.btn--danger:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--accent-rose);
}

.btn--lg {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--grad-purple-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav__logo span {
  -webkit-text-fill-color: var(--text-muted);
  font-weight: 400;
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-top: -4px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
}

.nav__link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent-purple);
  transform: scaleX(0);
  transition: transform var(--transition-base);
  transform-origin: left;
}

.nav__link:hover {
  color: var(--text-primary);
}
.nav__link:hover::after {
  transform: scaleX(1);
}
.nav__link--active {
  color: var(--text-primary);
}
.nav__link--active::after {
  transform: scaleX(1);
}

/* Nav background on scroll */
.nav--scrolled {
  background: rgba(13, 15, 18, 0.85);
  border-bottom: 1px solid var(--border-subtle);
}

@supports (backdrop-filter: blur(12px)) {
  .nav--scrolled {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

/* ── Form Elements ──────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition:
    border-color var(--transition-base),
    background var(--transition-base),
    box-shadow var(--transition-base);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

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

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.06);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.form-input--error {
  border-color: var(--accent-rose);
}
.form-input--success {
  border-color: var(--accent-emerald);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--accent-rose);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

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

.form-select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ── Option Cards (Quiz) ────────────────────────────────────── */
.option-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
}

@supports (backdrop-filter: blur(8px)) {
  .option-card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

.option-card:hover {
  border-color: var(--border-accent);
  background: rgba(139, 92, 246, 0.08);
  transform: translateX(4px);
}

.option-card.selected {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.14);
  box-shadow:
    0 0 0 1px var(--accent-purple),
    var(--shadow-glow-purple);
}

.option-card.selected::before {
  content: "✓";
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: var(--accent-purple);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}

.option-card__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.option-card__label {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.option-card__sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--grad-purple-cyan);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-smooth);
  box-shadow: 0 0 8px var(--glow-purple);
}

/* ── Badge / Tag ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.badge--cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}
.badge--emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge--amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.badge--rose {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* ── Rating Stars / Score Bar ───────────────────────────────── */
.score-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.score-bar__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.score-bar__track {
  flex: 1;
  height: 5px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-bar__fill {
  height: 100%;
  background: var(--grad-purple-cyan);
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-smooth);
}

.score-bar__value {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
  width: 28px;
  text-align: right;
}

/* ── Toggle Switch ──────────────────────────────────────────── */
.toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.toggle__input {
  display: none;
}

.toggle__track {
  width: 46px;
  height: 26px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition-base);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: var(--radius-full);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.toggle__input:checked + .toggle__track {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.toggle__input:checked + .toggle__track .toggle__thumb {
  transform: translateX(20px);
  box-shadow: 0 0 8px var(--glow-emerald);
}

.toggle__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

@supports (backdrop-filter: blur(8px)) {
  .modal-overlay {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 480px;
  width: 100%;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

/* ── Alert / Toast ──────────────────────────────────────────── */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert--error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fca5a5;
}
.alert--success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}
.alert--info {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #67e8f9;
}
.alert--warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

/* ── Section Dividers & Decorators ─────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-subtle),
    transparent
  );
  margin: var(--space-8) 0;
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-label::before,
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-subtle), transparent);
}

.section-label::before {
  max-width: 40px;
  background: linear-gradient(90deg, transparent, var(--border-subtle));
}

/* Glow dot decorator */
.glow-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  flex-shrink: 0;
}

.glow-dot--purple {
  background: var(--accent-purple);
  box-shadow: 0 0 8px var(--glow-purple);
}
.glow-dot--cyan {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--glow-cyan);
}
.glow-dot--emerald {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--glow-emerald);
}
.glow-dot--pulse {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Ambient orb background */
.orb {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.orb--purple {
  background: rgba(139, 92, 246, 0.18);
}
.orb--cyan {
  background: rgba(6, 182, 212, 0.14);
}

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg-elevated);
}

th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--bg-glass);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ── Stat / Metric Cards ────────────────────────────────────── */
.stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

@supports (backdrop-filter: blur(8px)) {
  .stat-card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-card__rank {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  background: var(--grad-purple-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-card__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.stat-card__change {
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card__change--up {
  color: var(--accent-emerald);
}
.stat-card__change--down {
  color: var(--accent-rose);
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 6px var(--glow-purple);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 16px var(--glow-purple);
    transform: scale(1.15);
  }
}

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

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s var(--ease-smooth) both;
}
.animate-fade-in {
  animation: fade-in 0.4s var(--ease-smooth) both;
}
.animate-scale-in {
  animation: scale-in 0.4s var(--ease-bounce) both;
}
.animate-slide-in-right {
  animation: slide-in-right 0.5s var(--ease-smooth) both;
}

.delay-1 {
  animation-delay: 0.1s;
}
.delay-2 {
  animation-delay: 0.2s;
}
.delay-3 {
  animation-delay: 0.3s;
}
.delay-4 {
  animation-delay: 0.4s;
}
.delay-5 {
  animation-delay: 0.5s;
}

/* ── Skeleton Loader ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ── Focus visible ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE SYSTEM
   Strategy: design for 375px first, scale up
   ══════════════════════════════════════════════════════════════ */

/* ── Touch & tap improvements (all screen sizes) ── */
* {
  -webkit-tap-highlight-color: transparent; /* remove blue flash on tap */
}

/* All interactive elements: minimum 44×44px touch target (Apple HIG) */
button,
a,
[role="button"],
.option-card,
.toggle,
.nav__link,
.faq-question,
.sidebar-nav__link {
  min-height: 44px;
  touch-action: manipulation; /* no 300ms delay */
}

/* Inputs: 16px minimum to prevent iOS zoom on focus */
input,
textarea,
select {
  font-size: 16px !important;
}

/* Prevent horizontal overflow on every page */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* iOS safe area support (notch / home bar) */
.nav {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ── Mobile Hamburger Nav ── */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
}

.nav__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.25s var(--ease-smooth);
  transform-origin: center;
}

.nav__hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav__hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.nav__drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(13, 15, 18, 0.97);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-4) var(--space-6) var(--space-6);
  z-index: calc(var(--z-overlay) - 1);
  flex-direction: column;
  gap: var(--space-2);
  transform: translateY(-8px);
  opacity: 0;
  transition:
    opacity 0.2s var(--ease-smooth),
    transform 0.2s var(--ease-smooth);
}

@supports (backdrop-filter: blur(16px)) {
  .nav__drawer {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

.nav__drawer.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.nav__drawer-link {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
}

.nav__drawer-link:hover,
.nav__drawer-link:active {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.nav__drawer-link--active {
  color: var(--accent-purple);
}

.nav__drawer-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}

/* ── Tablet: ≤ 1024px ── */
@media (max-width: 1024px) {
  :root {
    --nav-height: 60px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mobile: ≤ 768px ── */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
    --space-20: 3rem;
    --space-24: 3.5rem;
    --space-16: 3rem;
  }

  /* Layout */
  .container {
    padding: 0 var(--space-4);
  }
  .section {
    padding: var(--space-10) 0;
  }
  .grid-3,
  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  /* Nav: hide desktop links, show hamburger */
  .nav__links {
    display: none;
  }
  .nav__hamburger {
    display: flex;
  }

  /* Typography */
  h1 {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }
  h2 {
    font-size: clamp(1.4rem, 6vw, 2rem);
  }
  h3 {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
  }

  /* Buttons — full width on small screens where needed */
  .btn--primary {
    padding: 14px var(--space-6);
    font-size: var(--text-base);
  }
  .btn--lg {
    padding: 16px var(--space-8);
    font-size: var(--text-lg);
  }

  /* Cards */
  .card {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
  }
  .modal {
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    margin: var(--space-4);
  }

  /* Tables: horizontal scroll */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Option cards: bigger tap area */
  .option-card {
    padding: var(--space-4) var(--space-4);
    border-radius: var(--radius-lg);
    min-height: 64px;
  }

  /* Toggle: bigger track */
  .toggle__track {
    width: 52px;
    height: 30px;
  }
  .toggle__thumb {
    width: 22px;
    height: 22px;
    top: 4px;
    left: 4px;
  }
  .toggle__input:checked + .toggle__track .toggle__thumb {
    transform: translateX(22px);
  }

  /* Score bars: more readable */
  .score-bar__label {
    width: 90px;
    font-size: 11px;
  }
  .score-bar__track {
    height: 6px;
  }

  /* Stats */
  .stat-card {
    padding: var(--space-4);
  }
  .stat-card__value {
    font-size: var(--text-2xl);
  }

  /* Modals full-width bottom sheet feel */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: var(--space-8) var(--space-6);
    padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
  }

  /* Form inputs */
  .form-input,
  .form-textarea,
  .form-select {
    padding: 14px var(--space-4);
    border-radius: var(--radius-md);
  }
}

/* ── Mobile Small: ≤ 480px ── */
@media (max-width: 480px) {
  :root {
    --nav-height: 52px;
  }

  .container {
    padding: 0 var(--space-4);
  }
  .section {
    padding: var(--space-8) 0;
  }

  /* Nav logo smaller */
  .nav__logo {
    font-size: var(--text-lg);
  }

  /* Buttons full width in certain contexts */
  .btn--lg {
    width: 100%;
    padding: 16px var(--space-6);
    font-size: var(--text-base);
  }

  /* Cards tighter */
  .card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  /* Badges smaller */
  .badge {
    font-size: 10px;
    padding: 2px var(--space-2);
  }

  /* Score bar labels truncate */
  .score-bar__label {
    font-size: 10px;
    width: 78px;
  }

  /* Option cards: full width, clear tap feel */
  .option-card {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
    min-height: 60px;
  }

  .option-card__icon {
    font-size: 1.3rem;
  }
  .option-card__label {
    font-size: var(--text-sm);
  }

  /* Reduce blur on low-end Android (performance) */
  .card,
  .option-card,
  .contender-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-elevated);
  }

  /* Stat grid: 2 col */
  .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Ranking grid single col */
  .analytics-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Extra Small: ≤ 360px (budget Androids) ── */
@media (max-width: 360px) {
  :root {
    --text-base: 0.9375rem; /* 15px */
    --nav-height: 50px;
  }
  .container {
    padding: 0 var(--space-3);
  }
  .hero__title {
    font-size: 1.6rem;
  }
  .btn--lg {
    font-size: 0.9375rem;
  }
  .option-card__label {
    font-size: 0.875rem;
  }
}

/* ── Reduce motion (accessibility) ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print ── */
@media print {
  .nav,
  .btn,
  .orb,
  .nav__hamburger,
  .nav__drawer {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card {
    border: 1px solid #ddd;
    box-shadow: none;
    background: #fff;
  }
}
