/* The Saddest Instrument: the night, a cold white, one ember. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-roman.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

:root {
  --night: rgb(5 5 6);
  --ink: rgb(230 235 237);
  /* The cold white at 70 % over the night, as a solid colour (contrast 8.3:1). */
  --ink-70: rgb(163 166 168);
  --ember: rgb(189 51 43);
  --thread: rgb(230 235 237 / 0.28);
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --serif: "Newsreader", ui-serif, "New York", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

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

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--night);
  color: var(--ink-70);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.0625rem, 0.98rem + 0.45vw, 1.25rem);
  line-height: 1.6;
  font-synthesis: none;
  font-optical-sizing: auto;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
}

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

h1,
h2,
h3 {
  color: var(--ink);
  font-style: italic;
  font-weight: 300;
  line-height: 1.15;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: rgb(230 235 237 / 0.38);
  transition: text-decoration-color 0.2s ease;
}

a:hover {
  text-decoration-color: var(--ink);
}

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
  text-decoration-color: var(--ink);
}

::selection {
  background: rgb(230 235 237 / 0.85);
  color: var(--night);
}

/* ---------- The poster ---------- */

.home main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-block: clamp(1.5rem, 5vh, 4rem) 1.5rem;
  text-align: center;
}

.hero {
  position: relative;
  width: min(100%, calc(62svh * 2.82));
  margin: 0;
  container-type: inline-size;
}

.hero img {
  width: 100%;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 13%, #000 87%, transparent),
    linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 13%, #000 87%, transparent),
    linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
  mask-composite: intersect;
}

/* The name between the two threads, as when the app opens. */
.hero h1 {
  position: absolute;
  inset-inline: 0;
  top: 47.5%;
  transform: translateY(-50%);
  margin: 0;
  padding-inline: var(--gutter);
  font-size: 4.5cqw;
  letter-spacing: 0.035em;
  line-height: 1;
  text-shadow: 0 0 1.2em var(--night), 0 0 0.4em var(--night);
}

.phrase {
  margin: clamp(1.5rem, 4vh, 2.75rem) var(--gutter) 0;
  max-width: 30em;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem);
  line-height: 1.35;
  color: var(--ink-70);
  text-wrap: balance;
}

.store {
  margin: clamp(1.75rem, 5vh, 3rem) var(--gutter) 0;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  color: var(--ink);
  font-size: 1.0625em;
}

/* The only ember: the app lights it when it films. Here, something is about to begin. */
.ember {
  flex: none;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0.6em rgb(189 51 43 / 0.7);
  animation: breathe 3.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

.devices {
  margin: 0.35rem var(--gutter) 0;
  color: var(--ink-70);
  font-size: 0.94em;
}

.home footer {
  padding: 1.5rem var(--gutter) max(1.75rem, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.6rem;
  font-size: 0.94em;
}

.home footer a {
  color: var(--ink-70);
  text-decoration-color: rgb(163 166 168 / 0.35);
}

.home footer a:hover,
.home footer a:focus-visible {
  color: var(--ink);
}

.home footer small {
  font-size: 1em;
  flex-basis: 100%;
  text-align: center;
}

/* A phone held upright: the instrument turns a quarter, as in its portrait films,
   and the name settles below the threads. */
@media (max-width: 640px) and (orientation: portrait) {
  .home main {
    padding-top: 1.25rem;
  }

  .hero {
    width: min(100%, calc(64svh * 0.715));
  }

  .hero img {
    -webkit-mask-image:
      linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
      linear-gradient(to bottom, transparent, #000 12%, #000 70%, transparent 90%);
    mask-image:
      linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
      linear-gradient(to bottom, transparent, #000 12%, #000 70%, transparent 90%);
  }

  .hero h1 {
    top: auto;
    bottom: 1.5%;
    transform: none;
    font-size: clamp(1.4rem, 8.2cqw, 2.4rem);
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .phrase {
    margin-top: 1.1rem;
  }
}

/* ---------- The pages ---------- */

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem var(--gutter) 1.1rem;
  font-size: 0.94em;
}

.top .mark {
  font-style: italic;
  font-weight: 300;
  font-size: 1.12em;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.top .mark:hover {
  text-decoration: underline;
  text-decoration-color: rgb(230 235 237 / 0.38);
}

.top .lang {
  color: var(--ink-70);
}

/* A thread across the night, fading at both ends. The text lives between two of them. */
.thread {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(to right, transparent, var(--thread) 18%, var(--thread) 82%, transparent);
}

.text {
  flex: 1;
  width: 100%;
  max-width: calc(27em + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2.5rem, 7vh, 4.5rem) var(--gutter) clamp(3rem, 8vh, 5rem);
}

.text h1 {
  margin: 0;
  font-size: clamp(2.6rem, 1.9rem + 3.2vw, 4.25rem);
  letter-spacing: 0.01em;
  line-height: 1.05;
}

.text .date {
  margin: 0.9rem 0 0;
  font-style: italic;
  font-weight: 300;
}

.text .lead {
  margin: 2rem 0 0;
  color: var(--ink);
  font-size: 1.12em;
  line-height: 1.55;
}

.text h2 {
  margin: 2.1em 0 0;
  font-size: 1.6em;
  letter-spacing: 0.01em;
}

.text h3 {
  margin: 1.9em 0 0;
  font-size: 1.25em;
}

.text p,
.text ul {
  margin: 0.8em 0 0;
}

.text ul {
  padding: 0;
  list-style: none;
}

.text li {
  position: relative;
  padding-left: 1.35em;
}

.text li + li {
  margin-top: 0.45em;
}

/* Each item marked by a small empty moon. */
.text li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.62em;
  width: 0.4em;
  height: 0.4em;
  border: 1px solid rgb(230 235 237 / 0.55);
  border-radius: 50%;
}

.text address {
  font-style: normal;
}

kbd {
  font-family: var(--serif);
  color: var(--ink);
  white-space: nowrap;
}

.path {
  color: var(--ink);
}

.nowrap {
  white-space: nowrap;
}

.page footer {
  padding: 1.6rem var(--gutter) max(2rem, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.94em;
}

.page footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

.page footer a {
  color: var(--ink-70);
  text-decoration-color: rgb(163 166 168 / 0.35);
}

.page footer a:hover,
.page footer a:focus-visible {
  color: var(--ink);
}

.page footer small {
  font-size: 1em;
}

/* ---------- Lost ---------- */

.lost main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  padding: 3rem var(--gutter);
  text-align: center;
}

.lost h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(2.4rem, 1.8rem + 3vw, 3.75rem);
}

.lost p {
  margin: 0;
}

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

  .ember {
    opacity: 1;
  }
}
