/* ==========================================================================
   NowWhat | style.css
   Warm, Human, Mentor Aesthetic
   Outfit + Inter | Warm Cream Base | Reactive Ambient Background
   NO EM DASHES anywhere in content.
   ========================================================================== */

/* ── DESIGN TOKENS ── */
:root {
  /* Background & Surface */
  --cream:        #FFFBF5;
  --surface:      #FFFFFF;
  --surface-warm: #FEF3E8;

  /* Accent - warm orange */
  --accent:       #E8622A;
  --accent-hover: #D4541F;
  --accent-light: #FDF0E8;
  --accent-glow:  rgba(232, 98, 42, 0.18);

  /* Trust blue */
  --blue:         #3D6E9E;
  --blue-light:   #EBF3FB;

  /* Text */
  --text-900:  #1C1007;
  --text-700:  #4A3020;
  --text-500:  #7B5E48;
  --text-300:  #C4A882;
  --text-muted:#A08060;

  /* Borders */
  --border:       rgba(74, 48, 32, 0.12);
  --border-focus: rgba(232, 98, 42, 0.45);

  /* Shadows */
  --sh-xs: 0 1px 3px rgba(0,0,0,0.06);
  --sh-sm: 0 2px 8px rgba(0,0,0,0.08);
  --sh-md: 0 6px 20px rgba(0,0,0,0.10);
  --sh-lg: 0 12px 40px rgba(0,0,0,0.12);

  /* Radius */
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-xl:   32px;
  --r-pill: 999px;

  /* Typography */
  --font-title: 'Outfit', 'Inter', sans-serif;
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Motion */
  --ease: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --spring: 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  min-height: 100%;
  font-size: 17px;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── AMBIENT REACTIVE BACKGROUND ── */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 1.2s ease;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: blobDrift 14s ease-in-out infinite alternate;
  will-change: transform;
}

.blob-a {
  top: -15%;
  left: -10%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(232, 98, 42, 0.12), transparent 70%);
}

.blob-b {
  bottom: -10%;
  right: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(61, 110, 158, 0.10), transparent 70%);
  animation-delay: -6s;
}

@keyframes blobDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -25px) scale(1.08); }
  100% { transform: translate(-15px, 20px) scale(0.96); }
}

/* Reactive background tone shifts */
.ambient-bg.tone-cool   .blob-a { background: radial-gradient(circle, rgba(61, 110, 158, 0.15), transparent 70%); }
.ambient-bg.tone-cool   .blob-b { background: radial-gradient(circle, rgba(100, 140, 190, 0.12), transparent 70%); }
.ambient-bg.tone-warm   .blob-a { background: radial-gradient(circle, rgba(232, 98, 42, 0.18), transparent 70%); }
.ambient-bg.tone-warm   .blob-b { background: radial-gradient(circle, rgba(250, 160, 80, 0.14), transparent 70%); }
.ambient-bg.tone-reveal .blob-a { background: radial-gradient(circle, rgba(255, 190, 60, 0.2), transparent 70%); }
.ambient-bg.tone-reveal .blob-b { background: radial-gradient(circle, rgba(232, 98, 42, 0.16), transparent 70%); }

/* ── SCREENS ── */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.screen.hidden {
  display: none;
}

/* ── WELCOME SCREEN ── */
.welcome-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 540px;
  width: 100%;
}

.char-stage--welcome {
  position: relative;
  width: 180px;
  height: 180px;
}

.char-glow {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 98, 42, 0.15), transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

.char-glow--active {
  background: radial-gradient(circle, rgba(232, 98, 42, 0.2), transparent 60%);
}

.char-glow--reveal {
  inset: -24px;
  background: radial-gradient(circle, rgba(255, 190, 60, 0.3), rgba(232, 98, 42, 0.2), transparent 70%);
  animation: glowPulse 1.8s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1; transform: scale(1.06); }
}

/* ── SVG CHARACTER ── */
.char-svg {
  width: 100%;
  height: 100%;
  animation: charBreathe 3.8s ease-in-out infinite;
  transform-origin: center bottom;
  filter: drop-shadow(0 8px 24px rgba(232, 98, 42, 0.15));
}

.char-svg--md {
  width: 220px;
  height: 220px;
}

.char-svg--sm {
  width: 150px;
  height: 150px;
}

@keyframes charBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-5px) scale(1.015); }
}

/* Eyelid blinking animation */
.eyelid {
  transform-origin: center 96px;
  transform: scaleY(0);
  animation: blink 4.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 88%, 100% { transform: scaleY(0); }
  92%, 96%      { transform: scaleY(1); }
}

/* Thinking state: pupils drift up-left */
.char-svg.state-thinking .pupil {
  transform: translate(-5px, -7px);
  transition: transform 0.35s ease;
}

.char-svg.state-thinking .brow {
  animation: browFurrow 0.4s ease forwards;
}

@keyframes browFurrow {
  to { d: path("M 68 86 Q 88 80 108 86"); }
}

/* Listening state: slight attentive tilt */
.char-svg.state-listening {
  animation: charListen 2s ease-in-out;
}

@keyframes charListen {
  0%   { transform: translateY(0) rotate(0deg); }
  30%  { transform: translateY(-3px) rotate(-2deg); }
  70%  { transform: translateY(-3px) rotate(-2deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* Reveal state: burst of energy */
.char-svg.state-reveal {
  animation: charReveal 0.6s var(--spring) forwards;
}

@keyframes charReveal {
  0%   { transform: scale(0.95) translateY(4px); }
  60%  { transform: scale(1.05) translateY(-8px); }
  100% { transform: scale(1) translateY(0); }
}

/* ── WELCOME COPY ── */
.welcome-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.welcome-eyebrow {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.welcome-headline {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-900);
}

.welcome-sub {
  font-size: 1.05rem;
  color: var(--text-500);
  line-height: 1.65;
  max-width: 420px;
}

.btn-start {
  margin-top: 8px;
  padding: 16px 32px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(232, 98, 42, 0.35);
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}

.btn-start:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(232, 98, 42, 0.45);
}

.btn-start:active {
  transform: translateY(0);
}

.welcome-reassure {
  font-size: 0.82rem;
  color: var(--text-300);
}

/* ── QUESTION SCREEN ── */
.screen-question {
  justify-content: flex-start;
  gap: 0;
  padding-top: 40px;
}

.char-stage--question {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 260px;
}

.question-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 660px;
  padding: 36px 24px 0;
}

.question-step {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-300);
}

/* Speech bubble wrapping the question text */
.question-bubble {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  box-shadow: var(--sh-sm);
  border: 1.5px solid var(--border);
  width: 100%;
}

/* Tail pointing UP on mobile (toward character above) */
.question-bubble::before,
.question-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: solid transparent;
  pointer-events: none;
}

.question-bubble::before {
  top: -13px;
  border-width: 0 12px 12px;
  border-bottom-color: var(--border);
}

.question-bubble::after {
  top: -11px;
  border-width: 0 11px 11px;
  border-bottom-color: var(--surface);
}

.question-text {
  font-family: var(--font-title);
  font-size: clamp(1.3rem, 4.5vw, 1.9rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-900);
  margin: 0;
  animation: questionIn 0.35s ease;
}

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

/* Answer grid */
.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  animation: answersIn 0.4s ease 0.1s both;
}

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

.answer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-700);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--sh-xs);
  transition: all var(--ease);
  line-height: 1.4;
  transition-behavior: allow-discrete;
}

.btn-emoji {
  font-size: 1.25em;
  flex-shrink: 0;
  line-height: 1;
}

.btn-label {
  flex: 1;
}

@starting-style {
  .answer-btn {
    opacity: 0;
    transform: translateY(8px);
  }
}

.answer-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--text-900);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 98, 42, 0.15);
}

.answer-btn:active {
  transform: translateY(0);
}

.answer-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(232, 98, 42, 0.3);
}

/* Thinking dots (shown during AI processing) */
.thinking-dots {
  position: absolute;
  bottom: -4px;
  right: -10px;
  display: flex;
  gap: 5px;
  padding: 8px 14px;
  background: var(--surface);
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  box-shadow: var(--sh-sm);
}

.thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.18s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* Progress dots */
.progress-dots {
  display: flex;
  gap: 8px;
  margin-top: 32px;
}

.pdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--ease), transform var(--ease);
}

.pdot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.pdot.done {
  background: var(--accent);
  opacity: 0.45;
}

/* ── REVEAL SCREEN ── */
.screen-reveal {
  gap: 28px;
  justify-content: flex-start;
  padding-top: 28px;
}

.char-stage--reveal {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 190px;
}

.reveal-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1.5px solid rgba(232, 98, 42, 0.2);
  padding: 32px 36px;
  width: 100%;
  max-width: 660px;
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: revealCardUp 0.5s var(--spring);
}

@keyframes revealCardUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Personalized reveal headline generated dynamically from user answers */
.reveal-headline {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-900);
  letter-spacing: -0.01em;
}

.reveal-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-700);
  min-height: 80px;
}

.reveal-text p {
  margin: 0;
}

/* Typewriter cursor blink */
.typewriter-cursor::after {
  content: '|';
  animation: cursorBlink 0.8s step-start infinite;
  color: var(--accent);
  margin-left: 1px;
}

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

/* Reveal action chip */
.reveal-action {
  animation: fadeInUp 0.4s ease;
}

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

.action-chip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--surface-warm);
  border: 1.5px solid rgba(232, 98, 42, 0.2);
}

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

.action-chip-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-700);
  line-height: 1.5;
}

/* Reveal controls */
.reveal-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

/* Portfolio author badge */
.author-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-500);
  margin-top: 16px;
}

.author-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px dashed var(--accent);
  transition: opacity var(--ease);
}

.author-link:hover {
  opacity: 0.8;
}

/* AEO FAQ Accordion for Search Engines & Readers */
.aeo-faq-accordion {
  width: 100%;
  max-width: 480px;
  margin-top: 12px;
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  text-align: left;
}

.aeo-faq-accordion summary {
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-700);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.aeo-faq-accordion summary::after {
  content: '▼';
  font-size: 0.75rem;
  color: var(--text-300);
  transition: transform var(--ease);
}

.aeo-faq-accordion[open] summary::after {
  transform: rotate(180deg);
}

.aeo-faq-content {
  padding: 0 18px 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-500);
  border-top: 1px solid var(--border);
}

.aeo-faq-content p {
  margin-top: 10px;
}

.btn-copy {
  padding: 12px 24px;
  border-radius: var(--r-pill);
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
}

.btn-copy:hover {
  background: var(--accent);
  color: white;
}

.btn-restart {
  padding: 12px 24px;
  border-radius: var(--r-pill);
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-500);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
}

.btn-restart:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Screen fade-out utility (applied by JS during transitions) */
.screen-exiting {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .char-svg { animation: none; }
  .eyelid   { animation: none; transform: scaleY(0); }
  .ambient-blob { animation: none; }
  .thinking-dots span { animation: none; opacity: 1; }
}

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

  .reveal-card {
    padding: 22px 20px;
  }

  .char-stage--question {
    height: 210px;
  }

  .char-svg--md {
    width: 190px;
    height: 190px;
  }

  .screen-question {
    padding-top: 24px;
  }
}

@media (min-width: 900px) {
  .screen-question {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 72px;
    padding: 0 72px;
  }

  .char-stage--question {
    height: 340px;
    width: 280px;
    flex-shrink: 0;
  }

  .char-svg--md {
    width: 260px;
    height: 260px;
  }

  .question-area {
    align-items: flex-start;
    text-align: left;
    padding: 0;
  }

  /* On desktop: bubble tail points LEFT toward character */
  .question-bubble::before {
    top: 50%;
    left: -13px;
    transform: translateY(-50%);
    border-width: 12px 12px 12px 0;
    border-right-color: var(--border);
    border-bottom-color: transparent;
  }

  .question-bubble::after {
    top: 50%;
    left: -11px;
    transform: translateY(-50%);
    border-width: 11px 11px 11px 0;
    border-right-color: var(--surface);
    border-bottom-color: transparent;
  }

  .question-text {
    text-align: left;
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  }

  .progress-dots {
    align-self: flex-start;
    margin-top: 28px;
  }

  .answer-btn {
    font-size: 1.1rem;
    padding: 20px 24px;
  }
}
