:root {
  --ink: #111111;
  --cream: #e6d6c6;
  /* ink + cream: under mix-blend-mode: difference this reads as cream on ink and ink on cream */
  --text: #f7e7d7;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 3vw, 40px);
  --cover: 260px; /* height of the resting shutter, set from main.js */
}

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

html,
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
}

body {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--cream);
  color: var(--ink);
}

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

/* ---------- stage ---------- */

.scroll {
  position: relative;
  height: 260vh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

html:not(.js) #field {
  display: none;
}

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay a,
.overlay button,
.overlay input {
  pointer-events: auto;
}

.bar,
.eyebrow,
.headline,
.sub,
.swap {
  color: var(--text);
  mix-blend-mode: difference;
}

/* ---------- bars ---------- */

.bar {
  position: absolute;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  text-transform: uppercase;
}

.bar > :last-child {
  justify-self: end;
}

.bar--top {
  top: 0;
  grid-template-columns: 1fr auto;
  padding-top: max(20px, env(safe-area-inset-top));
}

.bar--bottom {
  bottom: 0;
  padding-bottom: max(22px, calc(10px + env(safe-area-inset-bottom)));
}

.lang {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lang button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.lang button[aria-pressed="true"] {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.lang button:hover {
  opacity: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.clock {
  white-space: nowrap;
}

.clock time {
  font-variant-numeric: tabular-nums;
}

/* ---------- center ---------- */

.center {
  position: absolute;
  top: 56px;
  bottom: var(--cover);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2vh, 22px);
  padding: 0 var(--gutter);
  text-align: center;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
}

.logo-slot {
  width: min(88vw, 880px, calc((100svh - var(--cover) - 300px) * 2.58));
  min-width: 220px;
  aspect-ratio: 995 / 385;
}

.logo-slot img {
  width: 100%;
  height: 100%;
  display: block;
}

html.js .logo-slot img {
  visibility: hidden;
}

.headline {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 340;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  font-size: clamp(38px, 6.4vw, 84px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0;
  font-size: 12px;
  max-width: 46ch;
  text-wrap: balance;
}

.swap {
  display: grid;
  margin-top: 4px;
  min-height: 2em;
}

.swap > * {
  grid-area: 1 / 1;
  margin: 0;
  justify-self: center;
  align-self: center;
}

.hint {
  font: inherit;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: inherit;
  background: none;
  border: 0;
  padding: 8px 4px;
  cursor: pointer;
  opacity: 0.7;
}

.hint:hover span:last-child {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hint__arrow {
  display: inline-block;
  animation: nudge 1.8s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ---------- notify form ---------- */

.notify {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(440px, 84vw);
  border-bottom: 1px solid currentColor;
  padding: 6px 0;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
}

.notify__prompt {
  opacity: 0.6;
}

.notify input {
  flex: 1;
  min-width: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  caret-color: currentColor;
  background: none;
  border: 0;
  padding: 4px 0;
  outline: none;
  border-radius: 0;
}

.notify input::placeholder {
  color: inherit;
  opacity: 0.45;
}

.notify input:-webkit-autofill {
  -webkit-text-fill-color: currentColor;
  transition: background-color 9999s;
}

.notify .notify__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.notify button {
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: inherit;
  background: none;
  border: 0;
  padding: 4px 0 4px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.notify button:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.notify:focus-within {
  border-bottom-width: 2px;
  padding-bottom: 5px;
}

.notify input:focus-visible {
  outline: none;
}

.notify.is-busy button {
  opacity: 0.4;
  pointer-events: none;
}

/* the message never takes layout space, so the logo slot doesn't move */
.notify__msg {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  margin: 0;
  font-size: 11px;
  min-height: 1em;
}

.notify.is-done {
  border-bottom-color: transparent;
}

.notify.is-done > :not(.notify__msg) {
  visibility: hidden;
}

.notify.is-done .notify__msg {
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
}

/* ---------- 404 ---------- */

.page-404 .stage {
  position: relative;
}

.page-404 .center {
  bottom: 64px;
}

.glyph-slot {
  width: min(78vw, 560px, calc((100svh - 330px) * 2.1));
  min-width: 200px;
  aspect-ratio: 2.1;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: min(30vw, 220px);
  line-height: 1;
}

html.js .glyph-slot span {
  visibility: hidden;
}

.home-link {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- footer links ---------- */

.links {
  display: flex;
  gap: 20px;
}

@media (max-width: 640px) {
  body {
    font-size: 10.5px;
  }

  .bar--bottom {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
  }

  .eyebrow {
    font-size: 10px;
  }

  /* with the email link shown, links get their own row */
  .bar--bottom:has([data-link="email"]:not([hidden])) {
    grid-template-columns: 1fr 1fr;
    row-gap: 10px;
  }

  .bar--bottom:has([data-link="email"]:not([hidden])) .links {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }

  .sub {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hint__arrow {
    animation: none;
  }
}
