:root {
  --ink: #120e0c;
  --ink-2: #1d1613;
  --ink-3: #2a201b;
  --paper: #f4eadd;
  --soft: #e3d6c6;
  --muted: #b3a393;
  --rec: #ff4a2e;
  --gold: #e9b96e;
  --line: rgba(244, 234, 221, .15);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "Cascadia Mono", monospace;
  --h: 100dvh;
  --pad: 22px;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }

html, body { margin: 0; height: 100%; }

body {
  background:
    radial-gradient(120% 70% at 85% -10%, #3a2219 0%, transparent 60%),
    radial-gradient(90% 60% at -10% 110%, #2b1d12 0%, transparent 55%),
    var(--ink);
  color: var(--paper);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* A little grain over everything, like tape hiss you can see. */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  opacity: .11; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#stage {
  position: relative;
  max-width: 480px;
  min-height: var(--h);
  margin: 0 auto;
  overflow: hidden;
  background: var(--ink);
}

@media (min-width: 700px) and (min-height: 700px) {
  :root { --h: min(880px, calc(100dvh - 56px)); }
  body { display: grid; place-items: center; min-height: 100dvh; }
  #stage {
    width: 430px; height: var(--h); min-height: 0;
    border-radius: 34px;
    box-shadow: 0 0 0 1px var(--line), 0 40px 90px -20px #000;
  }
  .screen.on { height: var(--h); overflow-y: auto; }
}

.mono { font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.dim { color: var(--muted); }
[hidden] { display: none !important; }

/* ---- screens ---- */

.screen { display: none; position: relative; z-index: 2; flex-direction: column; min-height: var(--h); }
.screen.on { display: flex; animation: cut .45s cubic-bezier(.2, .7, .2, 1); }
.screen.fixed.on { height: var(--h); min-height: 0; overflow: hidden; }
@keyframes cut { from { opacity: 0; transform: translateY(10px); } }

.grow { flex: 1; padding: 8px var(--pad) 0; min-height: 0; }
.center { display: grid; place-items: center; text-align: center; }

/* The strip across the top of a page: a still waveform. */
.wavehead { display: flex; align-items: center; gap: 3px; height: 26px; padding: 0 var(--pad); overflow: hidden; background: var(--ink-2); }
.wavehead i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--paper); opacity: .85; }

.slate {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px var(--pad) 14px;
  border-bottom: 1px solid var(--line);
}

h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(42px, 13vw, 58px); line-height: .98; font-variation-settings: "opsz" 144; }
h1 em, h2 em { font-style: italic; color: var(--gold); }
h2 { font-size: 30px; line-height: 1.1; margin-bottom: 18px; }

.hero { padding-top: 34px; }
.lede { font-size: 17px; color: var(--soft); margin: 22px 0 30px; max-width: 36ch; }

.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.steps li { display: flex; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.steps .mono { color: var(--rec); min-width: 22px; }
.steps li:nth-child(1) { animation: cut .5s .08s backwards; }
.steps li:nth-child(2) { animation: cut .5s .16s backwards; }
.steps li:nth-child(3) { animation: cut .5s .24s backwards; }

.actions { display: flex; flex-direction: column; gap: 10px; padding: 22px var(--pad) calc(22px + env(safe-area-inset-bottom)); }
.actions.tight { padding: 16px 0 0; }
.actions.row { flex-direction: row; padding: 16px 0 0; }
.actions.row .btn.primary { flex: 1; }

.btn {
  font: 700 16px/1 var(--sans);
  min-height: 54px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; color: var(--ink);
  transition: transform .12s, background .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn.primary { background: var(--paper); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.ghost { background: transparent; color: var(--paper); border-color: var(--line); font-weight: 500; }
.btn.ghost.danger { color: #ff9d8c; border-color: rgba(255, 74, 46, .4); }
.btn.ghost.danger.armed { background: var(--rec); color: #fff; border-color: var(--rec); font-weight: 700; }
.btn.small { min-height: 42px; font-size: 14px; padding: 0 16px; }
.btn.wide { width: 100%; }

.link { background: none; border: 0; padding: 6px 0; color: var(--paper); cursor: pointer; }
.link.warn { color: #ff9d8c; }
.link:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.fine { font-size: 13px; color: var(--muted); margin: 4px 0 0; text-align: center; }
.fine.left { text-align: left; }
.err { color: #ff9d8c; font-size: 14px; margin: 12px 0 0; }
.err:empty { display: none; }
.note { font-size: 14px; color: var(--gold); margin: 12px 0 0; }

/* ---- agreement ---- */

#s-consent .grow { padding-top: 28px; }
.field { display: block; margin-bottom: 20px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.field input {
  width: 100%; height: 56px; padding: 0 16px;
  font: 400 22px var(--serif); color: var(--paper);
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px;
}
.field textarea { width: 100%; padding: 12px 14px; font: 400 16px/1.4 var(--sans); color: var(--paper); background: var(--ink); border: 1px solid var(--line); border-radius: 14px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.field input::placeholder { color: #6f6257; }

.tick { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.tick input {
  appearance: none; flex: none; width: 26px; height: 26px; margin: 0;
  border: 1.5px solid var(--muted); border-radius: 8px; background: transparent;
  display: grid; place-items: center; cursor: pointer;
}
.tick input:checked { background: var(--gold); border-color: var(--gold); }
.tick input:checked::after { content: ""; width: 11px; height: 6px; border: 2.5px solid var(--ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translateY(-1px); }
.tick input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.where { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; color: var(--muted); font-size: 14px; }
.where summary { cursor: pointer; color: var(--paper); }
.where ul { margin: 10px 0 0; padding-left: 18px; }
.where li { margin: 6px 0; }

/* ---- the voice: live bars that move when someone talks ---- */

.voice { display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; flex: 1; overflow: hidden; }
.voice i { flex: none; width: 3px; height: 6%; min-height: 3px; border-radius: 3px; background: var(--gold); transition: height .1s linear; }
.voice.big { flex: none; width: 100%; height: 170px; gap: 5px; }
.voice.big i { width: 5px; border-radius: 5px; }
.voice.rec i { background: var(--rec); }
.voice.idle i { background: rgba(244, 234, 221, .22); }

.panel { padding: 0 var(--pad) calc(22px + env(safe-area-inset-bottom)); }
.panel h2 { margin-bottom: 8px; }
.panel p { margin: 0; color: var(--soft); }
.panel .fine { margin-top: 12px; color: var(--muted); }

/* ---- interview ---- */

.rec { display: inline-flex; align-items: center; gap: 8px; opacity: .45; }
.rec i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.rec.live { opacity: 1; color: #fff; }
.rec.live i { background: var(--rec); box-shadow: 0 0 0 0 rgba(255, 74, 46, .6); animation: pulse 1.3s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(255, 74, 46, 0); } }

.dots { display: flex; gap: 3px; flex: 1; max-width: 200px; }
.dots i { flex: 1; min-width: 2px; max-width: 14px; height: 3px; border-radius: 3px; background: rgba(244, 234, 221, .25); }
.dots i.done { background: var(--paper); }
.dots i.now { background: var(--gold); }

.preroll { display: grid; gap: 10px; justify-items: center; }
.preroll strong { font: 300 120px/1 var(--serif); font-variation-settings: "opsz" 144; color: var(--paper); text-shadow: 0 4px 40px rgba(0, 0, 0, .6); }
.preroll strong.tick-in { animation: tickin .9s ease-out; }
@keyframes tickin { from { transform: scale(1.35); opacity: 0; } 30% { opacity: 1; } }

.ask { padding: 0 var(--pad) calc(22px + env(safe-area-inset-bottom)); }
.question {
  font: 400 clamp(26px, 7.6vw, 34px)/1.14 var(--serif);
  font-variation-settings: "opsz" 72;
  margin: 10px 0 0; text-wrap: balance;
}
.question.in { animation: qin .6s cubic-bezier(.2, .7, .2, 1); }
@keyframes qin { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
.caption { min-height: 1.5em; margin: 12px 0 0; font-size: 14px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; }

.timebar { height: 3px; margin-top: 10px; background: rgba(244, 234, 221, .18); border-radius: 3px; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 0; background: var(--paper); transition: width .25s linear; }
.timebar.late i { background: var(--rec); }

.sending {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  padding: var(--pad); text-align: center;
  background: rgba(18, 14, 12, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: cut .3s;
}

.reel {
  width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--gold); border-right-color: var(--gold);
  animation: spin 1.1s linear infinite;
}
.reel.small { width: 26px; height: 26px; }
@keyframes spin { to { transform: rotate(360deg); } }

.wrapbox { gap: 22px; align-content: center; padding-bottom: 60px; }

/* ---- the intro video: the only screen with a camera ---- */

/* The whole camera picture is shown, never cropped to fill the screen, so
   what you see is what is filmed. It sits under the header, with the
   question below it. */
#camlayer { position: absolute; inset: 52px 0 0 0; z-index: 1; display: none; background: var(--ink); }
body[data-screen="s-film"] #camlayer { display: block; }
#cam { width: 100%; height: 100%; object-fit: contain; object-position: center top; transform: scaleX(-1); }
.scrim { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(18, 14, 12, .93) 82%); }
.over-cam .slate { border-bottom-color: transparent; }
.over-cam .question { text-shadow: 0 2px 24px rgba(0, 0, 0, .6); }
.over-cam.reviewing { background: var(--ink); }
.over-cam.reviewing > .grow { display: none; }
.review { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px var(--pad) calc(22px + env(safe-area-inset-bottom)); }
.review #film-tape { flex: 1; min-height: 0; }
.review .tape, .review .tape video { height: 100%; max-height: none; }

.tape { position: relative; border-radius: 18px; overflow: hidden; background: #000; }
.tape video { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #000; }
.tape .cap {
  position: absolute; left: 0; right: 0; top: 0; margin: 0; padding: 14px 16px 34px;
  font: 400 19px/1.2 var(--serif); color: var(--paper); pointer-events: none;
  background: linear-gradient(180deg, rgba(18, 14, 12, .85), transparent);
}
.tape .cap:empty { display: none; }

/* ---- profile ---- */

#profile-top, #profile, #setup { padding: 0 var(--pad); }
#profile-top { padding-top: 26px; }
#profile-top h1 { font-size: clamp(34px, 10vw, 44px); line-height: 1.02; }
.who { color: var(--gold); margin: 0 0 14px; }
.summary { font-size: 17px; color: #e9ddcd; margin: 18px 0 0; }

.block { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.block > .mono { color: var(--muted); display: block; margin-bottom: 14px; }
.block p { margin: 0; }
.big { font: 400 22px/1.25 var(--serif); }
.block .hint { color: var(--soft); font-size: 15px; margin-bottom: 14px; }
.block .hint + .btn { margin-top: 2px; }
.block .btn + .btn { margin-top: 10px; }
.done-mark { color: var(--gold); }

.notice { margin-top: 20px; padding: 16px; border: 1px dashed rgba(233, 185, 110, .5); border-radius: 14px; color: #ecd9b8; font-size: 15px; }

.photos { display: flex; gap: 10px; overflow-x: auto; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 6px; scroll-snap-type: x mandatory; }
.photo { position: relative; flex: none; width: 46%; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--ink-2); scroll-snap-align: start; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(18, 14, 12, .75); color: var(--paper); font: 400 20px/1 var(--sans); cursor: pointer; }
.photo.add { border: 1.5px dashed var(--muted); background: transparent; color: var(--paper); cursor: pointer; font: 500 15px var(--sans); display: grid; place-content: center; gap: 6px; text-align: center; }
.photo.add b { font: 300 44px/1 var(--serif); color: var(--gold); }
.photo.add:focus-visible, .photo .x:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.faces .photo { width: 78%; }

/* A piece of audio: play button, waveform, length. Used for interview
   clips and for voice notes. */
.vn { display: flex; align-items: center; gap: 12px; max-width: 86%; padding: 12px 16px 12px 12px; border-radius: 22px; background: var(--ink-3); align-self: flex-start; border: 0; color: var(--paper); cursor: pointer; text-align: left; font: inherit; }
.vn.mine { align-self: flex-end; background: #3b2a1c; }
.vn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.vn .play { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; }
.vn .play::after { content: ""; border-left: 12px solid var(--ink); border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
.vn.playing .play::after { border: 0; width: 12px; height: 14px; margin: 0; background: linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 8px, var(--ink) 8px); }
.vn.new .play { background: var(--gold); }
.vn .meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vn .mono { font-size: 10px; color: var(--muted); }
.vn.new .mono { color: var(--gold); }
.vn.clip { max-width: none; width: 100%; }
.vn.clip .meta { flex: 1; }

.bars { display: flex; align-items: center; gap: 2px; height: 30px; overflow: hidden; }
.bars i { flex: none; width: 3px; min-height: 3px; border-radius: 3px; background: rgba(244, 234, 221, .32); }
.bars i.on { background: var(--paper); }
.vn.mine .bars i.on, .vn.clip .bars i.on { background: var(--gold); }

.heard + .heard { margin-top: 16px; }
.heard .q { font-size: 14px; color: var(--soft); margin: 0 0 8px; }

.scale { padding: 12px 0; }
.scale + .scale { border-top: 1px solid var(--line); }
.scale .ends { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.track { position: relative; height: 22px; margin: 8px 0 6px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--line); }
.track i { position: absolute; top: 6px; width: 2px; height: 10px; background: rgba(244, 234, 221, .3); }
.track b { position: absolute; top: 2px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(233, 185, 110, .18); }
.scale.unsure .track b { background: transparent; border: 2px dashed var(--muted); box-shadow: none; }
/* The ring marks where they want a partner to be on the same line. */
.track u { position: absolute; top: -1px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; border: 2px solid var(--rec); }
.key { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0 0 6px !important; }
.key b { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.key u { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--rec); margin-left: 12px; }
.scale .why.wants { color: #ffb9ab; margin-top: 4px; }
.scale .why { font-size: 14px; color: var(--soft); margin-top: 8px; }
.scale .label { font-weight: 700; font-size: 14px; margin-bottom: 2px; }

.trait { padding: 14px 0; }
.trait + .trait { border-top: 1px solid var(--line); }
.trait strong { display: block; font-weight: 700; }
.trait q { display: block; margin-top: 6px; font: italic 400 18px/1.35 var(--serif); color: #eadfce; quotes: "\201C" "\201D"; }
.trait small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.trait .does { margin-top: 4px; color: var(--soft); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 10px 0 10px 22px; position: relative; }
ul.plain li + li { border-top: 1px solid var(--line); }
ul.plain li::before { content: ""; position: absolute; left: 2px; top: 20px; width: 8px; height: 2px; background: var(--gold); }

.answer { border-top: 1px solid var(--line); }
.answer summary { display: flex; gap: 14px; padding: 14px 0; cursor: pointer; list-style: none; }
.answer summary::-webkit-details-marker { display: none; }
.answer summary .mono { color: var(--rec); padding-top: 5px; min-width: 30px; }
.answer summary span:last-child { flex: 1; }
.answer .body { padding: 0 0 18px 44px; }
.answer .said { margin-top: 12px; font-size: 15px; color: var(--soft); }
.answer .said.none { color: var(--muted); font-style: italic; }

/* ---- introductions ---- */

#intros { padding-top: 22px; padding-bottom: 30px; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }
.empty h2 { color: var(--paper); }

.intro { padding: 0 0 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); animation: cut .45s backwards; }
.intro:last-child { border-bottom: 0; }
.intro > .mono { color: var(--rec); display: block; margin-bottom: 12px; }
.intro h2 { font-size: 38px; margin: 16px 0 6px; }
.intro .headline { font: italic 400 19px/1.3 var(--serif); color: #eadfce; margin: 0 0 12px; }
.intro .both { font-size: 14px; color: var(--gold); margin: 0 0 16px; }
.intro .sub { display: block; color: var(--muted); margin: 20px 0 12px; }
.intro .actions.row { padding-top: 20px; gap: 10px; }
.intro .state { color: var(--muted); font-size: 15px; margin: 20px 0 0; }
.intro .btn.wide { margin-top: 20px; }
.badge { display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 999px; background: var(--rec); color: #fff; font: 600 11px/1.4 var(--mono); vertical-align: 2px; }

/* ---- conversation ---- */

.talkwho { display: flex; align-items: center; gap: 10px; min-width: 0; }
.talkwho img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.notes { flex: 1; min-height: 0; overflow-y: auto; padding: 18px var(--pad); display: flex; flex-direction: column; gap: 12px; }
.notes .empty { margin: auto 0; padding: 0; }

.recorder { padding: 14px var(--pad) calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--ink-2); }
.recorder > div { display: none; align-items: center; gap: 12px; }
.recorder[data-state="idle"] .vn-idle { display: flex; flex-direction: column; gap: 10px; }
.recorder[data-state="recording"] .vn-rec,
.recorder[data-state="review"] .vn-review,
.recorder[data-state="sending"] .vn-sending { display: flex; }
.vn-review .btn, .vn-rec .btn { min-height: 50px; }
.vn-review .btn.primary { flex: 1; }
.vn-sending { justify-content: center; min-height: 50px; }
.recorder .fine { margin: 0; }
.recorder .err { margin: 0 0 10px; text-align: center; }

.mic { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--paper); background: transparent; display: grid; place-items: center; cursor: pointer; }
.mic i { width: 52px; height: 52px; border-radius: 50%; background: var(--rec); transition: transform .15s; }
.mic:active i { transform: scale(.88); }
.mic:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.sheet { position: absolute; inset: auto 0 0 0; z-index: 6; padding: 26px var(--pad) calc(22px + env(safe-area-inset-bottom)); background: var(--ink-2); border-top: 1px solid var(--line); border-radius: 26px 26px 0 0; box-shadow: 0 -30px 80px rgba(0, 0, 0, .7); animation: cut .3s; }
.sheet p { color: var(--soft); margin: 0 0 14px; }

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