:root {
  color-scheme: dark;
  --background: #051109;
  --cream: #efdbca;
  --red: #f63d0d;
  --beat: 500ms;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }
body { background: var(--background); }

main {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* Positions use the supplied SVGs' original proportions on a 581.61 × 88.96 canvas. */
.logo {
  position: relative;
  width: clamp(280px, 31vw, 760px);
  max-width: 100%;
  aspect-ratio: 581.61 / 88.96;
  margin: 0;
}

.logo > * { position: absolute; display: block; }

.logo__word {
  appearance: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: none;
  color: var(--cream);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Transparent hit areas stay at least 44px tall without changing the artwork. */
.logo__word::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: max(100%, 44px);
  transform: translateY(-50%);
}

.logo__word:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}

.logo__word[aria-pressed="true"] { color: var(--red); }
.logo__no { color: var(--red); }
.logo__no[aria-pressed="true"] { color: var(--cream); }

.logo__ink { display: block; width: 100%; height: 100%; background: currentColor; }

.logo__never {
  left: 0;
  top: 1.2253%;
  width: 55.9911%;
  height: 97.5495%;
}

.logo__never .logo__ink {
  -webkit-mask: url("SVG/never.svg") center / contain no-repeat;
  mask: url("SVG/never.svg") center / contain no-repeat;
  animation: handoff var(--beat) step-end;
}

.logo__no {
  left: 58.8281%;
  top: 0;
  width: 22.4033%;
  height: 100%;
  animation: appear 0s var(--beat) both;
}

.logo__no .logo__ink {
  -webkit-mask: url("SVG/no.svg") center / contain no-repeat;
  mask: url("SVG/no.svg") center / contain no-repeat;
}

.logo__suffix {
  left: 84.0684%;
  top: 0;
  width: 15.9316%;
  height: 100%;
  animation: appear 0s calc(var(--beat) * 2) both;
}

.logo__suffix > * { position: absolute; display: block; background: currentColor; }

.logo__dot, .logo__co {
  left: 0;
  top: 1.2253%;
  width: 100%;
  height: 58.3408%;
  -webkit-mask: url("SVG/co.svg") center / contain no-repeat;
  mask: url("SVG/co.svg") center / contain no-repeat;
}

/* Reveal the dot and letters separately, preserving the original .co artwork. */
.logo__dot {
  clip-path: inset(0 90% 0 0);
  animation: appear 0s calc(var(--beat) * 2) both;
}

.logo__co {
  clip-path: inset(0 0 0 19%);
  animation: appear 0s calc(var(--beat) * 3) both;
}

.logo__rule {
  left: 19.9007%;
  top: 93.1093%;
  width: 76.9911%;
  height: 5.6655%;
  -webkit-mask: url("SVG/rule.svg") center / contain no-repeat;
  mask: url("SVG/rule.svg") center / contain no-repeat;
  animation: underline calc(var(--beat) * 0.8) cubic-bezier(0.333333, 0.666667, 0.666667, 1) calc(var(--beat) * 4) both;
}

@keyframes handoff {
  from { background-color: var(--red); }
  to { background-color: currentColor; }
}

@keyframes appear {
  from { visibility: hidden; }
  to { visibility: visible; }
}

@keyframes underline {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .logo > *, .logo__word > * { animation: none; }
}
