/* Sophie pre-screening logic tour
   Linear/Inter aesthetic, light + dark, no em dashes in copy. */

:root {
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-phone: #efeae2;
  --bg-bubble-sophie: #ffffff;
  --bg-bubble-candidate: #d9fdd3;
  --bg-bubble-system: #fff3cd;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --border: #e5e7eb;
  --border-soft: #f3f4f6;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --green: #25d366;
  --whatsapp-header: #128c7e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

[data-theme='dark'] {
  --bg: #0b0d10;
  --bg-card: #15181d;
  --bg-phone: #0e1418;
  --bg-bubble-sophie: #1f2937;
  --bg-bubble-candidate: #054640;
  --bg-bubble-system: #2a2410;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;
  --border: #1f2329;
  --border-soft: #15181d;
  --accent: #60a5fa;
  --accent-strong: #93c5fd;
  --green: #25d366;
  --whatsapp-header: #075e54;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Welcome screen */
.welcome {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
  z-index: 100;
}
.welcome.hide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.welcome-card {
  max-width: 640px;
  text-align: center;
}
.welcome-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.welcome-title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--text);
}
.welcome-title .accent-num {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme='dark'] .welcome-title .accent-num {
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.welcome-lead {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.55;
}
.welcome-lang-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
}
.welcome-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.lang-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms, background 120ms, box-shadow 160ms, border-color 120ms;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.lang-btn:hover {
  transform: translateY(-2px);
  background: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.15);
}
.lang-flag { font-size: 20px; }
.floating-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 110;
}
@media (max-width: 600px) {
  .welcome-title { font-size: 40px; }
  .welcome-lead { font-size: 16px; }
  .welcome-buttons { flex-direction: column; }
  .lang-btn { justify-content: center; }
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

/* Top bar */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.tagline { font-size: 13px; color: var(--text-muted); }
.theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
}
.theme-toggle:hover { background: var(--border-soft); }
[data-theme='light'] .theme-icon-dark { display: none; }
[data-theme='dark'] .theme-icon-light { display: none; }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 120px;
}

/* Hero */
.hero { margin-bottom: 24px; }
.hero h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.hero p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 15px;
}
.progress {
  height: 4px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 200ms ease;
}
.progress-text {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Scene grid */
.scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .scene { grid-template-columns: 1fr; }
}

/* Phone / chat */
.chat-pane {
  display: flex;
  justify-content: center;
}
.phone {
  width: 100%;
  max-width: 420px;
  background: var(--bg-phone);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 460px;
}
.phone-bar {
  background: var(--whatsapp-header);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.phone-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.phone-name { font-weight: 600; font-size: 15px; }
.phone-status { font-size: 11px; opacity: 0.85; }
.chat {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 540px;
}
.bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: bubble-in 200ms ease-out;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bubble.sophie {
  align-self: flex-start;
  background: var(--bg-bubble-sophie);
  border-top-left-radius: 2px;
  color: var(--text);
}
.bubble.candidate {
  align-self: flex-end;
  background: var(--bg-bubble-candidate);
  border-top-right-radius: 2px;
  color: var(--text);
}
.bubble .meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* Voice note bubble */
.bubble.voice { padding: 10px 12px; min-width: 260px; }
.voice-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.voice-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--whatsapp-header);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}
.voice-wave {
  flex: 1;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: monospace;
}
.voice-duration {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.voice-transcript {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

/* PDF / file bubble */
.bubble.pdf { padding: 10px 12px; min-width: 240px; }
.pdf-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pdf-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.pdf-info { display: flex; flex-direction: column; }
.pdf-name { font-weight: 600; font-size: 14px; color: var(--text); }
.pdf-size { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.phone-input {
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-soft);
  background: var(--bg-card);
}

/* Narrative pane */
.narrative-pane { padding-top: 0; }
.narrative-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
[data-theme='dark'] .badge { background: rgba(96, 165, 250, 0.12); }
.narrative-card h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  line-height: 1.25;
}
.narrative-card p { margin: 0 0 16px; color: var(--text); }
.narrative-card ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.narrative-card ul li {
  position: relative;
  padding: 8px 0 8px 22px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border-soft);
}
.narrative-card ul li:last-child { border-bottom: none; }
.narrative-card ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Nav — floating, always visible, never requires scroll */
.scene-nav {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 120ms, background 120ms, box-shadow 120ms;
  box-shadow: var(--shadow-md);
}
.nav-btn:hover { background: var(--border-soft); transform: translateY(-1px); }
.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}
.nav-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
  padding: 14px 26px;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}
.nav-btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.4);
}
[data-theme='dark'] .nav-btn.primary { box-shadow: 0 8px 24px rgba(96, 165, 250, 0.4); }
[data-theme='dark'] .nav-btn.primary:hover { box-shadow: 0 12px 28px rgba(96, 165, 250, 0.5); }
@media (max-width: 600px) {
  .scene-nav { bottom: 16px; right: 16px; left: 16px; justify-content: space-between; }
}

/* End CTA */
.cta {
  margin-top: 40px;
  padding: 48px 32px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cta h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.cta p { margin: 0 0 24px; color: var(--text-muted); font-size: 16px; }
.cta-button {
  display: inline-block;
  background: var(--accent);
  color: white !important;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: background 120ms;
}
.cta-button:hover { background: var(--accent-strong); text-decoration: none; }

/* Footer */
.footer {
  max-width: 1200px;
  margin: 64px auto 0;
  padding: 24px 24px 96px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}
@media (max-width: 600px) {
  .footer { flex-direction: column; gap: 8px; padding-bottom: 120px; }
}
