/*
  The tuner's page (docs/todo-16.md, part D): the live demonstration in a phone-sized frame, the
  iPad beside it as a picture, and the page's own bits. The demo keeps the stage's own dark look
  whatever the page's theme, like the real tuner. No inline styles: the site's security rule allows
  only this file and styles.css.
*/
.tn-hero {
  padding: 56px 0 24px;
}
.tn-hero h1 {
  max-width: 14ch;
}
.tn-hero .lede {
  max-width: 60ch;
}
.tn-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

/* The demonstration and its words. */
.tn-demo .container {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
@media (max-width: 860px) {
  .tn-demo .container {
    grid-template-columns: minmax(0, 1fr);
  }
}
.tn-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line, #e0e1dc);
  border-radius: 999px;
  background: #fff;
  margin-bottom: 14px;
}
.tn-switch button {
  border: 0;
  background: transparent;
  font: 600 14px/1 inherit;
  font-family: inherit;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: #5d6168;
}
.tn-switch button[aria-pressed="true"] {
  background: #121418;
  color: #fff;
}
.tn-frame[hidden] {
  display: none !important;
}
.tn-ipad img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid #23262b;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.45);
}
.tn-notes ol {
  padding-left: 20px;
}
.tn-notes li {
  margin-bottom: 8px;
}
.tn-notes li b {
  color: #121418;
}
.tn-cap {
  font-size: 14px;
  color: #5d6168;
  margin-top: 10px;
}
.tn-demo-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-top: 12px;
  font-size: 14px;
  color: #5d6168;
}
.tn-demo-foot label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.tn-demo-foot input {
  accent-color: #f2a93b;
  width: 16px;
  height: 16px;
}

/* The tuner itself: the stage's look, whatever the page's theme. */
.tuner-demo {
  --stage: #0c0d0f;
  --stage-2: #15171a;
  --stage-line: #2a2d32;
  --stage-ink: #ecebe8;
  --stage-muted: #8d929a;
  --amber: #f2a93b;
  --pad: 18px;
  background: var(--stage);
  color: var(--stage-ink);
  border-radius: 26px;
  border: 1px solid #23262b;
  padding: var(--pad);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--sans, inherit);
}
.tuner-demo::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 60% at 50% 32%, rgba(242, 169, 59, 0.07), transparent 60%);
  opacity: var(--glow, 0.4);
  transition: opacity 0.5s ease;
}
.tuner-demo .t-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.tuner-demo .t-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--stage-2);
  color: var(--stage-ink);
  border: 1px solid var(--stage-line);
  border-radius: 999px;
  height: 36px;
  padding: 0 28px 0 12px;
  font: 600 12.5px/1 inherit;
  font-family: inherit;
  background-image: linear-gradient(45deg, transparent 50%, var(--stage-muted) 50%), linear-gradient(135deg, var(--stage-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 15px,
    calc(100% - 10px) 15px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  max-width: 100%;
}
.tuner-demo .t-select:focus-visible,
.tuner-demo .t-btn:focus-visible,
.tuner-demo .chip:focus-visible,
.tuner-demo .peg:focus-visible,
.tuner-demo .seg button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.tuner-demo .seg {
  display: inline-flex;
  background: var(--stage-2);
  border: 1px solid var(--stage-line);
  border-radius: 999px;
  padding: 3px;
}
.tuner-demo .seg button {
  border: 0;
  background: transparent;
  color: var(--stage-muted);
  font: 600 12px/1 inherit;
  font-family: inherit;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  cursor: pointer;
}
.tuner-demo .seg button[aria-pressed="true"] {
  background: #2a2d33;
  color: var(--stage-ink);
}
.tuner-demo .t-face {
  position: relative;
  margin: 18px 0 6px;
  height: 232px;
}
.tuner-demo .t-face svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.tuner-demo .t-note {
  position: absolute;
  left: 0;
  right: 0;
  top: 70px;
  text-align: center;
  pointer-events: none;
}
.tuner-demo .t-name {
  font: 600 92px/1 inherit;
  font-family: inherit;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: flex-start;
  transition: color 0.3s ease;
}
.tuner-demo .t-name sup {
  font: 500 26px/1 var(--mono, ui-monospace, monospace);
  margin: 10px 0 0 4px;
  color: var(--stage-muted);
}
.tuner-demo .t-name .acc {
  font-size: 56px;
  margin-top: 6px;
}
.tuner-demo .t-read {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 2px 0 12px;
  font: 500 14px/1 var(--mono, ui-monospace, monospace);
  color: var(--stage-muted);
  font-variant-numeric: tabular-nums;
}
.tuner-demo .t-read b {
  color: var(--stage-ink);
  font-weight: 600;
}
.tuner-demo .t-check {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  border-radius: 50%;
  background: var(--amber);
  color: #121316;
  display: grid;
  place-items: center;
  font: 700 17px/1 inherit;
  font-family: inherit;
  transform: scale(0.4);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2),
    opacity 0.25s ease;
}
.tuner-demo.locked .t-check {
  transform: scale(1);
  opacity: 1;
}
.tuner-demo.locked .t-name {
  color: var(--amber);
}
.tuner-demo .strobe {
  position: relative;
  height: 34px;
  border-radius: 10px;
  background: #0f1113;
  border: 1px solid var(--stage-line);
  overflow: hidden;
}
.tuner-demo .strobe canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.tuner-demo .strobe::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--stage) 0%, transparent 18%, transparent 82%, var(--stage) 100%);
}
.tuner-demo .strobe .mid {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(236, 235, 232, 0.55);
  z-index: 1;
}
.tuner-demo .t-say {
  text-align: center;
  font: 600 17px/1.2 inherit;
  font-family: inherit;
  margin: 14px 0 2px;
  min-height: 22px;
  transition: color 0.25s ease;
}
.tuner-demo.locked .t-say {
  color: var(--amber);
}
.tuner-demo .t-sub {
  text-align: center;
  font: 500 12.5px/1.3 inherit;
  font-family: inherit;
  color: var(--stage-muted);
  min-height: 17px;
  margin: 0;
}
.tuner-demo .strings {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  margin: 16px 0 12px;
}
.tuner-demo .strings.left {
  flex-direction: row-reverse;
}
.tuner-demo .chip {
  flex: 1 1 0;
  min-width: 0;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--stage-line);
  background: var(--stage-2);
  color: var(--stage-ink);
  font: 600 15px/1 inherit;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}
.tuner-demo .chip small {
  font: 500 10.5px/1 var(--mono, ui-monospace, monospace);
  color: var(--stage-muted);
}
.tuner-demo .chip.active {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(242, 169, 59, 0.14);
}
.tuner-demo .chip.done {
  background: var(--amber);
  border-color: var(--amber);
  color: #121316;
}
.tuner-demo .chip.done small {
  color: rgba(18, 19, 22, 0.7);
}
.tuner-demo .chip.done::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 6px;
  font: 700 10px/1 inherit;
  font-family: inherit;
}
.tuner-demo .chip.lockedstr::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--amber);
}
.tuner-demo .chip.done.lockedstr::before {
  background: #121316;
}
.tuner-demo .controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}
.tuner-demo .t-btn {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--stage-line);
  background: var(--stage-2);
  color: var(--stage-ink);
  font: 600 14px/1 inherit;
  font-family: inherit;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}
.tuner-demo .t-btn.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #121316;
}
.tuner-demo .t-btn:active {
  transform: translateY(1px);
}
.tuner-demo .peg {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--stage-line);
  background: repeating-linear-gradient(90deg, #1b1e22 0 3px, #24272c 3px 6px);
  position: relative;
  cursor: ew-resize;
  touch-action: none;
  overflow: hidden;
}
.tuner-demo .peg .grip {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(236, 235, 232, 0.16) 9px 10px);
  background-position: var(--peg, 0px) 0;
}
.tuner-demo .peg .lbl {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 600 12.5px/1 inherit;
  font-family: inherit;
  color: var(--stage-muted);
  pointer-events: none;
  text-shadow: 0 1px 2px #000;
}
.tuner-demo .listen {
  height: 18px;
  margin-top: 12px;
}
.tuner-demo .listen canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.tuner-demo.glance .t-face {
  height: 270px;
}
.tuner-demo.glance .t-name {
  font-size: 128px;
}
.tuner-demo.glance .t-note {
  top: 62px;
}
.tuner-demo .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Without JavaScript the still picture stands in for the demo. */
.js .tn-still {
  display: none;
}
.tn-still img {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 26px;
  border: 1px solid #23262b;
}
html:not(.js) .tuner-demo,
html:not(.js) .tn-switch,
html:not(.js) .tn-demo-foot {
  display: none;
}

/* What it does: six cards reuse the site's card grid; the privacy line and the questions. */
.tn-privacy {
  border-left: 3px solid #1f4f43;
  background: #e7f0ec;
  border-radius: 0 12px 12px 0;
  padding: 12px 16px;
  margin: 8px 0 0;
  max-width: 720px;
}
.tn-free {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 28px;
  align-items: center;
  background: #121418;
  color: #ecebe8;
  border-radius: 22px;
  padding: 28px 30px;
}
.tn-free h2 {
  margin: 0 0 6px;
  color: #ecebe8;
}
.tn-free p {
  margin: 0;
  color: #b9bcc3;
  max-width: 60ch;
}
.tn-free .btn-primary {
  white-space: nowrap;
}
@media (max-width: 700px) {
  .tn-free {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 480px) {
  .tuner-demo .t-name {
    font-size: 80px;
  }
  .tuner-demo.glance .t-name {
    font-size: 100px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tuner-demo .t-check,
  .tuner-demo .t-name,
  .tuner-demo .t-say,
  .tuner-demo .chip {
    transition: none;
  }
}
