/* Find Your Pork quiz flow — extends ../styles.css (fonts, tokens, ticker, nav) */

/* Single-viewport layout: ticker + nav + panel fill 100vh exactly, no footer, no page scroll */
html, body.quiz-body {
  height: 100%;
}
body.quiz-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* .quiz-main overrides the landing page's global `main { padding-top: 239px }` rule,
   which otherwise leaks into these pages since they share the same styles.css */
main.quiz-main {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 0;
  gap: 0;
}

.quiz-panel {
  position: relative;
  flex: 1;
  width: 100%;
  margin-top: 20px;
  background: #2b2926;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 24px;
}

.quiz-panel__title {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--gold);
  font-size: clamp(24px, 3vw, 38px);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.quiz-panel__subtitle {
  margin-top: 10px;
  color: #fff;
  font-size: clamp(14px, 1.6vw, 22px);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* intro screen (205) */
.quiz-intro__copy {
  margin-top: clamp(20px, 4vh, 60px);
  max-width: 700px;
  color: #fff;
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.42;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.quiz-intro__copy p:last-child {
  margin-top: 6px;
  line-height: 2.16;
}
.quiz-intro__cta {
  margin-top: clamp(16px, 3vh, 50px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  color: #363636;
  font-family: var(--font-script);
  font-size: 20px;
  text-transform: uppercase;
  padding: 10px 24px;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.quiz-intro__note {
  margin-top: clamp(12px, 2.5vh, 40px);
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* step screens (206-211) */
.quiz-step__label {
  margin-top: clamp(16px, 4vh, 60px);
  color: var(--gold);
  font-size: 18px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.quiz-dots {
  margin-top: 10px;
  display: flex;
  gap: 17px;
  position: relative;
  z-index: 1;
}
.quiz-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
}
.quiz-dot.is-active {
  background: var(--gold);
  border-color: var(--gold);
}
.quiz-step__question {
  margin-top: clamp(16px, 3vh, 35px);
  color: #fff;
  font-size: 20px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.quiz-options {
  margin-top: clamp(14px, 2.5vh, 25px);
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 100%;
  max-width: 756px;
  position: relative;
  z-index: 1;
}

/* test button component states: normal / hover / click (from Figma "test button" component) */
.quiz-option {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #454544;
  color: #fff;
  font-family: 'Paperlogy';
  font-size: 18px;
  text-transform: uppercase;
  padding: 12px 10px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.quiz-option:hover {
  background: #6d6d6d;
  color: #fff;
}
.quiz-option:active {
  background: var(--gold);
  color: #363636;
}

/* loading screen */
.quiz-loading__text {
  color: #ffc62b;
  font-family: 'Paperlogy';
  font-size: clamp(20px, 2.2vw, 28px);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.quiz-loading__dots {
  margin-top: 30px;
  width: 95px;
  position: relative;
  z-index: 1;
  animation: loading-pulse 1s ease-in-out infinite;
}
@keyframes loading-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* result card */
.result-card {
  position: relative;
  z-index: 1;
  width: min(546px, 90vw);
  max-height: min(694px, 82vh);
  background: var(--yellow);
  border-radius: 48px;
  padding: clamp(24px, 4vh, 39px) clamp(20px, 3vw, 39px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
  /* linear, not eased — an eased curve applies separately to each keyframe
     segment (0→50%, 50%→100%), so the rotation slowed sharply right at the
     midpoint and sped back up after it, reading as a stutter */
  animation: result-card-spin 0.9s linear both;
}
/* every stop below sets a complete `transform` value on purpose — a keyframe
   that omits it (as an earlier version here did for its opacity-only 45%
   stop) gets treated as an implicit reset by some browsers' interpolation,
   which snapped the rotation back and lurched forward again: exactly the
   "spins twice / stutters" look this replaces */
@keyframes result-card-spin {
  0% { opacity: 0; transform: perspective(1000px) translateY(0) rotateY(0deg) scale(0.85); }
  50% { opacity: 1; transform: perspective(1000px) translateY(-18px) rotateY(180deg) scale(0.97); }
  100% { opacity: 1; transform: perspective(1000px) translateY(0) rotateY(360deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .result-card { animation: none; }
}
.result-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 32px;
  border-radius: 999px;
  color: var(--yellow);
  font-family: 'Paperlogy';
  font-weight: 600;
  font-size: clamp(18px, 2vw, 28px);
  text-transform: uppercase;
  white-space: nowrap;
}
.result-card__headline {
  margin-top: 14px;
  color: #363636;
  font-family: 'Paperlogy';
  font-weight: 500;
  font-size: 16px;
  text-transform: uppercase;
}
.result-card__desc {
  margin-top: 8px;
  color: #363636;
  font-family: 'Paperlogy';
  font-size: 12px;
  line-height: 1.48;
  text-transform: uppercase;
}
.result-card__photo {
  margin-top: 20px;
  width: min(502px, 100%);
  aspect-ratio: 502 / 292;
  height: auto;
  border-radius: 26px;
  overflow: hidden;
  position: relative;
}
/* frame matches the exact manual crop offset from Figma (not a generic centered object-fit:cover) */
.result-card__photo-frame {
  position: absolute;
}
.result-card__photo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.result-card__tag {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fd8e27;
  color: #363636;
  font-family: 'Paperlogy';
  font-size: 14px;
  text-transform: uppercase;
  padding: 2px 18px;
  border-radius: 999px;
}
.result-card__product {
  margin-top: 6px;
  color: #363636;
  font-family: 'Paperlogy';
  font-weight: 500;
  font-size: clamp(15px, 1.8vw, 20px);
  white-space: nowrap;
}
.result-card__actions {
  margin-top: clamp(12px, 2.5vh, 20px);
  display: flex;
  gap: 10px;
}
.result-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 200px;
  max-width: 40vw;
  border-radius: 999px;
  font-family: var(--font-script);
  font-size: clamp(14px, 1.6vw, 20px);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.result-card__btn--primary {
  background: #fd8e27;
  color: #2b2926;
}
.result-card__btn--secondary {
  background: #2b2926;
  color: var(--yellow);
}

@media (max-height: 750px) {
  .quiz-panel__title { font-size: 26px; }
  .quiz-intro__copy { margin-top: 16px; }
  .quiz-intro__cta { margin-top: 14px; }
  .quiz-intro__note { margin-top: 10px; }
  .quiz-step__label { margin-top: 14px; }
}

@media (max-width: 700px) {
  .quiz-panel { padding: 20px 20px; }
}

/* ---------- mobile (Figma node 178:1100 intro / 178:1644 step1 / 181:1870
   loading / 181:2099,2343,2576,2791 results — 390px reference frame).
   One CSS pass drives every page here since they all share quiz.css. ---------- */
@media (max-width: 480px) {
  /* mobile header sits above the ticker (reverse of desktop) — reorder via
     flex instead of moving markup. Real sizing (38px, sized down from Figma's
     64px per direct user feedback) lives in ../styles.css's .nav mobile
     block, which this page inherits. */

  /* the desktop quiz experience locks to exactly one 100vh viewport with no
     scroll (height:100%; overflow:hidden on the body, flex:1 on main/panel).
     On a real phone that fixed-height math doesn't leave room for this much
     content and was producing a stray gap between the ticker and the panel —
     switch to a normal, scrollable page instead of fighting the viewport lock */
  html, body.quiz-body { height: auto; }
  body.quiz-body { overflow: visible; }
  main.quiz-main { flex: none; min-height: 0; }
  .quiz-panel { flex: none; min-height: calc(100vh - 74px); }

  .nav { order: 1; }
  .ticker { order: 2; }
  main.quiz-main { order: 3; }

  .quiz-panel { padding: 20px; margin-top: 0; }

  /* the 7 desktop sparkles were positioned as % of the (very wide) desktop
     panel — reused as-is they shrank to a fraction of their intended size on
     a 390px screen. Figma's mobile frame repositions 6 of them at fixed px
     sizes (the 7th, rotate 96.83deg, isn't part of the mobile design) */
  .quiz-panel .sparkle:nth-of-type(1) { left: 193px !important; top: 653px !important; width: 93px !important; height: 68px !important; }
  .quiz-panel .sparkle:nth-of-type(2) { left: 45px !important; top: 61px !important; width: 48px !important; height: 49px !important; }
  .quiz-panel .sparkle:nth-of-type(3) { display: none !important; }
  .quiz-panel .sparkle:nth-of-type(4) { left: 346px !important; top: 368px !important; width: 61px !important; height: 94px !important; }
  .quiz-panel .sparkle:nth-of-type(5) { left: -68px !important; top: 284.56px !important; width: 94px !important; height: 56px !important; }
  .quiz-panel .sparkle:nth-of-type(6) { left: 87px !important; top: 431px !important; width: 48px !important; height: 46px !important; }
  .quiz-panel .sparkle:nth-of-type(7) { left: 320px !important; top: 118px !important; width: 48px !important; height: 46px !important; }

  .quiz-panel__title { font-size: 18px; }
  .quiz-panel__subtitle { font-size: 14px; margin-top: 6px; }

  /* intro (178:1100) */
  .quiz-intro__copy { font-size: 12px; margin-top: 24px; max-width: 244px; }
  .quiz-intro__cta { font-size: 12px; padding: 8px 18px; margin-top: 20px; }
  .quiz-intro__note { font-size: 12px; margin-top: 12px; }

  /* steps (178:1644 template, reused for step 2-6) */
  .quiz-step__label { font-size: 12px; margin-top: 16px; }
  .quiz-dots { gap: 10px; margin-top: 8px; }
  .quiz-dot { width: 5px; height: 5px; }
  .quiz-step__question { font-size: 14px; margin-top: 16px; }
  .quiz-options { max-width: 282px; gap: 9px; margin-top: 16px; }
  .quiz-option { font-size: 12px; padding: 12px 10px; }

  /* loading (181:1870) */
  .quiz-loading__text { font-size: 14px; }
  .quiz-loading__dots { width: 44px; margin-top: 8px; }

  /* result card (181:2099 / 2343 / 2576 / 2791) — Figma stacks the two
     buttons full-width instead of the desktop side-by-side pair */
  /* card's inner content is 250px wide in Figma (181:3050 etc.), inside a
     20px all-around padding — 290px total, not the 250px total this used */
  .result-card {
    width: min(290px, 84vw);
    max-height: none;
    border-radius: 22px;
    padding: 20px;
  }
  .result-card__badge { font-size: 16px; padding: 6px 26px; }
  .result-card__headline { font-size: 14px; margin-top: 20px; }
  .result-card__desc { font-size: 10px; margin-top: 7px; line-height: 1.41; }
  .result-card__photo { margin-top: 20px; aspect-ratio: auto; height: 166px; border-radius: 12px; }
  /* each result card has its own manual pan-crop offset in Figma (mobile
     nodes 181:2099/2343/2576/2791) computed against the 250x166 inner photo
     box; inline styles win over a plain class override, so these need
     !important, scoped per page via the body class added above */
  .result-juicy .result-card__photo-frame {
    left: -2% !important;
    top: 7.229% !important;
    width: 110.4% !important;
    height: 166.265% !important;
  }
  .result-balanced .result-card__photo-frame {
    left: 5.6% !important;
    top: 9.036% !important;
    width: 102.4% !important;
    height: 115.663% !important;
  }
  .result-camping .result-card__photo-frame {
    left: 7.2% !important;
    top: 7.229% !important;
    width: 89.2% !important;
    height: 104.819% !important;
  }
  .result-party .result-card__photo-frame {
    left: 8% !important;
    top: 6.325% !important;
    width: 90.4% !important;
    height: 136.145% !important;
  }
  .result-card__tag { font-size: 12px; margin-top: 25px; }
  .result-card__product { font-size: 14px; margin-top: 4px; white-space: normal; }
  .result-card__actions { flex-direction: column; width: 100%; margin-top: 10px; gap: 10px; }
  .result-card__btn { width: 100%; max-width: none; height: 36px; font-size: 12px; }
}
