/* whip.to
   Night: the photographs' own black. Volt: the one loud colour. Ink on volt, paper on night. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

/* Same file, but the giant sign-off word waits for it rather than flashing a
   much wider fallback that would be clipped. */
@font-face {
  font-family: "Archivo Display";
  src: url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Martian Mono";
  src: url("/assets/fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  --night: #0a0a09;
  --night-raised: #151513;
  --paper: #f3f0e6;
  --ash: #aaa89d;
  --volt: #f2de38;
  --ink: #14130e;
  --ink-soft: #3d3a1c;
  --rule-night: rgb(243 240 230 / 0.18);
  --rule-ink: rgb(20 19 14 / 0.24);

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --measure: 66ch;
  --snap: cubic-bezier(0.16, 1, 0.3, 1);

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 420;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture {
  display: block;
  max-width: 100%;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Masthead */

.masthead {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 1.25rem;
  padding: var(--gutter);
}

.wordmark {
  font-weight: 900;
  font-stretch: 62%;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark span {
  color: var(--volt);
}

.masthead .mono {
  margin: 0;
  color: var(--paper);
  letter-spacing: 0.08em;
}

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: calc(var(--gutter) + 5rem) var(--gutter) calc(var(--gutter) + 9rem);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  max-width: none;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 30%;
}

.hero__content {
  width: min(100%, 52rem);
}

.hero h1 {
  margin: 0;
  font-weight: 800;
  font-stretch: 62%;
  font-size: clamp(3.4rem, 7.6vw, 8.75rem);
  line-height: 0.86;
  letter-spacing: -0.012em;
  word-spacing: 0.06em;
  overflow-wrap: break-word;
}

.hero h1 .line {
  display: block;
}

.whip-it {
  margin: 0.3em 0 0;
  color: var(--volt);
  font-weight: 900;
  font-stretch: 62%;
  font-size: clamp(1.75rem, 3.05vw, 2.75rem);
  line-height: 1;
  word-spacing: 0.06em;
}

.hero__caption {
  position: absolute;
  bottom: var(--gutter);
  left: calc(9 * var(--gutter) + 8 * (100% - 13 * var(--gutter)) / 12);
  width: calc(4 * (100% - 13 * var(--gutter)) / 12 + 3 * var(--gutter));
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1rem;
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(243 240 230 / 0.35);
  color: var(--paper);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.hero__caption .mono {
  padding-top: 0.25rem;
}

/* Signup */

.signup {
  margin-top: 3rem;
  max-width: 29rem;
}

.signup__row {
  display: flex;
  gap: 0.5rem;
}

.signup input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 3.25rem;
  padding: 0 1rem;
  border: 1px solid rgb(243 240 230 / 0.45);
  border-radius: 0;
  background: var(--night-raised);
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
}

.signup input[type="email"]::placeholder {
  color: #8d8b81;
}

.signup input[type="email"]:focus-visible {
  outline-offset: 0;
  border-color: var(--volt);
}

.signup button {
  flex: 0 0 auto;
  height: 3.25rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 0;
  background: var(--volt);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-stretch: 75%;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s var(--snap), background-color 0.15s linear;
}

.signup button:hover {
  background: #fff07a;
}

.signup button:active {
  transform: translateY(1px);
}

.signup button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.signup__note {
  margin: 0.75rem 0 0;
  color: var(--ash);
  text-wrap: pretty;
}

.signup__status {
  min-height: 1.5em;
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
}

.signup__status[data-tone="ok"] {
  color: var(--volt);
}

.signup.is-done .signup__row {
  display: none;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* Field notes */

.notes {
  background: var(--volt);
  color: var(--ink);
  padding: clamp(4rem, 8.5vw, 7.5rem) var(--gutter) clamp(4.5rem, 10vw, 9rem);
}

.notes ::selection {
  background: var(--ink);
  color: var(--volt);
}

.notes :focus-visible {
  outline-color: var(--ink);
}

.notes__head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 2rem;
  align-items: end;
}

.notes__head > * {
  grid-column: 1 / -1;
}

@media (min-width: 1000px) {
  .notes__head h2 {
    grid-column: 1 / span 8;
  }

  .notes__head .notes__lede {
    grid-column: 9 / span 4;
  }
}

.notes h2 {
  margin: 0;
  font-weight: 800;
  font-stretch: 62%;
  font-size: clamp(3.4rem, 7.6vw, 8.75rem);
  line-height: 0.86;
  letter-spacing: -0.012em;
  word-spacing: 0.06em;
}

.notes h2 span {
  display: block;
}

.notes__lede {
  margin: 0;
  max-width: 30ch;
  text-wrap: pretty;
  color: var(--ink);
  font-size: clamp(1.1875rem, 1.6vw, 1.5rem);
  line-height: 1.4;
  font-weight: 450;
}

.plates {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: start;
  margin: clamp(4rem, 9vw, 8rem) 0 0;
  padding: 0;
  list-style: none;
}

.plate,
.plate figure {
  margin: 0;
}

/* Two alignment lines: Fig. 1 and Fig. 3 share a top edge, Fig. 1 and Fig. 2
   share an image bottom (captions are equal height), so the pair rises left
   to right like the lash in the hero. */
.plate--1 {
  grid-column: 1 / span 5;
  grid-row: 1;
}

.plate--2 {
  grid-column: 6 / span 3;
  grid-row: 1;
  align-self: end;
}

.plate--3 {
  grid-column: 9 / span 4;
  grid-row: 1;
}

.plate img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--night);
}

/* The shadowgraph is a square plate: a circular light field on black. */
.plate--3 img {
  aspect-ratio: 1;
}

.plate figcaption {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1rem;
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ink);
}

.plate figcaption .mono {
  padding-top: 0.25rem;
  color: var(--ink);
}

.plate figcaption p {
  min-height: 2.9em;
  max-width: 36ch;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  text-wrap: balance;
}

/* Sign-off */

.sign-off {
  container-type: inline-size;
  overflow-x: clip;
  padding: clamp(5rem, 12vw, 11rem) var(--gutter) clamp(2.5rem, 5vw, 4rem);
}

/* "Whip it." is 2.587em wide at this width and weight, and the full stop's
   side bearing is about 0.022em, so 0.39 of the container puts the ink on
   both gutters. */
.sign-off h2 {
  margin: 0;
  font-family: "Archivo Display", var(--sans);
  color: var(--volt);
  font-weight: 900;
  font-stretch: 62%;
  font-size: calc((100vw - 2 * var(--gutter)) * 0.37);
  font-size: calc(100cqw * 0.39);
  line-height: 0.8;
  letter-spacing: -0.02em;
  word-spacing: 0.06em;
  white-space: nowrap;
}

.sign-off .signup {
  margin-top: 3.75rem;
}

/* On wide screens the form sits under "it.", on the same column edge as the
   Fig. 0 caption, the yellow-fold paragraph and Fig. 3. Its row ends on the
   bottom of the "p": at line-height 0.8 Archivo's p ink drops 0.131em below
   the line box, which at 0.39 of the container is 5.11cqw. */
@media (min-width: 1000px) {
  .sign-off {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .sign-off h2 {
    grid-column: 1 / -1;
  }

  .sign-off .signup {
    grid-column: 9 / -1;
    max-width: none;
    margin-top: calc(5.11cqw - 3.25rem);
  }
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  padding: 1.5rem var(--gutter) 2rem;
  border-top: 1px solid var(--rule-night);
  color: var(--ash);
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

/* Legal pages */

.legal {
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
}

.legal ::selection {
  background: var(--volt);
  color: var(--ink);
}

.legal :focus-visible {
  outline-color: var(--ink);
}

.legal .masthead {
  position: static;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule-ink);
}

.legal .masthead .mono {
  color: var(--ink-soft);
}

.legal .wordmark span {
  color: inherit;
}

.doc {
  width: min(100%, var(--measure));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(4rem, 9vw, 7rem);
}

.doc h1 {
  margin: 0;
  word-spacing: 0.06em;
  font-weight: 800;
  font-stretch: 62%;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 0.9;
}

.doc .updated {
  margin: 1rem 0 2.5rem;
  color: var(--ink-soft);
}

.doc h2 {
  margin: 2.75rem 0 0.75rem;
  font-weight: 800;
  font-stretch: 75%;
  font-size: 1.625rem;
  line-height: 1.15;
}

.doc p,
.doc li {
  line-height: 1.65;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.4rem;
}

.doc address {
  font-style: normal;
}

.legal .site-footer {
  border-top-color: var(--rule-ink);
  color: var(--ink-soft);
}

/* Not found */

.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: var(--gutter);
}

.lost h1 {
  margin: 0;
  word-spacing: 0.06em;
  font-weight: 900;
  font-stretch: 62%;
  font-size: clamp(4rem, 14vw, 12rem);
  line-height: 0.85;
}

.lost p {
  margin: 1.5rem 0 0;
  font-size: 1.25rem;
}

/* Small screens: the tall photograph as its own block, full width so both the
   coil and the tip stay in frame, with the text set over its faded foot. */

@media (max-width: 760px) {
  .hero {
    display: block;
    min-height: 0;
    padding: 0 var(--gutter) calc(var(--gutter) * 2.5);
  }

  .hero__media {
    position: relative;
    inset: auto;
    z-index: 0;
    height: max(62vh, 22rem);
    height: max(62svh, 22rem);
    margin: 0 calc(var(--gutter) * -1);
  }

  .hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--night) 0%, rgb(10 10 9 / 0) 38%);
  }

  .hero__media img {
    object-position: 50% 0%;
  }

  .hero__content {
    position: relative;
    margin-top: -4.5rem;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 16.5vw, 4.4rem);
  }

  .whip-it {
    font-size: 1.75rem;
  }

  .hero__caption {
    top: calc(max(62vh, 22rem) - 8rem);
    top: calc(max(62svh, 22rem) - 8rem);
    right: var(--gutter);
    bottom: auto;
    left: auto;
    width: auto;
  }

  .signup__row {
    flex-direction: column;
  }

  .signup button {
    width: 100%;
  }

  .notes h2 {
    font-size: clamp(2.4rem, 12.6vw, 3.9rem);
  }

  .plates {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    row-gap: 3rem;
  }

  .plate--1,
  .plate--2,
  .plate--3 {
    grid-row: auto;
    align-self: start;
  }

  .plate--1 {
    grid-column: 1 / -1;
  }

  .plate--2 {
    grid-column: 1 / span 5;
  }

  .plate--3 {
    grid-column: 2 / -1;
  }

  .plate figcaption p {
    min-height: 0;
  }

  .site-footer {
    flex-direction: column;
  }
}

/* One motion idea: the headline snaps in like the tip of the whip. */

@media (prefers-reduced-motion: no-preference) {
  .hero h1 .line {
    animation: snap 0.62s var(--snap) backwards;
  }

  .hero h1 .line:nth-child(2) {
    animation-delay: 0.07s;
  }

  .hero h1 .line:nth-child(3) {
    animation-delay: 0.14s;
  }

  .whip-it {
    animation: snap 0.5s var(--snap) 0.32s backwards;
  }

  .hero__media img {
    animation: settle 1.6s var(--snap) both;
  }
}

@keyframes snap {
  from {
    clip-path: inset(-0.3em 100% -0.3em -0.1em);
    transform: translateX(-0.06em);
  }
  to {
    clip-path: inset(-0.3em -0.1em -0.3em -0.1em);
    transform: none;
  }
}

@keyframes settle {
  from {
    transform: scale(1.05);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
