/* The flatplan transition: on a click the page steps back until the whole site shows as a row of pages on the
   wall, like a magazine's flatplan. A pair of crop marks runs from this page to the next one, the row slides it to
   the middle, and the camera walks back in until the new page fills the screen. */
:root {
  --desk: #e6e2d8;
  --paper: #f6f3ec;
  --ink: #141414;
  --muted: #7d786e;
  --hair: rgba(20, 20, 20, 0.16);
  --night: #141414;
  --night-ink: #f1ede5;
  --night-muted: #8f8a80;
  --accent: #e5432b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--desk);
  font-family: 'Archivo Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  --pad: clamp(20px, 4.4vw, 64px);
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--desk);
}

/* ------------------------------------------------------------------ the row of pages */
.track {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  visibility: hidden;
}

.track.is-ready {
  visibility: visible;
}

.track.is-moving {
  pointer-events: none;
}

.page {
  position: absolute;
  top: 0;
  /* the script writes left, width and height: each page is exactly as big as the screen */
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

.page--work {
  background: var(--night);
  color: var(--night-ink);
}

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

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: clamp(13px, 1.1vw, 15px);
}

.brand {
  font-weight: 720;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: clamp(12px, 2vw, 28px);
}

.nav a {
  --w: 100;
  color: var(--muted);
  font-weight: 440;
  font-stretch: calc(var(--w) * 1%);
  transition: font-stretch 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease;
}

.page--work .nav a {
  color: var(--night-muted);
}

.nav a[aria-current='page'] {
  color: inherit;
  font-weight: 640;
}

.body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.kicker {
  margin: 0 0 1.2em;
  font-size: clamp(12px, 1vw, 14px);
  color: var(--muted);
  font-stretch: 108%;
  letter-spacing: 0.02em;
}

.title {
  margin: 0;
  font-size: clamp(52px, min(14.5vw, 25vh), 230px);
  line-height: 0.92;
  font-weight: 560;
  font-stretch: 84%;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.title .ch {
  display: inline-block;
  white-space: pre;
}

.lede {
  max-width: 30em;
  margin: 1.6em 0 0;
  font-size: clamp(14px, 1.25vw, 18px);
  line-height: 1.45;
  font-stretch: 96%;
}

.list {
  margin: 1.4em 0 0;
  padding: 0;
  list-style: none;
  max-width: 44em;
  font-size: clamp(14px, 1.2vw, 17px);
}

.list li {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  padding: 0.75em 0;
  border-top: 1px solid rgba(241, 237, 229, 0.2);
}

.list li:last-child {
  border-bottom: 1px solid rgba(241, 237, 229, 0.2);
}

.list__kind {
  color: var(--night-muted);
}

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 48px);
  max-width: 44em;
  margin-top: 1.6em;
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.45;
  font-stretch: 96%;
}

.cols p {
  margin: 0;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: clamp(13px, 1.1vw, 15px);
}

.note {
  color: var(--muted);
}

.page--work .note {
  color: var(--night-muted);
}

/* the link to the next page: the words widen and the arrow stretches its shaft, on a spring */
.next {
  --w: 100;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-weight: 600;
  font-stretch: calc(var(--w) * 1%);
  transition: font-stretch 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.next__arrow {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}

.next__shaft {
  width: 18px;
  height: 1.5px;
  margin-right: -7px;
  background: currentColor;
  transform-origin: 0 50%;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.next__head {
  width: 8px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
  .nav a:hover {
    --w: 116;
    color: inherit;
  }

  .next:hover {
    --w: 114;
  }

  .next:hover .next__shaft {
    width: 30px;
  }
}

.next:focus-visible,
.nav a:focus-visible,
.brand:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 4px;
}

/* ------------------------------------------------------------------ the flatplan */
.plan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.plan > * {
  position: absolute;
  left: 0;
  top: 0;
}

.frame {
  border: 1px solid var(--hair);
}

.rule {
  width: 100%;
  height: 1px;
}

.rule__line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--hair);
}

.tick {
  width: 1px;
  height: 9px;
}

.tick i {
  display: block;
  width: 1px;
  height: 100%;
  background: rgba(20, 20, 20, 0.34);
  transform-origin: 50% 0;
}

.lab {
  width: 0;
  display: flex;
  justify-content: center;
}

.lab span {
  --wg: 430;
  --w: 100;
  display: block;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--muted);
  font-weight: var(--wg);
  font-stretch: calc(var(--w) * 1%);
}

.lab.is-on span {
  color: var(--ink);
}

.crop__c {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
}

.crop__c i {
  position: absolute;
  inset: 0;
  border: 0 solid var(--accent);
}

.crop__c--tl i {
  border-top-width: 1.5px;
  border-left-width: 1.5px;
  transform-origin: 0 0;
}

.crop__c--tr i {
  border-top-width: 1.5px;
  border-right-width: 1.5px;
  transform-origin: 100% 0;
}

.crop__c--bl i {
  border-bottom-width: 1.5px;
  border-left-width: 1.5px;
  transform-origin: 0 100%;
}

.crop__c--br i {
  border-bottom-width: 1.5px;
  border-right-width: 1.5px;
  transform-origin: 100% 100%;
}

@media (max-width: 640px) {
  .nav {
    gap: 12px;
  }

  .cols {
    grid-template-columns: 1fr;
  }

  .list li {
    grid-template-columns: 1fr auto;
  }

  .list__kind {
    display: none;
  }
}
