/* The front door's hero (R100, R101, R122, R166): the basics and nothing else: the premise, the trailer
 * (`door_trailer.css`), the waitlist, the way into the Discord and the way into the show. A phone reads
 * them in that order, one column, and the first screen holds the H1, the lede, the whole trailer and
 * the waitlist's field and button. From 1024 the words and the ways in stand left and the trailer
 * stands right alone, the wider column, the two ending near one line, filling the masthead's width.
 * The System's obituary and rule are not here: they have a band of their own after the cast
 * (`door_pilot.css`). */

.door-hero {
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

.door-hero-head {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.door-hero-head .door-kicker {
  margin: 0;
}

/* The one `<h1>`: big, in the novel's face, broken in a few short lines. */
.door-pitch {
  margin: 0;
  max-inline-size: 20ch;
  color: var(--parchment);
  text-wrap: balance;
}

/* Why anyone watches: the premise and its stakes, under the pitch. */
.door-lede {
  margin: 0;
  max-inline-size: 40ch;
  color: var(--parchment);
  font-size: var(--text-prose);
  line-height: 1.45;
  /* Even lines, never "out." alone on the last (768, RP10). */
  text-wrap: balance;
}

/* --- the way out ------------------------------------------------------------------------------- */

.door-hero-act {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

/* The two outlines, the Discord and the rehearsal, one over the other, share the ways on's gap. */
.door-ways {
  display: grid;
  gap: inherit;
}

/* The waitlist (R122): the page's one form, a field and the hero's one filled button, with what
 * comes next (the sign-up ends on Tally, where the crawler is optional) and what we write about
 * under them. A phone stacks the field over the button, each a
 * row; from 640 they share one line. The field is in the reading face at 16 px, so a phone does not
 * zoom into it, and wears the outline's edge. */
.door-wait {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.door-wait-label {
  color: var(--parchment);
  font-size: var(--text-16);
  font-weight: 600;
  line-height: var(--leading-chrome);
}

.door-wait-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.door-wait-email {
  flex: 1 1 100%;
  min-inline-size: 0;
  min-block-size: 2.75rem;
  margin: 0;
  padding: 0 var(--space-3);
  border: 1px solid var(--parchment-dim);
  border-radius: 0;
  background: var(--ink-2);
  color: var(--parchment);
  font-family: var(--font-prose);
  font-size: var(--text-16);
}

.door-wait-email::placeholder {
  color: var(--parchment-faint);
  opacity: 1;
}

.door-wait-email:hover {
  border-color: var(--parchment);
}

.door-wait-email:focus-visible {
  border-color: var(--parchment);
  outline: 2px solid var(--parchment);
  outline-offset: 3px;
}

.door-wait-go {
  cursor: pointer;
}

.door-wait-note {
  margin: 0;
  max-inline-size: 36rem;
  font-size: var(--text-14);
  line-height: var(--leading-chrome);
  color: var(--parchment-dim);
}

/* A phone's hero is a tighter column than a desk's: one step less between its parts. */
@media (max-width: 63.99em) {
  .door-hero {
    gap: var(--space-4);
  }
}

/* --- from 640: the pitch spans the frame ------------------------------------------------------- */

@media (min-width: 40em) {
  .door-pitch {
    max-inline-size: none;
    font-size: clamp(2.75rem, 7.2vw, 4rem);
    line-height: 1.04;
  }

  /* A tablet's lede has a real measure: two or three even lines under a one-line H1, not a narrow
   * column of five. */
  .door-lede {
    max-inline-size: 34em;
  }

  /* The trailer and the waitlist's row run the content's width here, one column (768: 22 to 746). */
  .door-wait-row {
    flex-wrap: nowrap;
  }

  .door-wait-note {
    max-inline-size: none;
  }

  .door-wait-email {
    flex: 1 1 auto;
  }
}

/* --- from 1024: the words left, the trailer right ----------------------------------------- */

@media (min-width: 64em) {
  /* The DOM is the phone's order (head, trailer, ways on); here the head stands top left and the
   * trailer right alone across the rows beside the words. The trailer takes the wider column, all
   * the width the words leave, so its frame reads as the hero's picture and ends near the line the
   * words end; the ways on are laid out under, below. (`cqw` is the page's own width: `.door`.) */
  /* Each outline is its button with its note under it, whatever the column's width, so the two read
   * as a pair. */
  html.has-discord .door-also,
  html.has-rehearsal .door-seen {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .door-hero {
    --trailer-col: clamp(30rem, calc(100cqw - 28.75rem - var(--page-gap)), 58rem);
    grid-template-columns: minmax(0, 1fr) var(--trailer-col);
    grid-template-rows: auto auto auto;
    column-gap: var(--page-gap);
    row-gap: var(--space-5);
    align-items: start;
  }

  .door-hero-head { grid-column: 1; grid-row: 1; }
  .door-trailer { grid-column: 2; grid-row: 1 / 3; }
}

/* 1024 to 1439: the words and the waitlist stand left; the two outlines stand in a row under both
 * columns, each a button with its note, so the left column is only as tall as the trailer is wide. */
@media (min-width: 64em) and (max-width: 89.99em) {
  .door-hero-act {
    display: contents;
  }

  .door-wait {
    grid-column: 1;
    grid-row: 2;
  }

  /* Each outline stands under its own column: the Discord under the words, the rehearsal's button
   * under the trailer it is the way into. */
  .door-ways {
    display: contents;
  }

  .door-also {
    grid-column: 1;
    grid-row: 3;
  }

  .door-seen {
    grid-column: 2;
    grid-row: 3;
  }
}

/* From 1440 the left column is wide enough for the waitlist and both outlines under the words, the
 * outlines side by side, each a button over its note. */
@media (min-width: 90em) {
  .door-hero {
    --trailer-col: clamp(40rem, calc(100cqw - 37.5rem - var(--page-gap)), 58rem);
  }

  .door-hero-act {
    grid-column: 1;
    grid-row: 2;
    gap: var(--space-4);
  }

  .door-ways {
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: var(--space-4);
  }

  .door-ways .door-btn {
    inline-size: 100%;
  }

}

@media (min-width: 64em) {
  /* The frame's top is the H1's cap line, not the kicker's: the picture does not rise above the
   * headline. The kicker's line, the head's gap and the H1's space above its capitals
   * (`--cap-gap`, a share of its size) come to the offset. */
  .door-hero {
    /* The hero's foot is a step longer, so a 1440 x 900 fold falls between the hero and the next
     * section, never through its kicker and heading. */
    margin-block-end: var(--space-5);
    --pitch: clamp(3.5rem, 5vw, 5.25rem);
    --kicker-h: 1.2rem;
    --cap-gap: 0.045;
  }

  .door-trailer {
    margin-block-start: calc(var(--kicker-h) + var(--space-3) + var(--cap-gap) * var(--pitch));
  }

  .door-pitch {
    font-size: var(--pitch);
    line-height: 1.02;
  }

  .door-wait-row {
    max-inline-size: 36rem;
  }

  .door-wait-note {
    max-inline-size: 36rem;
  }

  .door-lede {
    max-inline-size: 36em;
    font-size: var(--text-lead);
  }
}

/* --- below 640: the first screen of a phone (RP13, R137, R166) ------------------------------------------------------
 * The first screen holds the pitch, the lede, the whole trailer and the waitlist's field and button; the other two
 * ways in are under the fold (R166). The gaps between the parts are one step smaller than a desk's, and the buttons keep
 * their 44 px and the field its size: nothing is crowded, only the air between sections is less. */
@media (max-width: 39.99em) {
  .door {
    padding-block-start: var(--space-3);
  }

  .door-hero {
    gap: var(--space-4);
  }

  .door-hero-head {
    gap: var(--space-2);
  }

  .door-hero-head .door-kicker {
    line-height: 1.2;
  }

  .door-lede {
    line-height: 1.35;
  }

  .door-hero-act {
    gap: var(--space-2);
  }

  .door-wait,
  .door-wait-row {
    gap: var(--space-1) var(--space-2);
  }

  .door-wait-label,
  .door-wait-note {
    line-height: 1.3;
  }

  .door-also,
  .door-seen {
    gap: var(--space-1) var(--space-3);
  }

  .door-also-why {
    line-height: 1.3;
  }
}

/* --- below 360: the narrowest phones ------------------------------------------------------------ */

@media (max-width: 22.49em) {
  .door {
    padding-block-start: var(--space-4);
  }

  .door-hero {
    gap: var(--space-4);
  }

  .door-hero-head {
    gap: var(--space-2);
  }

  .door-lede {
    font-size: var(--text-16);
    line-height: 1.4;
  }
}
