/* The menu that opens from its button: a black circle grows out of the button until it covers the page, the links
   rise one after the other, and the button, turned white, becomes the way back. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #0b0b0b;           /* the button and the menu */
  --paper: #ffffff;         /* the text on the menu */
  --muted: rgba(255, 255, 255, 0.5);
  --edge: clamp(18px, 3.2vw, 44px);
  --dim: 0.3;               /* set by the script: how bright the other links stay while one is pointed at */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

html.is-locked {
  overflow: hidden;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Syne Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- the button */
.burger {
  position: fixed;
  top: var(--edge);
  right: var(--edge);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  padding: 0 19px 0 23px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.45s ease, color 0.45s ease;
}

.burger.is-open {
  background: var(--paper);
  color: var(--ink);
}

.burger:focus-visible {
  outline: 2px solid #8a8a8a;
  outline-offset: 4px;
}

/* the two words share one cell, so the button is as wide as the longer one; the script rolls one out, one in */
.burger__words {
  display: grid;
  overflow: hidden;
  line-height: 1.25;
}

.burger__word {
  grid-area: 1 / 1;
}

.burger__icon {
  position: relative;
  width: 22px;
  height: 12px;
  flex: none;
}

.burger__icon i {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.burger__icon i:first-child {
  top: 0;
}

.burger__icon i:last-child {
  bottom: 0;
}

/* ---------------------------------------------------------------- the menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 32px;
  padding: calc(var(--edge) + 84px) var(--edge) var(--edge);
  background: var(--ink);
  color: var(--paper);
  visibility: hidden;
}

.menu.is-open {
  visibility: visible;
}

.menu__links {
  align-self: center;
  display: grid;
  justify-items: start;
  gap: 0.04em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(50px, 9.4vw, 136px);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.035em;
}

.menu__link {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  transition: opacity 0.35s ease;
}

.menu__links.is-pointing .menu__link:not(.is-here) {
  opacity: var(--dim);
}

.menu__link:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 8px;
  border-radius: 6px;
}

/* each word rises out of its own mask; a little room below keeps the descenders */
.menu__mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.menu__word {
  display: block;
}

.menu__arrow {
  width: 0.4em;
  height: 0.24em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.menu__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.menu__foot a {
  transition: color 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .menu__foot a:hover {
    color: var(--paper);
  }
}

.menu__foot a:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
  border-radius: 3px;
}

@media (max-width: 640px) {
  .burger {
    height: 48px;
    padding: 0 17px 0 20px;
  }

  .menu__links {
    font-size: clamp(46px, 14.5vw, 90px);
  }
}
