:root {
  color-scheme: light;
  --stage: #F7FAF9;
  --card: #FFFFFF;
  --ink: #0B0D0E;
  --muted: #5F6B6B;
  --faint: #8A9895;
  --line: #E2EBE7;
  --emerald: #06A269;
  --sg: #2AD189;
  --mint: #C6F5DD;
  --deep-teal: #045B5D;
  --blue: #1972DC;
  --ok: #05603F;
  --ok-bg: #E4F6EC;
  --shadow: 0 2px 0 rgba(11,13,14,.03), 0 24px 50px -12px rgba(11,13,14,.18), 0 60px 90px -40px rgba(11,13,14,.22);
  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-in-out: cubic-bezier(.45,0,.55,1);
  font-family: "Inter", sans-serif; /* taste-skill-ignore: exact film typeface, required by Order C. */
  color: var(--ink);
  background: var(--stage);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  padding: 20px 32px 16px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.5;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(0,0,0,0) 60%, rgba(11,40,32,.10) 100%);
}
::selection { background: var(--mint); color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
button, input, textarea { font: inherit; max-width: 100%; min-height: 48px; }
button { cursor: pointer; border: 0; color: var(--ink); font-weight: 600; transition: transform 160ms var(--ease), opacity 160ms var(--ease); }
button:disabled { cursor: wait; opacity: .65; }
button:active, a:active { transform: translateY(1px) scale(.98); }
a { color: inherit; text-underline-offset: .2em; }
a, input, textarea { transition: transform 160ms var(--ease), opacity 160ms var(--ease); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; min-height: 48px; }
.brand img { display: block; width: 110px; height: auto; }
.sound { padding: 12px 0 12px 16px; background: transparent; font-size: 14px; color: var(--muted); }
main { width: 100%; max-width: 1100px; margin: auto; padding: 0 0 30px; text-align: center; }
.portrait { --viz-scale: .9444; position: relative; width: 340px; height: 340px; max-width: 100%; margin: 0 auto -28px; }
/* Film floor: a broad mint pool and a low, elliptical contact shadow, both feather to zero. */
.portrait::before { content: ""; position: absolute; inset: 34% -55% -12%; background: radial-gradient(ellipse closest-side at 50% 64%, rgba(42,209,137,.15), rgba(198,245,221,.08) 48%, rgba(198,245,221,0) 100%); pointer-events: none; }
.portrait::after { content: ""; position: absolute; left: 22%; right: 22%; top: 69%; height: 9%; background: radial-gradient(closest-side, rgba(11,58,46,.16), rgba(11,58,46,0)); pointer-events: none; }
.avatar, .intro { position: absolute; inset: 0; }
.avatar img, .intro svg { display: block; width: 100%; height: 100%; border: 0; }
/* The app lays the equalizer out for a 720 px window and slims it under 600 px; the film rendered that
   720 px view and cropped its centre 360 px (zoom 2). Do the same: a 720 px frame scaled to the portrait. */
.avatar { overflow: hidden; }
.avatar iframe { position: absolute; left: 50%; top: 50%; width: 720px; height: 720px; border: 0; background: transparent; pointer-events: none; transform: translate(-50%, -50%) scale(var(--viz-scale)); transform-origin: 50% 50%; }
.intro { pointer-events: none; }
.conversation { position: relative; }
h1 { margin: 0; font: 800 clamp(52px, 5.5vw, 76px)/1.05 "Inter Tight", sans-serif; letter-spacing: -.045em; }
.lead { margin: 12px 0 28px; color: var(--muted); font-size: 21px; }
.caption { font: 800 clamp(30px, 3.7vw, 52px)/1.05 "Inter Tight", sans-serif; letter-spacing: -.025em; max-width: 900px; min-height: 2.1em; margin: 0 auto 30px; }
.caption-line { display: block; }
.caption-word { color: var(--faint); }
.caption-word.spoken { color: var(--ink); }
.responses { min-height: 84px; }
.choices { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.choice, .card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); }
.choice { padding: 20px 22px; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--ink); color: var(--card); border-radius: 999px; padding: 12px 24px; }
.pill:has(.speaker) { padding-left: 9px; }
.speaker { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--sg); color: var(--ink); }
.speaker svg { width: 20px; height: 20px; fill: currentColor; }
.card { width: 100%; max-width: 620px; padding: 26px 30px 30px; margin: 0 auto; }
input, textarea { display: block; width: 100%; min-width: 0; padding: 13px 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[aria-invalid="true"] { border-color: var(--ink); }
.note { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.confirmation { font-size: 21px; font-weight: 600; }
.confirmation p { margin: 12px 0 0; }
.check { display: inline-flex; width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--ok); color: var(--card); }
.caption-dock { display: flex; justify-content: center; padding: 12px 0 20px; min-height: 64px; }
.caption-pill { margin: 0; padding: 10px 22px; max-width: 720px; border-radius: 16px; background: rgba(11,13,14,.82); color: var(--card); font-size: 14px; font-weight: 600; letter-spacing: -.2px; text-align: center; }
.caption-pill:empty { visibility: hidden; }
footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; font-size: 13px; color: var(--faint); }
footer a { justify-self: end; text-decoration: none; padding: 10px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (hover: hover) and (pointer: fine) {
  button:hover { transform: translateY(-2px); }
  .sound:hover, a:hover { color: var(--ink); text-decoration: underline; }
  input:hover { border-color: var(--faint); }
}
@media (max-width: 600px) {
  body { padding: 12px 20px max(16px, env(safe-area-inset-bottom)); }
  main { padding-top: 4px; padding-bottom: 16px; }
  .portrait { --viz-scale: .6111; width: 220px; height: 220px; margin-bottom: -12px; }
  .portrait::before { inset-inline: -25%; }
  h1 { font-size: 12vw; }
  .lead { font-size: 18px; margin: 8px 0 22px; }
  .caption { font-size: 8vw; margin-bottom: 22px; }
  .choices { flex-direction: column; gap: 10px; }
  .choice { width: 100%; min-height: 48px; padding: 12px 22px; text-align: left; }
  .choices > .pill { align-self: center; }
  .card { padding: 22px; }
  .caption-dock { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .caption-pill { padding: 10px 16px; }
  footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; text-align: center; }
  footer > :first-child { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  button:active, button:hover, a:active { transform: none; }
}

.intro-copy { max-width: 56ch; margin: 0 auto 26px; font-size: 17px; color: var(--muted); }
.lead { margin-bottom: 16px; }
.film-pill { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
/* The film pill lives outside the reply set so M's replies never replace it: beside "Talk to M" at rest, under the replies after. */
.responses { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.responses > .choices { align-self: stretch; }
.responses.at-rest { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.responses.at-rest > .choices { align-self: auto; }
.responses > #join-direct, .responses > form { flex-basis: 100%; }
#watch-film[hidden] { display: none; }
.text-button { background: transparent; color: var(--muted); padding: 12px; text-decoration: underline; text-underline-offset: .2em; }
#join-direct { margin-top: 6px; }
#intro-morph { position: absolute; inset: 0; }
#question { font: 800 24px/1.2 "Inter Tight", sans-serif; margin: 8px 0 20px; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
#step-next { margin-left: auto; }
textarea { resize: vertical; }
.consent { display: flex; align-items: flex-start; gap: 12px; text-align: left; font-size: 15px; }
.consent input { flex-shrink: 0; width: 20px; height: 20px; min-height: 20px; margin: 2px 0; accent-color: var(--emerald); }
.honeypot { position: absolute; left: -10000px; width: 2px; height: 2px; overflow: hidden; }
.answer-summary { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 6px; color: var(--muted); font-size: 13px; }
.answer-summary button { background: transparent; color: inherit; font-size: inherit; padding: 4px; max-width: 100%; overflow-wrap: anywhere; }
.progress { display: flex; justify-content: center; gap: 7px; margin-top: 20px; }
.progress i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.progress i.current { background: var(--emerald); }
#film-dialog { width: min(1100px, calc(100% - 32px)); max-width: none; max-height: calc(100svh - 32px); padding: 0; border: 0; background: transparent; overflow: auto; }
/* The film opens out of M's own stage, so the page stays visible behind it, softened. */
#film-dialog::backdrop { background: rgba(247,250,249,.86); }
.film-card { transform-origin: 0 0; }
.film-dock { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px; color: var(--muted); font-size: 14px; font-weight: 500; text-align: left; }
.film-dock img { width: 56px; height: 56px; margin: -10px -6px -10px -10px; object-fit: contain; }
#close-film { top: 10px; right: 10px; }
.film-card { position: relative; padding: 4px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
#film-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 18px; background: var(--ink); }
#close-film { position: absolute; z-index: 1; }
#film-error { padding: 12px; margin: 0; }
