:root {
  --bg: #0d0d0d;
  --ink: #f4efe4;
  --muted: rgba(244, 239, 228, 0.62);
  --line: rgba(244, 239, 228, 0.18);
  --accent: #cc8a00;
  --accent-ink: #0d0d0d;
  --card-bg: #0d0d0d;
  --radius: 18px;
  --font: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Result themes, set on <body data-flavour> */
body[data-flavour="classic"] { --bg: #0d0d0d; --ink: #f4efe4; --muted: rgba(244,239,228,.66); --line: rgba(204,138,0,.45); --accent: #cc8a00; --accent-ink: #0d0d0d; }
body[data-flavour="mango"]   { --bg: #ffb33f; --ink: #141414; --muted: rgba(20,20,20,.72); --line: rgba(20,20,20,.25); --accent: #141414; --accent-ink: #ffb33f; }
body[data-flavour="lime"]    { --bg: #97d700; --ink: #141414; --muted: rgba(20,20,20,.72); --line: rgba(20,20,20,.25); --accent: #141414; --accent-ink: #97d700; }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#app {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  display: grid;
}
.screen {
  grid-area: 1 / 1;
  display: none;
  flex-direction: column;
  min-height: calc(100dvh - 44px);
}
.screen.is-active { display: flex; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.wordmark { font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.wordmark--small { font-size: 16px; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 56px; padding: 0 24px;
  border-radius: 999px; font-weight: 700; font-size: 17px; letter-spacing: .02em;
  text-decoration: none; transition: transform .15s var(--ease), opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn--link { min-height: 40px; font-weight: 500; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); }
.btn--inline { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body[data-flavour="classic"] :focus-visible, body:not([data-flavour]) :focus-visible { outline-color: #cc8a00; }

/* Welcome */
.screen--welcome { justify-content: space-between; }
.welcome__body { display: flex; flex-direction: column; gap: 20px; }
.welcome__body h1 { font-size: clamp(44px, 13vw, 60px); line-height: .98; font-weight: 800; letter-spacing: -.03em; }
.lede { font-size: 19px; line-height: 1.4; color: var(--muted); max-width: 30ch; margin-bottom: 12px; }
.fineprint { font-size: 13px; letter-spacing: .08em; color: var(--muted); text-align: center; }

/* Question */
.qhead { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; margin-bottom: 40px; }
.btn--back { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); font-size: 18px; }
.btn--back[disabled] { opacity: .25; cursor: default; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s var(--ease); }
.progress__label { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.5ch; text-align: right; }
.qtext { font-size: clamp(30px, 8.5vw, 40px); line-height: 1.08; font-weight: 800; letter-spacing: -.02em; margin-bottom: 32px; }
.answers { display: flex; flex-direction: column; gap: 12px; }
.answer {
  text-align: left; width: 100%; padding: 18px 20px; min-height: 64px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  font-size: 18px; line-height: 1.35; font-weight: 500;
  transition: border-color .15s, background-color .15s, transform .15s var(--ease);
}
.answer:hover { border-color: var(--accent); }
.answer.is-picked { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: scale(.985); }

/* Loading */
.screen--loading { align-items: center; justify-content: center; gap: 28px; }
.loading__text { font-size: 20px; font-weight: 500; color: var(--muted); }
.bubbles { position: relative; width: 120px; height: 120px; }
.bubbles span {
  position: absolute; bottom: 0; border-radius: 50%; border: 2px solid var(--accent);
  animation: bubble 1.4s infinite ease-in;
}
.bubbles span:nth-child(1) { left: 10%; width: 18px; height: 18px; animation-delay: 0s; }
.bubbles span:nth-child(2) { left: 40%; width: 26px; height: 26px; animation-delay: .25s; }
.bubbles span:nth-child(3) { left: 70%; width: 14px; height: 14px; animation-delay: .5s; }
.bubbles span:nth-child(4) { left: 25%; width: 10px; height: 10px; animation-delay: .75s; }
.bubbles span:nth-child(5) { left: 58%; width: 20px; height: 20px; animation-delay: 1s; }
@keyframes bubble { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-110px); opacity: 0; } }

/* Result */
.screen--result { gap: 18px; padding-top: 8px; }
.result__eyebrow { font-size: 14px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; color: var(--muted); text-align: center; }
.card {
  background: var(--card-bg); color: #f4efe4; border-radius: 24px; overflow: hidden;
  padding: 0 0 24px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
  border: 1px solid var(--line);
}
.card__photo { aspect-ratio: 1 / 1; overflow: hidden; }
.card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__name { font-size: clamp(42px, 12vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-top: -8px; color: var(--flav, #f4efe4); }
.card__words { font-size: 20px; letter-spacing: .04em; font-weight: 700; margin-top: 10px; opacity: .95; }
.card__wink { font-size: 18px; font-style: italic; margin: 12px 24px 0; opacity: .8; }
.result__about { font-size: 18px; line-height: 1.5; }
.result__actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.result__again { font-size: 15px; color: var(--muted); text-align: center; }
.result__foot { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hero-line { font-size: 14px; color: var(--muted); }

/* Result panels: Did we nail it?, Mixed AF, insights */
.panel { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px; border: 1.5px solid var(--line); border-radius: var(--radius); }
.panel__title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.panel__body { font-size: 16px; line-height: 1.45; color: var(--muted); }
.panel__fine { font-size: 13px; line-height: 1.45; color: var(--muted); }
.panel__fine a { color: inherit; text-underline-offset: 3px; }
.panel__done { font-size: 16px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  font-size: 15px; font-weight: 500; line-height: 1.2; text-align: left;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mixed { text-align: center; align-items: center; }
.mixed__line { font-size: 18px; font-weight: 700; line-height: 1.35; max-width: 28ch; }
.insight__group { border: 0; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.insight__group legend { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.insight__suburb { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); margin-top: 4px; }
.insight__suburb input {
  min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: transparent; color: var(--ink); font: inherit; font-size: 16px;
}
.insight__suburb input:focus { outline: none; border-color: var(--accent); }
.insight__actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }
.insight.is-done .insight__group, .insight.is-done .insight__actions, .insight.is-done .panel__body { display: none; }

/* Email sign-up */
.join { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px; border: 1.5px solid var(--line); border-radius: var(--radius); }
.join__title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.join__body { font-size: 16px; line-height: 1.45; color: var(--muted); margin-bottom: 4px; }
.join__label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.join__row { display: flex; flex-direction: column; gap: 10px; }
.join input[type="email"] {
  width: 100%; min-height: 54px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  font: inherit; font-size: 17px;
}
.join input[type="email"]::placeholder { color: var(--muted); }
.join input[type="email"]:focus { outline: none; border-color: var(--accent); }
.join input[aria-invalid="true"] { border-color: #e2412d; }
.join__submit[disabled] { opacity: .6; cursor: wait; }
.join__consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; cursor: pointer; margin-top: 4px; }
.join__consent input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.join__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.join__status { font-size: 15px; font-weight: 500; min-height: 1.4em; }
.join__status.is-error { color: #e2412d; }
body[data-flavour="mango"] .join__status.is-error, body[data-flavour="lime"] .join__status.is-error { color: #8a1205; }
.join__fine { font-size: 13px; color: var(--muted); }
.join__fine a { color: inherit; text-underline-offset: 3px; }
.join.is-done .join__row, .join.is-done .join__consent, .join.is-done .join__label, .join.is-done .join__body { display: none; }
@media (min-width: 420px) { .join__row { flex-direction: row; } .join__submit { width: auto; flex: none; } }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  background: #f4efe4; color: #0d0d0d; padding: 12px 18px; border-radius: 99px; font-weight: 500; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
