/* The plumb line menu. The colours stay here, so the Playground's Palette can change them.
   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 {
  --paper: #ffffff;
  --ink: #141414;
  --soft: #8a8a86;
  --hair: #c4c3bd;
  --accent: #e5482b;
}

* { 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;
}

.plumb {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  height: clamp(300px, 88vh, 420px);
  --row: clamp(44px, 11.5vh, 58px);
}

/* the button */
.toggle {
  position: absolute;
  left: 0;
  top: 0;
  height: 52px;
  padding: 0 22px 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  letter-spacing: 0.01em;
  cursor: pointer;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.toggle__icon { width: 22px; height: 26px; display: block; }
.toggle__icon svg { width: 100%; height: 100%; overflow: visible; }
.toggle__thread { stroke: var(--ink); stroke-width: 1; }
.toggle__words {
  position: relative;
  display: block;
  height: 20px;
  overflow: hidden;
  min-width: 46px;
}
.toggle__word {
  display: block;
  height: 20px;
  line-height: 20px;
  font-variation-settings: 'wght' 480, 'wdth' 100;
}
.toggle__word[data-word-close] { position: absolute; left: 0; top: 0; }

/* the bob, in the button and on the thread */
.bob__cap { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.bob__body { fill: var(--paper); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.bob__tip { fill: var(--accent); }
.bob__rim { stroke: var(--ink); stroke-width: 1; }

/* the links */
.menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 74px;
  bottom: 0;
}
.menu[inert] { pointer-events: none; }
.menu__list { list-style: none; margin: 0; padding: 0; }
.menu__item { margin: 0; }
.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  height: var(--row);
  padding-left: 44px;
  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(26px, min(8.6vw, 7.4vh), 38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variation-settings: 'wght' 300, 'wdth' 88;
  will-change: transform;
}
.row__note {
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--soft);
  white-space: nowrap;
  opacity: 0;
}
.row[aria-current='page'] .row__word { color: var(--accent); }
.row:focus-visible .row__word { outline: 1px solid var(--ink); outline-offset: 4px; }

/* the drawing on top */
.line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 4;
}
.line__guide { stroke: var(--hair); stroke-width: 1; stroke-dasharray: 2 4; }
.line__thread { fill: none; stroke: var(--ink); stroke-width: 1; }
.mark { stroke: var(--hair); stroke-width: 1; }

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

@media (max-width: 360px) {
  .row__note { display: none; }
}

/* the bob on the thread is drawn 1.4 times bigger: its lines stay one pixel */
.line .bob__cap, .line .bob__body, .line .bob__rim { stroke-width: 0.72; }
