/* ISFTR
   The page is a calibration board: matte white, true black marks made for
   machine eyes, and one laser line. The room is the same board from behind. */

:root {
  --board: #e7e9e4;
  --ink: #000;
  --graphite: #2f322e;
  --aluminum: #5a605b;
  --aluminum-pale: #adb2ac;
  --rule: #c2c6c0;
  --laser: #ff2a1a;
  --laser-deep: #b3140a;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --measure: 31rem;

  --fg: var(--ink);
  --bg: var(--board);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.25rem);
  font-optical-sizing: auto;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
figure,
ol {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: var(--laser);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--laser);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--board);
}

.skip:focus {
  top: 0.75rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- marks ------------------------------------------------------------- */

x-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55em 0.95em;
  font-size: 1.05rem;
  line-height: 0;
  color: var(--fg);
}

x-marks .gw {
  display: flex;
  gap: 0.15em;
}

x-marks .g {
  position: relative;
  flex: none;
  width: 1em;
  height: 1em;
}

x-marks svg {
  display: block;
  width: 100%;
  height: 100%;
}

x-marks .g-b {
  fill: currentColor;
}

x-marks .g-w {
  fill: var(--bg);
}

/* Point at a mark and it says what it is. */
x-marks .g::after {
  content: attr(data-c);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--laser);
  color: #000;
  font: 600 0.6em/1 var(--serif);
  opacity: 0;
}

x-marks .g:hover::after {
  opacity: 1;
}

/* ---- top --------------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem var(--gutter);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.mark x-marks {
  font-size: 0.95rem;
  gap: 0;
}

.mark-name {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.22em;
}

.top-link {
  font-size: 1rem;
}

/* ---- hero -------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
  padding: clamp(2rem, 6vw, 5rem) 0 clamp(4rem, 9vw, 8rem) var(--gutter);
}

.scan-wrap {
  position: relative;
  padding-bottom: clamp(1rem, 3vw, 2.5rem);
}

.hero-marks {
  font-size: clamp(1.35rem, 3.05vw, 2.7rem);
  margin-bottom: clamp(2.25rem, 5vw, 4rem);
}

.hero h1 {
  max-width: 11.5em;
  font-size: clamp(2.7rem, 6.1vw, 5.6rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.lede {
  max-width: var(--measure);
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: 1.15em;
  color: var(--graphite);
}

/* One laser pass prints the hero, top to bottom, then goes dark. */
.laser {
  position: absolute;
  left: calc(var(--gutter) * -1);
  right: 0;
  top: 0;
  height: 2px;
  background: var(--laser);
  box-shadow: 0 0 14px 2px rgb(255 42 26 / 0.5);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .scan {
    animation: print 2.4s linear 0.25s backwards;
  }

  .laser {
    animation: sweep 2.4s linear 0.25s backwards;
  }
}

@keyframes print {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes sweep {
  from {
    top: 0;
    opacity: 1;
  }
  94% {
    opacity: 1;
  }
  to {
    top: 100%;
    opacity: 0;
  }
}

/* ---- plates ------------------------------------------------------------ */

.plate {
  background: var(--rule);
}

.plate img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.plate--hero img {
  aspect-ratio: 4 / 5;
}

/* ---- what they said ---------------------------------------------------- */

.said {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: center;
  padding: clamp(3rem, 8vw, 7rem) var(--gutter);
  border-top: 1px solid var(--rule);
}

.said--flip .words {
  order: 2;
}

.words x-marks,
.voice x-marks {
  margin-bottom: 1.4rem;
}

.said h2,
.voice h2,
.door h2 {
  font-size: clamp(2rem, 4.1vw, 3.4rem);
  font-weight: 350;
  line-height: 1.06;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.words p {
  max-width: var(--measure);
  margin-top: 1.4rem;
  color: var(--graphite);
}

.voice {
  padding: clamp(5rem, 13vw, 11rem) var(--gutter);
  border-top: 1px solid var(--rule);
}

.voice h2 {
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}

.voice p {
  max-width: var(--measure);
  margin-top: 2rem;
  font-size: 1.15em;
  color: var(--graphite);
}

/* ---- the door (sign-up) ------------------------------------------------ */

.door,
.foot,
.room {
  --fg: var(--board);
  --bg: var(--ink);
}

.door {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  padding: clamp(4rem, 10vw, 8rem) var(--gutter);
  background: var(--bg);
  color: var(--fg);
}

.door-words p {
  max-width: 24rem;
  margin-top: 1.4rem;
  color: var(--aluminum-pale);
}

.door-form {
  max-width: 30rem;
}

.field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1.75rem;
}

.field label {
  font-size: 0.95em;
  color: var(--aluminum-pale);
}

.field input {
  width: 100%;
  padding: 0.45rem 0;
  border: 0;
  border-bottom: 1px solid var(--aluminum);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 1.3em;
}

.field input:focus-visible {
  outline: 0;
  border-bottom-color: var(--laser);
  box-shadow: 0 2px 0 var(--laser);
}

.field input[aria-invalid="true"] {
  border-bottom-color: var(--laser);
}

.field .hint {
  margin-top: 0.35rem;
  font-size: 0.9em;
  font-style: italic;
  color: var(--aluminum-pale);
}

.hp {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border: 0;
  border-radius: 0;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--laser);
  color: #000;
}

.btn:disabled {
  background: var(--aluminum);
  color: var(--bg);
  cursor: progress;
}

.out {
  min-height: 1.6em;
  margin-top: 1.4rem;
}

.out:empty {
  margin-top: 0;
}

.out.is-error {
  color: #ff7a6e;
}

.granted h3 {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 350;
  line-height: 1.1;
}

.granted p {
  margin: 1rem 0 2rem;
  color: var(--aluminum-pale);
}

/* ---- foot -------------------------------------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--graphite);
  background: var(--bg);
  color: var(--aluminum-pale);
  font-size: 0.9em;
}

.foot x-marks {
  font-size: 0.8rem;
  color: var(--aluminum-pale);
}

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

@media (max-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 0;
  }

  .scan-wrap {
    padding-right: var(--gutter);
  }

  .plate--hero {
    margin-left: clamp(2rem, 14vw, 6rem);
  }

  .plate--hero img {
    aspect-ratio: 1;
  }

  .said,
  .door {
    grid-template-columns: minmax(0, 1fr);
  }

  .said--flip .words {
    order: 0;
  }

  .top-link {
    font-size: 0.95rem;
  }
}

/* ---- not found --------------------------------------------------------- */

.lost {
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 1.5rem;
  padding: 4rem var(--gutter);
}

.lost h1 {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.018em;
}

/* ---- the room ---------------------------------------------------------- */

.room {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  color: var(--fg);
}

.room .top {
  border-bottom: 1px solid var(--graphite);
}

.room-present {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 0.95em;
  font-style: italic;
  color: var(--aluminum-pale);
}

.room-main {
  overflow-y: auto;
  padding: 1.5rem var(--gutter);
  overscroll-behavior: contain;
}

.log {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.line {
  display: grid;
  grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) auto;
  gap: 0 1.5rem;
  align-items: baseline;
  padding: 0.4rem 0;
}

.line .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font-style: italic;
  color: var(--aluminum-pale);
}

.line--mine .who {
  color: var(--laser);
}

.line .body {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.line time,
.note {
  font-size: 0.85em;
  color: var(--aluminum-pale);
}

.note {
  padding: 0.4rem 0 0.4rem 11.5rem;
  font-style: italic;
}

.room-empty {
  max-width: 60rem;
  margin: 18vh auto 0;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--aluminum-pale);
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  align-items: end;
  padding: 1rem var(--gutter) 1.25rem;
  border-top: 1px solid var(--graphite);
}

.composer .field {
  margin: 0;
}

.composer .field input {
  font-size: 1.15em;
}

.room-state {
  grid-column: 1 / -1;
  min-height: 1.4em;
  font-size: 0.85em;
  font-style: italic;
  color: var(--aluminum-pale);
}

@media (max-width: 40rem) {
  .line {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.55rem 0;
  }

  .line .who {
    text-align: left;
  }

  .line .body {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .note {
    padding-left: 0;
  }

  /* Who is here gets its own row instead of being squeezed between the links. */
  .room .top {
    flex-wrap: wrap;
    row-gap: 0.6rem;
  }

  .room-present {
    order: 3;
    flex-basis: 100%;
    text-align: left;
  }
}
