/* The menu whose links stretch between the margins. The colours stay here, so the Playground's Palette can change them.
   On a real site the column is the header's menu: keep the button where it is and let the list open under it. */
:root {
  --paper: #000000;
  --ink: #f2efe8;
  --soft: #77746d;
  --hair: #3b3a37;
  --accent: #ff5a36;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  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;
}

.column {
  position: relative;
  width: min(460px, calc(100vw - 32px));
  height: clamp(300px, 88vh, 440px);
  display: flex;
  flex-direction: column;
  --row: clamp(40px, 11vh, 60px);
  --size: clamp(26px, min(8.4vw, 7.6vh), 48px);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  flex: none;
}
.brand {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
  font-variation-settings: 'wght' 460, 'wdth' 112;
}

/* the button: words in a pill, the wide axis opens up on hover */
.toggle {
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.3s;
}
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) {
  .toggle:hover { border-color: var(--ink); }
}
.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' 480, 'wdth' var(--tw, 100);
}
.toggle__word[data-word-close] { position: absolute; left: 0; top: 0; }

/* the field between the margins */
.field {
  position: relative;
  flex: 1;
  margin-top: 18px;
}
.margins {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.margin {
  fill: none;
  stroke: var(--hair);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.margin--hot { stroke: var(--accent); }

.menu {
  position: absolute;
  inset: 0 var(--gap, 5px);
}
.field.is-open { touch-action: none; }
.menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.row {
  display: block;
  height: var(--row);
  color: inherit;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.row:focus-visible .row__word { color: var(--accent); }
.row__mask {
  display: block;
  clip-path: inset(0 -60px 0 -60px);
  height: var(--row);
  line-height: var(--row);
}
.row__word {
  display: inline-block;
  white-space: nowrap;
  font-size: var(--size);
  line-height: var(--row);
  text-transform: uppercase;
  font-variation-settings: 'wght' 300, 'wdth' 100;
  will-change: transform;
}
.row__word span:last-child { letter-spacing: 0 !important; }

.note {
  flex: none;
  position: relative;
  height: 18px;
  margin: 14px 0 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 18px;
  color: var(--soft);
  text-align: center;
}
.note__line { display: block; }

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

@media (max-width: 380px) {
  .column { --size: clamp(24px, 8.2vw, 34px); }
  .brand { font-size: 11px; }
}
