@font-face {
  font-family: Archivo;
  src: url('/assets/archivo-variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
/* Plate, ink, line and focus colours are the app's theme tokens (src/app/styles.css). The box is one
   typeface and one ink colour in both modes; the only warm light on the page is in the windows. */
:root {
  font-family: Archivo, Arial, sans-serif;
  font-synthesis: none;
  --scene: #98978f;
  --plate: #f7f7f5;
  --ink: #1b191f;
  --quiet: rgba(27, 25, 31, 0.72);
  --line: #d8d5de;
  --focus: #5624bb;
  --track: rgba(27, 25, 31, 0.06);
  --track-line: rgba(27, 25, 31, 0.26);
  --dim: rgba(27, 25, 31, 0.5);
  --thumb: #1b191f;
  --thumb-ink: #f7f7f5;
  --fade: 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--scene);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --scene: #313033;
  --plate: #16141c;
  --ink: #f4f0f8;
  --quiet: rgba(244, 240, 248, 0.72);
  --line: #3f384c;
  --focus: #a482ff;
  --track: rgba(244, 240, 248, 0.07);
  --track-line: rgba(244, 240, 248, 0.3);
  --dim: rgba(244, 240, 248, 0.5);
  --thumb: #f4f0f8;
  --thumb-ink: #16141c;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: clamp(16px, 3.2vw, 44px);
  padding-right: max(clamp(16px, 3.2vw, 44px), env(safe-area-inset-right));
  padding-bottom: max(clamp(16px, 3.2vw, 44px), env(safe-area-inset-bottom));
  padding-left: max(clamp(16px, 3.2vw, 44px), env(safe-area-inset-left));
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
p,
h1 {
  margin: 0;
}
.scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  background: var(--scene);
}
/* Both layers share one geometry; a different crop on either would ghost during the fade. */
.scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 56% 50%;
}
/* The opaque backdrop keeps the day photo from showing through while the night photo loads. */
.scene-night {
  background: #313033;
  opacity: 0;
  transition: opacity var(--fade);
}
[data-theme='dark'] .scene-night {
  opacity: 1;
}
.plaque {
  position: relative;
  width: min(100%, 470px);
  padding: clamp(22px, 2.8vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--plate);
  box-shadow: 0 10px 30px rgba(12, 10, 18, 0.22);
  color: var(--ink);
  transition:
    background-color var(--fade),
    border-color var(--fade);
}
/* Text fades are set on leaves only. Chromium restarts a colour transition on every frame while an
   ancestor is fading its own colour, so no element that fades its colour may contain another that does. */
.wordmark,
.line,
.sub,
.lights-label,
.lights-track svg,
.signup-track svg,
.contact a {
  transition: color var(--fade);
}
.wordmark {
  display: block;
  width: 140px;
  height: auto;
}
h1 {
  margin-top: clamp(20px, 2.6vw, 28px);
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.1;
  font-weight: 480;
  letter-spacing: -0.04em;
}
/* One left rule for the whole box. A glyph's ink starts a little inside its own box, more at larger sizes,
   so each text line is pulled back by its first letter's side bearing (P in the headline, K below). */
.line {
  display: block;
  text-indent: -0.08em;
}
h1 .after,
[data-late] h1 .before {
  display: none;
}
[data-late] h1 .after {
  display: block;
}
.sub {
  margin-top: 12px;
  text-indent: -0.083em;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--quiet);
}
/* E-mail sign-up: a field in the shape of the switch track, confirmed with the same switch. The thumb
   carries an arrow and slides onto the tick once the address is stored. */
.signup {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: clamp(16px, 2.2vw, 22px);
}
.js .signup {
  display: flex;
}
.signup-field {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--track-line);
  border-radius: 999px;
  background: var(--track);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  letter-spacing: -0.01em;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background-color var(--fade),
    border-color var(--fade),
    color var(--fade);
}
.signup-field::placeholder {
  color: inherit;
  opacity: 0.72;
}
.signup-field:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
/* A browser's autofill tint would break the single ink colour. */
.signup-field:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 100px var(--plate) inset;
  caret-color: var(--ink);
}
.signup[data-state='done'] .signup-field {
  color: var(--quiet);
}
.signup[data-state='invalid'] .signup-field,
.signup[data-state='error'] .signup-field {
  border-color: var(--ink);
  animation: refuse 0.3s;
}
@keyframes refuse {
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}
/* Never shown to people; see worker.js. */
.signup-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.signup-send {
  display: flex;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.signup-send:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
.signup[data-state='sending'] .signup-send {
  cursor: progress;
}
.signup[data-state='done'] .signup-send {
  cursor: default;
}
/* Switch on the left rule, contact on the right rule; the label and the e-mail share a baseline. */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  align-items: last baseline;
  justify-content: space-between;
  gap: 14px 16px;
  margin-top: clamp(14px, 2vw, 20px);
}
.lights {
  display: none;
  align-items: center;
  gap: 13px;
  min-height: 48px;
  /* The track is 34 px in a 48 px touch target; this puts its lower edge on the box's bottom rule. */
  margin-bottom: -7px;
  padding: 0 8px 0 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 520;
  letter-spacing: -0.01em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.js .lights {
  display: inline-flex;
}
.lights:hover .lights-label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.lights:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
.lights-track,
.signup-track {
  position: relative;
  flex-shrink: 0;
  width: 60px;
  height: 34px;
  border: 1px solid var(--track-line);
  border-radius: 999px;
  background: var(--track);
  transition:
    background-color var(--fade),
    border-color var(--fade);
}
.lights-thumb,
.signup-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--thumb);
  transition:
    transform 0.45s cubic-bezier(0.5, 0, 0.2, 1),
    background-color var(--fade);
}
[data-theme='dark'] .lights-thumb,
.signup[data-state='done'] .signup-thumb {
  transform: translateX(26px);
}
/* Sun and moon sit at the two ends above the thumb; whichever the thumb is under takes its contrast colour. */
.lights-track svg,
.signup-track svg {
  position: absolute;
  top: 8px;
  width: 16px;
  height: 16px;
}
.lights-sun,
.signup-arrow {
  left: 8px;
  color: var(--thumb-ink);
}
.lights-moon,
.signup-check {
  right: 8px;
  color: var(--dim);
}
[data-theme='dark'] .lights-sun,
.signup[data-state='done'] .signup-arrow {
  color: var(--dim);
}
[data-theme='dark'] .lights-moon,
.signup[data-state='done'] .signup-check {
  color: var(--thumb-ink);
}
.lights-label {
  white-space: nowrap;
}
[data-theme='dark'] .when-day,
:root:not([data-theme='dark']) .when-night {
  display: none;
}
/* Right rule: the last digit and letter end 0.04em inside their boxes. Bottom rule (when the block sits
   under the switch): the last line's box extends 5 px below the ink of its descenders. */
.contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0 -0.04em -5px auto;
  font-size: 13px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  line-height: 24px;
  white-space: nowrap;
}
.contact a {
  color: var(--quiet);
  text-decoration: none;
}
.contact a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.contact a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* Too narrow for switch and contact side by side: the contact keeps the bottom-right corner, one row down. */
@media (max-width: 480px) {
  .foot {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 16px;
  }
  .contact {
    align-self: flex-end;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
