/* ── Product Match Quiz — roastery chalk & copper ───────────────────
   Espresso-charcoal ground with burlap weave, chalk-white hand
   lettering with copper underline swash, tasting-card choices with
   copper ring stamps, coffee-bean progress, tasting-flight result. */

:root {
  --espresso: #2b211c;
  --espresso-deep: #1f1712;
  --chalk: #f2ece2;
  --chalk-soft: #b8ac9c;
  --copper: #c47f4a;
  --copper-bright: #dd9a63;
  --cream: #f6efe2;
  --ink-on-cream: #33261e;
  --err: #e07856;
  --script: 'Caveat', cursive;
  --serif: 'Fraunces', serif;
  --sans: 'Karla', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--sans);
  color: var(--chalk);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background:
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(242, 236, 226, 0.014) 3px 4px),
    repeating-linear-gradient(-45deg, transparent 0 3px, rgba(0, 0, 0, 0.05) 3px 4px),
    linear-gradient(180deg, var(--espresso), var(--espresso-deep));
  background-attachment: fixed;
  min-height: 100vh;
}

.roastery { min-height: 100vh; display: flex; flex-direction: column; }

.wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 24px; }

main { flex: 1 0 auto; padding-bottom: 60px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 46px 24px 8px; }

.cup { width: 96px; height: 88px; color: var(--chalk); opacity: 0.9; }

.steam { animation: drift 3.4s ease-in-out infinite; }
.steam.s2 { animation-delay: 0.6s; }
.steam.s3 { animation-delay: 1.2s; }

@keyframes drift {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50%      { opacity: 0.9;  transform: translateY(-3px); }
}

.kicker {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--copper-bright);
  margin: 16px 0 10px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 7.5vw, 3.1rem);
  line-height: 1.12;
  color: var(--chalk);
}

.swash {
  font-family: var(--script);
  font-weight: 700;
  font-size: 1.18em;
  color: var(--copper-bright);
  position: relative;
  white-space: nowrap;
}

.swash::after {
  content: '';
  position: absolute;
  left: 4%;
  right: 2%;
  bottom: -4px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--copper), transparent);
  border-radius: 999px;
}

.sub { color: var(--chalk-soft); max-width: 420px; margin: 14px auto 0; }

/* ── Board ────────────────────────────────────────────────────────── */
.board {
  background: rgba(242, 236, 226, 0.045);
  border: 1px solid rgba(196, 127, 74, 0.35);
  border-radius: 16px;
  padding: 30px 30px 28px;
  margin-top: 28px;
  backdrop-filter: blur(2px);
}

/* bean progress */
.beans { display: flex; justify-content: center; gap: 10px; margin-bottom: 24px; }

.bean {
  width: 18px;
  height: 24px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border: 2px solid var(--copper);
  position: relative;
  opacity: 0.35;
  transition: all 0.25s ease;
  transform: rotate(-14deg);
}

.bean::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 12%;
  bottom: 12%;
  width: 2px;
  margin-left: -1px;
  background: var(--copper);
  border-radius: 999px;
}

.bean.filled { background: var(--copper); opacity: 1; }
.bean.filled::after { background: var(--espresso-deep); }
.bean.current { opacity: 1; transform: rotate(-14deg) scale(1.18); }

/* question */
.q-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.28rem;
  line-height: 1.35;
  text-align: center;
  margin-bottom: 22px;
}

.choices { display: grid; gap: 10px; }

.choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--chalk);
  background: rgba(242, 236, 226, 0.05);
  border: 1.5px solid rgba(242, 236, 226, 0.18);
  border-radius: 12px;
  padding: 15px 17px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-btn:hover:not(:disabled) { border-color: var(--copper); background: rgba(196, 127, 74, 0.12); transform: translateX(4px); }
.choice-btn:disabled { cursor: default; }

.choice-btn .ring {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(242, 236, 226, 0.35);
  transition: all 0.15s ease;
}

.choice-btn.picked { border-color: var(--copper-bright); background: rgba(196, 127, 74, 0.2); }
.choice-btn.picked .ring { border-color: var(--copper-bright); background: var(--copper-bright); box-shadow: inset 0 0 0 4px var(--espresso); }

/* ── Gate ─────────────────────────────────────────────────────────── */
.gate { text-align: center; }

.gate-ring {
  display: inline-block;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--copper);
  border-top-color: transparent;
  animation: spin 1.6s linear infinite;
  margin-bottom: 14px;
}

.gate h2 { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; }

.lead { color: var(--chalk-soft); margin: 8px 0 22px; }

.field { margin-bottom: 16px; text-align: left; }

label {
  display: block;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--copper-bright);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 15px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--chalk);
  background: rgba(242, 236, 226, 0.07);
  border: 1.5px solid rgba(242, 236, 226, 0.22);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--copper-bright); }
input.error { border-color: var(--err); }
input::placeholder { color: rgba(184, 172, 156, 0.6); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--espresso-deep);
  background: linear-gradient(180deg, var(--copper-bright), var(--copper));
  border: none;
  border-radius: 10px;
  padding: 16px 30px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
  box-shadow: 0 6px 18px rgba(196, 127, 74, 0.35);
}

.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--chalk); outline-offset: 3px; }

.btn-block { width: 100%; }

.btn.ghost {
  background: transparent;
  color: var(--copper-bright);
  border: 1.5px solid var(--copper);
  box-shadow: none;
  margin-top: 22px;
}

.form-error { color: var(--err); font-weight: 700; text-align: center; margin-top: 14px; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.5px solid rgba(43, 33, 28, 0.35);
  border-top-color: var(--espresso-deep);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result flight card ───────────────────────────────────────────── */
.flight { margin-top: 28px; }

.flight-inner {
  position: relative;
  background: var(--cream);
  color: var(--ink-on-cream);
  border-radius: 8px;
  padding: 40px 36px;
  text-align: center;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
}

.corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--copper);
  border-style: solid;
  border-width: 0;
}

.corner.tl { top: 12px; left: 12px; border-top-width: 3px; border-left-width: 3px; }
.corner.tr { top: 12px; right: 12px; border-top-width: 3px; border-right-width: 3px; }
.corner.bl { bottom: 12px; left: 12px; border-bottom-width: 3px; border-left-width: 3px; }
.corner.br { bottom: 12px; right: 12px; border-bottom-width: 3px; border-right-width: 3px; }

.flight-tag {
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 12px;
}

.flight-inner h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  line-height: 1.25;
}

.roast-dots { display: flex; justify-content: center; gap: 7px; margin: 16px 0; }

.roast-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--copper);
}

.roast-dot.filled { background: var(--copper); }

.result-image {
  max-width: 220px;
  width: 100%;
  border-radius: 8px;
  margin: 6px auto 12px;
  display: block;
}

.flight-desc { color: #6b5b4d; max-width: 440px; margin: 0 auto; }

/* ── Footer ───────────────────────────────────────────────────────── */
.foot {
  text-align: center;
  padding: 30px 20px;
  color: rgba(184, 172, 156, 0.55);
  font-size: 0.8rem;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .board { padding: 24px 18px 22px; }
  .flight-inner { padding: 34px 22px; }
}
