:root{
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

*,*::before,*::after{ box-sizing:border-box; }

html,body{
  margin:0; padding:0; min-height:100vh;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:#f5ede0;
  color:#2a2422;
  overflow:hidden;
  letter-spacing: -0.005em;
}

#root{
  min-height:100vh;
  display:block;
}

.stage{
  position:relative;
  width:100vw;
  height:100vh;
  overflow:hidden;
  background:#f5ede0;
  isolation:isolate;
}

.bg-layer{
  position:absolute; inset:0; z-index:0;
  overflow:hidden;
  pointer-events:none;
}
.character-layer{
  position:absolute; inset:0; z-index:1;
  overflow:hidden;
  pointer-events:none;
}
.content-layer{
  position:absolute; inset:0; z-index:2;
  display:flex; flex-direction:column;
  padding: 24px 22px 28px;
  gap: 0;
  align-items:center;
  justify-content:center;
}
.content-wrap{
  width:100%;
  max-width: 480px;
  display:flex;
  flex-direction:column;
  gap: 12px;
}

/* Tablet: bigger padding, wider content */
@media (min-width: 768px){
  .content-layer{ padding: 48px 40px; }
  .content-wrap{ max-width: 520px; gap: 14px; }
}

/* Desktop: content shifts to right column */
@media (min-width: 1100px){
  .content-layer{
    justify-content: center;
    align-items: flex-end;
    padding: 48px max(6vw, 64px) 48px 48px;
  }
  .content-wrap{ max-width: 540px; gap: 16px; }
}

/* Cards */
.card{
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 10px 30px -14px rgba(0,0,0,0.18);
}

.card-anecdote{
  font-family: var(--sans);
  font-style: italic;
  font-weight: 300;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink, #3a2f2a);
  letter-spacing: 0.005em;
}
.card-anecdote::before{
  content:"";
  display:block;
  width:24px; height:2px;
  background: currentColor;
  opacity:0.35;
  margin-bottom: 10px;
}

.card-question{
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink, #3a2f2a);
  text-wrap: pretty;
  letter-spacing: -0.01em;
}
.card-question em{
  font-style: normal;
  font-weight: 700;
}

.answers{
  display:flex; flex-direction:column;
  gap: 9px;
}
.answer{
  appearance:none;
  border:none;
  text-align:left;
  width:100%;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink, #2a2422);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 14px 18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  letter-spacing: -0.005em;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 6px 18px -10px rgba(0,0,0,0.15);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.answer:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.95);
}
.answer:active{ transform: translateY(0); }
.answer .arrow{
  font-weight: 300;
  opacity:0.45;
  transition: transform .2s ease, opacity .2s ease;
}
.answer:hover .arrow{ opacity:1; transform: translateX(3px); }
.answer.selected{
  background: var(--accent, #3a2f2a);
  color:#fefcf8;
}
.answer.selected .arrow{ opacity:1; }

/* Step indicator */
.steps{
  position:absolute; top:18px; left:0; right:0;
  z-index: 3;
  display:flex; justify-content:center; gap:6px;
  pointer-events:none;
}
.step-dot{
  width: 22px; height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.18;
  transition: opacity .3s ease;
}
.step-dot.active{ opacity: 0.85; }
.step-dot.done{ opacity: 0.45; }
.steps{ color: var(--ink, #3a2f2a); }

/* Intro */
.intro{
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding: 40px 28px;
  text-align:center;
  gap: 22px;
}
@media (min-width: 1100px){
  .intro{ align-items:flex-end; padding: 48px max(6vw, 64px) 48px 48px; text-align:right; }
  .intro > *{ max-width: 480px; }
}
.intro-eyebrow{
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 10px;
  font-weight: 600;
  color: #8a7568;
}
.intro-headline{
  font-family: var(--sans);
  font-weight: 300;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #2a2018;
  max-width: 16ch;
  text-wrap: balance;
}
.intro-headline em{
  font-style: normal;
  font-weight: 700;
  color: #8b5a3c;
}
.intro-sub{
  font-family: var(--sans);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: #6b5a4f;
  max-width: 28ch;
}
.btn-primary{
  appearance:none; border:none; cursor:pointer;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.005em;
  color: #fefcf8;
  background: #2a2018;
  padding: 16px 28px;
  border-radius: 999px;
  box-shadow: 0 14px 30px -10px rgba(42,32,24,0.55), 0 1px 0 rgba(255,255,255,0.1) inset;
  transition: transform .15s ease, box-shadow .2s ease;
  display:inline-flex; align-items:center; gap:10px;
}
.btn-primary:hover{ transform: translateY(-1px); box-shadow: 0 20px 36px -10px rgba(42,32,24,0.6); }
.btn-primary:active{ transform: translateY(0); }
.btn-primary .arrow{ display:inline-block; font-weight: 300; transition: transform .2s ease; }
.btn-primary:hover .arrow{ transform: translateX(4px); }

/* Final form */
.final{
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  align-items:stretch; justify-content:center;
  padding: 40px 26px;
  gap: 14px;
}
.final h1{
  font-family: var(--sans);
  font-weight: 300;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0;
  color: #2a2418;
  text-align:center;
  text-wrap: balance;
}
.final h1 em{ font-style: normal; font-weight: 700; color: #6b8b6f; }
.final-hint{
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: #6b5a4f;
  text-align:center;
  margin: 0 0 6px;
  letter-spacing: 0.01em;
}
.field{
  display:flex; flex-direction:column;
  gap: 6px;
}
.field label{
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a7568;
  display:flex; justify-content:space-between; align-items: baseline;
}
.field label .opt{
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #b09a8b;
  text-transform: none;
  font-size: 10px;
}
.field input{
  appearance:none; border:none;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  color: #2a2418;
  padding: 14px 16px;
  background: rgba(255,255,255,0.88);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 0 0 1px rgba(0,0,0,0.06);
  outline:none;
  transition: box-shadow .2s ease;
  letter-spacing: -0.005em;
}
.field input:focus{
  box-shadow: 0 0 0 2px #6b8b6f;
}
.field input::placeholder{ color:#c0b3a6; font-weight: 400; font-style: italic; }
.field-help{
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 400;
  color: #8a7568;
  line-height: 1.45;
  margin: 4px 4px 0;
  letter-spacing: 0.005em;
}
.final-submit{ align-self:center; margin-top:8px; }

/* Final form responsive — media queries AFTER base rules so they win */
@media (min-width: 768px){
  .final{ padding: 48px 40px; }
  .final h1, .final-hint, .field{ max-width: 520px; width:100%; align-self:center; }
  .final-submit{ align-self:center; }
}
@media (min-width: 1100px){
  .final{ align-items:flex-end; padding: 48px max(6vw, 64px) 48px 48px; }
  .final h1, .final-hint, .field{ max-width: 480px; align-self:flex-end; width:100%; }
  .final h1, .final-hint{ text-align:right; }
  .final-submit{ align-self:flex-end; }
}

/* Confirmation */
.confirm{
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding: 40px 32px;
  text-align:center;
  gap: 22px;
}
@media (min-width: 1100px){
  .confirm{ align-items:flex-end; padding: 48px max(6vw, 64px) 48px 48px; text-align:right; }
  .confirm > *{ max-width: 480px; }
}
.confirm-sun{
  width: 86px; height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fbe0a8, #e8b76b 70%, #c4904a);
  box-shadow: 0 0 60px rgba(232,183,107,0.5);
}
.confirm h2{
  font-family: var(--sans);
  font-weight: 300;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
  color: #2a2418;
  text-wrap: balance;
  max-width: 18ch;
}
.confirm h2 em{ font-style: normal; font-weight: 700; color: #8b5a3c; }

/* Score ring */
.score{
  display:flex; flex-direction:column; align-items:center; gap: 10px;
}
.score-ring{
  width: 132px; height: 132px;
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 16px 40px -16px rgba(107,139,111,0.5);
}
.score-ring-inner{
  width: 108px; height: 108px;
  border-radius: 50%;
  background: #F6F1E6;
  display:flex; align-items:center; justify-content:center;
}
.score-pct{
  font-family: var(--sans);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.03em;
  color: #3f5c43;
  line-height: 1;
}
.score-pct small{
  font-size: 18px;
  font-weight: 600;
  margin-left: 1px;
}
.score-label{
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b8b6f;
}
.score-foot{
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  color: #8a7568;
  max-width: 26ch;
  line-height: 1.5;
}
.confirm p{
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  color: #6b5a4f;
  max-width: 28ch;
  margin: 0;
  line-height: 1.55;
}
.confirm-link{
  display:inline-flex; align-items:center; gap:8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.005em;
  color: #fefcf8;
  background: #3f5c43;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 999px;
  box-shadow: 0 12px 28px -10px rgba(63,92,67,0.55), 0 1px 0 rgba(255,255,255,0.1) inset;
  transition: transform .15s ease, box-shadow .2s ease;
}
.confirm-link:hover{ transform: translateY(-1px); box-shadow: 0 18px 34px -10px rgba(63,92,67,0.6); }
.confirm-link:active{ transform: translateY(0); }
.confirm-link .arrow{ font-weight: 300; transition: transform .2s ease; }
.confirm-link:hover .arrow{ transform: translateX(3px); }

/* Transition states */
.content-layer > *{
  opacity: 0;
  transform: translateY(14px);
  animation: card-in 520ms cubic-bezier(.2,.7,.2,1) forwards;
}
.content-layer > *:nth-child(1){ animation-delay: 180ms; }
.content-layer > *:nth-child(2){ animation-delay: 280ms; }
.content-layer > *:nth-child(3){ animation-delay: 380ms; }
.content-layer > *:nth-child(4){ animation-delay: 460ms; }

.exiting .content-layer > *{
  animation: card-out 240ms cubic-bezier(.5,.1,.7,.1) forwards;
}
.exiting .content-layer > *:nth-child(1){ animation-delay: 0ms; }
.exiting .content-layer > *:nth-child(2){ animation-delay: 40ms; }
.exiting .content-layer > *:nth-child(3){ animation-delay: 80ms; }
.exiting .content-layer > *:nth-child(4){ animation-delay: 120ms; }

@keyframes card-in{
  from{ opacity:0; transform: translateY(14px); }
  to  { opacity:1; transform: translateY(0); }
}
@keyframes card-out{
  from{ opacity:1; transform: translateY(0); }
  to  { opacity:0; transform: translateY(-10px); }
}

/* Background element entry animations */
.bg-el{
  position:absolute;
  transition: transform 580ms cubic-bezier(.2,.7,.2,1), opacity 580ms cubic-bezier(.2,.7,.2,1);
  will-change: transform, opacity;
}
.bg-el.from-bottom{ transform: translateY(120%); opacity: 0; }
.bg-el.from-top   { transform: translateY(-120%); opacity: 0; }
.bg-el.from-left  { transform: translateX(-120%); opacity: 0; }
.bg-el.from-right { transform: translateX(120%);  opacity: 0; }
.bg-el.from-scale { transform: scale(0.3); opacity: 0; }

.bg-el.in{
  transform: translate(0,0) scale(1);
  opacity: 1;
}

/* Character entry */
.character{
  position:absolute;
  bottom: -4%;
  width: 72%;
  z-index: 1;
  transition: transform 640ms cubic-bezier(.2,.7,.2,1), opacity 540ms ease;
  will-change: transform, opacity;
  opacity: 0;
  transform: translateY(48px);
}
.character--left { left: -18%; right: auto; }
.character--right{ right: -18%; left: auto; }

@media (min-width: 768px){
  .character{ width: 56%; bottom: -2%; }
  .character--left { left: -10%; }
  .character--right{ right: -10%; }
}

@media (min-width: 1100px){
  /* Content pinned right → character always anchored left, whatever its mobile side */
  .character{ width: min(44vw, 600px); bottom: -4%; left: -3vw; right: auto; }
  .character--left { left: -3vw; right: auto; }
  .character--right{ left: -3vw; right: auto; }
}

.character.in{
  opacity: 1;
  transform: translateY(0);
}
.exiting .character{
  opacity: 0;
  transform: translateY(28px);
  transition: transform 260ms ease, opacity 240ms ease;
}
