/* How I Land — the mirror is the interface. Two lines of type over the live picture, nothing else.
   Type: the device's own interface face (San Francisco on iPhone, Roboto on Android), so nothing
   downloads and every letter renders at its sharpest. */

:root {
  --row: 40px;
  --side: 20px;
  --ink: #fff;
  --ink-2: rgba(255, 255, 255, 0.82);
  --ink-3: rgba(255, 255, 255, 0.5);
  --paper: #fff;
  --paper-ink: #17181a;
  --paper-ink-2: #55585e;
  --paper-rule: #e3e4e6;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* The mirror */
.stage { position: fixed; inset: 0; overflow: hidden; background: #000; }
.stage__video, .stage__overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__video { object-fit: cover; transform: scaleX(-1); }
.stage__overlay { pointer-events: none; }

/* Shade under the two lines of type, only as deep as the type needs */
.stage::before, .stage::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; z-index: 1; transition: opacity 0.2s; }
.stage::before { top: 0; height: calc(var(--safe-top) + 132px); background: linear-gradient(rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0)); }
.stage::after { bottom: 0; height: calc(var(--safe-bottom) + 150px); background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.62)); }
.stage.is-choosing::before { height: calc(var(--safe-top) + 250px); background: linear-gradient(rgba(0, 0, 0, 0.62) 55%, rgba(0, 0, 0, 0)); }

/* I want to be ___ */
.want {
  position: absolute; z-index: 2;
  top: calc(var(--safe-top) + 12px); left: var(--side); right: var(--side);
  display: flex; align-items: flex-start; gap: 0.32em;
  font-size: 24px; line-height: var(--row); letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.want__lead { color: var(--ink-2); white-space: nowrap; }

.picker {
  position: relative; height: var(--row); min-width: 0; max-width: 100%;
  transition: width 0.18s;
  overflow: hidden; outline-offset: 2px;
  font-weight: 600; cursor: pointer;
  scrollbar-width: none;
  touch-action: pan-y;
}
.picker::-webkit-scrollbar { display: none; }
.picker.is-open {
  height: calc(var(--row) * 5); margin-top: calc(var(--row) * -1);
  padding: var(--row) 0 calc(var(--row) * 3);
  overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scroll-padding-top: var(--row);
  -webkit-mask-image: linear-gradient(rgba(0, 0, 0, 0.35), #000 var(--row), #000 calc(var(--row) * 2), rgba(0, 0, 0, 0.3) 100%);
  mask-image: linear-gradient(rgba(0, 0, 0, 0.35), #000 var(--row), #000 calc(var(--row) * 2), rgba(0, 0, 0, 0.3) 100%);
}
.picker__item {
  height: var(--row); display: flex; align-items: center; gap: 8px;
  white-space: nowrap; scroll-snap-align: start;
}
.picker.is-open .picker__item { color: var(--ink-3); }
.picker.is-open .picker__item.is-current { color: var(--ink); }
.picker__chev { width: 12px; height: 8px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: transform 0.18s, opacity 0.18s; }
.picker__item.is-current .picker__chev { opacity: 0.85; }
.picker.is-open .picker__item.is-current .picker__chev { transform: rotate(180deg); }

/* One instruction, and the way to its reasons */
.bar {
  position: absolute; z-index: 2;
  left: var(--side); right: var(--side); bottom: calc(var(--safe-bottom) + 14px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.cue { margin: 0; min-height: 1.3em; max-width: 30ch; font-size: 21px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.cue.is-match { color: var(--ink); font-weight: 600; }
.cue.is-quiet { color: var(--ink-2); font-weight: 500; }
.why {
  flex: none; margin: 0 -10px -10px 0; padding: 12px 10px;
  background: none; border: 0; cursor: pointer;
  color: var(--ink-2); font-size: 16px; font-weight: 500;
  text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 4px;
}

/* When the camera or the model cannot start */
.gate {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; padding: 32px var(--side);
  background: #000;
}
.gate[hidden] { display: none; }
.gate__text { margin: 0; max-width: 26ch; font-size: 20px; line-height: 1.4; color: var(--ink-2); }
.gate__action {
  justify-self: start; margin-top: 20px; padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 999px; background: none; cursor: pointer;
  font-size: 17px; font-weight: 500;
}

/* Why: a sheet of paper over the mirror */
.sheet {
  width: 100%; max-width: 620px; max-height: min(88vh, 900px);
  margin: auto auto 0; padding: 0; border: 0; border-radius: 16px 16px 0 0;
  background: var(--paper); color: var(--paper-ink);
  font-size: 17px; line-height: 1.5;
}
.sheet[open] { animation: sheet-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sheet::backdrop { background: rgba(0, 0, 0, 0.42); }
.sheet__form { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
.sheet__body { overflow-y: auto; padding: 26px 24px 8px; }
.sheet__title { margin: 0 0 6px; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.sheet__lede { margin: 0 0 18px; color: var(--paper-ink-2); }
.sheet h3 { margin: 22px 0 6px; font-size: 15px; font-weight: 650; color: var(--paper-ink); }
.sheet p { margin: 0 0 10px; }
.sheet__list { margin: 0; padding-left: 1.1em; }
.sheet__list li { margin: 0 0 4px; }
.sheet a { color: inherit; text-decoration-color: #9a9da3; text-underline-offset: 3px; white-space: nowrap; }
.sheet__fine { font-size: 15px; color: var(--paper-ink-2); }
.sheet__sub { margin-top: 8px !important; color: var(--paper-ink-2); }
.sheet__practice p { margin: 0 0 4px; }
/* The benchmark: each parameter, its target, and what it measures */
.sheet__params dl { margin: 0; }
.sheet__param { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; padding: 10px 0; border-top: 1px solid var(--paper-rule); }
.sheet__param:first-child { border-top: 0; padding-top: 2px; }
.sheet__param dt { font-weight: 650; }
.sheet__value { margin: 0; text-align: right; text-wrap: balance; font-variant-numeric: tabular-nums; }
.sheet__what { grid-column: 1 / -1; margin: 2px 0 0; font-size: 15px; line-height: 1.4; color: var(--paper-ink-2); }
/* How the benchmark was built, last in the sheet */
.sheet__basis { margin-top: 26px; padding-top: 6px; border-top: 1px solid var(--paper-rule); }
.sheet__basis p { font-size: 16px; }
/* Progress drawings: earlier face dashed, later face solid */
.sheet__faces { display: flex; gap: 20px; margin: 16px 0 6px; }
.sheet__face { flex: 0 1 150px; min-width: 0; margin: 0; }
.sheet__face svg { display: block; width: 100%; height: auto; }
.sheet__face figcaption { margin-top: 6px; font-size: 14px; line-height: 1.35; color: var(--paper-ink-2); }
.sheet__legend { font-size: 14px; color: var(--paper-ink-2); }
.face-then, .face-now { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.face-then { stroke: #8e9197; stroke-width: 1.3; stroke-dasharray: 2.5 3; }
.face-now { stroke: var(--paper-ink); stroke-width: 1.6; }
.sheet__data { margin-top: 26px; padding-top: 6px; border-top: 1px solid var(--paper-rule); }
.sheet__switch { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; font-size: 16px; cursor: pointer; }
.sheet__switch input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--paper-ink); }
.sheet__danger {
  display: block; margin: 8px 0 0; padding: 10px 0; border: 0; background: none; cursor: pointer;
  color: #a1281e; font-size: 16px; font-weight: 500; text-align: left;
}
.sheet__danger.is-armed { font-weight: 700; }
.sheet__policy { display: inline-block; margin-top: 10px; padding: 6px 0; font-size: 15px; color: var(--paper-ink-2) !important; }

/* Privacy policy page */
body.doc { overflow: auto; height: auto; background: var(--paper); color: var(--paper-ink); color-scheme: light; }
.doc main { max-width: 42rem; margin: 0 auto; padding: calc(var(--safe-top) + 32px) var(--side) calc(var(--safe-bottom) + 48px); font-size: 17px; line-height: 1.55; }
.doc h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 6px; }
.doc h2 { font-size: 19px; margin: 30px 0 8px; }
.doc p, .doc li { margin: 0 0 10px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 12px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--paper-rule); }
.doc code { font-size: 14px; }
.doc a { color: inherit; text-underline-offset: 3px; }
.doc .doc__meta { color: var(--paper-ink-2); font-size: 15px; }
.nowrap { white-space: nowrap; }
.doc :focus-visible { outline-color: var(--paper-ink); }
.sheet__done {
  margin: 8px 24px calc(var(--safe-bottom) + 18px); padding: 14px; border: 0; border-radius: 12px;
  background: var(--paper-ink); color: var(--paper); font-size: 17px; font-weight: 600; cursor: pointer;
}
.sheet__done:focus-visible { outline-color: var(--paper-ink); }
@media (min-width: 700px) {
  .sheet { margin: auto; border-radius: 16px; }
  .sheet__done { margin-bottom: 20px; }
  .want { font-size: 28px; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .sheet[open] { animation: none; }
  .picker, .picker__chev, .stage::before, .stage::after { transition: none; }
}
