/*
 * nitz.fyi landing page. Section rhythm, top to bottom:
 * yellow cover, paper, deep paper (demo), paper, red, paper, cyan, ink,
 * paper with a yellow band, yellow back cover, ink footer.
 */

.home {
  --section-pad: clamp(72px, 10vw, 136px);
}

.home .masthead {
  --masthead-bg: var(--yellow);
}

.home .masthead[data-stuck] {
  --masthead-bg: var(--paper);
}

/* Code tokens on ink. Severity hues follow the extension's pins. */
.t-kw {
  color: var(--yellow);
}
.t-n {
  color: var(--white);
  font-weight: 600;
}
.t-p0 {
  color: #ff6a5c;
  font-weight: 600;
}
.t-p1 {
  color: #ff9a4d;
  font-weight: 600;
}
.t-p2 {
  color: #7cbcff;
  font-weight: 600;
}
.t-p3 {
  color: #c2bab0;
  font-weight: 600;
}
.t-loc {
  color: var(--white);
}
.t-str {
  color: #ffe27a;
}
.t-at {
  color: #7fd3ff;
}
.t-dim {
  color: #a2988c;
}
.t-sig {
  color: #d6b3ff;
}
.t-ok {
  color: #8fe39a;
}
.t-bad {
  color: #ff6a5c;
}
.t-add {
  color: #8fe39a;
}
.t-del {
  color: #ff8a80;
}
.t-new {
  animation: line-in 900ms ease-out;
}

@keyframes line-in {
  from {
    background: rgb(255 210 26 / 0.35);
  }
  to {
    background: transparent;
  }
}

/* Comic furniture */
.panel {
  position: relative;
  background: var(--white);
  border: var(--line) solid var(--ink);
}

.panel > .caption:first-child {
  position: relative;
  z-index: 1;
  margin: calc(var(--line) * -1) 0 0 calc(var(--line) * -1);
}

.balloon {
  --tail-x: 28px;
  position: relative;
  padding: 10px 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  background: var(--white);
  border: 2.5px solid var(--ink);
  border-radius: 24px;
  text-wrap: balance;
}

.balloon::before,
.balloon::after {
  content: "";
  position: absolute;
  left: var(--tail-x);
}

.balloon::before {
  bottom: -20px;
  width: 26px;
  height: 22px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 8% 100%);
}

.balloon::after {
  bottom: -14px;
  left: calc(var(--tail-x) + 3.5px);
  width: 18px;
  height: 17px;
  background: inherit;
  clip-path: polygon(0 0, 100% 0, 6% 100%);
}

.balloon--right::before,
.balloon--right::after {
  left: auto;
  right: var(--tail-x);
  transform: scaleX(-1);
}

.balloon--right::after {
  right: calc(var(--tail-x) + 3.5px);
}

.balloon--up::before,
.balloon--up::after {
  bottom: auto;
  transform: scaleY(-1);
}

.balloon--up::before {
  top: -20px;
}

.balloon--up::after {
  top: -14px;
}

.term {
  padding: 12px 14px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--paper);
  background: var(--ink);
  white-space: pre;
  overflow-x: auto;
}

.linkish {
  padding: 4px 2px;
  font-size: 0.875rem;
  font-weight: 700;
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.btn--cyan {
  --btn-hover-bg: #45bdf0;
  background: var(--cyan);
}

.btn--big {
  min-height: 64px;
  padding: 0 2em;
  font-size: var(--step-1);
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
}

.seg button {
  padding: 5px 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.seg button:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.seg button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--yellow);
}

/* ------------------------------------------------------------------ Cover */

.cover {
  --cx: 76%;
  --cy: 46%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(16px, 3vw, 40px) 0 clamp(56px, 7vw, 96px);
  background: var(--yellow);
  border-bottom: var(--line) solid var(--ink);
}

.cover__rays {
  position: absolute;
  z-index: -2;
  left: var(--cx);
  top: var(--cy);
  width: 260vmax;
  height: 260vmax;
  translate: -50% -50%;
  background: repeating-conic-gradient(var(--yellow) 0deg 4.5deg, var(--yellow-deep) 4.5deg 9deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 4%, transparent 38%);
  mask-image: radial-gradient(closest-side, #000 4%, transparent 38%);
}

/*
 * True halftone: a staggered dot screen multiplied by a tone ramp, then
 * thresholded with contrast() so dot size follows the tone. The red layer
 * lightens black to red; the whole group multiplies onto the yellow.
 */
.cover__dots {
  position: absolute;
  z-index: -1;
  inset: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.cover__dots::before,
.cover__dots::after {
  content: "";
  position: absolute;
  inset: 0;
}

.cover__dots::before {
  background:
    radial-gradient(closest-side, #8a8a8a, #fff) 0 0 / 12px 12px,
    radial-gradient(closest-side, #8a8a8a, #fff) 6px 6px / 12px 12px,
    radial-gradient(circle at var(--cx) var(--cy), #111 0%, #fff 44%);
  background-blend-mode: multiply;
  filter: contrast(20);
}

.cover__dots::after {
  background: #ff7a1a;
  mix-blend-mode: lighten;
}

.cover__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}

.cover__tagline {
  font-size: var(--step-1);
  font-weight: 800;
  font-style: italic;
  font-stretch: 80%;
  letter-spacing: 0.01em;
}

.cover__title {
  margin-top: 14px;
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.86;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.cover__line {
  display: block;
  width: max-content;
  white-space: nowrap;
  font-size: var(--fs, clamp(2.75rem, 1rem + 6vw, 6.5rem));
  text-shadow: 0.045em 0.05em 0 var(--red);
}

.cover__lead {
  max-width: 38ch;
  margin-top: 28px;
  font-size: var(--step-1);
  line-height: 1.45;
  font-weight: 500;
  text-wrap: pretty;
}

.cover__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.cover__fine {
  margin-top: 16px;
  font-size: var(--step--1);
  font-weight: 600;
}

.cover__art {
  position: relative;
  min-width: 0;
}

.scene {
  position: relative;
  aspect-ratio: 1 / 0.82;
  container-type: inline-size;
}

.scene__caption {
  position: absolute;
  z-index: 5;
  left: 2%;
  top: 4%;
  rotate: -2deg;
  font-size: clamp(0.75rem, 2.5cqi, 1rem);
}

.scene__form {
  position: absolute;
  left: 3%;
  top: 11%;
  width: 84%;
  padding: 6cqi 5.5cqi 5cqi;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: 3cqi;
  rotate: 1.5deg;
  box-shadow: 1.6cqi 1.6cqi 0 var(--ink);
}

.scene__label {
  display: block;
  font-size: 3.4cqi;
  font-weight: 700;
  color: #57534e;
}

.scene__input {
  display: block;
  margin-top: 1.6cqi;
  padding: 2.4cqi 3cqi;
  font-size: 4.4cqi;
  font-weight: 500;
  border: 2px solid var(--ink);
  border-radius: 1.6cqi;
}

.scene__actions {
  display: flex;
  justify-content: flex-end;
  gap: 3cqi;
  margin-top: 7cqi;
}

.scene__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 2.6cqi 4.4cqi;
  font-size: 4.6cqi;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: 2cqi;
}

.scene__btn--save {
  color: var(--white);
  background-color: var(--cyan);
  /* Ben-Day shading on the lower half only. */
  background-image:
    linear-gradient(var(--cyan) 50%, transparent 50%),
    radial-gradient(circle, var(--cyan-deep) 30%, transparent 34%);
  background-size:
    100% 100%,
    1.4cqi 1.4cqi;
  -webkit-text-stroke: 0.16em var(--ink);
  paint-order: stroke fill;
}

.scene__hl {
  position: absolute;
  inset: -2.4cqi;
  border: 0.9cqi solid var(--yellow);
  border-radius: 2.6cqi;
  box-shadow:
    0 0 0 2px var(--ink),
    inset 0 0 0 2px var(--ink);
}

.scene__tag {
  position: absolute;
  left: -0.9cqi;
  bottom: calc(100% + 0.2cqi);
  padding: 1cqi 1.6cqi;
  font-family: var(--mono);
  font-size: 2.8cqi;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--ink);
  -webkit-text-stroke: 0;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 1.2cqi 1.2cqi 0 0;
}

.scene__tag i {
  font-style: normal;
  opacity: 0.6;
}

.scene__burst {
  position: absolute;
  z-index: 3;
  right: -4%;
  top: 13%;
  width: 34%;
  height: auto;
  rotate: -9deg;
  filter: drop-shadow(0.9cqi 1.2cqi 0 rgb(0 0 0 / 0.9));
}

.scene__balloon {
  --tail-x: 62%;
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: 2%;
  width: 56%;
  padding: 3cqi 4cqi;
  font-size: clamp(0.95rem, 3.9cqi, 1.5rem);
  font-weight: 800;
  font-stretch: 90%;
  line-height: 1.15;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: 50% / 46%;
  text-align: center;
  rotate: -3deg;
}

.scene__balloon::before,
.scene__balloon::after {
  content: "";
  position: absolute;
  left: 58%;
  top: -22px;
  width: 36px;
  height: 26px;
  background: var(--ink);
  clip-path: polygon(0 100%, 100% 100%, 92% 0);
}

.scene__balloon::after {
  left: calc(58% + 5px);
  top: -14px;
  width: 26px;
  height: 18px;
  background: var(--white);
  clip-path: polygon(0 100%, 100% 100%, 90% 0);
}

.scene__cursor {
  position: absolute;
  z-index: 6;
  left: 70%;
  top: 70%;
  width: 7cqi;
  height: auto;
  filter: drop-shadow(0.5cqi 0.6cqi 0 rgb(0 0 0 / 0.35));
}

.scene__brief {
  position: relative;
  z-index: 2;
  margin: 3% 0 0 6%;
  padding: 14px 16px;
  font-size: clamp(0.72rem, 0.55rem + 0.5vw, 0.875rem);
  line-height: 1.6;
  color: var(--paper);
  background: var(--ink);
  border: var(--line) solid var(--ink);
  white-space: pre;
  overflow: hidden;
  rotate: -1deg;
}

.scene__brief code {
  display: block;
  min-height: 4.8em;
}

/* Page-load sequence. Only runs with JS and without reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .js .cover__line,
  .js .cover__tagline,
  .js .cover__lead,
  .js .cover__cta,
  .js .cover__fine,
  .js .scene__form,
  .js .scene__caption,
  .js .scene__hl,
  .js .scene__burst,
  .js .scene__balloon,
  .js .scene__brief {
    opacity: 0;
  }

  .js .scene__cursor {
    opacity: 0;
  }

  .cover.is-live .cover__tagline {
    animation: rise 500ms var(--ease-out) 60ms both;
  }

  .cover.is-live .cover__line {
    animation: slam-word 520ms var(--ease-pop) calc(160ms + var(--i) * 130ms) both;
  }

  .cover.is-live .cover__lead {
    animation: rise 600ms var(--ease-out) 620ms both;
  }

  .cover.is-live .cover__cta {
    animation: rise 600ms var(--ease-out) 720ms both;
  }

  .cover.is-live .cover__fine {
    animation: rise 600ms var(--ease-out) 820ms both;
  }

  .cover.is-live .scene__form {
    animation: panel-in 620ms var(--ease-out) 300ms both;
  }

  .cover.is-live .scene__caption {
    animation: rise 400ms var(--ease-out) 700ms both;
  }

  .cover.is-live .scene__cursor {
    animation: cursor-path 1100ms var(--ease-out) 800ms both;
  }

  .cover.is-live .scene__hl {
    animation: hl-in 260ms ease-out 1500ms both;
  }

  .cover.is-live .scene__burst {
    animation: burst-slam 620ms var(--ease-pop) 1900ms both;
  }

  .cover.is-live .scene {
    animation: shake 380ms linear 2080ms;
  }

  .cover.is-live .cover__rays {
    animation: rays-in 1400ms var(--ease-out) 1900ms both;
  }

  .cover.is-live .scene__balloon {
    animation: balloon-pop 480ms var(--ease-pop) 2350ms both;
  }

  .cover.is-live .scene__brief {
    animation: rise 400ms var(--ease-out) 2600ms both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slam-word {
  0% {
    opacity: 0;
    transform: scale(1.5) rotate(-4deg);
  }
  60% {
    opacity: 1;
    transform: scale(0.96) rotate(0.5deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translate(30px, 24px) rotate(4deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cursor-path {
  0% {
    opacity: 0;
    transform: translate(120%, 160%);
  }
  15% {
    opacity: 1;
  }
  70% {
    transform: translate(0, 0);
  }
  82% {
    transform: translate(0, 0) scale(0.82);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes hl-in {
  from {
    opacity: 0;
    transform: scale(1.12);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes burst-slam {
  0% {
    opacity: 0;
    transform: scale(2.6) rotate(-30deg);
  }
  45% {
    opacity: 1;
    transform: scale(0.88) rotate(4deg);
  }
  70% {
    transform: scale(1.07) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes shake {
  0%,
  100% {
    translate: 0 0;
  }
  20% {
    translate: -7px 4px;
  }
  40% {
    translate: 6px -5px;
  }
  60% {
    translate: -4px 3px;
  }
  80% {
    translate: 2px -1px;
  }
}

@keyframes rays-in {
  from {
    rotate: -18deg;
    scale: 0.6;
  }
  to {
    rotate: 0deg;
    scale: 1;
  }
}

@keyframes balloon-pop {
  0% {
    opacity: 0;
    transform: scale(0.2);
    transform-origin: 60% 0;
  }
  100% {
    opacity: 1;
    transform: none;
    transform-origin: 60% 0;
  }
}

@media (max-width: 960px) {
  .cover {
    --cx: 62%;
    --cy: 82%;
  }

  .cover__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .cover__art {
    width: min(100%, 560px);
    justify-self: center;
  }
}

/* ---------------------------------------------------------------- Problem */

.problem {
  padding: var(--section-pad) 0;
}

.problem__title {
  max-width: 16ch;
}

.problem__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  margin-top: 40px;
}

.problem__strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}

.problem__strip .panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 0 0 20px;
}

.problem__strip .panel > :not(.caption) {
  margin-inline: 16px;
}

.panel--before {
  background-color: #e9e4da;
  background-image: radial-gradient(circle, rgb(0 0 0 / 0.12) 1.2px, transparent 1.6px);
  background-size: 7px 7px;
}

.panel--before .caption {
  background: #d4cec2;
}

.panel--after {
  background-color: var(--white);
  background-image: radial-gradient(circle, rgb(255 196 0 / 0.5) 1.6px, transparent 2px);
  background-size: 8px 8px;
}

.panel .balloon {
  align-self: flex-start;
  margin-bottom: 14px;
  font-size: 0.9375rem;
}

.balloon--you {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 14px;
}

.balloon--agent {
  --tail-x: 18px;
  align-self: flex-end;
  font-weight: 800;
}

.panel .balloon--agent {
  align-self: flex-end;
  margin: 0 16px 0 auto;
}

.panel--before .balloon--agent {
  background: #f5f2ec;
}

.panel--after .balloon--agent {
  background: var(--yellow);
}

.panel .term {
  font-size: 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .problem__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .problem__strip {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------------- Demo */

.steps {
  scroll-margin-top: 88px;
}

.demo {
  padding: var(--section-pad) 0;
  background-color: var(--paper-deep);
  background-image: radial-gradient(circle, rgb(122 12 6 / 0.09) 1.3px, transparent 1.8px);
  background-size: 9px 9px;
  border-block: var(--line) solid var(--ink);
  scroll-margin-top: 60px;
}

.demo__head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px 48px;
  align-items: end;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 36px 0 36px;
  padding: 0;
  list-style: none;
}

.steps__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  font-size: 0.9375rem;
  font-weight: 700;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  transition:
    background-color 200ms ease,
    transform 200ms var(--ease-pop);
}

button.steps__item {
  color: var(--ink);
  cursor: pointer;
}

button.steps__item:hover {
  background: #fff3b8;
}

.steps__note {
  max-width: 72ch;
  margin: -18px 0 36px;
  padding: 10px 16px;
  font-size: 0.9375rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 14px;
}

.steps__note[hidden] {
  display: none;
}

.steps__n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-weight: 900;
  color: var(--yellow);
  background: var(--ink);
  border-radius: 50%;
}

.steps__item.is-current {
  background: var(--yellow);
  transform: rotate(-2deg) scale(1.04);
}

.steps__item.is-done {
  color: var(--text-2);
  background: transparent;
}

.steps__item.is-done .steps__n {
  color: var(--ink);
  background: var(--yellow);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  gap: var(--gutter);
  align-items: stretch;
}

.browser {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--white);
  border: var(--line) solid var(--ink);
}

/* The challenge, stuck to the frame where you're looking. */
.hunt {
  position: absolute;
  z-index: 5;
  top: -24px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  background: var(--yellow);
  border: var(--line) solid var(--ink);
  rotate: 1.5deg;
}

.hunt.is-bumped {
  animation: hunt-bump 480ms var(--ease-pop);
}

@keyframes hunt-bump {
  40% {
    transform: scale(1.08) rotate(-2deg);
  }
}

.hunt__label {
  font-size: 1rem;
  font-weight: 900;
  font-style: italic;
  font-stretch: 85%;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hunt__slots {
  display: inline-flex;
  gap: 4px;
}

.hunt__slots i {
  width: 20px;
  height: 20px;
  background: rgb(0 0 0 / 0.22);
  clip-path: polygon(
    50% 0,
    61% 30%,
    95% 18%,
    72% 45%,
    100% 64%,
    66% 66%,
    70% 100%,
    48% 74%,
    24% 98%,
    30% 66%,
    0 62%,
    28% 44%,
    6% 16%,
    40% 30%
  );
  transition:
    background-color 200ms ease,
    transform 300ms var(--ease-pop);
}

.hunt__slots i.is-found {
  background: var(--red);
  transform: scale(1.2) rotate(-10deg);
}

.hunt__slots i.is-fixed {
  background: #16a34a;
  transform: scale(1.2) rotate(8deg);
}

.hunt__hint {
  padding: 2px 0;
  font-size: 0.8125rem;
  font-weight: 700;
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 560px) {
  .hunt {
    right: 10px;
    gap: 4px 8px;
    max-width: calc(100% - 20px);
    padding: 6px 10px;
  }

  .hunt__label {
    font-size: 0.8125rem;
  }

  .hunt__slots i {
    width: 15px;
    height: 15px;
  }

  .hunt__hint {
    font-size: 0.75rem;
  }
}

.browser__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: #ebe7df;
  border-bottom: 2px solid var(--ink);
}

.browser__dots {
  display: inline-flex;
  gap: 6px;
}

.browser__dots i {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

.browser__dots i:nth-child(1) {
  background: var(--red);
}
.browser__dots i:nth-child(2) {
  background: var(--yellow);
}
.browser__dots i:nth-child(3) {
  background: var(--cyan);
}

.browser__url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 5px 12px;
  font:
    500 13px/1.2 system-ui,
    sans-serif;
  color: #3f3f46;
  background: var(--white);
  border: 1.5px solid #b9b3a8;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser__lock {
  width: 9px;
  height: 7px;
  margin-top: 3px;
  border: 1.5px solid #71717a;
  border-radius: 2px;
  position: relative;
}

.browser__lock::before {
  content: "";
  position: absolute;
  left: 0.5px;
  top: -6px;
  width: 5px;
  height: 5px;
  border: 1.5px solid #71717a;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.browser__viewport {
  position: relative;
  flex: none;
  scroll-margin-top: 80px;
  height: 600px;
  overflow: hidden;
  background: #f4f4f5;
}

.acme-host {
  display: block;
  height: 100%;
}

/* The nitz overlay, styled to match the extension's own shadow-root UI. */
.nz-layer {
  --nz-accent: #eab308;
  --nz-accent-soft: rgb(234 179 8 / 0.16);
  --nz-border: #e4e4e7;
  --nz-border-strong: #d4d4d8;
  --nz-text: #18181b;
  --nz-muted: #63636b;
  --nz-faint: #8a8a93;
  --nz-elevated: #f4f4f5;
  --nz-shadow: 0 12px 32px rgb(0 0 0 / 0.16), 0 1px 2px rgb(0 0 0 / 0.08);
  --focus: #a16207;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  font:
    13px/1.45 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: var(--nz-text);
}

.nz-layer button {
  font: inherit;
}

.nz-hl {
  position: absolute;
  z-index: 10;
  border: 1.5px solid var(--nz-accent);
  border-radius: 3px;
  background: var(--nz-accent-soft);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25);
  pointer-events: none;
  transition:
    top 50ms linear,
    left 50ms linear,
    width 50ms linear,
    height 50ms linear;
}

.nz-hl[hidden] {
  display: none;
}

.nz-hl__label {
  position: absolute;
  left: -1.5px;
  top: -22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  max-width: 420px;
  padding: 0 6px;
  font: 11px/1 var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1a1a1a;
  background: var(--nz-accent);
  border-radius: 4px 4px 0 0;
}

.nz-hl__label.is-below {
  top: auto;
  bottom: -22px;
  border-radius: 0 0 4px 4px;
}

.nz-hl__label i {
  font-style: normal;
  opacity: 0.7;
}

.nz-pins {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.nz-pin {
  --sev: #3b82f6;
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  font:
    700 11px/1 system-ui,
    sans-serif;
  color: #fff;
  background: var(--sev);
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
  translate: -50% -50%;
  pointer-events: auto;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background-color 200ms ease,
    left 300ms var(--ease-out),
    top 300ms var(--ease-out);
}

.nz-pin:hover {
  transform: scale(1.12);
}

.nz-pin[data-severity="P0"] {
  --sev: #ef4444;
}
.nz-pin[data-severity="P1"] {
  --sev: #f97316;
}
.nz-pin[data-severity="P3"] {
  --sev: #71717a;
}
.nz-pin.is-done {
  --sev: #16a34a;
}

.nz-pin.is-new {
  animation: pin-drop 520ms var(--ease-pop);
}

@keyframes pin-drop {
  0% {
    transform: translateY(-26px) scale(0.4);
    opacity: 0;
  }
  60% {
    transform: translateY(2px) scale(1.15);
    opacity: 1;
  }
  100% {
    transform: none;
  }
}

.nz-toolbar {
  position: absolute;
  z-index: 40;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 4px 8px;
  background: #fff;
  border: 1px solid var(--nz-border);
  border-radius: 999px;
  box-shadow: var(--nz-shadow);
  pointer-events: auto;
}

.nz-logo {
  width: 24px;
  height: auto;
  margin-right: 4px;
}

.nz-tb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  font-weight: 500;
  color: var(--nz-text);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.nz-tb:hover {
  background: var(--nz-elevated);
}

.nz-tb[aria-pressed="true"],
.nz-tb--accent {
  color: #1a1a1a;
  background: var(--nz-accent);
}

.nz-tb--accent:hover {
  background: #f5c518;
}

.nz-hotkey {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  padding: 0 4px;
  font: 10px/1 var(--mono);
  color: var(--nz-faint);
  background: transparent;
  border: 1px solid var(--nz-border-strong);
  border-radius: 4px;
}

.nz-tb[aria-pressed="true"] .nz-hotkey {
  color: rgb(0 0 0 / 0.55);
  border-color: rgb(0 0 0 / 0.18);
}

.nz-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  background: var(--nz-elevated);
  border-radius: 999px;
}

.nz-badge.is-bumped {
  animation: bump 400ms var(--ease-pop);
}

@keyframes bump {
  50% {
    transform: scale(1.5);
    background: var(--nz-accent);
  }
}

.nz-card {
  position: absolute;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(340px, calc(100% - 16px));
  padding: 12px;
  background: #fff;
  border: 1px solid var(--nz-border);
  border-radius: 8px;
  box-shadow: var(--nz-shadow);
  pointer-events: auto;
  animation: card-in 160ms ease-out;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.nz-card__loc {
  font: 11px/1.4 var(--mono);
  color: var(--nz-muted);
  overflow-wrap: anywhere;
}

.nz-seg {
  display: inline-flex;
  align-self: flex-start;
  overflow: hidden;
  background: #fafafa;
  border: 1px solid var(--nz-border-strong);
  border-radius: 6px;
}

.nz-seg button {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nz-muted);
  background: none;
  border: 0;
  border-right: 1px solid var(--nz-border);
  cursor: pointer;
}

.nz-seg button:last-child {
  border-right: 0;
}

.nz-seg button[aria-pressed="true"] {
  color: var(--sev, var(--nz-text));
  background: var(--nz-elevated);
  box-shadow: inset 0 -2px 0 currentColor;
}

.nz-seg button[data-severity="P0"] {
  --sev: #ef4444;
}
.nz-seg button[data-severity="P1"] {
  --sev: #f97316;
}
.nz-seg button[data-severity="P2"] {
  --sev: #3b82f6;
}
.nz-seg button[data-severity="P3"] {
  --sev: #71717a;
}

.nz-card textarea,
.nz-card input {
  width: 100%;
  padding: 8px 10px;
  font:
    13px/1.45 system-ui,
    sans-serif;
  color: var(--nz-text);
  background: #fafafa;
  border: 1px solid var(--nz-border-strong);
  border-radius: 6px;
}

.nz-card textarea {
  min-height: 76px;
  resize: vertical;
}

.nz-card input {
  height: 30px;
  padding-block: 0;
}

.nz-card :is(textarea, input):focus-visible {
  outline: none;
  border-color: var(--nz-accent);
  box-shadow: 0 0 0 3px var(--nz-accent-soft);
}

.nz-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.nz-actions .nz-kbd {
  margin-right: auto;
  font: 10.5px var(--mono);
  color: var(--nz-faint);
}

.nz-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  font-weight: 500;
  color: var(--nz-text);
  background: #fafafa;
  border: 1px solid var(--nz-border-strong);
  border-radius: 6px;
  cursor: pointer;
}

.nz-btn:hover {
  background: var(--nz-elevated);
}

.nz-btn--primary {
  font-weight: 600;
  color: #1a1a1a;
  background: var(--nz-accent);
  border-color: #a37d06;
}

.nz-btn--primary:hover {
  background: #f5c518;
}

.nz-btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nz-btn--danger {
  color: #dc2626;
}

.nz-toast {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: 64px;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  font-weight: 500;
  color: var(--nz-text);
  background: var(--nz-elevated);
  border: 1px solid var(--nz-border);
  border-radius: 6px;
  box-shadow: var(--nz-shadow);
  translate: -50% 0;
  animation: toast-in 160ms ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.nz-circle {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  border: 3px solid var(--red);
  border-radius: 50%;
  rotate: -4deg;
  animation: circle-in 2600ms ease-out both;
}

@keyframes circle-in {
  0% {
    opacity: 0;
    transform: scale(1.5);
  }
  12% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.nz-flash {
  position: absolute;
  z-index: 15;
  pointer-events: none;
  border: 2px solid #16a34a;
  border-radius: 4px;
  background: rgb(22 163 74 / 0.12);
  animation: flash-out 1400ms ease-out both;
}

@keyframes flash-out {
  0%,
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Comic sound effects, spawned by sfx.js. */
.sfx {
  --size: 120px;
  position: absolute;
  z-index: 30;
  display: grid;
  place-items: center;
  width: var(--size);
  aspect-ratio: 1.25;
  translate: -50% -50%;
  pointer-events: none;
  animation: sfx-pop 1100ms var(--ease-pop) both;
}

.sfx svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sfx__word {
  position: relative;
  font-family: var(--sfx);
  font-size: calc(var(--size) * 0.25);
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--sfx-text, var(--yellow));
  -webkit-text-stroke: 0.14em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0.07em 0.08em 0 var(--oxblood);
  rotate: -7deg;
}

@keyframes sfx-pop {
  0% {
    opacity: 1;
    transform: scale(0) rotate(-25deg);
  }
  30% {
    transform: scale(1.18) rotate(4deg);
  }
  48% {
    transform: scale(0.94) rotate(-2deg);
  }
  62% {
    transform: scale(1) rotate(0);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sfx {
    animation: sfx-fade 1100ms ease both;
  }

  @keyframes sfx-fade {
    0%,
    70% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }
}

/* Brief panel */
.brief {
  --focus: var(--yellow);
  /* Side by side, the browser sets the row height; the brief fills it and scrolls. */
  contain: size;
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--paper);
  background: var(--ink);
  border: var(--line) solid var(--ink);
}

.brief__tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 10px 0;
  border-bottom: 1px solid #3b352e;
}

.brief__tab {
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #b9b0a4;
  background: none;
  border: 0;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}

.brief__tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--yellow);
}

.brief__tab.has-news::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  vertical-align: 2px;
  background: var(--red);
  border-radius: 50%;
}

.brief__tokens {
  margin-left: auto;
  padding: 0 4px 9px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #b9b0a4;
}

.brief__tokens.is-bumped {
  animation: tokens-bump 500ms ease-out;
}

@keyframes tokens-bump {
  30% {
    color: var(--yellow);
  }
}

.brief__body {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  padding: 14px 12px 12px;
}

.brief__body[hidden] {
  display: none;
}

.detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.detail__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #b9b0a4;
}

.brief .seg {
  color: #d9d0c3;
}

.brief .code {
  flex: 1 1 0;
  min-height: 0;
  margin-top: 12px;
  padding: 2px;
  font-size: 0.75rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
}

/* One block per brief line, with a hanging indent when it wraps. */
.brief .ln,
.brief .t-new {
  display: block;
}

.brief .ln {
  padding-left: 4ch;
  text-indent: -4ch;
}

.brief .code--agent {
  margin-top: 0;
}

.brief__empty {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 18px;
  padding: 14px 16px;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--paper);
  border-radius: 14px;
}

.brief__empty[hidden] {
  display: none;
}

/* Panel actions, drawn like the extension's own panel in dark mode. */
.brief__actions {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  padding: 12px;
  border-top: 1px solid #2e2e35;
}

.pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  font:
    500 12.5px/1 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  white-space: nowrap;
  color: #f4f4f5;
  background: #1f1f23;
  border: 1px solid #3a3a42;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background-color 80ms ease,
    border-color 80ms ease;
}

.pbtn:hover {
  background: #26262c;
}

.pbtn:active {
  background: #2e2e35;
}

.pbtn--primary {
  font-weight: 600;
  color: #1a1a1a;
  background: #f5d90a;
  border-color: color-mix(in srgb, #f5d90a 55%, #000);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.32);
}

.pbtn--primary:hover {
  background: #f5d90a;
  filter: brightness(1.05);
}

.pbtn--primary:active {
  filter: brightness(0.96);
  box-shadow: none;
}

.pbtn__icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pbtn--primary .pbtn__icon {
  opacity: 0.8;
}

.pbtn__key {
  min-height: 16px;
  padding: 0 4px;
  font: 10px/1 var(--mono);
  color: rgb(0 0 0 / 0.6);
  background: rgb(255 255 255 / 0.18);
  border: 1px solid rgb(0 0 0 / 0.22);
  border-radius: 4px;
}

.brief__go {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 14px;
}

.brief__agent {
  width: 100%;
}

.brief__agent:not(:disabled) {
  animation: agent-ready 2.4s ease-in-out infinite;
}

.brief__agent:disabled {
  color: #8a8a93;
  background: transparent;
  border: 2px dashed #3a3a42;
  opacity: 1;
}

@keyframes agent-ready {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(255 210 26 / 0.6);
  }
  50% {
    box-shadow: 0 0 0 6px rgb(255 210 26 / 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brief__agent:not(:disabled) {
    animation: none;
  }
}

.brief .linkish {
  align-self: flex-end;
  font-size: 0.8125rem;
  color: #b9b0a4;
}

@media (max-width: 1060px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .brief {
    contain: none;
    height: 560px;
  }

  .demo__head {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .browser__viewport {
    height: 620px;
  }
}

/* ---------------------------------------------------------------- Anatomy */

.anatomy {
  padding: var(--section-pad) 0;
}

.anatomy__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 48px;
  align-items: end;
}

.anatomy__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  margin-top: 44px;
}

.sheet {
  min-width: 0;
  background: var(--white);
  border: var(--line) solid var(--ink);
}

.sheet__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--yellow);
  border-bottom: var(--line) solid var(--ink);
}

.sheet__bar .seg {
  background: var(--white);
}

.sheet__bar .seg button[aria-pressed="true"] {
  color: var(--yellow);
  background: var(--ink);
}

.sheet__tokens {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
}

.sheet__code {
  padding: 20px 18px;
  font-size: 0.8125rem;
  line-height: 1.8;
  color: #1c1917;
  white-space: pre;
  overflow-x: auto;
}

.sheet__code .t-kw {
  color: var(--red);
  font-weight: 600;
}
.sheet__code .t-str {
  color: #8a5a00;
}
.sheet__code .t-at {
  color: var(--cyan-deep);
}
.sheet__code .t-p0 {
  color: #dc2626;
}
.sheet__code .t-p1 {
  color: #c2410c;
}
.sheet__code .t-p2 {
  color: #1d4ed8;
}
.sheet__code .t-p3 {
  color: #57534e;
}
.sheet__code .t-dim {
  color: #78716c;
}
.sheet__code .t-sig {
  color: #6d28d9;
}

.part {
  border-radius: 3px;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.part[data-n]::before {
  content: attr(data-n);
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  font: 800 10.5px/1 var(--sans);
  color: var(--white);
  vertical-align: 1px;
  background: var(--red);
  border-radius: 50%;
}

.part.is-lit {
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow);
}

.sheet__note {
  padding: 14px 18px;
  font-size: 0.9375rem;
  color: var(--text-2);
  border-top: 2px dashed #d6cdb9;
}

.legend {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: part;
}

.legend li {
  position: relative;
  padding: 10px 14px 10px 50px;
  color: var(--text-2);
  border: 2px solid transparent;
  border-radius: 14px;
  counter-increment: part;
  cursor: default;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.legend li::before {
  content: counter(part);
  position: absolute;
  left: 12px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--white);
  background: var(--red);
  border-radius: 50%;
}

.legend b {
  color: var(--ink);
}

.legend li.is-lit {
  background: var(--white);
  border-color: var(--ink);
}

.legend li.is-off {
  opacity: 0.4;
}

.teach {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  margin-top: clamp(40px, 6vw, 72px);
  background: var(--ink);
  border: var(--line) solid var(--ink);
}

.teach__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: clamp(20px, 3vw, 36px);
  background: var(--white);
}

.teach__title {
  font-size: var(--step-2);
  font-weight: 900;
  font-stretch: 112%;
  line-height: 1.05;
}

.teach__copy p {
  color: var(--text-2);
}

.teach__copy .btn {
  margin-top: 6px;
}

.teach__code {
  --focus: var(--yellow);
  max-height: 420px;
  padding: clamp(18px, 2.4vw, 28px);
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--paper);
  white-space: pre-wrap;
  overflow: auto;
}

@media (max-width: 960px) {
  .anatomy__head,
  .anatomy__grid,
  .teach {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------------------------------- Pins that hold (red) */

.hold {
  padding: var(--section-pad) 0;
  color: var(--white);
  background-color: var(--red);
  background-image: radial-gradient(circle, rgb(122 12 6 / 0.35) 1.6px, transparent 2.1px);
  background-size: 10px 10px;
  border-block: var(--line) solid var(--ink);
  --focus: var(--yellow);
}

.hold .title {
  max-width: 14ch;
  text-shadow: 0.05em 0.05em 0 var(--ink);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "a a b"
    "a a c"
    "d e e";
  gap: var(--gutter);
  margin-top: 44px;
  color: var(--ink);
}

.grid .panel {
  padding: clamp(18px, 2.2vw, 28px);
}

.grid h3 {
  font-size: var(--step-2);
  font-weight: 900;
  font-stretch: 112%;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.grid p {
  margin-top: 10px;
  color: var(--text-2);
}

.grid__a {
  grid-area: a;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: center;
}

.grid__b {
  grid-area: b;
  background: var(--cyan);
}

.grid__c {
  grid-area: c;
  background: var(--yellow);
}

.grid__d {
  grid-area: d;
}

.grid__e {
  grid-area: e;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 8px 32px;
  align-items: start;
}

.grid__b p,
.grid__c p {
  color: var(--ink);
}

.chip-code {
  margin-top: 16px;
  padding: 10px 12px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--paper);
  background: var(--ink);
  white-space: pre;
  overflow-x: auto;
}

.keys {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 600;
  grid-row: span 2;
}

.keys kbd {
  margin-right: 8px;
}

.grid__small {
  font-size: var(--step--1);
}

.reanchor {
  padding: 14px;
  font-family: system-ui, sans-serif;
  background: #f4f4f5;
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.reanchor__bar {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #3f3f46;
}

.reanchor__sort b {
  color: #18181b;
}

.reanchor__list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.reanchor__list li {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
  font-size: 14px;
  color: #18181b;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
}

.reanchor__list li.is-pinned {
  background: #fffbea;
  box-shadow: 0 0 0 1.5px #eab308;
}

.reanchor__pin {
  position: absolute;
  right: -10px;
  top: -10px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font:
    700 11px/1 system-ui,
    sans-serif;
  font-style: normal;
  color: #fff;
  background: #3b82f6;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
}

.reanchor__list.is-rerender li {
  animation: rerender 380ms ease-out;
}

@keyframes rerender {
  0% {
    opacity: 0.35;
  }
  100% {
    opacity: 1;
  }
}

.reanchor__log {
  margin-top: 12px;
  font: 12px/1.4 var(--mono);
  color: #52525b;
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "a a"
      "b c"
      "d e";
  }

  .grid__e {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "a" "b" "c" "d" "e";
  }

  .grid__a {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ----------------------------------------------------------------- Export */

.export {
  padding: var(--section-pad) 0;
  scroll-margin-top: 60px;
}

.export__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.export__copy .lead {
  margin-top: 24px;
}

.export__routes {
  display: grid;
  gap: 16px;
  margin: 32px 0 0;
}

.export__routes div {
  padding-left: 16px;
  border-left: 4px solid var(--ink);
}

.export__routes div:last-child {
  border-left-color: var(--cyan);
}

.export__routes dt {
  font-weight: 800;
}

.export__routes dd {
  margin: 2px 0 0;
  color: var(--text-2);
}

.exporter {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "chat chat"
    "file choices"
    "disk vault"
    "again again";
  gap: 16px;
  align-items: center;
}

.chat {
  grid-area: chat;
  position: relative;
  padding: 14px 14px 64px;
  font-family: system-ui, sans-serif;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: 20px;
}

.chat__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #52525b;
  border-bottom: 1px solid #e4e4e7;
}

.chat__dot {
  width: 10px;
  height: 10px;
  background: #d4d4d8;
  border-radius: 50%;
}

.chat__you {
  width: fit-content;
  max-width: 80%;
  margin: 12px 0 12px auto;
  padding: 8px 12px;
  font-size: 14px;
  background: #f4f4f5;
  border-radius: 14px;
}

.chat__preview {
  overflow: hidden;
  background: #fafafa;
  border: 1px solid #d4d4d8;
  border-radius: 12px;
  transform-origin: 70% 90%;
}

.chat__preview-bar {
  display: flex;
  gap: 4px;
  padding: 6px;
  font-size: 12px;
  border-bottom: 1px solid #e4e4e7;
}

.chat__preview-bar span {
  padding: 3px 10px;
  color: #71717a;
  border-radius: 6px;
}

.chat__preview-bar .is-on {
  color: #18181b;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.mini {
  padding: 16px;
}

.mini__title {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.mini__tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mini__tier {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 8px;
  font-size: 12px;
  text-align: center;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
}

.mini__tier span {
  font-size: 18px;
  font-weight: 800;
}

.mini__tier--pro {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1;
}

.mini__tier--pro i {
  position: absolute;
  left: 50%;
  top: -9px;
  translate: -50% 0;
  padding: 1px 7px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  background: #6366f1;
  border-radius: 999px;
}

.nz-toolbar--inline {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font:
    13px/1.45 system-ui,
    sans-serif;
  --nz-accent: #eab308;
  --nz-border: #e4e4e7;
  --nz-shadow: 0 12px 32px rgb(0 0 0 / 0.16), 0 1px 2px rgb(0 0 0 / 0.08);
  --nz-text: #18181b;
  --nz-elevated: #f4f4f5;
}

.filecard {
  grid-area: file;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: 12px;
  rotate: -2deg;
}

.filecard__icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 52px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 4px 14px 4px 4px;
}

.filecard__name {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.filecard__meta {
  font-size: 0.8125rem;
  color: var(--text-2);
}

.exporter__choices {
  grid-area: choices;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tray {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 12px 14px;
  font-size: 0.875rem;
  border: var(--line) dashed var(--ink);
  border-radius: 12px;
}

.tray--disk {
  grid-area: disk;
}

.tray--vault {
  grid-area: vault;
  background: color-mix(in srgb, var(--cyan) 18%, transparent);
}

.tray__title {
  font-weight: 800;
}

.tray__row {
  width: fit-content;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 8px;
}

.tray__link {
  font-size: 0.8125rem;
  font-weight: 600;
}

.exporter__cue {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  font-weight: 600;
}

.exporter__cue .caption {
  margin-right: 8px;
  rotate: -2deg;
}

.js .exporter:not([data-state="idle"]) .exporter__cue {
  display: none;
}

.exporter__again {
  grid-area: again;
  justify-self: start;
}

.exporter__status {
  position: absolute;
  inset: auto 0 -40px;
  font-weight: 700;
}

/* Export states. Idle shows the chat; each step reveals the next thing. */
.js .exporter[data-state="idle"] :is(.filecard, .exporter__choices),
.js .exporter:not([data-state="downloaded"], [data-state="vaulted"]) .exporter__again {
  display: none;
}

.js .exporter .tray {
  opacity: 0.35;
}

.js .exporter .tray__row,
.js .exporter .tray__link {
  visibility: hidden;
}

.js .exporter:is([data-state="downloaded"], [data-state="vaulted"]) .exporter__choices {
  visibility: hidden;
}

.js .exporter[data-state="downloaded"] .tray--disk,
.js .exporter[data-state="vaulted"] .tray--vault {
  opacity: 1;
  border-style: solid;
}

.js .exporter[data-state="downloaded"] .tray--disk :is(.tray__row, .tray__link),
.js .exporter[data-state="vaulted"] .tray--vault :is(.tray__row, .tray__link) {
  visibility: visible;
}

.js .exporter:is([data-state="downloaded"], [data-state="vaulted"]) .filecard {
  opacity: 0.35;
}

@media (max-width: 1020px) {
  .export__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .exporter {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "chat" "file" "choices" "disk" "vault" "again";
  }
}

/* ------------------------------------------------------------ Team (cyan) */

.team {
  padding: var(--section-pad) 0;
  background-color: var(--cyan);
  background-image: radial-gradient(circle, rgb(10 127 180 / 0.55) 1.5px, transparent 2px);
  background-size: 10px 10px;
  border-block: var(--line) solid var(--ink);
  scroll-margin-top: 60px;
}

.team__head {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px 48px;
  align-items: end;
}

.team .lead {
  color: var(--ink);
}

.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}

.strip__panel {
  display: flex;
  flex-direction: column;
  padding-bottom: 18px;
  background: var(--white);
  border: var(--line) solid var(--ink);
}

.strip__panel > .caption {
  align-self: flex-start;
  margin: calc(var(--line) * -1) 0 0 calc(var(--line) * -1);
}

.strip__art {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  height: 188px;
  margin: 14px 14px 0;
  padding: 14px;
  overflow: hidden;
  background-color: #f4f4f5;
  background-image: radial-gradient(circle, rgb(0 0 0 / 0.08) 1.2px, transparent 1.6px);
  background-size: 7px 7px;
  border: 2px solid var(--ink);
}

.strip__panel > p {
  margin: 14px 16px 0;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.doc-chip,
.share-chip {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 10px;
}

.doc-chip {
  font-family: var(--mono);
}

.share-chip {
  color: var(--ink);
  background: var(--cyan);
  border-radius: 999px;
}

.doc {
  position: relative;
  width: 80%;
  padding: 14px;
  font-family: system-ui, sans-serif;
  background: #fff;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
}

.doc__tier {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 14px 8px 10px;
  font-size: 13px;
  border: 1px solid #6366f1;
  border-radius: 6px;
}

.doc__tier span {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.doc__badge {
  position: absolute;
  white-space: nowrap;
  left: 52%;
  top: 30px;
  padding: 1px 7px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  color: #fff;
  background: #6366f1;
  border-radius: 999px;
}

.team-pin {
  position: absolute;
  right: -8px;
  top: -8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font:
    700 11px/1 system-ui,
    sans-serif;
  font-style: normal;
  color: #fff;
  background: #0ea5e9;
  border: 2px dashed #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
}

.balloon--mini {
  --tail-x: 20px;
  padding: 7px 12px;
  font-size: 0.8125rem;
  line-height: 1.25;
}

.balloon--cyan {
  background: var(--yellow);
}

.mini-term {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--paper);
  background: var(--ink);
  white-space: pre;
  overflow: hidden;
}

.sfx-word {
  font-family: var(--sfx);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--yellow);
  -webkit-text-stroke: 0.14em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0.07em 0.08em 0 var(--oxblood);
  rotate: -6deg;
}

@media (prefers-reduced-motion: no-preference) {
  .js .strip__art > * {
    opacity: 0;
  }

  .strip.is-playing .strip__panel .strip__art > * {
    animation: pop-in 460ms var(--ease-pop) both;
    animation-delay: calc(var(--panel) * 900ms + var(--item, 0) * 260ms + 200ms);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-6deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.partner {
  display: flex;
  gap: clamp(18px, 3vw, 32px);
  align-items: flex-start;
  margin-top: var(--gutter);
  padding: clamp(20px, 3vw, 36px);
  background: var(--white);
  border: var(--line) solid var(--ink);
}

.partner__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 76px;
  height: 76px;
  font-size: 2rem;
  font-weight: 900;
  font-stretch: 125%;
  color: var(--ink);
  background: var(--cyan);
  border: var(--line) solid var(--ink);
  border-radius: 16px;
  rotate: -4deg;
}

.partner__copy h3 {
  font-size: var(--step-2);
  font-weight: 900;
  font-stretch: 112%;
  line-height: 1.05;
}

.partner__copy p {
  max-width: 70ch;
  margin-top: 10px;
  color: var(--text-2);
}

.partner__link {
  display: inline-block;
  margin-top: 14px;
  font-weight: 800;
  text-decoration-color: var(--cyan-deep);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

@media (max-width: 1060px) {
  .strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team__head {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .partner {
    flex-direction: column;
  }
}

/* ------------------------------------------------------------ Signed (ink) */

.signed {
  --focus: var(--yellow);
  padding: var(--section-pad) 0;
  color: var(--paper);
  background: var(--ink);
  scroll-margin-top: 60px;
}

.signed .lead {
  color: #d9d0c3;
}

.signed .lead code {
  font-size: 0.9em;
  color: var(--yellow);
}

.signed__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  grid-template-areas:
    "copy copy"
    "signer slip";
  gap: clamp(36px, 5vw, 56px) clamp(24px, 4vw, 56px);
  align-items: start;
}

.signed__copy {
  grid-area: copy;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 48px;
  align-items: end;
}

.signed__copy .title {
  grid-row: span 2;
}

.signed__try {
  margin-top: 16px;
  font-weight: 700;
  color: var(--yellow);
}

.signer {
  grid-area: signer;
  position: relative;
  min-width: 0;
  color: var(--ink);
  background: var(--paper);
  border: var(--line) solid var(--paper);
  --focus: var(--ink);
}

.signer__bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
}

.signer__status {
  font-family: var(--sans);
  font-weight: 800;
}

.signer[data-state="signed"] .signer__status {
  color: #15803d;
}

.signer[data-state="tampered"] .signer__status {
  color: var(--red);
}

.signer__code {
  min-height: 250px;
  padding: 18px 16px;
  font-size: 0.75rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.signer__code .t-kw {
  color: var(--red);
  font-weight: 600;
}
.signer__code :is(.t-n, .t-loc) {
  color: var(--ink);
}
.signer__code .t-at {
  color: var(--cyan-deep);
}
.signer__code .t-str {
  color: #8a5a00;
}
.signer__code .t-p1 {
  color: #c2410c;
}
.signer__code .t-p2 {
  color: #1d4ed8;
}
.signer__code .t-p3 {
  color: #57534e;
}
.signer__code .t-sig {
  color: #6d28d9;
}

.signer__code mark {
  color: var(--white);
  background: var(--red);
  border-radius: 3px;
  padding: 0 2px;
}

.signer__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 2px solid var(--ink);
}

.stamp {
  position: absolute;
  right: 6%;
  top: 22%;
  padding: 10px 18px 8px;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem);
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--stamp, #15803d);
  border: 5px double var(--stamp, #15803d);
  border-radius: 8px;
  rotate: -12deg;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.stamp.is-down {
  opacity: 0.9;
  animation: stamp 420ms var(--ease-pop);
}

.signer[data-state="tampered"] .stamp {
  --stamp: var(--red);
}

@keyframes stamp {
  0% {
    opacity: 0;
    transform: scale(2.2);
  }
  60% {
    opacity: 0.95;
    transform: scale(0.94);
  }
  100% {
    transform: none;
  }
}

.slip {
  grid-area: slip;
  position: relative;
  padding: 22px 24px 20px;
  color: var(--ink);
  background: var(--yellow);
  rotate: -1.5deg;
  -webkit-mask:
    radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}

.slip__title {
  font-size: var(--step-1);
  font-weight: 900;
  font-style: italic;
  font-stretch: 80%;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--ink);
}

.slip__rows {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
}

.slip__rows div {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr);
  gap: 12px;
}

.slip__rows dt {
  font-weight: 800;
}

.slip__rows dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.slip code {
  color: var(--ink);
}

.slip__note {
  margin-top: 14px;
  padding-top: 12px;
  font-size: 0.9375rem;
  border-top: 2px dashed var(--ink);
}

@media (max-width: 960px) {
  .signed__grid,
  .signed__copy {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "signer" "slip";
  }

  .signed__copy .title {
    grid-row: auto;
  }
}

/* ---------------------------------------------------------------- Privacy */

.quiet {
  padding-top: var(--section-pad);
}

.quiet__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 44px);
  margin-top: 40px;
  padding-bottom: clamp(56px, 7vw, 96px);
}

.quiet__cols > div {
  padding-top: 16px;
  border-top: var(--line) solid var(--ink);
}

.quiet h3 {
  font-size: var(--step-1);
  font-weight: 800;
  line-height: 1.2;
}

.quiet p {
  margin-top: 8px;
  color: var(--text-2);
}

.quiet code {
  font-size: 0.88em;
}

.band {
  background: var(--yellow);
  border-block: var(--line) solid var(--ink);
}

.band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-block: 22px;
}

.band__claim {
  font-size: var(--step-2);
  font-weight: 900;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.band__link {
  margin-left: auto;
  font-weight: 800;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

@media (max-width: 800px) {
  .quiet__cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .band__link {
    margin-left: 0;
  }
}

/* ----------------------------------------------------------------- Finale */

.finale {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(72px, 10vw, 140px) 0;
  text-align: center;
  background: var(--yellow);
}

.finale__rays {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 38%;
  width: 260vmax;
  height: 260vmax;
  translate: -50% -50%;
  background: repeating-conic-gradient(var(--yellow) 0deg 4.5deg, var(--yellow-deep) 4.5deg 9deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 3%, transparent 30%);
  mask-image: radial-gradient(closest-side, #000 3%, transparent 30%);
}

.finale__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.finale__burst {
  width: min(360px, 70vw);
  height: auto;
  rotate: -6deg;
  filter: drop-shadow(6px 8px 0 rgb(0 0 0 / 0.9));
  transition: rotate 300ms var(--ease-pop);
}

.finale__burst:hover {
  rotate: 4deg;
}

.finale__title {
  margin-top: 24px;
  /* "SOMETHING." is about 8.3em wide at this width; keep it inside a phone. */
  font-size: min(8rem, 10.4vw);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-shadow: 0.045em 0.05em 0 var(--red);
  text-wrap: balance;
}

.finale__sub {
  margin: 20px 0 32px;
  font-size: var(--step-1);
  font-weight: 600;
}
