/* Survey + gift pages. Paper page from style.css; the one bold thing is the
   night-violet "listening room" with the gold waveform and scrubber. */
:root {
  --night: #241b45;
  --night-2: #342a63;
  --night-line: #4a3f80;
  --moon: #ece6ff;
  --haze: #b9adf0;
  --brass: #d9ad5c;
}

/* Phone: the document never scrolls, the body does (no bouncing bars),
   and every text box is 16px so iPhones don't zoom on focus. */
@media (max-width: 900px) {
  html, body { overscroll-behavior-y: none; }
  html { height: 100%; overflow: hidden; }
  body { position: relative; height: 100%; min-height: 0; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; }
  :is(input, textarea, select) { font-size: 16px; }
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Survey ---------- */
.sv-intro, .sv-form { max-width: 720px; }
.sv-intro { padding-top: 48px; }
.sv-intro h1 { font-size: clamp(1.9rem, 4.6vw, 2.7rem); margin: 0 0 16px; letter-spacing: -0.01em; }
.sv-lede { font-size: 1.12rem; line-height: 1.6; color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.sv-lede strong { color: var(--ink); }

.sv-gift {
  display: grid; grid-template-columns: 76px 1fr; gap: 20px; align-items: start;
  background: var(--night); color: var(--moon); border-radius: 22px 22px 22px 4px;
  padding: 24px 24px 20px;
}
.sv-gift-title { font-family: "Fraunces", Georgia, serif; font-size: 1.25rem; line-height: 1.25; margin: 0 0 4px; color: #fff; }
.sv-gift-meta { color: var(--haze); font-size: 0.92rem; margin: 0 0 12px; }
.sv-gift ul { margin: 0; padding-left: 1.1em; line-height: 1.5; font-size: 0.97rem; }
.sv-gift li { margin-bottom: 6px; }
.sv-gift li::marker { color: var(--brass); }

.sv-wave { display: flex; align-items: center; gap: 4px; height: 64px; }
.sv-wave span { flex: 1; background: var(--brass); border-radius: 3px; height: 30%; animation: sv-breathe 1.6s ease-in-out infinite; }
.sv-wave span:nth-child(2) { height: 70%; animation-delay: -.2s; }
.sv-wave span:nth-child(3) { height: 45%; animation-delay: -.5s; }
.sv-wave span:nth-child(4) { height: 95%; animation-delay: -.9s; }
.sv-wave span:nth-child(5) { height: 55%; animation-delay: -.3s; }
.sv-wave span:nth-child(6) { height: 80%; animation-delay: -.7s; }
.sv-wave span:nth-child(7) { height: 35%; animation-delay: -1.1s; }
@keyframes sv-breathe { 50% { transform: scaleY(.45); } }

.sv-form { padding-top: 36px; padding-bottom: 40px; }
.sv-q { border: 0; margin: 0 0 34px; padding: 0; min-width: 0; }
.sv-q legend { font-family: "Fraunces", Georgia, serif; font-size: 1.32rem; line-height: 1.3; font-weight: 600; padding: 0; margin-bottom: 8px; }
.sv-help { color: var(--muted); margin: 0 0 14px; font-size: 0.96rem; }
#pick-count { color: var(--accent-deep); font-weight: 600; }

.sv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sv-tile {
  position: relative; display: block; cursor: pointer; padding: 15px 16px 15px 46px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  transition: border-color .12s, background .12s;
}
.sv-tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sv-tile::before {
  content: ""; position: absolute; left: 15px; top: 17px; width: 18px; height: 18px;
  border: 1.5px solid var(--muted); border-radius: 5px; background: #fff;
}
.sv-tile:hover { border-color: var(--accent); }
.sv-tile:has(input:checked) { border-color: var(--accent); background: #f1edff; }
.sv-tile:has(input:checked)::before {
  border-color: var(--accent); background: var(--accent);
  box-shadow: inset 0 0 0 3px #fff;
}
.sv-tile:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.sv-tile:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.sv-tile-label { display: block; font-weight: 600; line-height: 1.3; }
.sv-tile-hint { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.4; margin-top: 3px; }

.sv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-chip { position: relative; cursor: pointer; }
.sv-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sv-chip span {
  display: inline-block; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 99px;
  background: var(--card); font-size: 0.97rem; transition: border-color .12s, background .12s, color .12s;
}
.sv-chip:hover span { border-color: var(--accent); }
.sv-chip input:checked + span { background: var(--night); border-color: var(--night); color: #fff; }
.sv-chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.sv-form textarea, .sv-form input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.sv-form textarea { resize: vertical; line-height: 1.5; }
.sv-form :is(textarea, input):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #e3dcff; }
.sv-field { display: block; margin: 0 0 14px; }
.sv-field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.sv-field[hidden] { display: none; }
.sv-field input[type="number"] { max-width: 9em; }

.sv-error { background: #fff1ee; border: 1.5px solid #e2a69a; color: #8a2e1c; border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; }

/* The send button sits after the last box: stuck to the screen it covered the first question and left a hole here. */
.sv-bar { padding: 18px 0 14px; }
.sv-send {
  display: block; width: 100%; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 1.08rem;
  background: var(--accent); color: #fff; padding: 17px 22px; border-radius: 14px; text-align: center; text-decoration: none;
  transition: background .15s;
}
.sv-send:hover { background: var(--accent-deep); }
.sv-send:disabled { opacity: .7; cursor: progress; }
.sv-fine { color: var(--muted); font-size: 0.86rem; text-align: center; margin: 10px 0 0; }

/* ---------- Gift ---------- */
.gf-room { background: var(--night); color: var(--moon); padding: 56px 0 44px; }
.gf-inner { max-width: 720px; margin: 0 auto; padding: 0 22px; }
.gf-from { color: var(--brass); font-size: 0.95rem; margin: 0 0 8px; }
.gf-room h1 { color: #fff; font-size: clamp(1.8rem, 4.4vw, 2.6rem); margin: 0 0 28px; letter-spacing: -0.01em; }
.gf-head { display: grid; grid-template-columns: 180px 1fr; gap: 26px; align-items: center; margin-bottom: 28px; }
.gf-head h1 { margin: 0; }
.gf-head .cover { box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.gf-state p { font-size: 1.08rem; line-height: 1.6; max-width: 56ch; }
.gf-state a:not(.btn, .sv-send) { color: var(--brass); }
.gf-cta { display: inline-block; width: auto; margin: 6px 0 14px; }
.gf-small { color: var(--haze); font-size: 0.92rem; }

.gf-main { display: flex; align-items: center; gap: 20px; }
.gf-play {
  flex: none; width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brass); color: var(--night); display: grid; place-items: center;
  transition: transform .12s;
}
.gf-play:hover { transform: scale(1.05); }
.gf-play svg { width: 34px; height: 34px; fill: currentColor; }
.gf-play .i-pause, .gf-play.playing .i-play { display: none; }
.gf-play.playing .i-pause { display: inline; }
.gf-now { min-width: 0; }
.gf-chapter { font-family: "Fraunces", Georgia, serif; font-size: 1.2rem; color: #fff; margin: 0 0 4px; line-height: 1.3; }
.gf-time { color: var(--haze); margin: 0; font-variant-numeric: tabular-nums; }

.gf-scrub { position: relative; margin: 26px 0 18px; height: 28px; }
.gf-ticks span { position: absolute; top: 4px; width: 2px; height: 20px; background: var(--haze); opacity: .55; pointer-events: none; }
#gf-seek {
  --p: 0%; position: relative; width: 100%; height: 28px; margin: 0; background: transparent;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
#gf-seek::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(to right, var(--brass) var(--p), var(--night-line) var(--p));
}
#gf-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 0;
}
#gf-seek::-moz-range-track { height: 6px; border-radius: 99px; background: var(--night-line); }
#gf-seek::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--brass); }
#gf-seek::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }

.gf-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.gf-controls button {
  font: inherit; font-size: 0.95rem; color: var(--moon); background: var(--night-2);
  border: 1.5px solid var(--night-line); border-radius: 99px; padding: 10px 18px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.gf-controls button:hover { border-color: var(--haze); }

.gf-chapters { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--night-line); counter-reset: ch; }
.gf-chapters li { border-bottom: 1px solid var(--night-line); }
.gf-chapters button {
  display: flex; justify-content: space-between; gap: 16px; width: 100%; text-align: left;
  font: inherit; color: var(--moon); background: none; border: 0; padding: 13px 4px; cursor: pointer;
}
.gf-chapters button:hover .gf-ch-title { color: #fff; text-decoration: underline; }
.gf-ch-time { color: var(--haze); font-variant-numeric: tabular-nums; flex: none; }
.gf-chapters li.on .gf-ch-title { color: var(--brass); font-weight: 600; }
.gf-note { margin: 18px 0 0; padding: 12px 16px; border: 1px solid var(--brass); border-radius: 12px; color: var(--moon); }
.gf-buy { margin: 28px 0 0; }
/* /go/lasting/: the free first chapters' line above the player, and the way to the rest. */
.gf-preview { margin: 0 0 18px; }
.gf-preview p { margin: 0 0 12px; }
/* The house player on a paper page (a title's free sample, a /go/ sample): the same player in a small night box. */
.gf-box { background: var(--night); color: var(--moon); border: 0; border-radius: 14px; padding: 18px; }
.gf-box figcaption, .gf-box .go-k { color: var(--brass); }
.gf-box .gf-main { gap: 14px; }
.gf-box .gf-play { width: 56px; height: 56px; }
.gf-box .gf-play svg { width: 26px; height: 26px; }
.gf-box .gf-scrub { margin: 16px 0 12px; }
.gf-box .gf-chapters:empty { display: none; }
.gf-box .go-note { color: var(--haze); margin-top: 12px; }

.gf-learn { max-width: 720px; padding-top: 44px; padding-bottom: 96px; }
.gf-learn h2 { font-size: 1.6rem; margin: 0 0 16px; }
.gf-list { padding-left: 1.2em; line-height: 1.6; margin: 0 0 22px; }
.gf-list li { margin-bottom: 10px; }
.gf-list li::marker { color: var(--gold); }
.gf-learn p { line-height: 1.65; max-width: 64ch; }
.gf-learn .gf-small { color: var(--muted); }

.gf-mini {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  background: var(--night); color: var(--moon); padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--night-line);
}
.gf-mini[hidden] { display: none; }
.gf-play-sm { width: 44px; height: 44px; }
.gf-play-sm svg { width: 22px; height: 22px; }
#gf-mini-text { margin: 0; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .sv-intro { padding-top: 30px; }
  .sv-gift { grid-template-columns: 1fr; gap: 14px; }
  .sv-wave { height: 40px; max-width: 120px; }
  .sv-tiles { grid-template-columns: 1fr; }
  .gf-room { padding-top: 36px; }
  .gf-head { grid-template-columns: 104px 1fr; gap: 16px; margin-bottom: 22px; }
  .gf-head .cover-w { display: none; }
  .gf-play { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .sv-wave span { animation: none; }
  .gf-play, .sv-tile, .sv-chip span, .sv-send { transition: none; }
  body { scroll-behavior: auto; }
}
.bn-audio { width: 100%; margin-top: 4px; }
/* /lasting/ email form on the dark gift room */
.lt-form { margin: 18px 0 10px; max-width: 520px; }
.lt-label { display: block; color: var(--haze); font-size: 0.92rem; margin-bottom: 6px; }
.lt-form > input, .lt-form select, .lt-form .field-row input { width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 14px 16px; font: inherit; font-size: 16px; border-radius: 12px; border: 1.5px solid var(--night-line); background: #fff; color: var(--ink); }
.lt-form .field-row { display: flex; gap: 10px; }
.lt-form .field-row select { flex: 2; }
.lt-form .field-row input { flex: 1; }
.lt-msg { min-height: 1.4em; color: var(--brass); margin: 6px 0 0; }
.lt-form .known-note { color: var(--haze); }
/* The same form and sample words on a light card (go-warm, go-lasting-start, go-lasting-identity, go-attachment-start, no
   .gf-room): the night colours above read 2:1 on it, so the card's own ink (tests/test_funnel_readable.py, bud 2026-11-27). */
:is(.q-card, .gate) .gf-from, :is(.q-card, .gate) .gf-state a:not(.btn, .sv-send), :is(.q-card, .gate) .lt-msg, :is(.q-card, .gate) .lt-form .known-change { color: var(--accent-deep); }
:is(.q-card, .gate) .gf-small, :is(.q-card, .gate) .lt-label, :is(.q-card, .gate) .lt-form .known-note { color: var(--muted); }
.lt-form .known-change { color: var(--brass); }
