/* ==========================================================================
   Text to image - Theme 1 — JONK (Asse) look & feel
   Structure follows the Figma wireframes (progress bar, conversation, input
   bar, tiles, carousels, cards).

   Visual idea: a fresh white phone frame on the brand cream page. The JONK
   colours are used at full strength but each has
   ONE job, so colour always means something:
     pink     -> you (your own messages)
     yellow   -> a choice you made, something you earned, and hints (nudges)
     cyan     -> progress (a deeper tone where it carries white text)
     magenta  -> the send button (all suggestion chips look the same)
   Olive and orange only appear as small accents (card tops).
   Aimed at 16-25 year olds: led by ink and white, flat icons without outlines,
   a sober selected state and little bounce. No decorative graphics inside the phone frame; motion is reserved for small
   rewards (choosing, sending, supporting an idea, the result, the finish).
   ========================================================================== */

/* ---- Font -----------------------------------------------------------------
   Brand font is Azo Sans. It is a licensed font and its files are not in the
   brand package, so this only picks it up when it is installed on the device.
   To use it everywhere, add the files to assets/fonts/ and extend the src
   lists below, e.g.  url("assets/fonts/AzoSans-Medium.woff2") format("woff2").
   Until then DM Sans (a clean geometric sans) is the stand-in.        */
@font-face { font-family: "Azo Sans"; font-weight: 400; src: local("Azo Sans"), local("AzoSans-Regular"), local("Azo Sans Regular"); }
@font-face { font-family: "Azo Sans"; font-weight: 500; src: local("Azo Sans Medium"), local("AzoSans-Medium"); }
@font-face { font-family: "Azo Sans"; font-weight: 600; src: local("Azo Sans Bold"), local("AzoSans-Bold"); }
@font-face { font-family: "Azo Sans"; font-weight: 700; src: local("Azo Sans Black"), local("AzoSans-Black"), local("Azo Sans Bold"), local("AzoSans-Bold"); }

:root {
  /* Brand colours (Jonk-kleuren.pdf), used at full strength */
  --yellow: #FDC300;
  --pink: #F29FC5;
  --bubble: #F9D6E6;                   /* your own messages: a soft tint of the brand pink */
  --cyan: #00ACC9;
  --olive: #BEBD00;
  --orange: #E8500E;
  --magenta: #C70065;
  --cream: #F2F1D5;
  --ink: #1D1D1B;
  --white: #FFFFFF;

  --paper: #FFFFFF;                    /* the phone frame is white; the page behind it is the brand cream (--page) */
  --page: var(--cream);                /* desktop backdrop */
  --line: rgba(29, 29, 27, 0.1);
  --line-strong: rgba(29, 29, 27, 0.22);
  --text-soft: rgba(29, 29, 27, 0.6);
  --magenta-dark: #A8005A;

  --font: "Azo Sans", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --shadow-s: 0 1px 2px rgba(29, 29, 27, 0.06);
  --shadow-m: 0 2px 14px rgba(29, 29, 27, 0.08);
  --shadow-lift: 0 6px 18px rgba(29, 29, 27, 0.12);
  --shadow-l: 0 16px 44px rgba(29, 29, 27, 0.14);

  --ease: cubic-bezier(0.25, 0.8, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background-color: var(--page);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---- Back link (same subtle bar as the other prototypes) ----------------- */
.flow-nav { position: fixed; top: 10px; left: 16px; z-index: 30; }
.flow-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.flow-nav a:hover { opacity: 1; }

/* ---- Desktop backdrop: outside the phone frame, hidden on phones ---------- */
/* Three big JONK shapes in their own colours, peeking out from behind the phone. They keep their
   place relative to the frame at any window width. */
.backdrop {
  --half: 210px; /* half of the phone frame's width */
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bd { position: absolute; display: block; background: center / contain no-repeat; }
.bd--yellow { background-image: url("assets/brand/ellipse-yellow.svg"); width: 680px; height: 556px; right: calc(50% + var(--half) - 170px); bottom: -190px; }
.bd--magenta { background-image: url("assets/brand/blob-magenta.svg"); width: 460px; height: 380px; left: calc(50% + var(--half) - 110px); top: -120px; }
.bd--olive { background-image: url("assets/brand/wave-olive.svg"); width: 420px; height: 210px; left: calc(50% + var(--half) + 30px); bottom: 40px; }

/* ---- App shell ------------------------------------------------------------ */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: min(860px, calc(100dvh - 48px));
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  box-shadow: var(--shadow-l);
  overflow: hidden;
}

/* ---- Phone status bar (desktop frame only) --------------------------------- */
.statusbar {
  position: relative;
  z-index: 7;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 4px 28px 0 30px;
  background: var(--paper);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.sb-icons { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.sb-icons svg { display: block; fill: currentColor; }

/* ---- chat/progress-bar ---------------------------------------------------- */
.progress {
  position: relative;
  z-index: 6;
  flex: none;
  height: 6px;
  background: rgba(29, 29, 27, 0.08);
}
.progress-fill {
  position: relative;
  height: 100%;
  width: 11%;
  background: var(--cyan);
  border-radius: 0 6px 6px 0;
  overflow: hidden;
  transition: width 0.5s var(--ease);
}
/* ---- conversation --------------------------------------------------------- */
.conversation {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 20px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.conversation::-webkit-scrollbar { display: none; }
.conversation > * { flex: none; }

/* chat — bot message: plain text, no bubble (as in the wireframes) */
.msg { margin: 0; max-width: 100%; overflow-wrap: anywhere; }
/* Emoji get their own font and a hair of room so they never touch the next word */
.emo {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  margin-inline: 0.04em 0.2em;
}
.msg--bot {
  white-space: pre-line;             /* blank lines in the copy ("\n\n") stay blank lines */
  align-self: flex-start;
  max-width: 94%;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  animation: fadeUp 0.4s var(--ease) both;
}

/* chat/message/user — right aligned bubble; it flies up from the input */
.msg--user {
  align-self: flex-end;
  max-width: 84%;
  padding: 10px 16px;
  background: var(--bubble);
  color: var(--ink);
  border-radius: 20px 20px 6px 20px;
  font-weight: 500;
  line-height: 1.4;
  transform-origin: 100% 100%;
  animation: sendIn 0.3s var(--ease) both;
}

/* chat/typing-indicator: three little dots in brand colours */
.typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 12px 15px;
  background: var(--white);
  border-radius: 18px 18px 18px 6px;
  animation: fade 0.25s ease both;
}
.typing-dots { display: inline-flex; gap: 5px; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(29, 29, 27, 0.35); animation: hop 1.1s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

/* ---- chat/input-bar ------------------------------------------------------- */
.input-bar {
  position: relative;
  z-index: 4;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
  max-height: 520px;
  transition: max-height 0.3s var(--ease), padding 0.3s var(--ease), opacity 0.2s ease, border-color 0.3s ease;
}

/* chat/chip row (does not wrap: swipe sideways) */
.chips {
  display: flex;
  gap: 8px;
  margin: 0 -14px;
  padding: 2px 14px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 14px;      /* snap with the same 14px gutter, so the first chip lines up with the field */
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  scroll-snap-align: start;
  padding: 9px 16px;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
  animation: fadeUp 0.4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.chip:hover { border-color: var(--ink); }
.chip:active { background: rgba(29, 29, 27, 0.06); }
/* shown only as a hint of what the real chat offers: not clickable */
.chip--static { cursor: default; user-select: none; }
.chip--static:hover { border-color: var(--line-strong); }
.chip--static:active { background: var(--white); }

/* chat/nudge — sits right above the field so the field never jumps */
.nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--cream);
  border-radius: 12px;
  animation: fadeUp 0.3s var(--ease) both;
}
.nudge-icon { flex: none; }
.nudge-icon--error { display: none; }

/* An error is quieter than a tip: no card, just a small alert icon and one line
   of text, and the field itself gets an orange line. */
.nudge--error { align-items: center; padding: 0 6px; background: none; }
.nudge--error .nudge-icon { display: none; }
.nudge--error .nudge-icon--error { display: block; margin-top: 0; }
.nudge--error .nudge-text { font-size: 0.84rem; font-weight: 500; }
.input-bar:has(.nudge--error:not([hidden])) .field { border-color: var(--orange); }
.input-bar:has(.nudge--error:not([hidden])) .field:focus-within { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(232, 80, 14, 0.15); }
.nudge-text { margin: 0; font-size: 0.84rem; font-weight: 500; line-height: 1.45; }

/* field + send */
.field {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0;
  padding: 4px 4px 4px 18px;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 26px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(0, 172, 201, 0.2); }
.field-input {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 112px;
  padding: 9px 0;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  font-size: 1rem;
  line-height: 1.4;
}
.field-input::placeholder { color: rgba(29, 29, 27, 0.42); }
.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--magenta);
  color: var(--white);
  border: 0;
  border-radius: 50%;
  transition: transform 0.2s var(--ease), opacity 0.2s ease, background 0.15s ease;
}
.send:disabled { opacity: 0.25; cursor: default; }
.send:not(:disabled):hover { background: var(--magenta-dark); transform: scale(1.06); }
.send:not(:disabled):active { transform: scale(0.9); }

.locked { display: flex; flex: 1; align-items: center; justify-content: center; margin: 0; text-align: center; font-size: 0.875rem; font-weight: 500; color: var(--text-soft); }

/* locked: there is a choice to make above, so the bar says so. idle: nothing to answer right now,
   the bar stays empty. Both keep the height of a field, so nothing jumps. */
.input-bar[data-mode="locked"] { min-height: 74px; }
/* idle: there is nothing to answer, so the bar is not there at all (it slides away softly) */
.input-bar[data-mode="idle"] { max-height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; border-top-color: transparent; opacity: 0; overflow: hidden; pointer-events: none; }
/* done: the result is shown, there is nothing left to answer, so no bar at all */
.input-bar[data-mode="done"] { display: none; }
.app:has(.input-bar[data-mode="done"]) .conversation { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.input-bar:not([data-mode="text"]):not([data-mode="voice"]) .field { display: none; }
.input-bar:not([data-mode="locked"]) .locked { display: none; }
/* ---- Speech: the microphone sits inside the field, like in familiar chat apps ---------- */
/* the demo chooser above the field: what "is said" */
.voice-demo { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 2px 0 4px; animation: fadeUp 0.3s var(--ease) both; }
.voice-demo[hidden] { display: none; }
.voice-demo-label { margin: 0; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); }
.voice-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.voice-chip {
  padding: 9px 16px;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.15s ease;
}
.voice-chip:hover { border-color: var(--ink); }
/* open questions: the field is for speaking, so there is no send button, only the microphone */
.input-bar[data-mode="voice"] .send { display: none; }
.field.is-voice { cursor: pointer; padding-right: 6px; }
.field.is-voice .field-input { cursor: pointer; }
.field.is-voice .field-mic { color: var(--ink); }
.field.is-voice.is-listening .field-input::placeholder { color: var(--magenta); }

/* the microphone inside a text field */
.field-mic {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  color: var(--text-soft);
  border: 0;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
}
.field-mic[hidden] { display: none; }
.field-mic:hover { color: var(--ink); background: rgba(29, 29, 27, 0.06); }
.field.is-listening { border-color: var(--magenta); box-shadow: 0 0 0 4px rgba(199, 0, 101, 0.15); }
.field.is-listening .field-mic { color: var(--white); background: var(--magenta); animation: micPulse 1.6s ease-out infinite; }
@keyframes wave { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }
@keyframes micPulse { 0% { box-shadow: 0 0 0 0 rgba(199, 0, 101, 0.35); } 100% { box-shadow: 0 0 0 16px rgba(199, 0, 101, 0); } }
@keyframes caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ---- Answers: chat/scale-tile (emoji tiles, scale tiles, text chips) ------ */
.ask { display: flex; flex-direction: column; gap: 10px; }
.answers { display: flex; flex-wrap: wrap; gap: 8px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease;
  animation: fadeUp 0.4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.tile:hover { border-color: var(--ink); }
.tile:active { background: rgba(29, 29, 27, 0.04); }
/* tile icons: our own JONK-style SVGs (icons.js) */
.tile-icon { display: block; width: 46px; height: 46px; transition: transform 0.2s ease; }
.tile-icon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tile:hover .tile-icon { transform: scale(1.05); }
/* shown but not clickable (the other themes at the end) */
.tile--static { cursor: default; user-select: none; }
.tile--static:hover { border-color: var(--line-strong); }
.tile--static:active { background: var(--white); }
.tile--static:hover .tile-icon { transform: none; }
.answers--scale .tile-icon { width: 34px; height: 34px; }
.answers--themes .tile-icon { width: 40px; height: 40px; }
.tile--chip .tile-icon { display: none; }
/* the same icon in front of an answer in the user's bubble */
.bubble-icon { display: inline-block; width: 22px; height: 22px; margin-right: 8px; vertical-align: -6px; }
.bubble-icon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tile-label { font-size: 0.93rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
/* the chosen answer: an ink frame and a small checked badge */
.tile.is-selected {
  background: var(--white);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.tile.is-selected::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.4 2.4 4.6-5' fill='none' stroke='%231D1D1B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  animation: fade 0.25s ease both;
}
.answers--scale .tile.is-selected::after { top: 4px; right: 4px; width: 13px; height: 13px; background-size: 8px; }
.tile--chip.is-selected { background: var(--ink); color: var(--white); box-shadow: none; }
.tile--chip.is-selected::after { display: none; }

.answers--2 .tile { flex: 1 1 calc(50% - 4px); min-height: 88px; }
.answers--scale { flex-wrap: nowrap; gap: 6px; }
.answers--scale .tile { flex: 1 1 0; min-width: 0; padding: 12px 0 10px; border-radius: 10px; }
.answers--scale .tile-label { font-size: 1rem; }
.tile--chip { flex: 0 0 auto; flex-direction: row; padding: 11px 17px; border-radius: 999px; }
.answers.is-done .tile:not(.is-selected) { opacity: 0.35; pointer-events: none; }
.answers.is-done .tile.is-selected { pointer-events: none; }

.scale-labels { display: flex; justify-content: space-between; margin-top: -4px; padding: 0 2px; font-size: 0.74rem; font-weight: 500; color: var(--text-soft); }

/* Collapse a finished answer block (answered frames only keep the bubble) */
.is-collapsing { overflow: hidden; animation: collapse 0.4s ease forwards; }

/* Style / Showing choice block */
.choice { display: flex; flex-direction: column; gap: 12px; }
.choice-label { margin: 6px 0 -2px; text-align: center; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-soft); }
.link-skip {
  align-self: center;
  padding: 4px 6px;
  background: none;
  border: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.link-skip:hover { color: var(--ink); }

/* ---- Carousels and cards -------------------------------------------------- */
.carousel {
  display: flex;
  gap: 12px;
  margin: 0 -20px;
  padding: 4px 20px 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 20px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.info-card, .contrib-card {
  position: relative;
  flex: 0 0 80%;
  scroll-snap-align: start;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-m);
  overflow: hidden;
  display: flex;                    /* the row stretches all cards to the tallest one; the content fills them */
  flex-direction: column;
  scale: var(--sc, 1);              /* the card in front is a little bigger (set from flow.js) */
  transition: scale 0.2s ease;
  animation: cardIn 0.4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.info-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--accent, var(--pink));
}
/* a big number as an anchor, the same for any content the cards will hold */
/* the closed question after the examples: a card like the example cards, close beneath them */
.ask-card {
  position: relative;
  padding: 16px 16px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-m);
  overflow: hidden;
  margin-top: -6px;
  animation: cardIn 0.4s var(--ease) both;
}
.ask-card .info-title { margin: 0 0 12px; font-size: 1.05rem; }
.info-num { display: block; margin: 4px 0 6px; font-size: 2.8rem; font-weight: 700; line-height: 0.95; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.info-total { margin-left: 2px; font-size: 1rem; font-weight: 500; letter-spacing: 0; color: rgba(29, 29, 27, 0.32); }
.info-title { margin: 0 0 8px; font-size: 1.05rem; font-weight: 600; line-height: 1.25; }
.info-body { margin: 0; font-size: 0.9rem; font-weight: 400; line-height: 1.55; color: rgba(29, 29, 27, 0.8); }

.contrib-card { padding: 14px; }
.contrib-count { display: block; margin: 0 2px 8px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; color: rgba(29, 29, 27, 0.32); }
.contrib-img { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--cream); }
.contrib-img img, .image-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.contrib-text { flex: 1 1 auto; margin: 14px 2px 14px; font-size: 0.95rem; font-weight: 400; line-height: 1.5; }
/* The like button: icon only and quiet (white, a thin line, an ink thumb), at the
   bottom left of the idea. It starts as an empty thumb; liking fills it in magenta. */
.contrib-foot { display: flex; justify-content: flex-start; }

.like {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px 0 12px;
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease;
}
.like:hover { border-color: var(--ink); }
.like:active { transform: scale(0.94); }
.like-icon { display: block; width: 26px; height: 26px; transform-origin: 50% 80%; }
.like-icon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.like-icon--on { display: none; }
.like.is-on .like-icon--off { display: none; }
.like.is-on .like-icon--on { display: block; animation: thumb 0.4s var(--ease); }
.like-count { display: inline-block; min-width: 1.4em; text-align: left; font-variant-numeric: tabular-nums; }
.like.is-on { border-color: var(--magenta); }
/* double-tap on the picture: a big thumb pops over it */
.big-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(29, 29, 27, 0.3));
  animation: bigThumb 0.7s var(--ease) forwards;
}
.big-thumb svg { display: block; width: 100%; height: 100%; }

/* where you are in the row of ideas */
.carousel-wrap { display: flex; flex-direction: column; }

/* ---- Generated image ------------------------------------------------------ */
.gen {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(110deg, #fff 30%, #f3f4f4 50%, #fff 70%) 0 0 / 220% 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  animation: shimmer 2.8s linear infinite, fade 0.3s ease both;
}
.gen--thinking { aspect-ratio: auto; height: 110px; }

/* Waiting for the example cards or other people's ideas: card-shaped surfaces in the size of the
   real cards, with the status line inside the first one */
.gen--card { flex: 0 0 80%; aspect-ratio: auto; height: var(--h, 340px); box-shadow: var(--shadow-m); }
.wait--info { --h: 343px; }
.wait--ideas { --h: 239px; }
.gen .status { padding: 0 18px; }

/* The status line, the same in every waiting state: the Jonk eye looks around on the left, and
   the copy says what is being worked on, with the same shimmer running through the words */
.status { display: flex; align-items: center; justify-content: center; gap: 10px; }
.status-eye { flex: none; display: block; width: 28px; height: 28px; }
.status-eye svg { display: block; width: 100%; height: 100%; overflow: visible; }
.status-pupil { animation: look 4s ease-in-out infinite; }
.status-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  background: linear-gradient(100deg, rgba(29, 29, 27, 0.52) 30%, #1D1D1B 50%, rgba(29, 29, 27, 0.52) 70%) 0 0 / 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 2.8s linear infinite;
}
.status-text span.is-in { animation: fade 0.5s ease both; }
@media (prefers-reduced-motion: reduce) {
  .status-text { background: none; -webkit-text-fill-color: var(--text-soft); color: var(--text-soft); }
  .status-pupil { animation: none; }
}
.image-card {
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-m);
  animation: cardIn 0.4s var(--ease) both;
}
.image-frame { aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--cream); }
.image-frame.is-reveal img { animation: focusIn 0.7s var(--ease) both; }
.image-caption { margin: 12px 4px 4px; font-size: 0.97rem; font-weight: 400; line-height: 1.5; }

/* ---- End screen ----------------------------------------------------------- */
.panel {
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-m);
  animation: cardIn 0.4s var(--ease) both;
}

/* "You're not alone": a crowd of little Jonk eyes, you among them */
.crowd {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 7px;
  margin: 0 2px 18px;
}
.person {
  --c: var(--cyan);
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  transform: scale(var(--s, 1));
}
/* the white of the eye (an almond shape, like the logo) ... */
.person::before {
  content: "";
  position: absolute;
  left: 13%;
  right: 13%;
  top: 28%;
  bottom: 28%;
  border-radius: 50%;
  background: var(--white);
}
/* ... and the pupil, which looks towards you or the pointer */
.person::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  height: 30%;
  margin: -15% 0 0 -15%;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(calc(var(--px, 0) * 1px), calc(var(--py, 0) * 1px));
  transition: transform 0.3s ease;
}
/* you: the full brand pink, a little bigger, with a ring */
.person--you {
  --c: var(--pink);
  --s: 1.65;
  z-index: 2;
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--ink);
}
.alone-title { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.alone-body { margin: 0; font-size: 0.95rem; font-weight: 400; line-height: 1.55; }
/* "You're not alone": the number big next to a small group of eyes */
/* the number is part of the sentence: same size and line as the rest, only bold */
.alone-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.theme-text { margin-bottom: 12px; }
/* top row of every result card: a round badge with an icon, then the title */
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-badge { flex: none; display: grid; place-items: center; width: 44px; height: 44px; background: var(--cream); border-radius: 50%; }
.panel-badge svg { display: block; width: 28px; height: 28px; }
.answers--themes .tile { flex: 1 1 calc(50% - 4px); min-height: 82px; padding: 12px 6px; }
.answers--themes .tile-label { font-size: 0.85rem; }

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.15s ease, box-shadow 0.2s ease;
  animation: cardIn 0.4s var(--ease) both;
}
.btn-outline:hover { border-color: var(--ink); }
.btn-outline:active { transform: scale(0.97); }

/* ---- Jonk in the thread: the 3D mascot (jonk3d.js) -------------------------
   He is the first thing in the conversation (and comes back at the end), so he
   scrolls away like any message. A horizontal drag spins him; vertical drags
   still scroll the chat. */
.jonk-hero {
  position: relative;
  align-self: center;
  width: min(210px, 60%);
  aspect-ratio: 1;
  margin: -6px 0 -10px;
  animation: fadeUp 0.6s var(--ease) both;
}
.jonk-stage { position: absolute; inset: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.jonk-stage:active { cursor: grabbing; }
.jonk-stage canvas { display: block; width: 100%; height: 100%; }
.jonk-still { display: block; width: 100%; height: 100%; object-fit: contain; animation: stillBob 3.4s ease-in-out infinite; }
/* a thumb that swipes across him while he sleeps: the hint that he can be spun */
.jonk-hint { position: absolute; inset: 0; pointer-events: none; transition: opacity 0.4s ease; }
.jonk-hint.is-gone { opacity: 0; }
.jonk-hint .thumb {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: rgba(29, 29, 27, 0.1);
  border: 2px solid rgba(29, 29, 27, 0.45);
  animation: swipe 2.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}


/* ---- Keyframes ------------------------------------------------------------ */
@keyframes bigThumb {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
@keyframes swipe {
  0% { transform: translate(-60px, 6px); opacity: 0; }
  15% { opacity: 1; }
  70% { transform: translate(60px, -6px); opacity: 1; }
  100% { transform: translate(60px, -6px); opacity: 0; }
}
@keyframes stillBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes sendIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-3px); } }
@keyframes thumb { 0% { transform: scale(1); } 40% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes look { 0%, 100% { transform: translate(-4px, 0); } 30% { transform: translate(4px, 0); } 55% { transform: translate(3px, -3px); } 78% { transform: translate(-3px, 2px); } }
@keyframes focusIn { from { opacity: 0; filter: blur(6px); transform: scale(1.02); } to { opacity: 1; filter: none; transform: none; } }
@keyframes collapse { 0% { opacity: 1; max-height: 600px; } 60% { opacity: 0; } 100% { opacity: 0; max-height: 0; margin-top: -16px; padding-top: 0; padding-bottom: 0; } }

/* ---- Phones: full-screen app, no frame, no backdrop ----------------------- */
@media (max-width: 520px) {
  body { padding: 28px 0 0; background: var(--paper); align-items: stretch; }
  .backdrop { display: none; }
  .statusbar { display: none; } /* a real phone already shows its own status bar */
  .app {
    width: 100%;
    height: calc(100dvh - 28px);
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }
  .flow-nav { top: 6px; }
}

@media (max-height: 640px) {
  .conversation { gap: 12px; padding-top: 16px; }
}

/* ---- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .conversation { scroll-behavior: auto; }
  .jonk-hint { display: none; }
  .jonk-still { animation: none; }
}
