/**
 * ESD LITE — DESIGN SYSTEM v1.0
 * Execution System Diagnostic
 *
 * DESIGN DIRECTION: Refined dark executive — not startup, not HR.
 * Feels like a Bloomberg terminal or a McKinsey slide in motion.
 * Fonts: DM Serif Display (headings) + DM Sans (body)
 * Colors: Deep navy base, amber accent, steel blue data
 */

/* ─────────────────────────────────────────────
   TOKENS
───────────────────────────────────────────── */
:root {
  --bg-base:       #080D14;
  --bg-surface:    #0E1520;
  --bg-elevated:   #141E2E;
  --bg-card:       #1A2540;

  --text-primary:  #F2F4F7;
  --text-secondary:#8A97AA;
  --text-muted:    #4D5E73;

  --accent-gold:   #C9962A;
  --accent-amber:  #E8B84B;
  --accent-blue:   #4A90D9;
  --accent-line:   #1E2D45;

  --zone-high:     #4A90D9;
  --zone-tension:  #E8B84B;
  --zone-risk:     #E07B39;
  --zone-stress:   #C0392B;

  --font-display:  'DM Serif Display', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;

  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     16px;

  --transition-fast: 180ms ease;
  --transition-mid:  350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 600ms cubic-bezier(0.4, 0, 0.2, 1);

  --max-content:   760px;
  --max-wide:      1100px;
}

/* ─────────────────────────────────────────────
   RESET + BASE
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
}

/* Subtle grain 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.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ─────────────────────────────────────────────
   SCREEN SYSTEM
───────────────────────────────────────────── */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  opacity: 1;
  transition: opacity var(--transition-mid);
}

.screen-hidden {
  display: none !important;
}

.screen-exit {
  opacity: 0;
  pointer-events: none;
}

.screen-enter {
  opacity: 0;
}

.screen-active {
  opacity: 1;
}

/* ─────────────────────────────────────────────
   LAYOUT
───────────────────────────────────────────── */
.container {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─────────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.display-xl {
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: var(--text-primary);
}

.display-lg {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  color: var(--text-primary);
}

.display-md {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--text-primary);
}

.body-lg {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.body-md {
  font-size: 1rem;
  color: var(--text-secondary);
}

.label-sm {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   SCREEN 1: LANDING
───────────────────────────────────────────── */
#screen-landing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

.landing-inner {
  padding: 80px 24px;
  max-width: var(--max-content);
  margin: 0 auto;
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.eyebrow-line {
  width: 32px;
  height: 1px;
  background: var(--accent-gold);
}

.landing-title {
  margin-bottom: 28px;
}

.landing-title em {
  font-style: italic;
  color: var(--accent-amber);
}

.landing-sub {
  margin-bottom: 48px;
  max-width: 580px;
}

.landing-not {
  margin-bottom: 56px;
  padding: 28px 32px;
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent-gold);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
}

.landing-not p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.landing-not ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.landing-not li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
}

.landing-not li::before {
  content: '×';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.landing-tagline {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.landing-credibility {
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--accent-line);
  max-width: 560px;
}

/* ─────────────────────────────────────────────
   SCREEN 2: CONTEXT
───────────────────────────────────────────── */
#screen-context {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.context-inner {
  max-width: 600px;
  padding: 80px 24px;
  text-align: center;
}

.context-inner h2 {
  margin-bottom: 32px;
}

.context-body {
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 40px;
}

.context-body p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
  line-height: 1.75;
}

.context-body p:last-child { margin-bottom: 0; }

.context-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
}

/* ─────────────────────────────────────────────
   SCREEN 3: ASSESSMENT
───────────────────────────────────────────── */
#screen-assessment {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.assessment-header {
  padding: 28px 24px 0;
  max-width: var(--max-content);
  margin: 0 auto;
  width: 100%;
}

.progress-container {
  margin-bottom: 8px;
}

.progress-bar {
  height: 2px;
  background: var(--accent-line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gold);
  width: 0%;
  transition: width 400ms ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.assessment-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 24px 60px;
  max-width: var(--max-content);
  margin: 0 auto;
  width: 100%;
}

#question-container {
  position: relative;
}

/* ─── Question Blocks ─── */
.question-block {
  transition: opacity var(--transition-mid), transform var(--transition-mid);
}

.question-hidden {
  display: none;
}

.question-exit {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.question-enter {
  opacity: 0;
  transform: translateY(8px);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.dim-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.q-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.question-text {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}

/* ─── Response Tiles ─── */
.response-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.response-tile {
  background: var(--bg-surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  padding: 18px 10px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 90px;
  justify-content: center;
}

.response-tile:hover {
  border-color: var(--accent-gold);
  background: var(--bg-elevated);
}

.response-tile.selected {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

.response-tile.selected .tile-label,
.response-tile.selected .tile-sub {
  color: #0E1520;
}

.tile-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.tile-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  transition: color var(--transition-fast);
}

/* ─────────────────────────────────────────────
   SCREEN 4: PROCESSING
───────────────────────────────────────────── */
#screen-processing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.processing-inner {
  text-align: center;
  padding: 40px 24px;
}

.processing-pulse {
  width: 64px;
  height: 64px;
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  margin: 0 auto 32px;
  animation: processingPulse 1.4s ease-in-out infinite;
}

@keyframes processingPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.12); opacity: 0.6; }
}

.processing-inner h2 {
  margin-bottom: 12px;
}

/* EMAIL GATE inside processing screen */
.email-gate {
  margin-top: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.email-gate h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.email-gate p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.gate-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.gate-input {
  background: var(--bg-elevated);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.gate-input::placeholder { color: var(--text-muted); }
.gate-input:focus { border-color: var(--accent-gold); }

.gate-error {
  color: var(--zone-stress);
  font-size: 0.82rem;
  margin-bottom: 12px;
  display: none;
}

.gate-privacy {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   SCREEN 5: REPORT
───────────────────────────────────────────── */
#screen-report {
  min-height: 100vh;
  padding-bottom: 120px;
}

/* ─── Report Header ─── */
.report-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--accent-line);
  padding: 24px;
}

.report-header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-brand {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.report-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

/* ─── Signature Block ─── */
#report-signature {
  padding: 80px 24px 60px;
  max-width: var(--max-content);
  margin: 0 auto;
  text-align: center;
}

.signature-eyebrow {
  margin-bottom: 24px;
}

.signature-text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.signature-archetype {
  display: inline-block;
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--accent-gold);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-amber);
}

/* ─── Score Dashboard ─── */
.score-dashboard {
  padding: 0 24px 64px;
  max-width: var(--max-wide);
  margin: 0 auto;
}

.dashboard-divider {
  height: 1px;
  background: var(--accent-line);
  margin-bottom: 48px;
}

.overall-score-block {
  text-align: center;
  margin-bottom: 48px;
}

.overall-score-ring {
  width: 120px;
  height: 120px;
  border: 3px solid var(--zone-tension);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.overall-score-number {
  font-family: var(--font-display);
  font-size: 2.8rem;
  line-height: 1;
  color: var(--text-primary);
}

.overall-score-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

.overall-score-zone {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dim-scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.dim-score-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
}

.dim-label-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.dim-score-ring {
  width: 72px;
  height: 72px;
  border: 2px solid var(--zone-tension);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.dim-score-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-primary);
}

.dim-zone-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

/* ─── Primary Friction Signal ─── */
.friction-signal-section {
  padding: 0 24px 64px;
  max-width: var(--max-content);
  margin: 0 auto;
}

.friction-signal-card {
  background: var(--bg-surface);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--zone-risk);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
}

.friction-signal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.friction-signal-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.friction-signal-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 16px;
  font-style: italic;
}

.friction-signal-interpretation {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─── Dimension Narratives ─── */
.narratives-section {
  padding: 0 24px 64px;
  max-width: var(--max-content);
  margin: 0 auto;
}

.narrative-block {
  margin-bottom: 40px;
}

.narrative-block:last-child { margin-bottom: 0; }

.narrative-dim-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.narrative-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ─── Recommendations ─── */
.recommendations-section {
  padding: 0 24px 64px;
  max-width: var(--max-content);
  margin: 0 auto;
}

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.rec-card {
  display: flex;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin-bottom: 16px;
}

.rec-number {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent-gold);
  opacity: 0.5;
  min-width: 28px;
  line-height: 1;
  padding-top: 2px;
}

.rec-lever {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.rec-consequence, .rec-next {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.rec-next { margin-bottom: 0; }

.rec-label {
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Archetype ─── */
.archetype-section {
  padding: 0 24px 64px;
  max-width: var(--max-content);
  margin: 0 auto;
}

.archetype-card {
  background: var(--bg-surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.archetype-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.archetype-pattern {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 24px;
}

.archetype-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 28px;
}

.archetype-indicators-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.archetype-indicators {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archetype-indicator {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}

.archetype-indicator::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent-gold);
}

/* ─── Report CTA ─── */
.report-cta-section {
  padding: 0 24px;
  max-width: var(--max-content);
  margin: 0 auto;
}

.report-cta-card {
  background: var(--bg-elevated);
  border: 1px solid var(--accent-line);
  border-top: 2px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
}

.report-cta-card h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.report-cta-card p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gold);
  color: #0E1520;
}

.btn-primary:hover {
  background: var(--accent-amber);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--accent-line);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ─────────────────────────────────────────────
   SECTION DIVIDERS
───────────────────────────────────────────── */
.section-divider {
  height: 1px;
  background: var(--accent-line);
  max-width: var(--max-content);
  margin: 0 auto 64px;
}

/* ─────────────────────────────────────────────
   STICKY REPORT CTA BAR
───────────────────────────────────────────── */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-top: 1px solid var(--accent-line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transform: translateY(100%);
  transition: transform 400ms ease;
}

.sticky-cta.visible {
  transform: translateY(0);
}

.sticky-cta p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 640px) {
  .response-tiles {
    grid-template-columns: 1fr 1fr;
  }

  .response-tile:last-child {
    grid-column: 1 / -1;
  }

  .dim-scores-grid {
    grid-template-columns: 1fr;
  }

  .rec-card {
    flex-direction: column;
    gap: 12px;
  }

  .report-header-inner {
    flex-direction: column;
    gap: 8px;
    text-align: left;
  }

  .email-gate {
    padding: 28px 24px;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .sticky-cta {
    flex-direction: column;
    text-align: center;
  }
}

/* ─────────────────────────────────────────────
   PRINT / PDF STYLES
───────────────────────────────────────────── */
@media print {
  body { background: #fff; color: #111; }
  .screen-hidden { display: none !important; }
  #screen-landing, #screen-context, #screen-assessment, #screen-processing { display: none !important; }
  #screen-report { display: block !important; }
  .sticky-cta, .report-cta-section { display: none; }
  .screen { min-height: unset; }
  :root {
    --bg-base: #fff;
    --bg-surface: #f8f8f8;
    --bg-elevated: #f0f0f0;
    --bg-card: #f4f4f4;
    --text-primary: #111;
    --text-secondary: #444;
    --text-muted: #777;
    --accent-line: #ddd;
  }
}
