/* ============================================
   ARCHETYPE - Intimate Dynamics Assessment v3.0
   Premium dark theme with refined interactions
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */

:root {
  /* Spacing scale (8px base) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Typography scale */
  --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: 2rem;      /* 32px */
  --text-4xl: 2.5rem;    /* 40px */

  /* Brand colors */
  --gold: #c9a959;
  --gold-light: #f4e4ba;
  --gold-dark: #a88932;
  
  /* Background colors */
  --bg-dark: #0a0a0f;
  --bg-mid: #1a1a2e;
  --bg-accent: #16213e;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.04);
  
  /* Text colors */
  --text-primary: #e8e6e3;
  --text-secondary: #c5c3c0;
  --text-muted: #9a9a9a;
  --text-dim: #6b6b6b;
  
  /* Border colors */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-gold: rgba(201, 169, 89, 0.2);
  --border-gold-hover: rgba(201, 169, 89, 0.5);
  
  /* Category colors */
  --cat-power: #c9a959;
  --cat-roleplay: #a58dc9;
  --cat-primal: #c97a59;
  --cat-bondage: #59a5c9;
  --cat-sensation: #c95959;
  --cat-psychological: #7ac959;
  --cat-voyeuristic: #c959a5;
  --cat-general: #8b8b8b;
  --cat-relationship: #59c9a5;
  --cat-financial: #c9c959;

  /* Timing */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(201, 169, 89, 0.3);

  /* Focus ring */
  --focus-ring: 0 0 0 2px var(--bg-dark), 0 0 0 4px var(--gold);
}

/* ============================================
   RESET & BASE
   ============================================ */

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

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(145deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-accent) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

button:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(16px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(24px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateX(-16px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

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

@keyframes scaleIn {
  from { 
    opacity: 0; 
    transform: scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: scale(1); 
  }
}

/* ============================================
   PAGE STRUCTURE
   ============================================ */

.page { 
  display: none; 
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-2xl) var(--space-lg);
  opacity: 0;
}

.page.active { 
  display: flex; 
  align-items: center; 
  justify-content: center;
  animation: fadeIn 0.5s var(--transition-slow) forwards;
}

/* ============================================
   INTRO PAGE
   ============================================ */

.intro-container { 
  max-width: 800px; 
  width: 100%;
  margin: 0 auto; 
  text-align: center;
}

.title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.25rem, 6vw, var(--text-4xl));
  font-weight: 400;
  letter-spacing: 0.3em;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease forwards;
}

.subtitle { 
  font-size: var(--text-xl); 
  font-weight: 300; 
  letter-spacing: 0.2em; 
  color: var(--text-muted); 
  margin-bottom: var(--space-3xl);
  animation: fadeInUp 0.8s ease 0.1s forwards;
  opacity: 0;
}

.intro-text { 
  font-size: var(--text-lg); 
  line-height: 1.9; 
  color: var(--text-secondary); 
  max-width: 600px; 
  margin: 0 auto var(--space-xl); 
  font-weight: 300;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

.features { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
  gap: var(--space-lg); 
  margin: var(--space-2xl) 0;
  animation: fadeInUp 0.8s ease 0.3s forwards;
  opacity: 0;
}

.feature { 
  background: var(--bg-card); 
  border: 1px solid var(--border-gold); 
  border-radius: 4px; 
  padding: var(--space-lg); 
  transition: all var(--transition-base);
}

.feature:hover { 
  border-color: var(--border-gold-hover); 
  background: var(--bg-card-hover); 
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon { 
  font-size: var(--text-2xl); 
  margin-bottom: var(--space-md); 
  color: var(--gold);
}

.feature-title { 
  font-family: 'Cinzel', serif; 
  font-size: var(--text-base); 
  letter-spacing: 0.1em; 
  color: var(--gold); 
  margin-bottom: var(--space-sm);
}

.feature-desc { 
  font-size: var(--text-sm); 
  color: var(--text-muted); 
  line-height: 1.6;
}

.start-btn {
  font-family: 'Cinzel', serif;
  font-size: var(--text-lg);
  letter-spacing: 0.25em;
  padding: var(--space-lg) var(--space-3xl);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-dark);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-top: var(--space-xl);
  text-transform: uppercase;
  font-weight: 500;
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
}

.start-btn:hover { 
  transform: scale(1.03); 
  box-shadow: var(--shadow-gold);
}

.start-btn:active {
  transform: scale(0.98);
}

.disclaimer { 
  margin-top: var(--space-2xl); 
  padding: var(--space-lg); 
  background: rgba(201, 169, 89, 0.05); 
  border-left: 2px solid var(--gold); 
  text-align: left; 
  font-size: var(--text-sm); 
  color: var(--text-muted); 
  line-height: 1.8;
  animation: fadeInUp 0.8s ease 0.5s forwards;
  opacity: 0;
}

.disclaimer strong { 
  color: var(--gold);
}

.disclaimer p + p {
  margin-top: var(--space-md);
}

/* ============================================
   QUIZ PAGE
   ============================================ */

.quiz-container { 
  max-width: 800px; 
  width: 100%; 
  margin: 0 auto;
}

.progress-section { 
  margin-bottom: var(--space-xl);
}

.progress-bar { 
  width: 100%; 
  height: 3px; 
  background: rgba(255, 255, 255, 0.1); 
  margin-bottom: var(--space-md); 
  overflow: hidden;
  border-radius: 2px;
}

.progress-fill { 
  height: 100%; 
  background: linear-gradient(90deg, var(--gold), var(--gold-light)); 
  transition: width var(--transition-slow);
  border-radius: 2px;
}

.progress-text { 
  display: flex; 
  justify-content: space-between; 
  font-family: 'Cinzel', serif; 
  font-size: var(--text-xs); 
  letter-spacing: 0.15em; 
  color: var(--text-dim);
}

.progress-text span:last-child { 
  color: var(--gold);
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-gold);
}

.section-icon {
  font-size: var(--text-2xl);
  color: var(--gold);
  display: block;
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xl);
  letter-spacing: 0.15em;
  color: var(--gold-light);
  display: block;
  margin-bottom: var(--space-xs);
}

.section-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.questions-container { 
  display: flex; 
  flex-direction: column; 
  gap: var(--space-lg); 
  margin-bottom: var(--space-xl);
}

/* ============================================
   QUESTION CARDS
   ============================================ */

.question-card { 
  background: var(--bg-card); 
  border: 1px solid var(--border-gold); 
  padding: var(--space-lg); 
  transition: all var(--transition-base);
  border-radius: 2px;
  animation: scaleIn 0.4s ease forwards;
}

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

.question-text { 
  font-size: var(--text-lg); 
  line-height: 1.7; 
  color: var(--text-primary); 
  margin-bottom: var(--space-lg); 
  font-weight: 400;
}

/* ============================================
   LIKERT SCALE
   ============================================ */

.answer-scale { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  gap: var(--space-md);
}

.scale-label { 
  font-size: var(--text-sm); 
  color: var(--text-dim); 
  width: 70px; 
  text-align: center;
  flex-shrink: 0;
}

.scale-label:first-child { text-align: left; }
.scale-label:last-child { text-align: right; }

.scale-options { 
  display: flex; 
  gap: var(--space-sm); 
  flex: 1; 
  justify-content: center;
}

.scale-btn {
  width: 48px; 
  height: 48px; 
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: transparent; 
  color: var(--text-muted);
  font-family: 'Cormorant Garamond', serif; 
  font-size: var(--text-base);
  cursor: pointer; 
  transition: all var(--transition-fast);
  position: relative;
}

.scale-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: transparent;
  transition: background var(--transition-fast);
}

.scale-btn:hover { 
  border-color: var(--gold); 
  color: var(--gold); 
  transform: scale(1.1);
}

.scale-btn:active {
  transform: scale(0.95);
}

.scale-btn.selected { 
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)); 
  border-color: var(--gold); 
  color: var(--bg-dark); 
  font-weight: 600;
  box-shadow: var(--shadow-gold);
}

/* ============================================
   POLARITY SLIDER
   ============================================ */

.polarity-card {
  padding: var(--space-xl);
}

.polarity-container {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.polarity-label {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.5;
}

.polarity-label.left {
  text-align: right;
}

.polarity-label.right {
  text-align: left;
}

.polarity-slider-container {
  position: relative;
  padding: var(--space-sm) 0 var(--space-2xl);
}

.polarity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, 
    var(--gold) 0%, 
    rgba(201, 169, 89, 0.3) 40%, 
    rgba(201, 169, 89, 0.2) 50%, 
    rgba(201, 169, 89, 0.3) 60%, 
    var(--gold) 100%
  );
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.polarity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: transform var(--transition-fast);
}

.polarity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.polarity-slider::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

.polarity-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-gold);
}

.polarity-ticks {
  display: flex;
  justify-content: space-between;
  position: absolute;
  width: 100%;
  top: 18px;
  pointer-events: none;
}

.polarity-ticks .tick {
  width: 2px;
  height: 10px;
  background: rgba(201, 169, 89, 0.3);
  transition: all var(--transition-fast);
}

.polarity-ticks .tick.center {
  height: 14px;
  background: var(--gold);
}

.polarity-ticks .tick.active {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.polarity-labels {
  display: flex;
  justify-content: space-between;
  position: absolute;
  width: 100%;
  top: 36px;
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ============================================
   SCENARIO QUESTIONS
   ============================================ */

.scenario-card {
  padding: var(--space-xl);
}

.scenario-prompt {
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--gold-light);
  margin-bottom: var(--space-xl);
  text-align: center;
  line-height: 1.5;
}

.scenario-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.scenario-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  font-family: 'Cormorant Garamond', serif;
  font-size: var(--text-base);
  color: var(--text-secondary);
  width: 100%;
}

.scenario-option:hover {
  border-color: var(--gold);
  background: rgba(201, 169, 89, 0.05);
  transform: translateX(4px);
}

.scenario-option.selected {
  border-color: var(--gold);
  background: rgba(201, 169, 89, 0.12);
}

.scenario-option.selected .option-marker {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-dark);
  border-color: var(--gold);
}

.option-marker {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: var(--text-sm);
  color: var(--gold);
  transition: all var(--transition-fast);
}

.option-text {
  line-height: 1.6;
  padding-top: 5px;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav-buttons { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding-top: var(--space-lg); 
  border-top: 1px solid var(--border-subtle);
  gap: var(--space-md);
}

.nav-btn {
  font-family: 'Cinzel', serif; 
  font-size: var(--text-sm); 
  letter-spacing: 0.15em;
  padding: var(--space-md) var(--space-xl); 
  background: transparent;
  border: 1px solid var(--border-gold); 
  color: var(--text-muted);
  cursor: pointer; 
  transition: all var(--transition-fast);
  border-radius: 2px;
  white-space: nowrap;
}

.nav-btn:hover:not(:disabled) { 
  border-color: var(--gold); 
  color: var(--gold);
}

.nav-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.nav-btn:disabled { 
  opacity: 0.3; 
  cursor: not-allowed;
}

.nav-btn.primary { 
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)); 
  border-color: var(--gold); 
  color: var(--bg-dark);
  font-weight: 500;
}

.nav-btn.primary:hover:not(:disabled) { 
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.nav-btn.primary:active:not(:disabled) {
  transform: translateY(0);
}

.nav-btn.secondary {
  border-color: var(--text-dim);
}

.nav-btn.secondary[hidden] {
  display: none;
}

.page-indicator { 
  font-family: 'Cinzel', serif; 
  font-size: var(--text-sm); 
  letter-spacing: 0.1em; 
  color: var(--gold);
}

/* ============================================
   LOADING PAGE
   ============================================ */

.loading-container {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.loading-icon {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-2xl);
}

.loading-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.loading-ring:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top-color: var(--gold-light);
  animation-duration: 2s;
  animation-direction: reverse;
}

.loading-ring:nth-child(3) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  border-top-color: var(--gold-dark);
  animation-duration: 1s;
}

.loading-title {
  font-family: 'Cinzel', serif;
  font-size: var(--text-2xl);
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: var(--space-md);
}

.loading-text {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  line-height: 1.6;
}

.loading-steps {
  text-align: left;
  max-width: 320px;
  margin: 0 auto;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  color: var(--text-dim);
  transition: color var(--transition-base);
}

.loading-step.active {
  color: var(--gold);
}

.loading-step.active .step-icon {
  animation: pulse 1s ease infinite;
}

.loading-step.complete {
  color: var(--gold-light);
}

.step-icon {
  font-size: var(--text-xl);
  width: 24px;
  text-align: center;
}

.step-text {
  font-size: var(--text-base);
}

/* ============================================
   RESULTS PAGE
   ============================================ */

.results-container { 
  max-width: 900px; 
  margin: 0 auto;
  width: 100%;
}

.results-header { 
  text-align: center; 
  margin-bottom: var(--space-2xl);
}

.results-title { 
  font-family: 'Cinzel', serif; 
  font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl)); 
  letter-spacing: 0.3em; 
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold)); 
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-md);
}

.results-subtitle { 
  font-size: var(--text-lg); 
  color: var(--text-muted); 
  letter-spacing: 0.15em;
}

.top-results { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
  gap: var(--space-lg); 
  margin-bottom: var(--space-2xl);
}

.top-result-card { 
  background: rgba(201, 169, 89, 0.08); 
  border: 1px solid var(--border-gold-hover); 
  padding: var(--space-xl); 
  text-align: center; 
  position: relative; 
  overflow: hidden;
  border-radius: 2px;
  animation: scaleIn 0.5s ease forwards;
}

.top-result-card:nth-child(2) { animation-delay: 0.1s; }
.top-result-card:nth-child(3) { animation-delay: 0.2s; }

.top-result-card::before { 
  content: ''; 
  position: absolute; 
  top: 0; 
  left: 0; 
  right: 0; 
  height: 3px; 
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.top-rank { 
  font-family: 'Cinzel', serif; 
  font-size: var(--text-xs); 
  letter-spacing: 0.3em; 
  color: var(--gold); 
  margin-bottom: var(--space-sm);
}

.top-name { 
  font-family: 'Cinzel', serif; 
  font-size: var(--text-xl); 
  letter-spacing: 0.1em; 
  color: var(--text-primary); 
  margin-bottom: var(--space-xs);
}

.top-percent { 
  font-size: var(--text-4xl); 
  font-weight: 300; 
  color: var(--gold);
  line-height: 1.2;
}

.top-category {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-sm);
}

/* ============================================
   AI REPORT SECTION
   ============================================ */

.report-section {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-gold);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
  line-height: 1.9;
  border-radius: 2px;
}

.report-section h1 {
  font-family: 'Cinzel', serif;
  font-size: var(--text-2xl);
  letter-spacing: 0.2em;
  color: var(--gold);
  text-align: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-gold);
}

.report-section h2 {
  font-family: 'Cinzel', serif;
  font-size: var(--text-xl);
  letter-spacing: 0.12em;
  color: var(--gold-light);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(201, 169, 89, 0.2);
}

.report-section h3 {
  font-family: 'Cinzel', serif;
  font-size: var(--text-lg);
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.report-section p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-size: var(--text-base);
}

.report-section ul, 
.report-section ol {
  color: var(--text-secondary);
  margin-left: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.report-section li {
  margin-bottom: var(--space-sm);
  font-size: var(--text-base);
  line-height: 1.7;
}

.report-section strong {
  color: var(--gold);
  font-weight: 500;
}

.report-section em {
  color: var(--text-primary);
  font-style: italic;
}

.report-section table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: var(--text-sm);
}

.report-section th {
  background: rgba(201, 169, 89, 0.15);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: var(--space-md);
  text-align: left;
  border: 1px solid rgba(201, 169, 89, 0.2);
}

.report-section td {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.report-section tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.report-section hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: var(--space-2xl) 0;
}

.report-section blockquote {
  border-left: 3px solid var(--gold);
  padding-left: var(--space-lg);
  margin: var(--space-lg) 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-top: var(--space-xl);
}

.retake-btn,
.print-btn { 
  font-family: 'Cinzel', serif; 
  font-size: var(--text-sm); 
  letter-spacing: 0.15em; 
  padding: var(--space-md) var(--space-xl); 
  background: transparent; 
  border: 1px solid var(--gold); 
  color: var(--gold); 
  cursor: pointer; 
  transition: all var(--transition-fast);
  border-radius: 2px;
}

.retake-btn:hover,
.print-btn:hover { 
  background: rgba(201, 169, 89, 0.1);
}

.retake-btn:active,
.print-btn:active {
  transform: scale(0.98);
}

.print-btn {
  border-color: var(--text-dim);
  color: var(--text-muted);
}

.print-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: transparent;
}

/* ============================================
   ERROR PAGE
   ============================================ */

.error-container {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.error-icon {
  font-size: var(--text-4xl);
  color: #c95959;
  margin-bottom: var(--space-xl);
}

.error-title {
  font-family: 'Cinzel', serif;
  font-size: var(--text-2xl);
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.error-text {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.retry-btn,
.fallback-btn {
  font-family: 'Cinzel', serif;
  font-size: var(--text-sm);
  letter-spacing: 0.12em;
  padding: var(--space-md) var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: 2px;
}

.retry-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  color: var(--bg-dark);
}

.retry-btn:hover {
  box-shadow: var(--shadow-gold);
}

.retry-btn:active {
  transform: scale(0.98);
}

.fallback-btn {
  background: transparent;
  border: 1px solid var(--text-dim);
  color: var(--text-muted);
}

.fallback-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  :root {
    --text-primary: #1a1a1a;
    --text-secondary: #333;
    --text-muted: #555;
    --gold: #8a6914;
  }
  
  body {
    background: white;
    color: var(--text-primary);
    font-size: 11pt;
    line-height: 1.5;
  }
  
  .page { 
    display: none !important;
    padding: 0;
    min-height: auto;
  }
  
  #results-page { 
    display: block !important;
    animation: none;
    opacity: 1;
  }
  
  .action-buttons,
  .top-results,
  .results-header { 
    display: none !important; 
  }
  
  .results-container {
    max-width: 100%;
  }
  
  .report-section {
    background: white;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
  }
  
  .report-section h1 {
    color: var(--gold);
    font-size: 18pt;
    border-bottom: 2px solid var(--gold);
    page-break-after: avoid;
  }
  
  .report-section h2 {
    color: var(--text-primary);
    font-size: 14pt;
    margin-top: 20pt;
    page-break-after: avoid;
  }
  
  .report-section h3 {
    color: var(--text-primary);
    font-size: 12pt;
    page-break-after: avoid;
  }
  
  .report-section p,
  .report-section li,
  .report-section td {
    color: var(--text-secondary);
    orphans: 3;
    widows: 3;
  }
  
  .report-section table {
    page-break-inside: avoid;
  }
  
  .report-section th {
    background: #f5f5f5;
    color: var(--text-primary);
  }
  
  .report-section td {
    border-color: #ddd;
  }
  
  .report-section hr {
    border-top: 1px solid #ddd;
    background: none;
  }
  
  .report-section blockquote {
    border-left-color: #999;
  }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 768px) {
  .page {
    padding: var(--space-xl) var(--space-md);
  }
  
  .polarity-container {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .polarity-label {
    text-align: center !important;
    font-size: var(--text-sm);
    order: 0;
  }
  
  .polarity-label.left {
    order: 1;
  }
  
  .polarity-slider-container {
    order: 2;
  }
  
  .polarity-label.right {
    order: 3;
  }
  
  .polarity-labels {
    font-size: 0.65rem;
  }
  
  .nav-buttons {
    gap: var(--space-sm);
  }
  
  .nav-btn {
    padding: var(--space-md) var(--space-md);
    font-size: var(--text-xs);
  }
  
  .page-indicator {
    display: none;
  }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 600px) {
  :root {
    --space-lg: 20px;
    --space-xl: 28px;
    --space-2xl: 40px;
  }
  
  .page.active { 
    align-items: flex-start; 
    padding-top: var(--space-lg);
  }
  
  .intro-container {
    padding: 0 var(--space-sm);
  }
  
  .features {
    gap: var(--space-md);
  }
  
  .feature {
    padding: var(--space-md);
  }
  
  .start-btn {
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
  }
  
  .scale-label { 
    display: none; 
  }
  
  .scale-btn { 
    width: 44px; 
    height: 44px;
  }
  
  .scale-options {
    gap: var(--space-sm);
  }
  
  .question-card { 
    padding: var(--space-md);
  }
  
  .polarity-card,
  .scenario-card {
    padding: var(--space-lg);
  }
  
  .question-text {
    font-size: var(--text-base);
    margin-bottom: var(--space-md);
  }
  
  .scenario-prompt {
    font-size: var(--text-lg);
    margin-bottom: var(--space-lg);
  }
  
  .scenario-option {
    padding: var(--space-md);
    gap: var(--space-sm);
  }
  
  .option-marker {
    width: 28px;
    height: 28px;
    font-size: var(--text-xs);
  }
  
  .option-text {
    font-size: var(--text-sm);
    padding-top: 3px;
  }
  
  .report-section {
    padding: var(--space-lg);
  }
  
  .report-section h1 {
    font-size: var(--text-xl);
    letter-spacing: 0.1em;
  }
  
  .report-section h2 {
    font-size: var(--text-lg);
  }
  
  .report-section h3 {
    font-size: var(--text-base);
  }
  
  .report-section p,
  .report-section li {
    font-size: var(--text-sm);
  }
  
  .report-section table {
    font-size: var(--text-xs);
  }
  
  .report-section th,
  .report-section td {
    padding: var(--space-sm);
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .retake-btn,
  .print-btn {
    width: 100%;
    padding: var(--space-md);
  }
  
  .error-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .retry-btn,
  .fallback-btn {
    width: 100%;
  }
  
  .top-results {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}
