/* Witumi
   Layout: the field fills everything; three faint marks in the corners; a
   frosted veil rises over the dark when something is opened.
   Single, deliberate dark look.
   Two voices. The space (labels, hints, buttons) speaks in Geo Sans Light by
   Manfred Klein (free for personal, non-commercial use). People (letters,
   questions, answers, what you type) write in Satoshi by Indian Type Foundry
   (Fontshare, ITF Free Font License). */
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/satoshi-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/satoshi-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geo Sans Light';
  src: url('../fonts/geosans-light.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --abyss: #05060a;
  --ink: #0c0d14;
  --text: rgba(236, 231, 242, 0.88);
  --dim: rgba(236, 231, 242, 0.5);
  --faint: rgba(236, 231, 242, 0.16);
  --warm: #f2d6b0;
  --warm-soft: rgba(242, 214, 176, 0.32);
  --cool: #acc6e8;
  --cool-soft: rgba(172, 198, 232, 0.3);
  --glass: rgba(18, 19, 27, 0.6);
  --serif: 'Geo Sans Light', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --sans: 'Geo Sans Light', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --people: 'Satoshi', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html {
  font-size: 17.5px;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--abyss);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
[tabindex]:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 1px solid var(--warm-soft);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
#grain {
  position: fixed;
  inset: -120px;
  pointer-events: none;
  opacity: 0.055;
  background-size: 160px 160px;
  animation: grain 0.9s steps(5) infinite;
  z-index: 1;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-37px, 21px); }
  40% { transform: translate(18px, -44px); }
  60% { transform: translate(-12px, 57px); }
  80% { transform: translate(49px, 8px); }
  100% { transform: translate(0, 0); }
}

/* ---------- whisper ---------- */
#whisper {
  position: fixed;
  left: 50%;
  bottom: calc(19% + var(--safe-b));
  transform: translate(-50%, 6px);
  margin: 0;
  max-width: calc(100% - 64px);
  text-align: center;
  font-style: normal;
  font-weight: 300;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
  color: var(--dim);
  opacity: 0;
  transition: opacity 1.4s ease, transform 1.4s ease;
  pointer-events: none;
  z-index: 3;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.74rem;
  padding-left: 0.32em;
}
#whisper.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- the three marks ---------- */
.ctrl {
  position: fixed;
  z-index: 4;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
body.inside .ctrl {
  opacity: 0.38;
  pointer-events: auto;
}
body.inside.exploring .ctrl {
  opacity: 0.07;
}
body.veiled .ctrl {
  opacity: 0 !important;
  pointer-events: none !important;
}
.ctrl:hover,
.ctrl:focus-visible {
  opacity: 0.75 !important;
}
#ctrl-home {
  left: 10px;
  bottom: calc(10px + var(--safe-b));
}
#ctrl-home span {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--text);
}
#ctrl-plus {
  right: 10px;
  bottom: calc(10px + var(--safe-b));
}
#ctrl-plus span,
#ctrl-plus span::after {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--text);
}
#ctrl-plus span {
  position: relative;
}
#ctrl-plus span::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: rotate(90deg);
}
#ctrl-place {
  right: 10px;
  top: calc(10px + var(--safe-t));
}
#ctrl-place span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0), 0 0 0 6px rgba(236, 231, 242, 0.5);
}

/* ---------- + ---------- */
#menu {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: radial-gradient(circle at calc(100% - 36px) calc(100% - 36px), rgba(5, 6, 10, 0.6), rgba(5, 6, 10, 0.1) 70%);
}
.menu-list {
  position: absolute;
  right: 28px;
  bottom: calc(76px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.menu-list button {
  font-style: normal;
  font-weight: 300;
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  padding: 6px 2px;
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.6s ease, color 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.86rem;
  line-height: 1.6;
}
#menu.on .menu-list button {
  opacity: 0.86;
  transform: none;
}
.menu-list button:hover {
  color: var(--warm);
}
#menu.on .menu-list button:nth-child(6) { transition-delay: 0.02s; }
#menu.on .menu-list button:nth-child(5) { transition-delay: 0.06s; }
#menu.on .menu-list button:nth-child(4) { transition-delay: 0.1s; }
#menu.on .menu-list button:nth-child(3) { transition-delay: 0.14s; }
#menu.on .menu-list button:nth-child(2) { transition-delay: 0.18s; }
#menu.on .menu-list button:nth-child(1) { transition-delay: 0.22s; }

/* ---------- the veil ---------- */
#sheet {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  box-sizing: border-box;
  background: radial-gradient(circle at var(--ox, 50%) var(--oy, 50%), rgba(172, 198, 232, 0.1), rgba(4, 5, 8, 0.6) 55%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  backdrop-filter: blur(14px) saturate(115%);
  opacity: 0;
  transition: opacity 0.5s ease;
  -webkit-user-select: text;
  user-select: text;
}
#sheet.on {
  opacity: 1;
}
.card {
  position: relative;
  box-sizing: border-box;
  width: min(440px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 24px 14px;
  border-radius: 24px;
  background: linear-gradient(168deg, rgba(52, 49, 62, 0.42), rgba(14, 15, 22, 0.7));
  border: 1px solid rgba(236, 231, 242, 0.07);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(16px) scale(0.975);
  filter: blur(4px);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.6s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}
.card::-webkit-scrollbar {
  display: none;
}
#sheet.on .card {
  transform: none;
  filter: none;
}
.card.together {
  background: linear-gradient(168deg, rgba(60, 60, 76, 0.45), rgba(14, 15, 22, 0.7));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 0 120px rgba(236, 231, 242, 0.06);
}
.card p {
  margin: 0;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--dim);
}
.eyebrow.gap {
  margin-top: 8px;
}
.letter {
  display: flex;
  flex-direction: column;
  gap: 0.9em;
  font-size: 1.08rem;
  line-height: 1.65;
  font-weight: 300;
}
.q {
  font-style: normal;
  font-weight: 300;
  font-size: 1.3rem;
  line-height: 1.38;
  text-wrap: balance;
}
.big {
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1.25;
  text-wrap: balance;
}
.caption {
  font-style: normal;
  font-weight: 300;
  font-size: 1.06rem;
  line-height: 1.5;
  color: rgba(236, 231, 242, 0.72);
  transition: opacity 1.4s ease;
}
.caption.hidden {
  opacity: 0;
}
.dim {
  color: var(--dim);
  line-height: 1.5;
}
.small {
  font-size: 0.95rem;
}
.meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--dim);
}
.err {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--warm);
  min-height: 1px;
}

.act {
  align-self: stretch;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--warm-soft);
  background: rgba(242, 214, 176, 0.06);
  color: var(--warm);
  font-style: normal;
  font-size: 1.08rem;
  transition: background 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.78rem;
}
.act:hover {
  background: rgba(242, 214, 176, 0.12);
}
.quiet {
  align-self: flex-start;
  font-style: normal;
  color: var(--warm);
  border-bottom: 1px solid var(--warm-soft);
  padding-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
}
.leave {
  align-self: center;
  margin-top: 6px;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--dim);
}
textarea,
input.line {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--faint);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.5;
  padding: 8px 0;
  resize: none;
  border-radius: 0;
  -webkit-user-select: text;
  user-select: text;
}
textarea:focus,
input.line:focus {
  outline: none;
  border-bottom-color: var(--warm-soft);
}
::placeholder {
  color: rgba(236, 231, 242, 0.3);
  font-style: normal;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.grow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--faint);
  font-size: 0.98rem;
  color: var(--dim);
  transition: all 0.3s;
}
.chip.on {
  border-color: var(--warm-soft);
  color: var(--warm);
  background: rgba(242, 214, 176, 0.07);
}
.suggest {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sug {
  text-align: left;
  font-style: normal;
  font-size: 0.98rem;
  color: var(--dim);
  padding: 5px 0;
}
.sug:hover {
  color: var(--text);
}
.file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.pick {
  align-self: flex-start;
  font-style: normal;
  color: var(--warm);
  border-bottom: 1px solid var(--warm-soft);
  padding-bottom: 2px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
}
.pick.small {
  align-self: center;
  font-size: 0.95rem;
}

.frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #020203;
}
.frame canvas,
.frame img,
.frame video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 58vh;
  object-fit: contain;
}
.frame #photo {
  touch-action: none;
  cursor: crosshair;
}
.frame-hint {
  font-family: var(--sans);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--dim);
  text-align: center;
  transition: opacity 1s;
  min-height: 1em;
}
.frame .frame-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  pointer-events: none;
}
.frame-hint.gone {
  opacity: 0;
}
.card.media .eyebrow + .frame {
  margin-top: 2px;
}

.hold {
  align-self: center;
  position: relative;
  width: 220px;
  height: 220px;
  max-width: 100%;
  border-radius: 50%;
  touch-action: none;
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hold canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hold-ring {
  position: absolute;
  inset: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(172, 198, 232, 0.16), rgba(172, 198, 232, 0) 70%);
  transition: all 1s;
}
.hold.on {
  transform: scale(1.06);
}
.hold.on .hold-ring {
  inset: 20px;
  background: radial-gradient(circle, rgba(172, 198, 232, 0.3), rgba(172, 198, 232, 0) 70%);
}
.rec-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px;
  border-radius: 50%;
  background: var(--warm);
  opacity: 0.7;
  transition: transform 0.5s;
}
.hold.on .rec-dot {
  transform: scale(1.8);
  animation: breathe 1.4s ease-in-out infinite;
}
.hold:disabled {
  opacity: 0.4;
}

.pulse {
  align-self: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  touch-action: none;
  background: radial-gradient(circle, rgba(236, 231, 242, 0.05), rgba(236, 231, 242, 0) 70%);
}
.pulse span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(236, 231, 242, 0.4);
}
.pulse.beat span {
  animation: beat 0.5s ease-out;
}
.pulse.beat-me span {
  animation: beatme 0.5s ease-out;
}
@keyframes beat {
  0% { transform: scale(1.9); background: rgba(172, 198, 232, 0.5); box-shadow: 0 0 50px rgba(172, 198, 232, 0.5); }
  100% { transform: scale(1); background: transparent; box-shadow: none; }
}
@keyframes beatme {
  0% { transform: scale(1.9); background: rgba(242, 214, 176, 0.45); box-shadow: 0 0 50px rgba(242, 214, 176, 0.45); }
  100% { transform: scale(1); background: transparent; box-shadow: none; }
}
.beats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 8px;
  opacity: 0;
  transition: opacity 1.2s;
}
.beats.on {
  opacity: 1;
}
.beats .row {
  position: relative;
  height: 10px;
}
.beats i {
  position: absolute;
  top: 2px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
}
.beats .theirs i {
  background: var(--cool);
  box-shadow: 0 0 10px var(--cool);
}
.beats .mine i {
  background: var(--warm);
  box-shadow: 0 0 10px var(--warm);
}

.pair {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 4px;
}
.answer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 1.12rem;
  line-height: 1.5;
  font-weight: 300;
}
.answer.mine .eyebrow {
  color: var(--warm);
}
.answer.theirs .eyebrow {
  color: var(--cool);
}
.answer-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sealed-answer {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 6px 0;
  filter: blur(5px);
  opacity: 0.55;
}
.sealed-answer span {
  height: 9px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--cool-soft), rgba(172, 198, 232, 0.1));
}
.sealed-answer span:nth-child(2) { width: 82%; }
.sealed-answer span:nth-child(3) { width: 46%; }

.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choice {
  text-align: left;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--faint);
  font-size: 1.04rem;
  line-height: 1.4;
  transition: all 0.4s;
}
button.choice:hover {
  border-color: var(--warm-soft);
}
.choices.done .choice {
  opacity: 0.4;
  position: relative;
}
.choices.done .choice.guess {
  opacity: 0.85;
  border-color: var(--warm-soft);
}
.choices.done .choice.real {
  opacity: 1;
  border-color: var(--cool-soft);
  background: rgba(172, 198, 232, 0.07);
}
.choices.done .choice.real::after,
.choices.done .choice.guess::after {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.choices.done .choice.real::after {
  content: 'their answer';
  color: var(--cool);
}
.choices.done .choice.guess::after {
  content: 'your guess';
  color: var(--warm);
}
.choices.done .choice.real.guess::after {
  content: 'their answer · your guess';
  color: var(--text);
}
.verdict {
  font-style: normal;
  font-size: 1.3rem;
  font-weight: 300;
}

.waiting-them {
  display: grid;
  place-items: center;
  height: 80px;
}
.waiting-them span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cool);
  box-shadow: 0 0 30px 8px rgba(172, 198, 232, 0.35);
  animation: breathe 1.4s ease-in-out infinite;
}

.note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(236, 231, 242, 0.035);
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(236, 231, 242, 0.75);
}
.rows {
  display: flex;
  flex-direction: column;
}
.rowbtn {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 13px 2px;
  border-top: 1px solid rgba(236, 231, 242, 0.07);
  text-align: left;
  font-size: 1.04rem;
}
.rowbtn span {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: right;
}
.rowbtn.danger {
  color: rgba(242, 214, 176, 0.75);
}
.card audio {
  width: 100%;
}

.arrive {
  animation: arrive 1.6s ease both;
}
@keyframes arrive {
  from { opacity: 0; filter: blur(8px); transform: translateY(6px); }
  to { opacity: 1; filter: none; transform: none; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* ---------- the door ---------- */
#threshold {
  --hold: 0;
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  background: radial-gradient(ellipse at 50% 46%, #0d0e16 0%, #05060a 60%, #020203 100%);
  touch-action: none;
  cursor: pointer;
  transition: opacity 1.3s ease;
  outline: none;
}
#threshold.opening {
  opacity: 0;
  pointer-events: none;
}
.door {
  position: relative;
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
}
.door-core {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 190, 0.9) 0%, rgba(242, 214, 176, 0.35) 18%, rgba(242, 214, 176, 0.06) 48%, rgba(242, 214, 176, 0) 70%);
  transform: scale(calc(1 + var(--hold) * 2.2));
  animation: door 5.5s ease-in-out infinite;
}
#threshold.opening .door-core {
  transform: scale(40);
  transition: transform 1.3s ease-in;
}
@keyframes door {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.door-orbit {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 3s;
  animation: orbit 9s linear infinite;
}
.door-orbit::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 6px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cool);
  box-shadow: 0 0 12px 3px rgba(172, 198, 232, 0.45);
}
#threshold.waiting .door-orbit {
  opacity: 0.8;
}
@keyframes orbit {
  to { transform: rotate(360deg); }
}
.door-word {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--dim);
  opacity: 0;
  transition: opacity 2s;
  padding-left: 0.4em;
}
.door-word.on {
  opacity: calc(0.7 - var(--hold) * 0.7);
}
.door-sub {
  position: absolute;
  bottom: calc(12% + var(--safe-b));
  margin: 0;
  font-style: normal;
  font-weight: 300;
  font-size: 1rem;
  color: var(--dim);
  opacity: 0;
  transition: opacity 3s 1s;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.7rem;
}
.door-sub.on {
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  #grain,
  .door-core,
  .door-orbit {
    animation: none;
  }
  .card {
    transition: none;
    filter: none;
  }
}

/* ---------- people's words ---------- */
.letter,
.q,
.answer p,
.caption,
textarea,
input.line,
.choice,
.sug {
  font-family: var(--people);
  font-weight: 300;
  letter-spacing: 0;
}
.letter {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}
.q {
  font-size: 1.2rem;
  line-height: 1.38;
  color: var(--text);
}
.answer p,
.caption,
.choice {
  font-size: 0.96rem;
  line-height: 1.55;
}
.caption {
  color: rgba(236, 231, 242, 0.82);
}
textarea,
input.line {
  font-size: 1rem;
}
.said {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 1.4s ease;
}
.said.hidden {
  opacity: 0;
}
.who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.who i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
}
.who.them {
  color: var(--cool);
}
.who.them i {
  background: var(--cool);
  box-shadow: 0 0 10px var(--cool);
}
.who.me {
  color: var(--warm);
}
.who.me i {
  background: var(--warm);
  box-shadow: 0 0 10px var(--warm);
}
.chip {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.64rem;
  padding: 9px 13px;
}

/* while connected, nothing else asks for attention */
body.together .ctrl {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---------- below ---------- */
.limits {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.limit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--faint);
  transition: all 0.3s;
}
.limit.on {
  border-color: var(--warm-soft);
  background: rgba(242, 214, 176, 0.06);
}
.limit-name {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.7rem;
  color: var(--dim);
}
.limit.on .limit-name {
  color: var(--warm);
}
.limit-desc {
  font-size: 0.95rem;
  color: var(--text);
}
.desire {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(236, 231, 242, 0.06);
}
.desire-text {
  font-size: 1rem;
  line-height: 1.45;
}
.yn {
  display: flex;
  gap: 6px;
}
.act:disabled {
  opacity: 0.45;
  cursor: default;
}
.shared {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shared-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.shared-row p {
  font-family: var(--people);
  font-weight: 300;
  font-size: 1.02rem;
  line-height: 1.45;
}
.dots {
  display: inline-flex;
  gap: 3px;
  flex: none;
}
.dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.dots .w {
  background: var(--warm);
  box-shadow: 0 0 8px var(--warm);
}
.dots .c {
  background: var(--cool);
  box-shadow: 0 0 8px var(--cool);
}
.figure {
  align-self: center;
  width: min(300px, 100%);
}
.figure canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}
.tabs .chip {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
}
.fantasy p {
  opacity: 0;
  filter: blur(6px);
  transition: opacity 1.6s ease, filter 1.6s ease;
}
.fantasy p.on {
  opacity: 1;
  filter: none;
}
#fan-hold.holding {
  background: rgba(242, 214, 176, 0.14);
}
body.below .card {
  background: linear-gradient(168deg, rgba(70, 44, 40, 0.45), rgba(20, 12, 12, 0.74));
}

/* ---------- media, inside the dark ---------- */
#embed {
  position: fixed;
  inset: 0;
  z-index: 6;
  background: radial-gradient(ellipse at 50% 42%, rgba(3, 4, 8, 0.25), rgba(3, 4, 8, 0.78) 75%);
  opacity: 0;
  transition: opacity 0.6s ease;
}
#embed.on {
  opacity: 1;
}
#embed-cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.embed-when {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  margin: 0;
  pointer-events: none;
}
.embed-hint {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 1s;
  pointer-events: none;
}
.embed-hint.on {
  opacity: 0.75;
}
.embed-cap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 48px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-user-select: text;
  user-select: text;
}
.embed-cap p {
  margin: 0;
}
.embed-words .caption {
  font-size: 1.05rem;
  color: var(--text);
}
.embed-leave {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + var(--safe-b));
}

/* Coming in: the same dark and the same light as the door. One step at a
   time; words at the top, the light in the middle, actions in thumb reach. */
#pair {
  position: fixed;
  inset: 0;
  z-index: 11;
  background: radial-gradient(ellipse at 50% 38%, #0e0f18 0%, #05060a 62%, #020203 100%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#pair[hidden] {
  display: none;
}
#pair-in {
  width: 100%;
  min-height: 100%;
}
.gate {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr) auto;
  padding: calc(10px + var(--safe-t)) 20px calc(22px + var(--safe-b));
  box-sizing: border-box;
}
.gate-bar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 44px;
}
.gate-back {
  width: 44px;
  height: 44px;
  margin-left: -10px;
  border: 0;
  background: none;
  color: var(--text);
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
}
.gate-back svg,
.gate-btn svg,
.gate-eye svg,
.gate-ghost svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gate-mark {
  justify-self: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  text-transform: uppercase;
  color: var(--dim);
}
.gate-steps {
  justify-self: end;
  display: flex;
  gap: 6px;
}
.gate-steps i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  transition: background 0.4s;
}
.gate-steps i.on {
  background: var(--warm);
}

/* the light: the door's own, breathing; it answers typing, and opens */
.gate-light {
  position: relative;
  align-self: center;
  justify-self: center;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
}
.gate-core {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 228, 194, 0.95) 0%, rgba(242, 214, 176, 0.38) 17%, rgba(242, 214, 176, 0.07) 46%, rgba(242, 214, 176, 0) 70%);
  animation: door 5.5s ease-in-out infinite;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.gate.g-pulse .gate-core {
  animation: gate-pulse 0.45s ease-out, door 5.5s ease-in-out infinite;
}
.gate.g-busy .gate-core {
  animation: door 1.1s ease-in-out infinite;
}
.gate.g-go .gate-core {
  transform: scale(30);
  transition: transform 0.9s ease-in;
}
.gate.g-go .gate-body,
.gate.g-go .gate-bar {
  opacity: 0;
  transition: opacity 0.35s;
}
@keyframes gate-pulse {
  40% {
    transform: scale(1.14);
  }
}
.gate-orbit {
  position: absolute;
  inset: 4px;
  animation: orbit 9s linear infinite;
  opacity: 0.7;
}
.gate-orbit::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cool);
  box-shadow: 0 0 12px 3px rgba(172, 198, 232, 0.45);
}

.gate-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gate-body.in > * {
  animation: gate-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.gate-body.in > *:nth-child(2) {
  animation-delay: 0.04s;
}
.gate-body.in > *:nth-child(n + 3) {
  animation-delay: 0.08s;
}
@keyframes gate-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.gate-title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 2.05rem;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
}
.gate-sub {
  margin: -4px 0 6px;
  font-family: var(--sans);
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--dim);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.gate-field {
  position: relative;
  display: block;
  margin-top: 4px;
}
.gate-field > span {
  display: block;
  margin: 0 0 8px 4px;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}
.gate-field input {
  width: 100%;
  height: 58px;
  box-sizing: border-box;
  padding: 0 52px 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(236, 231, 242, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--people);
  font-weight: 400;
  font-size: 1.05rem; /* at least 16px: no zoom on iOS */
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  -webkit-appearance: none;
  appearance: none;
}
.gate-field input:focus {
  border-color: rgba(242, 214, 176, 0.5);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(242, 214, 176, 0.08);
}
.gate-eye {
  position: absolute;
  right: 6px;
  bottom: 7px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--dim);
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
}
.gate-eye[aria-pressed='true'] {
  color: var(--warm);
}
.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.gate-btn {
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7e2c4 0%, #ecccA2 100%);
  color: #17120d;
  font-family: var(--sans);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 40px -12px rgba(242, 214, 176, 0.45);
  transition: transform 0.15s, opacity 0.2s;
}
.gate-btn:active {
  transform: scale(0.98);
}
.gate-btn:disabled {
  opacity: 0.55;
}
.gate-ghost {
  height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(236, 231, 242, 0.14);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.gate-text {
  align-self: center;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 0.92rem;
  cursor: pointer;
}
.gate-out {
  margin-top: 4px;
}
.gate-err {
  margin: 0;
  min-height: 1.3em;
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--warm);
  overflow-wrap: anywhere;
}
.gate-err:empty {
  min-height: 0;
  margin-top: -14px;
}
.gate-note {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--dim);
}
.gate-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gate-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 18px 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(236, 231, 242, 0.1);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.gate-card:active {
  transform: scale(0.985);
}
.gate-card:first-child {
  border-color: rgba(242, 214, 176, 0.3);
  background: rgba(242, 214, 176, 0.06);
}
.gate-card strong {
  display: block;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.15rem;
  margin-bottom: 4px;
}
.gate-card em {
  display: block;
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--dim);
}
.gate-card i {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}
.gate-card i b {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 12px 3px rgba(242, 214, 176, 0.35);
}
.gc-two b:first-child {
  left: 12px;
}
.gc-two b:last-child {
  right: 12px;
  background: var(--cool);
  box-shadow: 0 0 12px 3px rgba(172, 198, 232, 0.35);
}
.gc-one b {
  left: 19px;
}
.gate-key {
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px dashed rgba(242, 214, 176, 0.3);
  background: rgba(242, 214, 176, 0.04);
  overflow: hidden;
}
.gate-key span {
  font-family: var(--people);
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.key-card .gate-actions {
  margin-top: 14px;
}
@media (min-height: 760px) {
  .gate-light {
    width: 180px;
    height: 180px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gate-core,
  .gate-orbit,
  .gate-body.in > * {
    animation: none;
  }
}

/* Fantasy and promise are left only below. */
body:not(.below) #menu .below-only {
  display: none;
}
/* Writing by hand: the view holds still, two quiet choices at the top. */
#inkbar {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 16px;
  right: 16px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding: 10px 14px;
  border-radius: 22px;
  background: rgba(8, 9, 14, 0.72);
  backdrop-filter: blur(6px);
}
#inkbar .eyebrow {
  flex-basis: 100%;
  text-align: center;
}
#inkbar[hidden] {
  display: none;
}
#inkbar .eyebrow {
  margin: 0;
}
#inkbar .act {
  padding: 8px 14px;
  margin: 0;
}
#inkbar .quiet {
  margin: 0;
}
body.inking .ctrl {
  opacity: 0;
  pointer-events: none;
}

/* The black box's recording and the collection, inside a card. */
.box-stage,
.cat-stage {
  margin: 12px -4px 4px;
  border-radius: 14px;
  background: rgba(2, 3, 6, 0.6);
  overflow: hidden;
}
.box-stage canvas {
  display: block;
  width: 100%;
  height: min(62vh, 420px);
  touch-action: none;
}
.cat-stage canvas {
  display: block;
  width: 100%;
  touch-action: pan-y;
}
.designation {
  font-family: var(--people);
  font-style: italic;
  font-size: 1.5rem;
  margin: 2px 0 12px;
}
.fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0 0 16px;
  font-size: 0.86rem;
}
.fields dt {
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.66rem;
  padding-top: 3px;
}
.fields dd {
  margin: 0;
}

/* A quiet inline action inside a sentence (sign out). */
button.link {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Checking it is really them: a short code, read aloud. */
.gate-code {
  margin: 4px 0 0;
  font-family: var(--people);
  font-size: 2.2rem;
  letter-spacing: 0.18em;
  color: var(--warm);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.gate-strong {
  color: var(--text);
}
.seat-check {
  margin: 6px 0 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(242, 214, 176, 0.3);
  background: rgba(242, 214, 176, 0.05);
}
.seat-check .eyebrow {
  margin: 0 0 6px;
}
.seat-who {
  margin: 0 0 8px;
  font-family: var(--people);
  font-size: 1.05rem;
  color: var(--text);
  overflow-wrap: anywhere;
}
.seat-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.seat-actions .act {
  flex: 1;
  margin: 0;
}
/* the dot top right calls, quietly, when someone waits to be confirmed */
#ctrl-place.call::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--warm);
  animation: call 2.4s ease-out infinite;
}
@keyframes call {
  from {
    opacity: 0.8;
    transform: scale(0.6);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}
