/*
 * The waitlist page (worker/waitlist.ts serves it at / while the waitlist is on): a full-screen "coming soon" page in
 * the site's new look. The rules of that look: Nunito; gold is the only accent (green only where it means
 * "checked"); a dark top with the looping black hole (the subject of the library program HORIZON, whose real TI-89
 * screen sits beside it); then a light page with dark text, where content sits on the page between dividing lines
 * and a box is kept for a thing you press or a real object (the program listing, a clip, the calculator's screen).
 * Phone first: on a phone the black hole sits above the headline, on a wide screen to the right of the form.
 */
:root {
  --ink: #07070c; /* the picture's own black */
  --paper: #f5f5f2;
  --sheet: #ffffff;
  --text: #17171d;
  --text-2: #4c4d57;
  --text-3: #6f707a;
  --line: rgba(23, 23, 29, 0.16);
  --on-dark: #f6f3ec;
  --on-dark-2: rgba(246, 243, 236, 0.78);
  --on-dark-3: rgba(246, 243, 236, 0.6);
  --line-dark: rgba(246, 243, 236, 0.16);
  --gold: #f0b243;
  --gold-ink: #1b1204;
  --ok: #1d7a46; /* "checked" only */
  --bad: #ffa391;
  --field-ink: #15151b;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(20px, 6vw, 80px);
  --wrap: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ink);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 500 17.5px/1.58 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img,
video {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font);
  font-weight: 900;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
p {
  margin: 0;
  text-wrap: pretty;
}
.nw {
  white-space: nowrap;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--sheet);
  color: var(--text);
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* ---------- the dark top ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  overflow: clip;
  background: var(--ink);
  color: var(--on-dark);
}
.bg {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: -1;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--ink) url("/waitlist/bg/blackhole-m.webp") center top / cover no-repeat;
  /* phone: lift the picture so its subject sits above the headline */
  transform: translateY(-13svh);
}
.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.9s var(--ease-out);
}
.bg-video.on {
  opacity: 1;
}
/* the shade keeps the words readable: darker where the words are, clear where the picture is */
.bg-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 12, 0.5) 0%, rgba(7, 7, 12, 0) 24%, rgba(7, 7, 12, 0) 34%, rgba(7, 7, 12, 0.8) 47%, var(--ink) 80%);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: max(16px, env(safe-area-inset-top));
  min-height: 68px;
}
.mark img {
  width: auto;
  height: 20px;
  filter: brightness(0) invert(1);
}
.spots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 700 14.5px/1.2 var(--font);
  color: var(--on-dark-2);
  white-space: nowrap;
}
.spots b {
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.spots-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.lead {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  /* phone: the words start under the picture's subject */
  margin-top: clamp(130px, 25svh, 230px);
  padding-bottom: 36px;
}
.title {
  font-size: clamp(44px, 12.5vw, 72px);
  line-height: 1;
  color: #fff;
}
.opens {
  margin-top: 10px;
  font: 700 clamp(17px, 2.4vw, 20px) / 1.3 var(--font);
  color: var(--on-dark-2);
}
.opens b {
  font-weight: 900;
  color: #fff;
}
.lede {
  margin-top: 12px;
  max-width: 33em;
  font-size: clamp(16.5px, 2.1vw, 18.5px);
  line-height: 1.5;
  color: var(--on-dark-2);
}

/* ---------- the form ---------- */
.take {
  margin-top: 22px;
  scroll-margin-top: 16px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.field {
  position: relative;
  min-width: 0;
}
.field label {
  position: absolute;
  left: 16px;
  top: 8px;
  font: 800 12.5px/1 var(--font);
  color: #55565f;
  pointer-events: none;
}
.field .opt {
  font-weight: 600;
  color: #73747d;
}
.field input {
  width: 100%;
  height: 58px;
  padding: 24px 16px 6px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--sheet);
  color: var(--field-ink);
  font: 700 16.5px/1.2 var(--font); /* 16px or more: no zoom on focus on iOS */
  transition: border-color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}
.field input::placeholder {
  color: #9a9ba3;
  font-weight: 500;
}
.field input:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 178, 67, 0.5);
}
.field input[aria-invalid="true"] {
  border-color: #e0553f;
}
.field input[readonly] {
  background: rgba(255, 255, 255, 0.86);
}
.join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font: 800 17.5px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s var(--ease-out), filter 0.16s var(--ease-out);
}
.join:hover {
  filter: brightness(1.08);
}
.join:active {
  transform: scale(0.97);
}
.join[aria-busy="true"] {
  filter: saturate(0.6) brightness(0.9);
  cursor: progress;
}

.err {
  margin: 8px 0 0;
  font: 700 15px/1.4 var(--font);
  color: var(--bad);
}
.checks {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.check {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 11px;
  align-items: start;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid rgba(246, 243, 236, 0.75);
  border-radius: 7px;
  background: rgba(7, 7, 12, 0.5);
  cursor: pointer;
  transition: background-color 0.14s var(--ease-out), border-color 0.14s var(--ease-out);
}
.check input:checked {
  border-color: var(--gold);
  background: var(--gold)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%231b1204' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 16px no-repeat;
}
.check input[aria-invalid="true"] {
  border-color: var(--bad);
}
.check label {
  font-size: 16px;
  line-height: 1.45;
  color: #fff;
  cursor: pointer;
}
.check-sms label {
  font-size: 14px;
  color: var(--on-dark-2);
}
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.ts {
  margin-top: 12px;
}
.form-msg {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-left: 4px solid var(--bad);
  background: rgba(60, 16, 10, 0.6);
  font: 700 15.5px/1.45 var(--font);
  color: #ffd9d0;
}
.fine {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-dark-3);
}
.fine a {
  color: var(--on-dark-2);
}

/* after a sign-up: the fields stay (read only), the boxes go, a short note comes in */
.join-form[data-state="done"] .checks,
.join-form[data-state="done"] .errs {
  display: none;
}
.home {
  margin-top: 16px;
  padding: 2px 0 2px 16px;
  border-left: 4px solid var(--gold);
  animation: home-in 0.45s var(--ease-out) both;
}
.home:focus {
  outline: none;
}
.stamp {
  margin: 0 0 2px;
  font: 800 15px/1.3 var(--font);
  color: var(--gold);
}
.stamp-no {
  color: var(--on-dark-2);
}
.home-line {
  font-size: 16px;
  color: var(--on-dark-2);
}
.home-hello {
  font: 900 26px/1.15 var(--font);
  color: #fff;
}
@keyframes home-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* the calculator's real screen: beside the form on a wide screen, left out on a phone (the clips below show it) */
.lcd {
  display: none;
}

/* ---------- the light page ---------- */
.more {
  background: var(--paper);
}
/* on the light page the focus ring is the page's ink (gold on off-white is too faint to see) */
.band :focus-visible {
  outline-color: var(--text);
}
.band {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(60px, 9vw, 100px) var(--gutter);
}
.band + .band {
  border-top: 1px solid var(--line);
}
.band h2 {
  max-width: 17em;
  margin: 0 auto;
  font-size: clamp(30px, 5.6vw, 44px);
  line-height: 1.1;
  text-align: center;
}
.aside {
  max-width: 40em;
  margin: 14px auto 0;
  text-align: center;
  color: var(--text-2);
}
.updated {
  color: var(--text-3);
  white-space: nowrap;
}

/* how it works: the problem, the ask, the program E-Code wrote, the calculator's answer */
.work {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}
.step-label,
.printout-note,
.screenshot figcaption {
  margin: 0 0 6px;
  font: 800 15px/1.35 var(--font);
  color: var(--text-3);
}
.textbook {
  margin: 0 0 24px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text);
}
.work-ask-text {
  margin: 0;
  padding-left: 14px;
  border-left: 4px solid var(--gold);
  font-size: 17.5px;
  color: var(--text);
}
.printout {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sheet);
  min-width: 0;
}
.printout figcaption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font: 600 12.5px/1.3 var(--mono);
  color: var(--text-2);
}
.printout pre {
  margin: 12px 0;
  overflow-x: auto;
  font: 400 13px/1.62 var(--mono);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.printout-note {
  margin: 0;
}
.result {
  display: grid;
  gap: 18px;
  align-content: start;
}
.screenshot {
  margin: 0;
}
.screenshot img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border: 8px solid #1c1c22;
  border-radius: 8px;
  background: #f4f6f1;
  image-rendering: pixelated;
}
.screenshot figcaption {
  margin: 10px 0 0;
}
.answer {
  display: flex;
  align-items: center;
  gap: 14px;
}
.answer-box {
  margin: 0;
  font: 600 19px/1.45 var(--mono);
  color: var(--text);
}
.answer-tick {
  width: 44px;
  height: 44px;
  flex: none;
}
.answer-tick path {
  fill: none;
  stroke: var(--ok);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .answer .answer-tick path {
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 0.55s var(--ease-out) 0.15s;
  }
  .answer.seen .answer-tick path {
    stroke-dashoffset: 0;
  }
}

/* the clips */
.clips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.clip-frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  aspect-ratio: 9 / 16;
}
.clip-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.clip-play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(7, 7, 12, 0.72)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5h3v14H8zM13 5h3v14h-3z' fill='%23fff'/%3E%3C/svg%3E")
    center / 18px no-repeat;
  cursor: pointer;
}
.clip-play[data-paused] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5l12 7-12 7z' fill='%23fff'/%3E%3C/svg%3E");
}
.clip-cap {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-2);
}
.clip-cap b {
  display: block;
  font: 900 16.5px/1.3 var(--font);
  color: var(--text);
}

/* the status */
.rail {
  display: grid;
  max-width: 420px;
  margin: 34px auto 0;
  padding: 0;
  list-style: none;
}
.rail li {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 0 0 22px 32px;
  color: var(--text-3);
}
.rail li::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: -6px;
  width: 2px;
  background: var(--line);
}
.rail li:last-child::before {
  display: none;
}
.rail li.done::before {
  background: var(--text);
}
.rail-mark {
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-3);
  border-radius: 50%;
  background: var(--paper);
}
.rail li.done .rail-mark {
  border-color: var(--text);
  background: var(--text);
}
.rail li.now .rail-mark {
  border-color: var(--gold);
  background: var(--gold);
}
.rail-label {
  font-weight: 700;
}
.rail li.done .rail-label {
  color: var(--text-2);
}
.rail li.now .rail-label {
  font-weight: 900;
  color: var(--text);
}
.rail-now {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font: 800 13.5px/1.5 var(--font);
}

/* the questions */
.note-list {
  max-width: 800px;
  margin: 34px auto 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.note-list li {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.note-list h3 {
  margin: 0 0 4px;
  font-size: 19.5px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 0;
}
.note-list p {
  color: var(--text-2);
}
.last {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}
.last-link {
  display: inline-flex;
  align-items: center;
  height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font: 800 17px/1 var(--font);
  text-decoration: none;
}
.last-link:hover {
  filter: brightness(1.08);
}

.foot {
  padding: 44px var(--gutter) max(36px, env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--on-dark-2);
}
.foot > * {
  max-width: var(--wrap);
  margin-left: auto;
  margin-right: auto;
}
.foot > .foot-mark {
  margin-left: max(0px, calc(50% - var(--wrap) / 2));
}
.foot-mark {
  width: auto;
  height: 18px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
  margin-bottom: 20px;
  font-size: 15.5px;
}
.foot-links a {
  text-decoration: none;
}
.foot-links a:hover {
  color: #fff;
  text-decoration: underline;
}
.foot-fine {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--on-dark-3);
}

/* the top arrives once, in order: the words, then the form */
@media (prefers-reduced-motion: no-preference) {
  .title,
  .opens,
  .lede,
  .take {
    animation: rise 0.7s var(--ease-out) both;
  }
  .opens {
    animation-delay: 0.05s;
  }
  .lede {
    animation-delay: 0.1s;
  }
  .take {
    animation-delay: 0.16s;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ---------- wider than a phone ---------- */
@media (min-width: 720px) {
  .fields {
    grid-template-columns: 1fr 1fr;
  }
  .field-name,
  .join {
    grid-column: 1 / -1;
  }
  .clips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .work {
    grid-template-columns: 1fr 1fr;
    gap: 32px 40px;
  }
  .work-ask {
    grid-column: 1 / -1;
    max-width: 44em;
  }
}

/* ---------- desktop: the black hole to the right, the words and the form to the left ---------- */
@media (min-width: 980px) {
  .bg {
    background-image: url("/waitlist/bg/blackhole-d.webp");
    background-position: right top;
    transform: none;
  }
  .bg-video {
    object-position: right top;
  }
  .bg-shade {
    background:
      linear-gradient(90deg, rgba(7, 7, 12, 0.92) 0%, rgba(7, 7, 12, 0.74) 32%, rgba(7, 7, 12, 0) 60%),
      linear-gradient(180deg, rgba(7, 7, 12, 0.35) 0%, rgba(7, 7, 12, 0) 20%, rgba(7, 7, 12, 0) 100%);
  }
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 56px;
  }
  .top {
    grid-column: 1 / -1;
    min-height: 72px;
  }
  .mark img {
    height: 22px;
  }
  .lead {
    justify-content: center;
    margin-top: 0;
    padding: 8px 0 28px;
  }
  .title {
    font-size: clamp(54px, 11vh, 84px);
  }
  /* name | email on one row, phone | the button on the next */
  .fields {
    gap: 10px 12px;
  }
  .field-name,
  .join {
    grid-column: auto;
  }
  .lcd {
    display: block;
    align-self: end;
    justify-self: end;
    width: min(100%, 400px);
    margin: 0 0 32px;
    padding: 16px;
    border-radius: 18px;
    background: #16161b;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  }
  .lcd img {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    background: #c5c8b8;
  }
  .lcd figcaption {
    margin-top: 12px;
    font: 600 14.5px/1.45 var(--font);
    color: var(--on-dark-2);
  }
  .lcd figcaption b {
    font-weight: 800;
    color: #fff;
  }
  .work {
    grid-template-columns: 1fr 1.15fr 0.9fr;
    align-items: start;
  }
  .work-ask {
    grid-column: auto;
  }
}

/* a short desktop window (a laptop with the bookmarks bar): the whole form stays on the first screen */
@media (min-width: 980px) and (max-height: 660px) {
  .top {
    min-height: 58px;
    padding-top: 10px;
  }
  .title {
    font-size: clamp(46px, 10vh, 60px);
  }
  .opens {
    margin-top: 6px;
    font-size: 17px;
  }
  .lede {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.45;
  }
  .take {
    margin-top: 14px;
  }
  .field input,
  .join {
    height: 52px;
  }
  .field input {
    padding-top: 21px;
  }
  .checks {
    margin-top: 10px;
  }
  .fine {
    margin-top: 8px;
    font-size: 13.5px;
  }
  .lead {
    padding-bottom: 14px;
  }
  .lcd {
    width: min(100%, 330px);
    margin-bottom: 18px;
    padding: 12px;
  }
  .lcd figcaption {
    margin-top: 8px;
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
