/* The leading transition: every line of the page stands on a thin baseline. On a click the leading closes, the lines
   slide together and flatten one by one onto a single vermilion baseline; out of it the lines of the next page open
   again, set with more room, and settle on their own guides. */
:root {
  --paper: #f3f0e8;
  --ink: #141414;
  --muted: #8a857b;
  --guide: #e0dbd0;
  --guide-lit: #b3ac9f;
  --accent: #e2471f;
}

* {
  box-sizing: border-box;
}

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

.stage {
  /* the script writes --rule (where the shared baseline runs) and --ts (the size of each title) */
  --pad: clamp(22px, 4.6vw, 72px);
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

/* ------------------------------------------------------------------ the bar and the foot */
.bar,
.foot {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  z-index: 4;
}

.bar {
  top: calc(var(--pad) * 0.7);
}

.foot {
  bottom: calc(var(--pad) * 0.7);
  font-size: 13px;
  color: var(--muted);
  font-stretch: 92%;
}

.brand {
  font-size: 18px;
  font-weight: 620;
  font-stretch: 78%;
  letter-spacing: -0.01em;
}

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

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a[aria-current] {
  color: var(--ink);
}

@media (hover: hover) {
  .nav a:not([aria-current]):hover {
    color: var(--ink);
    transition: color 0.25s ease;
  }
}

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

/* ------------------------------------------------------------------ the pages and their lines */
.page {
  position: absolute;
  inset: 0;
  visibility: hidden;
  z-index: 1;
}

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

.col {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  top: 0;
}

.row {
  position: relative;
  display: block;
  white-space: nowrap;
}

/* the part of a line that flattens: it squashes onto its own baseline (the script sets the origin) */
.ink {
  --w: 100;
  --t: 0;
  position: relative;
  display: inline-block;
  font-stretch: calc(var(--w) * 1%);
  font-weight: calc(var(--wt) - (var(--wt) - 110) * var(--t));
}

/* the thin baseline under every line, drawn by the script at the height of the baseline */
.guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--guide);
  pointer-events: none;
}

.row--kicker {
  --wt: 520;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.row--title {
  --wt: 580;
  font-size: var(--ts, 120px);
  letter-spacing: -0.035em;
}

.row--text {
  --wt: 400;
  margin: 0;
  font-size: clamp(15px, 1.25vw, 19px);
  color: #4b4842;
}

.row--link {
  --wt: 560;
  font-size: 15px;
  line-height: 1;
}

/* the first page is set close, the second with room: that is the whole story */
.page--a .row--kicker {
  margin-bottom: 18px;
}

.page--a .row--title {
  line-height: 0.88;
}

.page--a .row--text {
  line-height: 1.38;
}

.page--a .row--first {
  margin-top: 22px;
}

.page--a .row--link {
  margin-top: 26px;
}

.page--b .row--kicker {
  margin-bottom: 30px;
}

.page--b .row--title {
  line-height: 1.12;
}

.page--b .row--text {
  line-height: 1.9;
}

.page--b .row--first {
  margin-top: 30px;
}

.page--b .row--link {
  margin-top: 40px;
}

/* the paragraph is only a source: the script sets it again one row per line */
p[data-lines] {
  position: absolute;
  left: 0;
  top: 0;
  max-width: var(--measure, 34em);
  white-space: normal;
  visibility: hidden;
  pointer-events: none;
}

/* ------------------------------------------------------------------ the link */
.go {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.go__text {
  display: inline-block;
}

.go__arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 30px;
  height: 12px;
}

.go__shaft {
  position: absolute;
  top: 50%;
  height: 1.5px;
  width: 16px;
  margin-top: -0.75px;
  background: currentColor;
}

.go__head {
  position: absolute;
  top: 0;
  width: 8px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.go .go__shaft {
  left: 0;
  transform-origin: 0 50%;
}

.go .go__head {
  left: 9px;
}

.go--back .go__shaft {
  left: auto;
  right: 0;
  transform-origin: 100% 50%;
}

.go--back .go__head {
  left: auto;
  right: 9px;
}

/* ------------------------------------------------------------------ the shared baseline */
.rule {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  top: var(--rule, 56%);
  height: 1px;
  background: var(--accent);
  transform-origin: 0 0;
  transform: scaleX(0);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
}

@media (max-width: 600px) {
  .brand {
    font-size: 17px;
  }

  .foot {
    font-size: 12px;
  }

  .row--link {
    font-size: 14px;
  }
}
