/* ELC #39 — AI Adoption Level Wizard
   Design: Navigara brand kit (off-white canvas, Geist, monochrome with soft data-viz). */

:root {
  /* ── Navigara tokens ── */
  --bg-primary:        #FBFAF8;
  --bg-surface:        #FFFFFF;
  --bg-meta:           #FAFAF7;
  --bg-card-hover:     #F4F2EE;

  --text-primary:      #0E1216;
  --text-secondary:    #5C6166;
  --text-muted:        #8E9398;
  --text-on-dark:      #FBFAF8;

  --border-subtle:     #E4E4E1;
  --border-strong:     #C1C4C8;

  --font-sans:         'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono:         'Geist Mono', ui-monospace, Menlo, monospace;

  --radius-card:       8px;
  --radius-card-lg:    16px;
  --radius-pill:       9999px;

  --btn-primary-bg:    #0E1216;
  --btn-primary-text:  #FBFAF8;
  --btn-primary-hover: #1A1F24;
  --btn-secondary-bg:  #FBFAF8;
  --btn-secondary-border: #C1C4C8;
  --btn-secondary-hover: #F0EFEC;

  --page-pad:          clamp(20px, 5vw, 64px);
  --transition-base:   150ms ease;

  /* ── Level palette (soft data-viz, lives only inside cards/chart) ── */
  --lvl-0:  #C1C4C8;   /* neutral grey */
  --lvl-1:  #9BAEC9;   /* soft slate-blue */
  --lvl-2:  #C7AE85;   /* warm sand */
  --lvl-3:  #87B5D5;   /* sky blue */
  --lvl-4:  #B7A2D9;   /* soft lavender */
  --lvl-5:  #87C7AA;   /* sage green */
}

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

html, body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'cv11';
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 17px;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover, a:focus { text-decoration-thickness: 2px; }

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

em { font-style: italic; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 248, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
}
.nav .container {
  display: flex; align-items: center; justify-content: center;
  max-width: 1280px; margin: 0 auto;
  padding: 0 var(--page-pad);
}
.nav-logo-elc { height: 22px; display: block; }

/* ── Layout ── */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px var(--page-pad) 96px;
}

/* ── Hero ── */
.hero { padding: 24px 0 28px; }
.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.hero h1 em { font-style: italic; font-weight: 700; }
.hero .lede {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 540px;
}

/* ── Progress dots ── */
.progress {
  display: flex; gap: 6px; justify-content: flex-start;
  margin: 28px 0 24px;
}
.progress-dot {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  transition: background var(--transition-base);
  max-width: 60px;
}
.progress-dot.done { background: var(--text-primary); }
.progress-dot.active { background: var(--text-primary); }

/* ── Question ── */
.question { display: none; }
.question.active {
  display: block;
  animation: fade 0.2s ease;
}
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.question .q-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.question .q-title {
  font-family: var(--font-sans);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 6px;
}
.question .q-title em { font-style: italic; }
.question .q-sub {
  color: var(--text-secondary);
  margin-bottom: 22px;
  font-size: 16px;
}

/* ── Option cards ── */
.options {
  display: flex; flex-direction: column; gap: 8px;
}
.opt {
  display: flex; align-items: stretch;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  text-align: left;
  color: var(--text-primary);
  transition: background var(--transition-base), border-color var(--transition-base), transform 0.1s;
  min-height: 64px;
}
.opt:active { transform: scale(0.99); }
.opt:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }
.opt.selected { border-color: var(--text-primary); background: var(--bg-surface); }
.opt.selected .opt-num { color: var(--text-primary); }

.opt-num {
  flex: 0 0 52px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  display: flex; align-items: center;
  margin-right: 6px;
  color: var(--text-secondary);
}
.opt-text {
  flex: 1;
  font-size: 16px;
  line-height: 1.4;
  align-self: center;
  color: var(--text-primary);
}

/* ── Back / Skip nav ── */
.q-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px;
  min-height: 32px;
}
.q-nav button {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: transparent;
  transition: color var(--transition-base), text-decoration-color var(--transition-base);
}
.q-nav button:hover { color: var(--text-primary); text-decoration-color: var(--text-primary); }
.q-nav button:disabled { opacity: 0.35; cursor: default; }

/* ── Result ── */
.result { display: none; }
.result.active { display: block; animation: fade 0.25s ease; }
.result-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.result-headline {
  font-family: var(--font-sans);
  font-size: clamp(48px, 9vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1;
}
.result-headline .level-big { font-style: italic; }
.result-sub {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 28px;
  max-width: 540px;
}

.dim-bars {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: 20px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}
.dim-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.dim-row:last-child { border-bottom: none; }
.dim-row.is-floor { margin: 0 -20px; padding: 12px 20px; background: var(--bg-meta); }
.dim-label {
  flex: 0 0 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dim-meter {
  flex: 1;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.dim-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.dim-fill.lvl-0 { background: var(--lvl-0); }
.dim-fill.lvl-1 { background: var(--lvl-1); }
.dim-fill.lvl-2 { background: var(--lvl-2); }
.dim-fill.lvl-3 { background: var(--lvl-3); }
.dim-fill.lvl-4 { background: var(--lvl-4); }
.dim-fill.lvl-5 { background: var(--lvl-5); }
.dim-value {
  flex: 0 0 32px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}
.dim-floor-mark {
  flex: 0 0 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
}

.next-move {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin-bottom: 28px;
}
.next-move-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.next-move-text {
  font-size: 17px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ── Email-receipt CTA (inside result) ── */
.email-cta {
  margin: 0 0 28px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
}
.email-cta .cta-headline {
  font-size: clamp(22px, 3.5vw, 28px);
  margin-bottom: 6px;
}
.email-cta .cta-sub {
  font-size: 15px;
  margin-bottom: 16px;
}
.email-form {
  display: flex; gap: 8px;
  flex-wrap: wrap;
}
.email-form input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 12px 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  transition: border-color var(--transition-base);
  -webkit-appearance: none;
}
.email-form input[type="email"]::placeholder {
  color: var(--text-muted);
}
.email-form input[type="email"]:focus {
  outline: none;
  border-color: var(--text-primary);
}
.email-form .btn-primary {
  flex: 0 0 auto;
}
.email-form .btn-primary:disabled {
  opacity: 0.5; cursor: not-allowed;
}
.email-error {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.email-confirm {
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
}
.email-confirm strong { font-weight: 600; }

.result-actions {
  display: flex; gap: 12px;
  margin-bottom: 40px;
}
.btn-secondary {
  flex: 1;
  font-family: var(--font-sans);
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition-base);
}
.btn-secondary:hover { background: var(--btn-secondary-hover); }

/* ── Chart section ── */
.chart-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 40px;
  margin-top: 8px;
}
.chart-header {
  font-family: var(--font-sans);
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.chart-header em { font-style: italic; }
.chart-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 22px;
}
.chart-meta .live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-primary);
  margin-right: 8px;
  vertical-align: 1px;
  animation: pulse 1.6s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.2; }
}

.chart {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 0;
  height: 260px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}
.bar-col {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  height: 100%;
  position: relative;
}
.bar-count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  min-height: 16px;
  transition: opacity 0.3s;
}
.bar-wrap {
  flex: 1;
  width: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  max-width: 72px;
}
.bar {
  width: 100%;
  background: var(--lvl-0);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-height: 2px;
}
.bar-col[data-level="0"] .bar { background: var(--lvl-0); }
.bar-col[data-level="1"] .bar { background: var(--lvl-1); }
.bar-col[data-level="2"] .bar { background: var(--lvl-2); }
.bar-col[data-level="3"] .bar { background: var(--lvl-3); }
.bar-col[data-level="4"] .bar { background: var(--lvl-4); }
.bar-col[data-level="5"] .bar { background: var(--lvl-5); }
.bar-col.is-you .bar { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.bar-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 10px;
  letter-spacing: 0.02em;
}
.bar-col.is-you .bar-label { color: var(--text-primary); font-weight: 600; }

/* ── CTA ── */
.cta {
  margin-top: 48px;
  padding: 32px 0 0;
  border-top: 1px solid var(--border-subtle);
}
.cta-headline {
  font-family: var(--font-sans);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 10px;
}
.cta-headline em { font-style: italic; }
.cta-sub {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 540px;
}
.btn-primary {
  display: inline-flex; align-items: center;
  gap: 8px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background var(--transition-base);
}
.btn-primary:hover {
  background: var(--btn-primary-hover);
  color: var(--btn-primary-text);
}
.btn-arrow { font-size: 14px; transition: transform var(--transition-base); }
.btn-primary:hover .btn-arrow { transform: translateX(2px); }

/* ── Toast ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 80px);
  background: var(--text-primary);
  color: var(--text-on-dark);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  z-index: 200;
  opacity: 0;
  transition: opacity var(--transition-base), transform var(--transition-base);
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Footer ── */
.footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* ── Tablet + ── */
@media (min-width: 600px) {
  .chart { height: 320px; }
  .opt { padding: 16px 20px; }
  .opt-text { font-size: 17px; }
  .result-actions { gap: 14px; }
}

/* ── Projector view (room.html) ── */
.room-mode .wrap { max-width: 1400px; padding: 32px var(--page-pad); }
.room-mode .chart { height: min(70vh, 600px); border-bottom: 1px solid var(--border-subtle); gap: 28px; }
.room-mode .bar-wrap { max-width: 160px; }
.room-mode .chart-header { font-size: clamp(36px, 5vw, 56px); margin-bottom: 10px; }
.room-mode .chart-meta { font-size: 14px; margin-bottom: 36px; }
.room-mode .bar-label { font-size: 18px; margin-top: 16px; }
.room-mode .bar-count { font-size: 22px; margin-bottom: 12px; min-height: 28px; }
.room-mode .chart-section { border-top: none; padding-top: 0; }

/* ── Admin view ── */
.admin-mode .wrap { max-width: 800px; }
.admin-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 16px;
}
.admin-section h2 {
  font-family: var(--font-sans);
  font-size: 18px; color: var(--text-primary);
  margin-bottom: 14px; font-weight: 700;
  letter-spacing: -0.01em;
}
.admin-btn {
  font-family: var(--font-sans);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: background var(--transition-base);
}
.admin-btn:hover { background: var(--btn-secondary-hover); }
.admin-btn.danger { border-color: var(--text-primary); color: var(--text-primary); }
.admin-btn.danger:hover { background: var(--text-primary); color: var(--text-on-dark); }

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