/* Built from the flyer's own hand lettering; see tools/font */
@font-face {
  font-family: "Persuasion Hand";
  src: url("../assets/fonts/PersuasionHand.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #000;
  --line: #fff;
  --muted: #9a9a9a;
  /* Black and white, like the flyer's line art */
  --paper: #fff;
  --paper-ink: #000;
  --accent: #fff;             /* accent on black */
  --accent-paper: #000;       /* accent on paper */
  --hand: "Persuasion Hand", "Marker Felt", cursive;
  --type: "Special Elite", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--line); font-family: var(--type); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
:focus-visible { outline: 3px dashed var(--accent); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

#app {
  position: relative; max-width: 460px; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
  padding: 0 0 calc(40px + env(safe-area-inset-bottom)); overflow-x: hidden;
}
.noscript { padding: 24px; font-size: 18px; }

/* The intake host and his speech bubble */
.host { display: flex; align-items: flex-end; gap: 14px; margin: 10px 12px 20px; } /* room below his frame before whatever comes next */
/* a hand-hung portrait frame: a heavy line, a black gap, then a thin outer line, slightly crooked */
.host-img {
  flex: 0 0 124px; width: 124px; height: auto; margin: 6px 6px 6px 4px;
  border: 3px solid var(--line); border-radius: 5px 3px 6px 4px; outline: 2px solid var(--line); outline-offset: 3px;
  transform: rotate(-1.5deg);
}
.bubble {
  position: relative; flex: 1; align-self: center; margin-bottom: 40px; padding: 12px 14px;
  background: var(--paper); color: var(--paper-ink); border: 3px solid var(--paper-ink);
  border-radius: 26px 22px 28px 20px / 22px 28px 20px 26px; outline: 2px solid var(--line); outline-offset: 0;
}
.bubble::before {
  /* the tail, pointing back at him */
  content: ""; position: absolute; left: -16px; bottom: 16px; width: 22px; height: 18px;
  background: var(--paper); clip-path: polygon(100% 0, 0 70%, 100% 100%);
}
.bubble p { margin: 0; font-family: var(--hand); font-size: 22px; line-height: 1.2; }

/* Spot drawings from the art pass */
.spot { display: block; width: min(70%, 260px); margin: 14px auto 0; }
.spot-in-paper { filter: invert(1); margin: 0 auto 12px; width: min(60%, 200px); }
.spot-small { width: 72px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.mini-logo { display: block; width: 190px; margin: calc(24px + env(safe-area-inset-top)) auto 18px; }

/* Progress */
.progress {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg);
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
}
.progress .track { flex: 1; height: 6px; border: 1px solid var(--muted); }
.progress .fill { display: block; height: 100%; background: var(--accent); transition: width .5s ease; }

/* Shared pieces */
.screen { position: relative; padding-bottom: 8px; }
.title-art { display: block; width: 100%; margin-top: 8px; }
.hand-head {
  font-family: var(--hand); font-weight: 400; color: var(--line);
  font-size: 40px; line-height: 1.1; margin: 22px 18px 6px; transform: rotate(-1.5deg);
}
.hand-head em { font-style: normal; color: var(--accent); }
.lede { margin: 8px 18px 0; font-size: 17px; line-height: 1.45; }
.sub { margin: 6px 18px 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

.paper {
  position: relative; background: var(--paper); color: var(--paper-ink);
  margin: 16px 14px; padding: 22px 18px 24px;
}
.paper > :not(.splat-dot) { position: relative; z-index: 1; }
.paper p { margin: 0 0 12px; font-size: 16px; line-height: 1.5; }
.paper p:last-child { margin-bottom: 0; }
.paper .small { font-size: 13px; opacity: .78; }
.paper .type-head, .paper h2 { font-family: var(--type); font-weight: 400; font-size: 23px; letter-spacing: 1px; line-height: 1.15; margin: 0 0 10px; }
.splat-dot { position: absolute; z-index: 0; border-radius: 50%; background: var(--accent-paper); pointer-events: none; opacity: .85; }

.eyes { width: 84px; mix-blend-mode: screen; pointer-events: none; }
.lurkers { display: flex; justify-content: space-between; align-items: flex-start; margin: 26px 20px 0; }

.msg { min-height: 1.6em; margin: 10px 18px 0; font-family: var(--hand); font-size: 24px; line-height: 1.3; color: var(--accent); }

/* Buttons */
.stamp-btn {
  display: block; margin: 22px auto 0; min-width: 200px; max-width: calc(100% - 40px); min-height: 56px; padding: 12px 22px;
  font-family: var(--type); font-size: 21px; letter-spacing: 2px; line-height: 1.2; text-wrap: balance;
  color: var(--accent); background: transparent; border: 4px double var(--accent); transform: rotate(-2deg);
}
.stamp-btn:active { transform: rotate(-2deg) scale(.97); }
.stamp-btn[disabled] { opacity: .35; cursor: default; }
.oval-btn {
  position: relative; display: block; margin: 20px auto 0; width: 240px; height: 88px;
  background: none; border: 0; color: var(--line); font-family: var(--hand); font-size: 40px; letter-spacing: 2px;
}
.oval-btn svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.oval-btn span { position: relative; }
.link-btn {
  display: block; margin: 14px auto 0; min-height: 44px; padding: 10px 14px; background: none; border: 0;
  color: var(--muted); font-family: var(--type); font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}
.start-over { margin-top: 36px; font-size: 13px; opacity: .8; }

/* Front door */
.spiral-wrap { position: relative; width: min(78vw, 300px); aspect-ratio: 1; margin: 4px auto 0; }
.spiral { display: block; width: 100%; height: 100%; }
.door-spiral { margin-top: -26px; } /* tuck it up under the logo's drips */
.footnote { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* Choices */
.choices { border: 0; margin: 18px 0 0; padding: 0; }
.choices legend { font-size: 17px; line-height: 1.4; margin-bottom: 8px; padding: 0; }
.choices legend .hint { display: block; font-size: 13px; opacity: .75; }
.choice {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 10px; margin: 6px 0;
  border: 2px solid var(--paper-ink); font-size: 16px; line-height: 1.3; cursor: pointer;
}
.choice input { appearance: none; -webkit-appearance: none; flex: 0 0 20px; width: 20px; height: 20px; margin: 0; border: 2px solid var(--paper-ink); border-radius: 50%; display: grid; place-items: center; }
.choice input:checked::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-paper); }
.choice:has(input:checked) { background: rgba(0,0,0,.08); }
.choice:has(input:focus-visible) { outline: 3px dashed var(--accent-paper); outline-offset: 2px; }
.text-in {
  display: block; width: 100%; margin-top: 8px; padding: 12px; min-height: 48px; font-size: 18px;
  font-family: var(--type); color: var(--paper-ink); background: transparent; border: 2px solid var(--paper-ink); border-radius: 0;
}
.text-in::placeholder { color: var(--paper-ink); opacity: .45; }
label.field-label { display: block; font-size: 17px; }
label.field-label .hint { font-size: 13px; opacity: .75; }

/* Dark-background answer list (exit survey, reading, reference) */
.answers { display: grid; gap: 10px; margin: 18px 16px 0; }
/* a question sits with its answers, not with the host above it */
.lede:has(+ .answers) { margin-top: 26px; }
.lede + .answers { margin-top: 10px; }
.answer {
  min-height: 52px; padding: 12px 14px; text-align: left; font-family: var(--type); font-size: 17px; line-height: 1.35;
  background: #000; color: var(--line); border: 2px solid var(--line);
}
.answer:active { background: var(--line); color: #000; }

/* Terms */
.margin-note { text-align: right; margin: 6px 20px -6px; }
.margin-note span { display: inline-block; transform: rotate(4deg); font-family: var(--hand); color: var(--accent); font-size: 24px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.4; margin-top: 14px; padding: 4px 0; background: none; border: 0; text-align: left; color: var(--paper-ink); width: 100%; }
.check .box { flex: 0 0 24px; height: 24px; border: 2px solid var(--paper-ink); display: grid; place-items: center; font-size: 18px; line-height: 1; }
.btn-row { position: relative; height: 168px; margin: 0 14px; }
.btn-row .stamp-btn { position: absolute; left: 50%; top: 8px; margin: 0; transform: translateX(-50%) rotate(-2deg); }
.decline {
  position: absolute; left: 50%; top: 100px; transform: translateX(-50%);
  min-height: 44px; padding: 8px 16px; font-family: var(--type); font-size: 15px;
  color: var(--muted); background: #000; border: 1px solid #555; transition: left .16s ease, top .16s ease;
}

/* Devotion grid */
.grid9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 18px 16px 0; }
.tile {
  position: relative; aspect-ratio: 1; padding: 0; background: #000 no-repeat; border: 2px solid #333;
  background-blend-mode: screen; overflow: hidden;
}
.tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--accent); }
.tile[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 4px; left: 6px; font-size: 18px; color: var(--accent);
}
.tile.missed { animation: missed .5s ease 2; }
@keyframes missed { 50% { border-color: var(--line); background-color: #300; } }

/* Password */
.rules { list-style: none; margin: 14px 0 0; padding: 0; }
.rule { display: flex; gap: 10px; padding: 10px 12px; margin-top: 8px; font-size: 15px; line-height: 1.35; border: 2px solid var(--accent-paper); }
.rule::before { content: "✗"; color: var(--accent-paper); }
.rule.ok { border-color: var(--paper-ink); opacity: .7; }
.rule.ok::before { content: "✓"; color: var(--paper-ink); }
/* Oracle */
.oracle-steps { margin: 0 0 12px; padding-left: 1.4em; font-size: 17px; line-height: 1.5; }
.oracle-steps li { margin-bottom: 6px; }
/* Seven across, so the multiples of 9 don't line up in a column */
.number-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin: 16px 10px 0; }
.num-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 0 5px; min-height: 52px; background: var(--paper); color: var(--paper-ink); }
.num { font-size: 14px; line-height: 1; }
/* The symbol drawings are white on black; on paper they're flipped to black ink */
.num-sym { display: block; width: 28px; height: 28px; filter: invert(1); }
.big-symbol { display: grid; place-items: center; width: 180px; aspect-ratio: 1; margin: 18px auto 0; background: #000; border: 3px solid var(--line); }
.big-symbol img { width: 140px; height: 140px; }
.mini-spiral { width: 180px; aspect-ratio: 1; margin: 30px auto 0; }

/* Reading reveal */
.reveal p { opacity: 0; animation: appear .6s ease forwards; }
.reveal p:nth-of-type(2) { animation-delay: .9s; font-family: var(--hand); font-size: 28px; line-height: 1.25; }
.reveal p:nth-of-type(3) { animation-delay: 1.9s; }
.reveal p:nth-of-type(4) { animation-delay: 2.8s; }
@keyframes appear { to { opacity: 1; } }
.who { margin: 14px 18px 0; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }

/* Review */
.review-line { text-align: center; margin: 22px 20px 0; font-size: 18px; min-height: 3em; }

/* Card */
.stamp {
  display: block; width: max-content; margin: 22px auto 0; transform: rotate(-6deg);
  font-family: var(--type); font-size: 30px; letter-spacing: 4px; color: var(--accent);
  border: 4px solid var(--accent); padding: 4px 14px;
}
.card .row { display: flex; gap: 12px; margin-bottom: 12px; }
.portrait { flex: 0 0 92px; height: 116px; background: #000 center / 86% no-repeat; }
.field { margin: 0 0 10px; }
.field .k { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .7; }
.field .v { font-family: var(--hand); font-size: 26px; line-height: 1.15; overflow-wrap: anywhere; }
.field .v.type { font-family: var(--type); font-size: 16px; }
.placed { border-top: 2px dashed var(--paper-ink); margin-top: 6px; padding-top: 10px; }
.placed .v { font-family: var(--type); font-size: 21px; letter-spacing: 2px; }
.placed .hint { font-family: var(--hand); font-size: 22px; line-height: 1.25; color: var(--accent-paper); margin-top: 4px; }
.barcode { height: 26px; margin-top: 14px; background: repeating-linear-gradient(90deg, var(--paper-ink) 0 2px, transparent 2px 4px, var(--paper-ink) 4px 5px, transparent 5px 9px); }
.card-foot { text-align: center; font-family: var(--hand); color: var(--line); font-size: 26px; line-height: 1.2; margin: 4px 20px 0; }
.members { margin: 22px 18px 0; font-size: 13px; color: var(--muted); }
.members button { margin: 6px 6px 0 0; min-height: 40px; padding: 6px 10px; background: #000; border: 1px solid #555; color: var(--line); font-family: var(--type); font-size: 13px; }
.members button[aria-current="true"] { border-color: var(--line); }

.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px; background: #000; overflow-y: auto;
}
.overlay img { max-height: 72vh; width: auto; border: 1px solid #333; -webkit-touch-callout: default; }
.overlay p { margin: 0; text-align: center; font-size: 16px; }

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