/* The pendulum transition: a thin rule hung above the screen falls like a pendulum, sweeps the new page in behind
   it, swings past, comes back and settles as the new page's column rule. */
:root {
  --paper: #f3f0e8;
  --ink: #151413;
  --muted: #8a857b;
  --night: #151413;
  --night-ink: #eeeae1;
  --night-muted: #86827a;
  --accent: #f0592a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  font-family: 'Roboto Flex Variable', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  /* the script writes --pad, --gap and, on each page, --c1, --c2 and --rx */
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--paper);
}

/* ------------------------------------------------------------------ the pages */
.page {
  position: absolute;
  inset: 0;
  visibility: hidden;
  display: grid;
  grid-template-columns: var(--c1, 1fr) var(--c2, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  column-gap: calc(var(--gap, 24px) * 2);
  padding: calc(var(--pad, 40px) * 0.7) var(--pad, 40px);
}

.page.is-on {
  visibility: visible;
}

.page--a {
  grid-template-areas: 'bar bar' 'main side' 'foot foot';
  background: var(--paper);
  color: var(--ink);
  --soft: var(--muted);
}

.page--b {
  grid-template-areas: 'bar bar' 'side main' 'foot foot';
  background: var(--night);
  color: var(--night-ink);
  --soft: var(--night-muted);
}

/* the column rule, where the pendulum comes to rest */
.rule {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--rx, 50%);
  width: 1.5px;
  margin-left: -0.75px;
  background: var(--accent);
}

.bar {
  grid-area: bar;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 18px;
  font-variation-settings: 'wght' 640, 'wdth' 120, 'opsz' 18;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 30px);
  font-size: 14px;
}

.nav a {
  color: var(--soft);
  text-decoration: none;
  transition: color 0.25s ease;
}

.nav a[aria-current] {
  color: inherit;
}

@media (hover: hover) {
  .nav a:not([aria-current]):hover {
    color: var(--accent);
  }
}

a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 6px;
  border-radius: 2px;
}

/* ------------------------------------------------------------------ the main column */
.main {
  grid-area: main;
  align-self: end;
  min-width: 0;
  padding-bottom: clamp(24px, 6vh, 64px);
}

.big {
  margin: 0;
  font-size: var(--fs, 150px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-weight: 300;
}

.ch {
  display: inline-block;
  font-variation-settings: 'wght' var(--wg, 340), 'wdth' 100, 'opsz' 144;
  transform-origin: 50% 100%;
}

.lede {
  margin: clamp(18px, 3vh, 30px) 0 0;
  max-width: 36ch;
  text-wrap: pretty;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.5;
  color: var(--soft);
}

.go {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(18px, 3vh, 30px);
  color: inherit;
  text-decoration: none;
  font-size: 15px;
  font-variation-settings: 'wght' 560, 'opsz' 16;
}

.go__t {
  display: inline-block;
  font-variation-settings: 'wght' 560, 'wdth' var(--w, 100), 'opsz' 16;
}

.go__arrow {
  width: 26px;
  height: 12px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.list {
  margin: clamp(16px, 3vh, 30px) 0 0;
  padding: 0;
  list-style: none;
  max-width: 640px;
}

.row {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(9px, 1.5vh, 13px) 0;
  font-size: clamp(14px, 1.15vw, 17px);
}

.row__rule {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: color-mix(in srgb, var(--night-ink) 22%, transparent);
  transform-origin: 0 50%;
}

.row__soft {
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ the side column */
.side {
  grid-area: side;
  align-self: end;
  padding-bottom: clamp(24px, 6vh, 64px);
  font-size: 14px;
  line-height: 1.55;
}

.side p {
  margin: 0;
  max-width: 24ch;
}

.side__soft {
  margin-top: 14px !important;
  color: var(--soft);
}

.foot {
  grid-area: foot;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 13px;
  color: var(--soft);
}

/* ------------------------------------------------------------------ the pendulum */
.arm {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5px;
  height: 10px;
  margin-left: -0.75px;
  z-index: 5;
  background: var(--accent);
  transform-origin: 50% 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 640px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }

  .page--a,
  .page--b {
    grid-template-areas: 'bar' 'main' 'side' 'foot';
  }

  .main {
    padding-bottom: 22px;
  }

  .side {
    padding-bottom: 22px;
  }

  .foot {
    font-size: 12px;
  }
}
