/* ==========================================================================
   The Flavour Forecast – Appetise
   Values taken from the Figma file (desktop frame 1728×1117, mobile 393×852)
   ========================================================================== */

@font-face {
  font-family: "Matter";
  src: url("../assets/fonts/Matter-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Matter";
  src: url("../assets/fonts/Matter-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Matter";
  src: url("../assets/fonts/Matter-SemiBoldItalic.otf") format("opentype");
  font-weight: 600 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Brand colours */
  --forest: #003103;
  --sunshine: #fff049;
  --zest: #bdec6c;
  --white: #fffef9;
  --feta: #fffff3;
  --ink: #232323;

  /* Quiz backgrounds */
  --q1: #febaed;
  --q2: #e1a567;
  --q3: #e40004;
  --q4: #007a06;
  --q5: #b50045;

  --header-h: 56px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body { margin: 0; height: 100%; }

body {
  font-family: "Matter", system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--sunshine);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
button { font: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Type styles ---------- */

.t-display {
  margin: 0;
  font-weight: 600;
  font-size: 60px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.t-body {
  margin: 0;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.t-small {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--forest);
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-header__logo { width: 149px; height: auto; }

.restart-btn {
  position: absolute;
  left: 20px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 254, 249, 0.6);
  border-radius: 30px;
  background: transparent;
  color: var(--white);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  animation: restart-in 0.5s var(--ease-out) both;
}
.restart-btn[hidden] { display: none; }
.restart-btn:hover { background: var(--zest); border-color: var(--zest); color: var(--ink); }
.restart-btn:hover svg { transform: translateX(-3px); }
.restart-btn svg { transition: transform 0.25s var(--ease-out); }
.restart-btn:focus-visible { outline: 2px solid var(--zest); outline-offset: 3px; }
@keyframes restart-in {
  from { opacity: 0; transform: translate(-10px, -50%); }
  to   { opacity: 1; transform: translateY(-50%); }
}

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--zest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 19.135px 38.917px;
  border: 1.428px solid var(--forest);
  border-radius: 47.837px;
  background: var(--btn-bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 21.048px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-out), background-color 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn--green { --btn-bg: var(--zest); }
.btn--white { --btn-bg: var(--white); }
.btn--yellow { --btn-bg: var(--sunshine); }
a.btn { text-decoration: none; }
/* Pressed-in feel: the button sinks slightly with an inner shadow along its top edge */
.btn:hover:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 3px 0 rgba(0, 49, 3, 0.22);
}
.btn:active:not(:disabled) {
  transform: translateY(2px) scale(0.96);
  box-shadow: inset 0 4px 6px rgba(0, 49, 3, 0.35);
  transition-duration: 0.08s;
}
.btn:focus-visible { outline: 3px solid var(--forest); outline-offset: 4px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--xl {
  padding: 32.556px 66.212px;
  border-width: 2.429px;
  border-radius: 81.389px;
  font-size: 35.811px;
}
.btn--sm { padding: 13px 26px; font-size: 16px; }

/* ---------- Screens ---------- */

#app { position: relative; min-height: 100vh; min-height: 100dvh; }

.screen {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--header-h);
  display: none;
  overflow: hidden;
  background: var(--sunshine);
}
.screen.is-active {
  position: relative;
  display: flex;
  flex-direction: column;
  animation: screen-in 0.6s var(--ease-out) backwards;
}
.screen.is-leaving {
  display: flex;
  flex-direction: column;
  position: absolute;
  z-index: 2;
  animation: screen-out 0.4s var(--ease-out) both;
  pointer-events: none;
}
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes screen-out { from { opacity: 1; } to { opacity: 0; } }

.stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: auto;
  padding: 40px 24px;
}

/* Staggered entrance for .reveal children */
.is-active .reveal {
  animation: rise 0.7s var(--ease-out) backwards;
}
.is-active .reveal:nth-child(2) { animation-delay: 0.08s; }
.is-active .reveal:nth-child(3) { animation-delay: 0.16s; }
.is-active .reveal:nth-child(4) { animation-delay: 0.24s; }
.is-active .reveal:nth-child(5) { animation-delay: 0.32s; }
.is-active .reveal:nth-child(6) { animation-delay: 0.40s; }
.is-active .reveal:nth-child(7) { animation-delay: 0.48s; }
.is-active .reveal:nth-child(8) { animation-delay: 0.56s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pop {
  0%   { opacity: 0; transform: translateY(40px) scale(0.9); }
  60%  { opacity: 1; transform: translateY(-6px) scale(1.02); }
  100% { opacity: 1; transform: none; }
}

/* ==========================================================================
   1. Landing
   ========================================================================== */

.screen--landing { align-items: center; }
.is-restoring .screen--landing,
.is-restoring .site-header__logo { visibility: hidden; }

.landing__title {
  position: relative;
  z-index: 1;
  margin: 23px 0 0;
  width: min(96.5vw, 1667px);
}
.landing__title img { width: 100%; height: auto; }

.landing__lemon {
  position: absolute;
  z-index: 2;
  left: 50%;
  /* sits a little below the fold so the bob never shows a gap underneath */
  bottom: -18px;
  width: 100vw;
  max-width: none;
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
}

.landing__cta {
  position: relative;
  z-index: 3;
  margin-top: 26px;
}

/* Sequenced entrance: title → lemon → button */
.screen--landing.is-active .landing__title {
  animation: title-pop 0.9s var(--ease-spring) 0.1s backwards;
}
.screen--landing.is-active .landing__lemon {
  animation: lemon-rise 1.1s var(--ease-out) 0.75s both, lemon-bob 4s ease-in-out 1.85s infinite;
}
.screen--landing.is-active .landing__cta {
  animation: pop 0.7s var(--ease-spring) 1.5s backwards;
}
@keyframes title-pop {
  0%   { opacity: 0; transform: translateY(60px) scale(0.85); }
  100% { opacity: 1; transform: none; }
}
@keyframes lemon-rise {
  from { transform: translate(-50%, 70%); }
  to   { transform: translate(-50%, 0); }
}
/* Straight up-and-down bob; travel (16px) stays within the 18px tucked below the fold */
@keyframes lemon-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -16px); }
}

/* ==========================================================================
   2. Introduction
   ========================================================================== */

.screen--intro .t-display { max-width: 804px; }
.intro__body { max-width: 748px; margin-top: 36px; }
.screen--intro .btn { margin-top: 44px; }

/* ==========================================================================
   3. Questions
   ========================================================================== */

.screen--question {
  --q-bg: var(--q1);
  --q-fg: var(--ink);
  background: var(--q-bg);
  color: var(--q-fg);
  transition: background-color 0.6s var(--ease-out), color 0.6s var(--ease-out);
}
.screen--question[data-q="1"] { --q-bg: var(--q1); --q-fg: var(--ink); }
.screen--question[data-q="2"] { --q-bg: var(--q2); --q-fg: var(--ink); }
.screen--question[data-q="3"] { --q-bg: var(--q3); --q-fg: var(--white); }
.screen--question[data-q="4"] { --q-bg: var(--q4); --q-fg: var(--white); }
.screen--question[data-q="5"] { --q-bg: var(--q5); --q-fg: var(--white); }

.question {
  width: min(804px, 100% - 48px);
  margin: auto;
  padding: 40px 0 120px;
  display: flex;
  flex-direction: column;
}
.question.is-swapping > * { animation: rise 0.6s var(--ease-out) backwards; }
.question.is-swapping > :nth-child(2) { animation-delay: 0.08s; }
.question.is-swapping > :nth-child(3) { animation-delay: 0.16s; }

.question__options {
  margin: 56px 0 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.option {
  display: flex;
  align-items: center;
  gap: 33px;
  cursor: pointer;
  border-radius: 30px;
  -webkit-tap-highlight-color: transparent;
}
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option__letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 30px;
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.01em;
  transition: background-color 0.25s var(--ease-out), transform 0.35s var(--ease-spring);
}
.option__text {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  transition: transform 0.3s var(--ease-out);
}
.option:hover .option__letter { transform: scale(1.1); }
.option:hover .option__text { transform: translateX(4px); }
.option input:focus-visible + .option__letter { outline: 3px solid currentColor; outline-offset: 3px; }
.option input:checked + .option__letter {
  background: var(--zest);
  animation: letter-pick 0.45s var(--ease-spring);
}
@keyframes letter-pick {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.question__next {
  align-self: center;
  margin-top: 70px;
}

.back-btn {
  position: absolute;
  left: 40px;
  bottom: 40px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--forest);
  cursor: pointer;
  transition: transform 0.3s var(--ease-out);
}
.screen--question[data-q="3"] .back-btn,
.screen--question[data-q="4"] .back-btn,
.screen--question[data-q="5"] .back-btn { color: var(--white); }
.back-btn:hover { transform: translateX(-6px); }
.back-btn svg { display: block; }

/* ==========================================================================
   4 + 7. Loading
   ========================================================================== */

.loading {
  margin: auto;
  width: min(804px, 100% - 48px);
  height: 140px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.loading__phrase {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading__phrase.is-in  { animation: phrase-in 0.55s var(--ease-out) both; }
.loading__phrase.is-out { animation: phrase-out 0.45s cubic-bezier(0.55, 0, 1, 0.45) both; }
@keyframes phrase-in {
  from { opacity: 0; transform: translateX(110px); }
  to   { opacity: 1; transform: none; }
}
@keyframes phrase-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(-110px); }
}
.loading__hint {
  position: absolute;
  left: 0; right: 0; bottom: 64px;
  text-align: center;
  font-size: 18px;
  opacity: 0.7;
  padding: 0 24px;
  animation: rise 0.6s var(--ease-out) backwards;
}

/* ==========================================================================
   Category theming (persona + image card)
   ========================================================================== */

.category-bg {
  background-color: var(--cat-body);
  background-image: var(--cat-bg-desktop);
  background-size: cover;
  background-position: center;
}
.category-bg::before {
  /* slow drift on the background photo */
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  background-size: cover;
  background-position: center;
  animation: bg-drift 18s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes bg-drift {
  from { transform: scale(1.02); }
  to   { transform: scale(1.08) translateY(-1%); }
}

[data-category="bright-sour"] {
  --cat-tab: #007a06;
  --cat-body: #ffe020;
  --cat-fg: var(--ink);
  --cat-bg-desktop: url("../assets/img/bg-bright-sour-desktop.jpg");
  --cat-bg-mobile: url("../assets/img/bg-bright-sour-mobile.jpg");
}
[data-category="spice-heat"] {
  --cat-tab: #ff550f;
  --cat-body: #e40004;
  --cat-fg: var(--white);
  --cat-bg-desktop: url("../assets/img/bg-spice-heat-desktop.jpg");
  --cat-bg-mobile: url("../assets/img/bg-spice-heat-mobile.jpg");
}
[data-category="umami"] {
  --cat-tab: #6d3800;
  --cat-body: #e1a567;
  --cat-fg: var(--ink);
  --cat-bg-desktop: url("../assets/img/bg-umami-desktop.jpg");
  --cat-bg-mobile: url("../assets/img/bg-umami-desktop.jpg");
}
[data-category="viral-sweet"] {
  --cat-tab: #b50045;
  --cat-body: #febaed;
  --cat-fg: var(--ink);
  --cat-bg-desktop: url("../assets/img/bg-viral-sweet-desktop.jpg");
  --cat-bg-mobile: url("../assets/img/bg-viral-sweet-mobile.jpg");
}

/* ==========================================================================
   5. Persona
   ========================================================================== */

.screen--persona { align-items: center; }

.persona-card {
  position: relative;
  z-index: 1;
  width: min(1003px, 100% - 48px);
  margin: auto auto 0;
  padding-top: 40px;
  color: var(--cat-fg);
  text-align: center;
}
.persona-card__tab {
  position: relative;
  z-index: 1;
  height: 115px;
  border: 1.428px solid var(--forest); /* matches .btn */
  border-radius: 20px;
  background: var(--cat-tab);
  display: flex;
  align-items: center;
  justify-content: center;
}
.persona-card__category { position: relative; display: block; }
.persona-card__category img { display: block; height: auto; max-width: 100%; }
.persona-card__category img + img { position: absolute; inset: -1.2px; width: calc(100% + 2.4px); }

.persona-card__body {
  margin-top: -61px;
  /* 61px sits under the tab; the rest gives an equal ~64px visual gap above the name and below the last line */
  padding: 113px 76px 59px;
  border: 1.428px solid var(--forest); /* matches .btn */
  border-radius: 20px;
  background: var(--cat-body);
}
.persona-card__desc { max-width: 851px; margin: 30px auto 0; }
.persona-card__shelf {
  max-width: 772px;
  margin: 34px auto 0;
  font-weight: 600;
  font-style: italic;
}
.persona-card__product { display: block; font-weight: 700; }

.persona__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 19px;
  margin: 46px auto auto;
}
.screen--persona { padding-bottom: 48px; }

/* Persona entrance: tab drops, body unfolds, CTA pops */
.screen--persona.is-active .persona-card__tab {
  animation: tab-drop 0.8s var(--ease-spring) 0.15s backwards;
}
.screen--persona.is-active .persona-card__category {
  animation: pop 0.7s var(--ease-spring) 0.5s backwards;
}
.screen--persona.is-active .persona-card__body {
  transform-origin: top center;
  animation: body-unfold 0.8s var(--ease-out) 0.45s backwards;
}
.screen--persona.is-active .persona-card__body > * {
  animation: rise 0.6s var(--ease-out) backwards;
}
.screen--persona.is-active .persona-card__name  { animation-delay: 0.85s !important; }
.screen--persona.is-active .persona-card__desc  { animation-delay: 0.95s !important; }
.screen--persona.is-active .persona-card__shelf { animation-delay: 1.05s !important; }
.screen--persona.is-active .persona__cta { animation: pop 0.7s var(--ease-spring) 1.3s backwards; }
.screen--persona.is-active .persona__cta + .persona__cta { animation-delay: 1.42s; }

@keyframes tab-drop {
  from { opacity: 0; transform: translateY(-80px) rotate(-3deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes body-unfold {
  from { opacity: 0; transform: scaleY(0.4); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   6. Upload
   ========================================================================== */

.upload { max-width: 640px; width: 100%; }
.upload__lede { margin-top: 24px; max-width: 560px; }
.upload__persona-name { font-weight: 600; }

.dropzone {
  position: relative;
  margin-top: 36px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 2.5px dashed var(--forest);
  background: rgba(255, 254, 249, 0.55);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.35s var(--ease-spring), background-color 0.25s, border-color 0.25s;
}
.dropzone:hover,
.dropzone.is-dragging { transform: scale(1.03); background: var(--white); }
.dropzone.is-dragging { border-style: solid; }
.dropzone:focus-within { outline: 3px solid var(--forest); outline-offset: 6px; }
.dropzone__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--forest);
}
.dropzone__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--zest);
  border: 1.5px solid var(--forest);
  animation: icon-bob 2.4s ease-in-out infinite;
}
@keyframes icon-bob { 50% { transform: translateY(-5px); } }
.dropzone__title { font-weight: 600; font-size: 22px; letter-spacing: -0.01em; color: var(--ink); }
.dropzone__sub { font-size: 15px; color: var(--ink); opacity: 0.8; }

.dropzone__preview {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  overflow: hidden;
  animation: pop 0.6s var(--ease-spring) backwards;
}
.dropzone__preview img { width: 100%; height: 100%; object-fit: cover; }
.dropzone__change {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 30px;
  background: var(--white);
  border: 1px solid var(--forest);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dropzone.has-image { border-style: solid; }

.selfie-btn { margin-top: 20px; display: none; }
@media (pointer: coarse) { .selfie-btn { display: inline-flex; } }

.upload__tips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
}
.upload__tips li {
  padding: 6px 14px;
  border-radius: 30px;
  background: rgba(255, 254, 249, 0.7);
}
.upload__error { margin-top: 16px; color: #b50045; font-weight: 600; }
.upload .btn--green { margin-top: 32px; }
.upload__privacy { margin-top: 16px; opacity: 0.7; font-size: 14px; }

/* ==========================================================================
   8. Image card
   ========================================================================== */

.screen--card { align-items: center; }

.card {
  position: relative;
  z-index: 1;
  margin: auto;
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  --card-size: min(821px, calc(100dvh - var(--header-h) - 200px), calc(100vw - 48px));
}
.card__frame {
  position: relative;
  width: var(--card-size);
  aspect-ratio: 1;
  border-radius: 41.734px;
  overflow: hidden;
  background: var(--cat-body);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  perspective: 1200px;
}
.card__img { width: 100%; height: 100%; object-fit: cover; }
.card__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%);
  transform: translateX(-120%);
  pointer-events: none;
}
.card__demo {
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 30px;
  background: var(--white);
  font-size: 14px;
}
.card__actions {
  display: flex;
  gap: 19px;
  margin-top: 34px;
}
/* Figma: Save image is fixed at 294px, the other two size to their label */
.card__btn { min-width: 294px; }

.screen--card.is-active .card__frame {
  animation: card-reveal 1.2s var(--ease-spring) 0.2s backwards;
}
.screen--card.is-active .card__shine {
  animation: shine 1.1s ease-in-out 1.2s both;
}
.screen--card.is-active .card__actions > * { animation: pop 0.6s var(--ease-spring) backwards; }
.screen--card.is-active .card__actions > :nth-child(1) { animation-delay: 1.3s; }
.screen--card.is-active .card__actions > :nth-child(2) { animation-delay: 1.42s; }
.screen--card.is-active .card__actions > :nth-child(3) { animation-delay: 1.54s; }

@keyframes card-reveal {
  0%   { opacity: 0; transform: translateY(80px) rotate(-8deg) scale(0.6); }
  55%  { opacity: 1; transform: translateY(-10px) rotate(2deg) scale(1.03); }
  100% { opacity: 1; transform: none; }
}
@keyframes shine {
  from { transform: translateX(-120%); }
  to   { transform: translateX(120%); }
}

/* Confetti bits that burst when the card lands */
.confetti {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 3;
  animation: confetti 1.4s var(--ease-out) forwards;
}
@keyframes confetti {
  0%   { opacity: 1; transform: translate(-50%, -50%) rotate(0); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 14px 22px;
  border-radius: 30px;
  background: var(--forest);
  color: var(--white);
  font-size: 16px;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 0.4s var(--ease-spring) both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   Mobile (Figma mobile frames, 393 wide)
   ========================================================================== */

@media (max-width: 767px) {
  .site-header { justify-content: flex-start; padding: 0 16px; }
  .restart-btn { left: auto; right: 16px; padding: 8px 12px; gap: 6px; font-size: 11px; }
  .restart-btn svg { width: 12px; }
  .t-display { font-size: 30px; letter-spacing: -0.04em; }
  .t-body { font-size: 16px; }

  /* Landing */
  .landing__title { width: min(88vw, 347px); margin-top: 25px; }
  .landing__lemon { width: max(126vw, 496px); }
  .landing__cta { margin-top: 37px; }
  .btn--xl {
    padding: 26.807px 54.521px;
    border-width: 2px;
    border-radius: 67.018px;
    font-size: 29.488px;
  }

  /* Intro */
  .screen--intro .t-display { max-width: 333px; }
  .intro__body { margin-top: 24px; max-width: 333px; }
  .screen--intro .btn { margin-top: 36px; }

  /* Questions */
  .question {
    width: min(333px, 100% - 48px);
    padding-top: 44px;
    margin-top: 0;
  }
  .question__title { text-align: center; }
  .question__options { margin-top: 44px; gap: 27px; }
  .option { gap: 17px; }
  .option__text { font-size: 16px; }
  .question__next { margin-top: 64px; }
  .back-btn { left: 22px; bottom: 16px; }
  .back-btn svg { width: 31px; height: 23px; }

  /* Loading */
  .loading { height: 100px; }

  /* Persona */
  .category-bg { background-image: var(--cat-bg-mobile); }
  .persona-card { width: min(333px, 100% - 40px); padding-top: 32px; }
  .persona-card__tab { height: 103px; }
  .persona-card__category img { width: auto; max-height: 64px; max-width: 293px; }
  .persona-card__body {
    margin-top: -85px;
    padding: 119px 22px 36px;
  }
  .persona-card__desc { margin-top: 22px; }
  .persona-card__shelf { margin-top: 24px; }
  /* Stacked buttons share the widest one's width */
  .persona__actions { flex-direction: column; align-items: stretch; width: max-content; max-width: 100%; gap: 15px; margin-top: 53px; }
  .persona__cta { min-width: 294px; }
  /* "Generate my FMCG product" is long; shrink it to fit a phone */
  .persona__cta,
  .upload [data-action="generate"] { padding: 18px 28px; font-size: 17px; }

  /* Upload */
  .dropzone { width: 240px; height: 240px; margin-top: 28px; }
  .dropzone__icon { width: 60px; height: 60px; }
  .dropzone__icon svg { width: 34px; height: 34px; }
  .dropzone__title { font-size: 18px; }
  .dropzone__sub { font-size: 13px; }

  /* Card */
  .card { --card-size: min(355px, calc(100vw - 38px)); padding-top: 40px; }
  .card__frame { border-radius: 18.046px; }
  .card__actions { flex-direction: column; gap: 15px; margin-top: 33px; }
  .card__btn { width: 294px; padding-inline: 16px; font-size: 19.05px; }
}

@media (max-width: 380px) {
  .btn--xl { font-size: 24px; padding: 22px 40px; }
  .card__btn, .persona__cta { width: auto; min-width: 260px; }
  .persona__cta,
  .upload [data-action="generate"] { padding: 16px 22px; font-size: 15px; }
}

/* Short desktop windows: keep the persona card on screen */
@media (min-width: 768px) and (max-height: 860px) {
  .t-display { font-size: 52px; }
  .persona-card__body { padding: 105px 64px 51px; }
  .question__options { margin-top: 44px; }
  .question__next { margin-top: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
