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

:root {
  --burnout-color: #e8845c;
  --burnout-dim: rgba(232, 132, 92, 0.12);
  --burnout-glow: rgba(232, 132, 92, 0.25);
  --recovery-color: #6db88a;
  --recovery-dim: rgba(109, 184, 138, 0.12);
  --bg: #141418;
  --surface: #1c1c22;
  --surface-2: #242430;
  --text: #dcdce4;
  --text-muted: #a0a0b0;
  --text-faint: #6e6e80;
  --border: #2a2a38;
  --radius: 12px;
  --focus-ring: 0 0 0 2px var(--burnout-color);
}

::selection {
  background: var(--burnout-color);
  color: var(--bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

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

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

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

/* Screens */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.35s ease-out; }

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

/* Hero / Landing */
.hero {
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.highlight {
  color: var(--burnout-color);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 440px;
  margin-bottom: 36px;
  line-height: 1.7;
}

/* Battery Icon */
.battery-icon {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
}

.battery-body {
  width: 100px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 5px;
  padding: 4px;
  display: flex;
  align-items: center;
}

.battery-cap {
  width: 6px;
  height: 18px;
  background: var(--border);
  border-radius: 0 3px 3px 0;
}

.battery-fill {
  width: 100%;
  height: 100%;
  display: flex;
  gap: 3px;
}

.battery-segment {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  opacity: 0;
}

/* Segments appear left to right, then drain right to left */
.seg-1 { background: var(--burnout-color); animation: segAppear 0.6s ease-out 0.5s forwards, segFlicker 2.5s ease-in-out 7s infinite; }
.seg-2 { background: var(--burnout-color); animation: segAppear 0.6s ease-out 1.0s forwards, segDrain 1s ease-in-out 5.5s forwards; }
.seg-3 { background: var(--burnout-color); animation: segAppear 0.6s ease-out 1.5s forwards, segDrain 1s ease-in-out 4.2s forwards; }
.seg-4 { background: var(--recovery-color); animation: segAppear 0.6s ease-out 2.0s forwards, segDrain 1s ease-in-out 3.0s forwards; }

@keyframes segAppear {
  from { opacity: 0; transform: scaleX(0.3); }
  to { opacity: 1; transform: scaleX(1); }
}

@keyframes segDrain {
  0% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0.06; transform: scaleX(0.6); }
}

@keyframes segFlicker {
  0%, 100% { opacity: 1; background: var(--burnout-color); }
  30% { opacity: 0.25; background: #c0503a; }
  60% { opacity: 0.7; background: var(--burnout-color); }
  80% { opacity: 0.35; background: #c0503a; }
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 28px;
  margin-bottom: 36px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  line-height: 1.4;
  max-width: 110px;
  text-align: center;
}

/* Social Proof */
.social-proof {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 20px;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.social-proof.visible {
  opacity: 1;
}

.social-proof .proof-count {
  color: var(--text-muted);
  font-weight: 600;
}

.trust-line {
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.3px;
  margin-bottom: 20px;
}

.hero-note {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* Buttons */
.btn-primary {
  background: var(--burnout-color);
  color: var(--bg);
  border: none;
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.85;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 14px 28px;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-secondary:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text-faint);
}

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

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--burnout-color);
  border-radius: 2px;
  transition: width 0.4s ease-out;
  width: 0%;
}

.progress-text {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 6px;
}

/* Question Card */
.question-card {
  padding: 28px 0;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s ease-out;
}

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

.question-card h2 {
  font-size: 1.15rem;
  font-weight: 500;
  min-height: 3.5em;
  margin-bottom: 24px;
  line-height: 1.6;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  min-height: 44px;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  font-family: inherit;
}

.option:hover {
  border-color: var(--text-faint);
  background: var(--surface-2);
}

.option.selected {
  border-color: var(--burnout-color);
  background: var(--burnout-dim);
  animation: optionPulse 0.2s ease-out;
}

@keyframes optionPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

/* Nav Buttons */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* Loading Screen */
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.loading-icon {
  width: 60px;
  height: 80px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.loading-flame {
  width: 30px;
  height: 50px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: linear-gradient(to top, var(--burnout-color), rgba(232, 132, 92, 0.05));
  animation: loadingFlicker 1.5s ease-in-out infinite;
}

@keyframes loadingFlicker {
  0%, 100% { height: 50px; opacity: 0.4; }
  50% { height: 35px; opacity: 0.8; }
}

.loading-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  animation: loadingFade 1.5s ease-in-out infinite;
}

@keyframes loadingFade {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Results */
#results > h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 32px;
  text-align: center;
}

/* Score Display */
.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.score-ring {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 12px;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 6;
}

.ring-fill {
  fill: none;
  stroke: var(--burnout-color);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.5s ease-out, stroke 0.8s ease-out;
}

.ring-fill.below {
  stroke: var(--recovery-color);
}

.score-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.score-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
}

.score-total {
  font-size: 0.9rem;
  color: var(--text-faint);
  font-weight: 500;
}

.score-label {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 6px 16px;
  border-radius: 20px;
}

.score-label.above {
  background: var(--burnout-dim);
  color: var(--burnout-color);
}

.score-label.below {
  background: var(--recovery-dim);
  color: var(--recovery-color);
}

/* Results Summary */
.results-summary {
  text-align: center;
  margin-bottom: 36px;
}

.results-summary p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto;
}

/* Breakdown */

.breakdown-card {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
}

.breakdown-card.stagger-in {
  animation: staggerIn 0.3s ease-out forwards;
}

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

.breakdown-card:last-child {
  border-bottom: none;
}

.breakdown-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breakdown-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.breakdown-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--burnout-color);
  transition: width 1s ease-out;
  width: 0%;
}

.breakdown-bar-fill.low {
  background: var(--recovery-color);
}

.breakdown-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-faint);
  min-width: 28px;
  text-align: right;
}

/* Interpretation */
.interpretation {
  padding: 24px 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--border);
}

.interpretation h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.interpretation p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 12px;
  line-height: 1.7;
}

.interpretation ul {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding-left: 18px;
  line-height: 1.8;
}

.interpretation li.noro-callout {
  list-style: none;
  margin-left: -18px;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--burnout-color);
  border-radius: 8px;
  color: var(--text);
}

/* Links */
.noro-link {
  color: var(--burnout-color);
  text-decoration: none;
  font-weight: 600;
}

.noro-link:hover {
  text-decoration: underline;
}

/* Info Accordions */
.info-accordions {
  margin-bottom: 24px;
}

.info-accordion {
  border-bottom: 1px solid var(--border);
}

.info-accordion:last-child {
  border-bottom: none;
}

.info-accordion summary {
  padding: 14px 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-faint);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-user-select: none;
  user-select: none;
}

.info-accordion summary::-webkit-details-marker {
  display: none;
}

.info-accordion summary::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-faint);
  border-bottom: 1.5px solid var(--text-faint);
  transform: rotate(45deg);
  transition: transform 0.2s ease-out;
  flex-shrink: 0;
  margin-left: 12px;
}

.info-accordion[open] summary::after {
  transform: rotate(-135deg);
}

.info-accordion summary:hover {
  color: var(--text-muted);
}

.accordion-body {
  padding: 0 0 16px;
}

.accordion-body p {
  font-size: 0.84rem;
  color: var(--text-faint);
  line-height: 1.7;
}

/* Results Actions */
.results-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 14px 18px;
  min-height: 44px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.btn-action:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

.action-icon {
  font-size: 0.9rem;
}

/* Email Capture */
.email-capture {
  display: none;
  text-align: center;
  margin-bottom: 28px;
}

.email-capture.visible {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

.email-prompt {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.email-form {
  display: flex;
  gap: 8px;
  max-width: 360px;
  margin: 0 auto;
}

.email-form input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
}

.email-form input::placeholder {
  color: var(--text-faint);
}

.email-form input:focus {
  outline: none;
  border-color: var(--burnout-color);
}

.btn-sm {
  padding: 14px 20px;
  min-height: 44px;
  font-size: 0.85rem;
}

.email-note {
  display: none;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.email-note.visible {
  display: block;
}

/* Share */
.share-section {
  text-align: center;
  padding: 20px 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--border);
}

.share-prompt {
  font-size: 0.84rem;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.share-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-share {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 14px 16px;
  min-height: 44px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.btn-share:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

.share-copied {
  font-size: 0.78rem;
  color: var(--recovery-color);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s;
}

.share-copied.visible {
  opacity: 1;
}

/* Print Summary */
.print-summary {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  .print-summary,
  .print-summary * {
    visibility: visible;
  }

  .print-summary {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 40px;
    background: white;
    color: #1a1a1a;
    font-size: 11pt;
    line-height: 1.6;
  }

  .print-summary h1 {
    font-size: 16pt;
    margin-bottom: 4px;
    color: #1a1a1a;
  }

  .print-date {
    font-size: 9pt;
    color: #666;
    margin-bottom: 24px;
  }

  .print-summary table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 10pt;
  }

  .print-summary th,
  .print-summary td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
  }

  .print-summary th {
    font-weight: 600;
    color: #444;
    font-size: 9pt;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .print-highlight {
    font-weight: 600;
    margin: 12px 0;
    padding: 10px 14px;
    background: #fff5f0;
    border-left: 3px solid #e8845c;
    font-size: 10pt;
  }

  .print-summary h2 {
    font-size: 13pt;
    margin: 24px 0 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
  }

  .print-item {
    margin-bottom: 8px;
    font-size: 10pt;
  }

  .print-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #ccc;
    font-size: 8.5pt;
    color: #888;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .stat-value { font-size: 1.1rem; }
  .stat-label { font-size: 0.68rem; }
  .question-card { padding: 20px 0; }
  .question-card h2 { min-height: 3.2em; }
  .container { padding: 20px 16px; }
  .results-actions { flex-direction: column; align-items: stretch; }
  .email-form { flex-direction: column; }
  .nav-buttons { flex-direction: column; }
}

@media (max-width: 360px) {
  .hero h1 { font-size: 1.35rem; }
  .container { padding: 16px 12px; }
  .hero-stats { gap: 12px; }
  .stat-value { font-size: 1rem; }
}
