/* ==========================================================================
   Cue — cards and pills, hairline outlines, generous air.
   Every value resolves to a token in tokens.css.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
pre {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}

canvas {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-pill);
}

::selection {
  background: var(--accent-fill);
  color: var(--accent-ink);
}

/* ---------------------------------------------------------------- layout */

.shell {
  width: 100%;
  max-width: var(--w-page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--s8);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: var(--s4);
  z-index: 10;
  padding: var(--s2) var(--s4);
  border-radius: var(--r-pill);
  background: var(--action-bg);
  color: var(--action-ink);
  font-size: var(--t-ui);
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: none;
  outline-color: var(--action-bg);
}

/* -------------------------------------------------------------- top strip */

.strip {
  background: var(--strip-bg);
  color: var(--strip-muted);
  font-size: 13px;
  line-height: 1.4;
}

.strip__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s2) var(--s4);
  padding-block: 10px;
  text-align: center;
}

.strip a {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--accent-fill);
  font-weight: 500;
}

.strip a:hover {
  color: #fff;
}

/* ------------------------------------------------------------------ type */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.kicker__i {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.display {
  font-size: var(--t-display);
  font-weight: 600;
  line-height: var(--lh-display);
  letter-spacing: -0.035em;
  margin-top: var(--s5);
}

.display em {
  font-style: normal;
  color: var(--accent);
}

.h2 {
  font-size: var(--t-h2);
  font-weight: 600;
  line-height: var(--lh-head);
  letter-spacing: -0.03em;
  margin-top: var(--s4);
  max-width: 24ch;
}

.lede {
  margin-top: var(--s4);
  max-width: var(--w-prose);
  color: var(--muted);
}

.prose {
  max-width: var(--w-prose);
  color: var(--muted);
}

.prose + .prose {
  margin-top: var(--s3);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  padding-inline: var(--s5);
  border-radius: var(--r-pill);
  font-size: var(--t-ui);
  font-weight: 500;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--action-bg);
  color: var(--action-ink);
}

.btn--primary:hover {
  opacity: 0.88;
}

.btn--secondary {
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.btn--secondary:hover {
  background: var(--well);
}

.btn__icon {
  width: 12px;
  height: 12px;
  flex: none;
}

/* -------------------------------------------------------------- masthead */

.masthead {
  background: var(--page);
}

.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  min-height: 68px;
}

.wordmark {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.wordmark span {
  color: var(--accent);
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--t-ui);
  color: var(--muted);
}

.masthead__nav a {
  padding: 8px var(--s3);
  border-radius: var(--r-pill);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.masthead__nav a:hover {
  background: var(--card);
  color: var(--ink);
}

.masthead__nav a span {
  color: var(--faint);
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ day / night */

.theme {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--well);
  border: 1px solid var(--line);
}

.theme__opt {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: var(--t-mono);
  font-weight: 500;
  color: var(--muted);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.theme__opt:hover {
  color: var(--ink);
}

.theme__opt[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.skin {
  display: none;
}

/* ------------------------------------------------------------------ hero */

.hero {
  padding-block: var(--s7) var(--s8);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: var(--s7);
  align-items: center;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s6);
}

.hero__file {
  min-width: 0;
  padding: var(--s4) var(--s5) var(--s2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.hero__file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-mono);
  font-weight: 500;
  color: var(--muted);
}

.hero__file-head .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
}

.hero__file-head .live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: var(--r-pill);
  background: currentColor;
}

/* ------------------------------------------------------------------ code */

.code {
  margin: 0;
  padding-block: var(--s3);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  line-height: 1.8;
  color: var(--muted);
  tab-size: 2;
}

.tok-key {
  color: var(--faint);
}

.tok-str {
  color: var(--accent);
}

.tok-num {
  color: var(--success);
}

.tok-punc {
  color: var(--faint);
}

/* --------------------------------------------------------------- console */

.console {
  margin-top: var(--s6);
}

.console__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4) var(--s5);
  padding: var(--s2) var(--s3) var(--s2) var(--s4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
}

.sound {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 36px;
  padding-right: var(--s3);
  font-size: var(--t-ui);
  color: var(--ink);
  transition: color var(--dur) var(--ease);
}

.sound__switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: var(--r-pill);
  background: var(--action-bg);
  transition: background-color var(--dur) var(--ease);
}

/* On = knob on the right. Off slides it left. */
.sound__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 19px;
  width: 14px;
  height: 14px;
  border-radius: var(--r-pill);
  background: var(--action-ink);
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.sound[aria-pressed="false"] .sound__switch {
  background: var(--sunken);
}

.sound[aria-pressed="false"] .sound__switch::after {
  transform: translateX(-16px);
  background: var(--faint);
}

.meter {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 240px;
  height: 28px;
}

.caps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-left: auto;
}

.caps__item {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--well);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* -------------------------------------------------------------- cue cards */

.cues {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
  margin-top: var(--s4);
}

.cue {
  position: relative;
  display: grid;
  grid-template-areas:
    "stage"
    "meta"
    "play";
  grid-template-rows: auto 1fr auto;
  gap: var(--s4);
  padding: var(--s4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.cue:hover {
  border-color: var(--line-strong);
}

.cue:focus-within {
  border-color: var(--accent-fill);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cue__i {
  position: absolute;
  top: var(--s4);
  right: var(--s4);
  z-index: 1;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.cue__stage {
  grid-area: stage;
  display: grid;
  place-items: center;
  min-height: 168px;
  padding: var(--s4);
  background: var(--well);
  border-radius: var(--r-well);
}

.cue__meta {
  grid-area: meta;
  display: grid;
  gap: var(--s2);
  align-content: start;
}

.cue__title {
  font-size: var(--t-h3);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.cue__blurb {
  font-size: var(--t-ui);
  color: var(--muted);
}

.cue__id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

.cue__play {
  grid-area: play;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 1px solid var(--line-strong);
  font-size: var(--t-ui);
  font-weight: 500;
  color: var(--ink);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.cue__play:hover {
  background: var(--action-bg);
  border-color: var(--action-bg);
  color: var(--action-ink);
}

.cue__play svg {
  width: 10px;
  height: 10px;
}

/* ------------------------------------------------------- in-world objects */

.receipt {
  display: grid;
  gap: var(--s2);
  width: 100%;
  max-width: 260px;
  padding: var(--s3) var(--s4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-well);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--muted);
}

.receipt__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}

.receipt__row--muted {
  color: var(--faint);
}

.receipt__amount {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.receipt__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.receipt__check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--success-fill);
  color: #fff;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.cue[data-state="done"] .receipt__check {
  opacity: 1;
  transform: none;
}

.receipt__check svg {
  width: 100%;
  height: 100%;
}

.field {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 260px;
}

.field__label {
  font-size: var(--t-mono);
  font-weight: 500;
  color: var(--faint);
}

.field__input {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--s4);
  background: var(--card);
  border: 1px solid var(--line-input);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--t-ui);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field__input:focus-visible {
  border-color: var(--accent);
  outline-offset: 3px;
}

.cue[data-state="invalid"] .field__input {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.field__error {
  display: none;
  font-size: var(--t-mono);
  color: var(--danger);
}

.cue[data-state="invalid"] .field__error {
  display: block;
}

.setup {
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  max-width: 260px;
}

.setup__ring {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
}

.setup__ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.setup__track {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 3;
}

.setup__fill {
  fill: none;
  stroke: var(--accent-fill);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 163.4;
  stroke-dashoffset: 54.5;
  transition: stroke-dashoffset var(--dur) var(--ease);
}

.cue[data-state="done"] .setup__fill {
  stroke-dashoffset: 0;
}

.setup__count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: var(--t-mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.setup__steps {
  display: grid;
  gap: 6px;
  font-size: var(--t-mono);
  color: var(--muted);
}

.setup__step {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.setup__bullet {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: 9px;
  line-height: 1;
  color: transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.setup__step:not(.setup__step--todo) .setup__bullet,
.cue[data-state="done"] .setup__step--todo .setup__bullet {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-ink);
}

.sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--accent-fill);
  opacity: 0;
}

/* -------------------------------------------------------------- inspector */

.inspector {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--s4);
  margin-top: var(--s4);
}

.inspector__col {
  min-width: 0;
  padding: var(--s4) var(--s5) var(--s5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.inspector__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-mono);
  font-weight: 500;
  color: var(--muted);
}

.inspector__head span:last-child {
  color: var(--faint);
  font-family: var(--font-mono);
}

.log {
  display: grid;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--muted);
}

.log__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--s3);
  align-items: baseline;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
}

.log__row:last-child {
  border-bottom: 0;
}

.log__time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.log__cue {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.log__meta {
  color: var(--faint);
  text-align: right;
  white-space: nowrap;
}

.log__empty {
  padding-top: var(--s3);
  color: var(--faint);
}

/* ------------------------------------------------------------------ spec */

.spec__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: var(--s6);
  align-items: start;
  margin-top: var(--s6);
}

.spec__copy > * + * {
  margin-top: var(--s5);
}

.targets {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.target {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  padding: 14px var(--s5);
  border-top: 1px solid var(--line);
  font-size: var(--t-ui);
}

.target:first-child {
  border-top: 0;
}

.target__how {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--faint);
  text-align: right;
}

/* ------------------------------------------------------------------ band */

.table-wrap {
  margin-top: var(--s6);
  padding: var(--s4) var(--s5) var(--s3);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.band {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-ui);
}

.band caption {
  text-align: left;
  color: var(--faint);
  font-size: var(--t-mono);
  padding-bottom: var(--s3);
}

.band th,
.band td {
  text-align: left;
  padding: 14px var(--s3) 14px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.band thead th {
  font-size: var(--t-mono);
  font-weight: 500;
  color: var(--faint);
  border-bottom-color: var(--line-strong);
}

.band tbody tr:last-child td {
  border-bottom: 0;
}

.band td:nth-child(2) {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  color: var(--muted);
  white-space: nowrap;
}

.band td:nth-child(3) {
  color: var(--muted);
}

.band__row--target td {
  color: var(--ink);
}

.band__row--target td:nth-child(2) {
  color: var(--accent);
}

.band__tag {
  display: inline-block;
  margin-left: var(--s2);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
}

.band__note {
  margin-top: var(--s4);
  max-width: var(--w-prose);
  font-size: var(--t-mono);
  line-height: 1.7;
  color: var(--faint);
}

/* ---------------------------------------------------------------- offers */

.offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
  margin-top: var(--s6);
}

.offer {
  display: flex;
  flex-direction: column;
  padding: var(--s5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.offer--featured {
  border-color: var(--accent-fill);
}

.offer__name {
  font-size: var(--t-mono);
  font-weight: 500;
  color: var(--faint);
}

.offer__price {
  margin-top: var(--s2);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.offer__list {
  display: grid;
  gap: 10px;
  margin-top: var(--s4);
  font-size: var(--t-ui);
  color: var(--muted);
}

.offer__list li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: var(--s2);
}

.offer__list li::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 0.55em;
  border-radius: var(--r-pill);
  background: var(--accent-fill);
}

/* ---------------------------------------------------------------- footer */

.footer {
  padding-block: var(--s7);
  border-top: 1px solid var(--line);
  font-size: var(--t-mono);
  color: var(--faint);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3) var(--s6);
}

.footer__note {
  margin-top: var(--s3);
  max-width: 72ch;
  line-height: 1.7;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
}

.footer__links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__links a:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------------- motion */

@keyframes cue-settle {
  0% {
    transform: translateY(0) scale(1);
  }
  16% {
    transform: translateY(-5px) scale(1.008);
  }
  42% {
    transform: translateY(0) scale(0.999);
  }
  64% {
    transform: translateY(-2px) scale(1.002);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes cue-check-draw {
  from {
    stroke-dashoffset: 26;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes cue-check-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--success-soft);
  }
  100% {
    box-shadow: 0 0 0 10px transparent;
  }
}

@keyframes cue-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  14% {
    transform: translateX(-7px);
  }
  28% {
    transform: translateX(6px);
  }
  42% {
    transform: translateX(-4px);
  }
  56% {
    transform: translateX(3px);
  }
  70% {
    transform: translateX(-1.5px);
  }
  84% {
    transform: translateX(0.5px);
  }
}

@keyframes cue-pop {
  0% {
    opacity: 0;
    transform: translateY(-3px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes cue-spark {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1);
  }
}

.cue.is-playing .receipt {
  animation: cue-settle var(--cue-dur) cubic-bezier(0.22, 1, 0.36, 1);
}

.cue.is-playing .receipt__check path {
  animation: cue-check-draw 420ms 120ms var(--ease) both;
}

.cue.is-playing .receipt__check {
  animation: cue-check-pulse var(--cue-dur) 80ms ease-out;
}

.cue.is-playing .field {
  animation: cue-shake var(--cue-dur) cubic-bezier(0.22, 1, 0.36, 1);
}

.cue.is-playing .field__error {
  animation: cue-pop 220ms var(--ease) both;
}

.cue.is-playing .setup__ring {
  animation: cue-pop 260ms var(--ease) both;
}

.cue.is-playing .spark {
  animation: cue-spark 620ms var(--ease) both;
}

.cue.is-playing .spark:nth-child(1) {
  --dx: 30px;
  --dy: -20px;
}
.cue.is-playing .spark:nth-child(2) {
  --dx: 38px;
  --dy: 6px;
  animation-delay: 40ms;
}
.cue.is-playing .spark:nth-child(3) {
  --dx: 20px;
  --dy: 24px;
  animation-delay: 80ms;
}
.cue.is-playing .spark:nth-child(4) {
  --dx: -22px;
  --dy: 22px;
  animation-delay: 60ms;
}
.cue.is-playing .spark:nth-child(5) {
  --dx: -36px;
  --dy: 2px;
  animation-delay: 20ms;
}
.cue.is-playing .spark:nth-child(6) {
  --dx: -26px;
  --dy: -22px;
  animation-delay: 100ms;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 980px) {
  .hero__grid,
  .spec__grid,
  .inspector {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-block: var(--s6) var(--s7);
  }

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

  .cues .cue:last-child {
    grid-column: 1 / -1;
  }

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

@media (max-width: 720px) {
  .masthead__nav {
    display: none;
  }

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

  .console__bar {
    border-radius: var(--r-card);
  }

  .caps {
    margin-left: 0;
    width: 100%;
  }

  .meter {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .section {
    padding-block: var(--s7);
  }
}

@media (max-width: 560px) {
  .code {
    mask-image: linear-gradient(to right, #000 88%, transparent);
  }

  .band th,
  .band td {
    padding-right: var(--s2);
  }

  .band td:nth-child(1),
  .band td:nth-child(2),
  .band td:nth-child(3) {
    white-space: normal;
  }

  .log__row {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 2px;
  }

  .log__meta {
    grid-column: 1 / -1;
    text-align: left;
  }

  .target {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .target__how {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------------------------------------- features */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
  margin-top: var(--s6);
}

.feature {
  padding: var(--s5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.feature__n {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
}

.feature__t {
  margin-top: var(--s3);
  font-size: var(--t-h3);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.feature__d {
  margin-top: var(--s2);
  font-size: var(--t-ui);
  color: var(--muted);
}

.note {
  margin-top: var(--s5);
  max-width: var(--w-prose);
  font-size: var(--t-mono);
  line-height: 1.7;
  color: var(--faint);
}

/* --------------------------------------------------------------- pricing */

.offer__was {
  margin-top: var(--s2);
  font-size: var(--t-mono);
  color: var(--faint);
}

.offer__buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--s5);
  min-height: 44px;
  padding-inline: var(--s5);
  border-radius: var(--r-pill);
  background: var(--action-bg);
  color: var(--action-ink);
  font-size: var(--t-ui);
  font-weight: 500;
  transition: opacity var(--dur) var(--ease);
}

.offer__buy:hover {
  opacity: 0.88;
}

.offer--featured .offer__buy {
  background: var(--accent-fill);
  color: var(--accent-ink);
}

.offer__list {
  margin-bottom: auto;
}

/* ------------------------------------------------------------------- faq */

.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4) var(--s5);
  margin-top: var(--s6);
}

.faq__item {
  padding: var(--s5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.faq__q {
  font-size: var(--t-body);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.faq__a {
  margin-top: var(--s2);
  font-size: var(--t-ui);
  color: var(--muted);
}

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

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

/* ------------------------------------------------------------- checkout */

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--s5);
  align-items: start;
  max-width: 960px;
  margin-inline: auto;
}

.checkout__card {
  padding: var(--s5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.checkout__title {
  margin-top: var(--s3);
  font-size: 26px;
}

.checkout__price {
  margin-top: var(--s3);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.checkout__was {
  margin-top: var(--s2);
  font-size: var(--t-mono);
  color: var(--faint);
}

.checkout__list {
  margin-top: var(--s4);
}

.checkout__change {
  margin-top: var(--s5);
  font-size: var(--t-ui);
}

.checkout__change a,
.checkout__alt a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.checkout__field {
  max-width: none;
  margin-top: var(--s4);
}

.checkout .field__input {
  font-family: var(--font-ui);
}

.field__hint {
  font-size: var(--t-mono);
  color: var(--faint);
}

.testnote {
  margin-top: var(--s5);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-well);
  background: var(--well);
  font-size: var(--t-mono);
  line-height: 1.65;
  color: var(--muted);
}

.checkout__pay {
  width: 100%;
  margin-top: var(--s4);
}

.checkout__pay:disabled {
  opacity: 0.6;
}

.checkout__alt {
  margin-top: var(--s3);
  font-size: var(--t-mono);
  color: var(--faint);
  text-align: center;
}

.checkout__step {
  font-size: var(--t-mono);
  color: var(--faint);
}

.checkout__lead {
  margin-top: var(--s3);
  font-size: var(--t-ui);
  color: var(--muted);
}

.key {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s4);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-well);
  background: var(--well);
}

.key__value {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--t-ui);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.key__copy {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: var(--t-mono);
}

.key__copy:hover {
  background: var(--card);
}

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

/* ----------------------------------------------------------------- steps */

.steps {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s5);
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: var(--s6);
  font-size: var(--t-ui);
  color: var(--muted);
  line-height: 1.6;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--well);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.steps strong {
  color: var(--ink);
  font-weight: 600;
}
