/* The isobar menu. The colours stay here, so the Playground's Palette can change them (the script reads them too).
   On a real site the frame is the header's menu: keep the button where it is and let the list open under it. */
:root {
  --night: #000000;
  --ink: #f2f1ec;
  --soft: #8d8c87;
  --line: #ffffff;
  --accent: #ff4b2b;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: hidden; }
body {
  background: var(--night);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;   /* the field reaches 24 pixels past the menu: it never pushes the page sideways */
}

.isobar {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  height: clamp(300px, 88vh, 420px);
  --row: clamp(42px, 11vh, 56px);
}

/* the field: it fades out towards the edges, so the frame never shows a hard border */
.field {
  position: absolute;
  inset: -24px;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
}

/* the button */
.toggle {
  position: absolute;
  left: 0;
  top: 0;
  height: 48px;
  padding: 0 20px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(242, 241, 236, 0.42);
  border-radius: 999px;
  background: var(--night);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.3s;
}
@media (hover: hover) {
  .toggle:hover { border-color: var(--ink); }
}
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.toggle__icon { width: 22px; height: 22px; display: block; }
.toggle__icon svg { width: 100%; height: 100%; overflow: visible; }
.toggle__iso { fill: none; stroke: var(--ink); stroke-width: 1; stroke-linecap: round; }
.toggle__words {
  position: relative;
  display: block;
  height: 20px;
  overflow: hidden;
  min-width: 44px;
}
.toggle__word {
  display: block;
  height: 20px;
  line-height: 20px;
  font-variation-settings: 'wght' 460, 'wdth' 100;
}
.toggle__word[data-word-close] { position: absolute; left: 0; top: 0; }

.brand {
  position: absolute;
  right: 0;
  top: 0;
  height: 48px;
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
}

/* the links */
.menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 72px;
  bottom: 0;
  z-index: 2;
}
.menu[inert] { pointer-events: none; }
.menu__list { list-style: none; margin: 0; padding: 0; }
.menu__list li { margin: 0; }
.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  height: var(--row);
  padding: 0 4px 0 18px;
  color: var(--ink);
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.row__mask { display: block; overflow: hidden; padding: 4px 0 6px; margin: -4px 0 -6px; }
.row__word {
  display: block;
  font-size: clamp(25px, min(8.2vw, 7.2vh), 36px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variation-settings: 'wght' 300, 'wdth' 90;
  will-change: transform;
}
.row__read {
  font-size: 11px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--soft);
  white-space: nowrap;
  opacity: 0;
}
.row:focus-visible .row__word { outline: 1px solid var(--ink); outline-offset: 4px; }

.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 340px) {
  .brand { display: none; }
}
