/* Two fonts, both from this server. Avinus is ours (public/js/type.js draws it,
   scripts/build-font.mjs packs it) and its width runs from 50 % to 200 %. */
@font-face {
  font-family: Avinus;
  src: url(/fonts/avinus.woff2) format("woff2");
  font-stretch: 50% 200%;
  font-weight: 100 900;
  font-display: block;
}
@font-face {
  font-family: Geist;
  src: url(/fonts/geist-latin.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: Geist;
  src: url(/fonts/geist-latin-ext.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB;
}

/* Andesite, the dark rock opal forms in. Daylight turns it into milky opal. */
:root {
  --ground: #08080b;
  --text: #eef2f7;
  --soft: #b3b9c6;
  --line: rgb(238 242 247 / 0.22);
  --veil: rgb(8 8 11 / 0.74);
  --sheet: rgb(8 8 11 / 0.8);
  --ring: #6ff0d8;
  --gutter: clamp(1.25rem, 5.6vw, 7.5rem);
  --quick: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
:root[data-day] {
  --ground: #e6edf1;
  --text: #0a0e18;
  --soft: #3d4658;
  --line: rgb(10 14 24 / 0.24);
  --veil: rgb(230 237 241 / 0.78);
  --sheet: rgb(236 242 245 / 0.9);
  --ring: #1c35d4;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  background: #08080b;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--text);
  font: 400 clamp(1.02rem, 0.94rem + 0.36vw, 1.3rem) / 1.56 Geist, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: color 0.5s;
}
h1, h2, h3, p, ul, dl, dd {
  margin: 0;
  padding: 0;
}
strong {
  font-weight: 650;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 4px;
  border-radius: 6px;
}
::selection {
  background: var(--ring);
  color: var(--ground);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
[hidden] {
  display: none !important;
}

#stage,
#old {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
}
#stage {
  z-index: -1;
}
#old {
  z-index: 40;
  display: none;
}
.intro:not(.boom) #old {
  display: block;
}

.skip {
  position: fixed;
  z-index: 60;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7em 1.1em;
  border-radius: 12px;
  background: var(--text);
  color: var(--ground);
  transform: translateY(-200%);
}
.skip:focus {
  transform: none;
}

/* ---- The bar at the top and the chapters on the right */

.bar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.6rem);
  padding: clamp(0.9rem, 2.4vh, 1.7rem) var(--gutter);
  font-size: 1rem;
}
.bar::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 -2.2rem;
  background: linear-gradient(var(--veil), transparent);
  pointer-events: none;
}
.brand {
  margin-right: auto;
  font: 400 1.5rem / 1 Avinus, Geist, sans-serif;
  font-stretch: 130%;
  text-transform: uppercase;
  text-decoration: none;
  transition: font-stretch 0.7s var(--quick);
}
.menu {
  display: flex;
  gap: clamp(1rem, 2vw, 2.2rem);
}
.menu a {
  padding: 0.5em 0;
  text-decoration: none;
}
.menu a:hover {
  text-decoration: underline;
}
.switches {
  display: flex;
  gap: 0.5rem;
}
.switches button {
  display: flex;
  align-items: center;
  gap: 0.6em;
  min-height: 2.75rem;
  padding: 0 0.95em;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: none;
}
.bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 1em;
}
.bars i {
  width: 2px;
  height: 25%;
  background: currentColor;
}
[aria-pressed="true"] .bars i {
  height: 100%;
  animation: sing 1.1s ease-in-out infinite alternate;
}
[aria-pressed="true"] .bars i:nth-child(2) { animation-duration: 0.7s; }
[aria-pressed="true"] .bars i:nth-child(3) { animation-duration: 0.9s; }
[aria-pressed="true"] .bars i:nth-child(4) { animation-duration: 0.6s; }
@keyframes sing {
  from { transform: scaleY(0.25); }
}
.pause {
  width: 0.8em;
  height: 0.9em;
  border: solid currentColor;
  border-width: 0 0.24em;
}
[aria-pressed="false"] .pause {
  width: 0;
  border: 0.45em solid transparent;
  border-left: 0.8em solid currentColor;
  border-right: 0;
}

.ticks {
  position: fixed;
  z-index: 25;
  top: 50%;
  right: 0.5rem;
  display: flex;
  flex-direction: column;
  transform: translateY(-50%);
}
.ticks a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 2.6rem;
  height: clamp(1.1rem, 3vh, 1.7rem);
  padding-right: 0.5rem;
}
.ticks a::after {
  content: "";
  width: 0.9rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.42;
  transition: width 0.4s var(--quick), opacity 0.4s;
}
.ticks a:hover::after,
.ticks a:focus-visible::after {
  opacity: 1;
}
.ticks a[aria-current]::after {
  width: 1.9rem;
  opacity: 1;
}
.ticks span {
  position: absolute;
  right: 100%;
  padding: 0.25em 0.7em;
  border-radius: 9px;
  background: var(--text);
  color: var(--ground);
  font-size: 0.875rem;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.ticks a:hover span,
.ticks a:focus-visible span {
  opacity: 1;
}

/* ---- Chapters: the text stays while the shapes change behind it */

section {
  position: relative;
}
.pin {
  position: sticky;
  top: 0;
  display: grid;
  align-items: center;
  height: 100vh;
  height: 100svh;
  padding: 6.5rem var(--gutter) clamp(1.5rem, 5vh, 3.4rem);
}
.hero {
  height: 165vh;
  height: 165svh;
}
.chapter {
  height: 195vh;
  height: 195svh;
}
.copy {
  position: relative;
  width: min(41rem, 43vw);
}
.right .copy {
  justify-self: end;
  margin-right: 1.5rem;
}
.center .copy {
  justify-self: center;
  align-self: end;
  width: min(50rem, 78vw);
  text-align: center;
}
.copy > p {
  max-width: 36em;
}
.center .copy > p {
  margin-inline: auto;
}

h2 {
  margin-bottom: 0.5em;
  font: 400 clamp(1.9rem, 4.4vw, 4.6rem) / 1 Avinus, Geist, sans-serif;
  font-stretch: 100%;
  text-transform: uppercase;
  text-wrap: balance;
}
/* main.js gives every line the size and width that fill the block exactly. */
.fit {
  margin-bottom: 0.32em;
}
.fit span {
  display: block;
  width: max-content;
  margin-left: -0.03em;
  font-size: var(--size, 1em);
  font-stretch: var(--wide, 100%);
  line-height: 1.02;
  white-space: nowrap;
}
.center .fit span {
  margin-inline: auto;
}
.fit:not(.fitted) span {
  width: auto;
  white-space: normal;
}

.source,
.caption {
  color: var(--soft);
  font-size: clamp(0.875rem, 0.84rem + 0.14vw, 1rem);
  line-height: 1.5;
  transition: color 0.5s;
}
.source {
  margin-top: 1.1em;
}
.caption {
  position: absolute;
  right: calc(var(--gutter) + 1.5rem);
  bottom: clamp(1.5rem, 5vh, 3.4rem);
  width: min(24rem, 30vw);
  text-align: right;
}
.right .caption {
  right: auto;
  left: var(--gutter);
  text-align: left;
}

/* Lines start narrow and stretch into place; the rest follows. */
.js .copy > *,
.js .caption,
.js .talk > * {
  opacity: 0;
  transform: translateY(1.6rem);
  transition: opacity 0.45s, transform 0.45s ease-in, color 0.5s;
}
.js .fit span {
  font-stretch: var(--narrow, 50%);
  transition: font-stretch 0.5s;
}
.js .on .copy > *,
.js .on .caption,
.js .on .talk > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s 0.12s, transform 1.1s 0.12s var(--quick), color 0.5s;
}
.js .on .copy > :nth-child(1),
.js .on .talk > :nth-child(1) { transition-delay: 0s; }
.js .on .copy > :nth-child(3),
.js .on .talk > :nth-child(3) { transition-delay: 0.22s; }
.js .on .copy > :nth-child(4),
.js .on .caption { transition-delay: 0.34s; }
.js .on .fit span {
  font-stretch: var(--wide, 100%);
  transition: font-stretch 1.5s var(--quick);
}
.js .on .fit span:nth-child(2) { transition-delay: 0.09s; }

/* ---- The opening */

.hero .pin {
  align-items: end;
}
h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hero .intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}
.hero .intro p {
  max-width: 34em;
  text-wrap: pretty;
}
.go,
.act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0 1.5em;
  border: 0;
  border-radius: 18px;
  background: var(--text);
  color: var(--ground);
  font: 400 1.08rem / 1 Avinus, Geist, sans-serif;
  font-stretch: 92%;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: font-stretch 0.6s var(--quick), background 0.5s, color 0.5s, opacity 0.5s;
}
.go {
  min-width: 11.5rem;
}
.go:hover,
.act:hover,
.brand:hover {
  font-stretch: 150%;
}
.act {
  min-width: min(21rem, 100%);
}
.act[disabled] {
  opacity: 0.55;
  cursor: default;
}

.bar,
.ticks,
.hero .intro {
  transition: opacity 1.2s, visibility 1.2s, color 0.5s;
}
.intro .bar,
.intro .ticks,
.intro .hero .intro {
  opacity: 0;
  visibility: hidden;
  transition: none;
}
.js .hero .intro {
  opacity: 0;
}
.js .hero.on .intro {
  opacity: 1;
}

/* ---- The three things we do */

.service {
  display: grid;
  min-height: 165vh;
  min-height: 165svh;
  padding: 24vh var(--gutter) 40vh;
}
.sheet {
  width: min(41rem, 43vw);
}
.right .sheet {
  justify-self: end;
  margin-right: 1.5rem;
}
#ai .sheet {
  width: min(47rem, 50vw);
}
.sheet > * + * {
  margin-top: 1.15em;
}
.sheet > .fit {
  margin-bottom: 0;
}
h3 {
  padding-top: 1em;
  font: 400 1.12rem / 1.15 Avinus, Geist, sans-serif;
  font-stretch: 112%;
  text-transform: uppercase;
}
.sheet ul {
  list-style: none;
}
.sheet li {
  padding: 0.66em 0;
  border-top: 1px solid var(--line);
}
.sheet li:last-child {
  border-bottom: 1px solid var(--line);
}
.lab {
  padding: clamp(1.1rem, 2vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--sheet);
  transition: background 0.5s;
}
.dials {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dials div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
}
.dials dt {
  color: var(--soft);
  font-size: 0.875rem;
  line-height: 1.35;
}
.dials dd {
  font: 400 clamp(1.7rem, 2.6vw, 2.5rem) / 1.2 Avinus, sans-serif;
  font-stretch: 78%;
}
.lab label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 1rem;
}
output {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
input[type="range"] {
  display: block;
  width: 100%;
  height: 2.75rem;
  margin: 0.3rem 0 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: grab;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, #15b89a, #2b62e8 34%, #9a3de0 58%, #e8364f 80%, #f2a71b);
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, #15b89a, #2b62e8 34%, #9a3de0 58%, #e8364f 80%, #f2a71b);
}
input[type="range"]::-webkit-slider-thumb {
  width: 1.9rem;
  height: 1.9rem;
  margin-top: -0.78rem;
  border: 0;
  border-radius: 10px;
  background: var(--text);
  -webkit-appearance: none;
}
input[type="range"]::-moz-range-thumb {
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 10px;
  background: var(--text);
}

.code {
  margin: 1.2rem 0 0.9rem;
  font: 400 clamp(1.15rem, 2.1vw, 1.9rem) / 1.2 Avinus, sans-serif;
  font-stretch: 76%;
}
.known {
  margin-bottom: 1.1rem;
}
.known li {
  display: grid;
  grid-template-columns: 11.5em 1fr;
  gap: 0 1rem;
  padding: 0.5em 0;
  font-size: 0.94em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.known b {
  color: var(--soft);
  font-weight: 400;
}

.poems {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}
.poem {
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: none;
  font-size: clamp(0.875rem, 0.8rem + 0.18vw, 1rem);
  line-height: 1.62;
  text-align: left;
  transition: border-color 0.4s, background 0.4s, color 0.4s;
}
.poem span:nth-child(even):not(:nth-child(n + 5)),
.poem span:nth-child(7),
.poem span:nth-child(10) {
  padding-left: 1em;
}
.poem:not([disabled]):hover {
  border-color: currentColor;
}
.poem[disabled] {
  color: inherit;
  cursor: default;
}
.poem.human {
  border-color: var(--text);
  background: var(--text);
  color: var(--ground);
}
.poem em {
  margin-top: 1em;
  font-style: normal;
  font-weight: 650;
}
.answer:not(:empty) {
  margin-top: 1rem;
}

/* ---- Meanwhile */

.count .pin {
  align-items: center;
}
.count .copy {
  align-self: center;
  width: min(74rem, 88vw);
  padding: 2.5rem 0;
}
.count h2 {
  margin-bottom: 0.35em;
  font-size: clamp(1.3rem, 2.5vw, 2.5rem);
}
.copy > .counter {
  max-width: none;
  margin-bottom: 0.12em;
  font: 400 clamp(2rem, 8.1vw, 8.4rem) / 1.05 Avinus, sans-serif;
  font-stretch: 62%;
  white-space: nowrap;
}
.count .copy::before,
.center .copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -3rem -8rem;
  background: radial-gradient(closest-side, var(--veil) 55%, transparent);
}

/* ---- Contact */

.contact {
  height: 125vh;
  height: 125svh;
}
.contact .pin {
  align-items: end;
  justify-items: center;
  padding-bottom: clamp(2.5rem, 11vh, 7rem);
  text-align: center;
}
.talk h2 {
  margin-bottom: 0.3em;
  font-size: clamp(1.6rem, 3.5vw, 3.6rem);
}
.talk p {
  text-wrap: balance;
}
.ways {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.8rem;
}
.ways .act {
  min-width: 22rem;
  min-height: 4.4rem;
  font-size: 1.4rem;
  font-stretch: 70%;
}
.ways .act:hover {
  font-stretch: 84%;
}

footer {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem clamp(1.5rem, 4vw, 4.5rem);
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--line);
  background: var(--sheet);
  font-size: clamp(0.875rem, 0.85rem + 0.1vw, 0.97rem);
  line-height: 1.55;
}
.legal p + p {
  margin-top: 0.7em;
}
#rewind {
  padding: 0.5em 0;
  border: 0;
  background: none;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---- Where there is no WebGL or no script: the words themselves */

html:not(.js) .ticks,
.flat .ticks {
  display: none;
}
.flat #stage,
.flat #old {
  display: none;
}
html:not(.js) h1,
.flat h1 {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
  white-space: normal;
  align-self: center;
  font: 400 clamp(3rem, 11vw, 11rem) / 0.98 Avinus, Geist, sans-serif;
  font-stretch: 100%;
  text-transform: uppercase;
}
html:not(.js) .chapter,
.flat .chapter {
  height: auto;
}
html:not(.js) .pin,
.flat .pin {
  position: static;
  height: auto;
  min-height: 80vh;
}
.flat .caption {
  display: none;
}

/* ---- Phones and narrow windows: shape above, words below */

@media (max-width: 860px), (max-aspect-ratio: 86/100) {
  .menu a:not(:last-child) {
    display: none;
  }
  .menu a {
    padding: 0.75em 0.2em;
  }
  .bar {
    gap: 0.75rem;
  }
  .brand {
    font-size: 1.3rem;
  }
  .switches button {
    min-width: 2.75rem;
    padding: 0 0.8em;
    justify-content: center;
  }
  .switches button span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .ticks {
    display: none;
  }
  .pin {
    align-items: end;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
  .chapter {
    height: 185vh;
    height: 185svh;
  }
  .copy,
  .center .copy,
  .right .copy {
    width: 100%;
    margin: 0;
    text-align: left;
  }
  .center .fit span {
    margin-inline: -0.03em 0;
  }
  .copy::before,
  .center .copy::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -5.5rem calc(-1 * var(--gutter)) -3rem;
    background: linear-gradient(transparent, var(--veil) 5rem, var(--veil));
  }
  .caption {
    display: none;
  }
  .hero .intro {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }
  .service {
    padding: 66vh 0 22vh;
    min-height: 0;
  }
  .sheet,
  #ai .sheet,
  .right .sheet {
    justify-self: stretch;
    width: 100%;
    margin: 0;
    padding: 2rem var(--gutter) 2.5rem;
    border-radius: 30px;
    background: var(--sheet);
  }
  .lab {
    margin-inline: calc(-0.5 * var(--gutter));
  }
  .dials {
    grid-template-columns: repeat(2, 1fr);
  }
  .known li {
    grid-template-columns: 1fr;
  }
  .poems {
    grid-template-columns: 1fr;
  }
  .act,
  .ways .act {
    width: 100%;
    min-width: 0;
    padding-inline: 1em;
  }
  .ways .act {
    font-size: 1.02rem;
    font-stretch: 66%;
  }
  .count .copy {
    align-self: center;
  }
  .count .copy::before {
    inset: -4rem calc(-1 * var(--gutter));
    background: linear-gradient(transparent, var(--veil) 6rem calc(100% - 6rem), transparent);
  }
  .copy > .counter {
    font-size: 10.6vw;
    font-stretch: 50%;
  }
  .ways {
    width: calc(100vw - 2 * var(--gutter));
  }
  footer {
    grid-template-columns: 1fr;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  }
}

/* A wide but low window, such as a phone on its side. */
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .pin {
    padding-top: 4rem;
  }
  body {
    font-size: 0.94rem;
    line-height: 1.45;
  }
  .caption {
    display: none;
  }
  .source {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
.still *,
.still *::before {
  animation: none !important;
}

@media print {
  #stage, #old, .bar, .ticks, .lab {
    display: none;
  }
}

/* ---- 404 */

.lost {
  display: grid;
  align-content: center;
  min-height: 100vh;
  padding: var(--gutter);
  background: #08080b;
}
.lost h1 {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
  white-space: normal;
  margin: 0.5em 0 0.3em;
  font: 400 clamp(2.4rem, 8vw, 8rem) / 0.98 Avinus, Geist, sans-serif;
  text-transform: uppercase;
}
.lost .go {
  margin-top: 1.6rem;
}
