/* ==========================================================================
   Cuetra v3 — "Crisp" (owner's pick) + The Drop mark + cardless icons.
   Loads after assets/tokens.css. Every value resolves to a token.
   checkout.html / redeem.html also load assets/app.css (shared flow styles).

   Decisions (binding, from the owner + the form study):
   - Surface: cool white page; content blocks are white surfaces lifted by
     cobalt-tinted elevation. NEVER borders on those blocks.
   - CARDLESS ICONS (owner's explicit rule): icon tiles are bare on the
     surface — whitespace does the separating; hover = the icon's motion plus
     a cobalt tint wash; nothing draws a box around an icon.
   - The Drop: the wordmark's period drops and settles on hover (masthead,
     footer, favicon).
   - Type: Sora display (60/25) + Inter body (16), labels 12.
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  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;
}

img,
svg,
video {
  max-width: 100%;
}

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* ---------------------------------------------------------------- helpers */

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

.shell--narrow {
  max-width: calc(var(--w-prose) + 2 * var(--gutter));
}

.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(--sp-4);
  top: var(--sp-4);
  z-index: 10;
  padding: 10px var(--sp-4);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--t-body);
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: none;
}

.kicker {
  margin: 0 0 var(--sp-4);
  font: 500 var(--t-label) / 1.3 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  margin: 0 0 var(--sp-5);
  font: 700 var(--t-display) / var(--lh-display) var(--font-display);
  letter-spacing: -0.025em;
  color: var(--text);
}

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

.h2 {
  font: 700 var(--t-h2) / var(--lh-h2) var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
}

.lede {
  margin: 0 0 var(--sp-6);
  font: 400 20px / 1.5 var(--font-body);
  color: var(--muted);
  max-width: 56ch;
}

.note {
  margin-top: var(--sp-4);
  max-width: var(--w-prose);
  font-size: 14px;
  color: var(--muted);
}

/* ------------------------------------------------------------- The Drop */

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text);
}

.brand__mark {
  width: 26px;
  height: 26px;
}

.brand__word {
  font: 700 20px / 1 var(--font-display);
  letter-spacing: -0.01em;
}

.brand__period {
  display: inline-block;
  color: var(--accent);
}

/* The Drop: the period falls in and settles (damped, ends at rest). */
.brand:hover .brand__period,
.brand:focus-visible .brand__period {
  animation: drop-settle 550ms cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

@keyframes drop-settle {
  0% {
    transform: translateY(-0.45em);
    opacity: 0;
  }
  55% {
    transform: translateY(0);
    opacity: 1;
  }
  75% {
    transform: translateY(-0.12em);
  }
  100% {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand:hover .brand__period,
  .brand:focus-visible .brand__period {
    animation: none;
  }
}

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

.mast {
  background: var(--bg);
}

.mast__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-5);
  padding-block: var(--sp-4);
}

.mast__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-5);
  margin-left: auto;
}

.mast__nav a {
  font: 500 14px / 1.2 var(--font-body);
  color: var(--muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: var(--sp-1);
  transition: color var(--dur) var(--ease);
}

.mast__nav a:hover {
  color: var(--text);
}

.mast__nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

/* Mobile masthead burger. Hidden entirely until the mobile block below turns
   it on under .mast.js-nav (the class src/nav-loading.js adds), so desktop
   keeps the inline nav and no-JS keeps the stacked one. */
.mast__burger {
  display: none;
}

/* Panel item markers: hidden everywhere except the open mobile panel. */
.mast__nav-icon {
  display: none;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px var(--sp-4);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--elev-1);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}

.sound-toggle:hover {
  box-shadow: var(--elev-2);
  color: var(--accent);
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-5);
  border-radius: var(--radius-ctl);
  font: 500 15px / 1.2 var(--font-body);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}

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

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

.btn--primary:hover {
  box-shadow: var(--elev-2);
}

.btn--ghost {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--elev-1);
}

.btn--ghost:hover {
  box-shadow: var(--elev-2);
  color: var(--accent);
}

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ------------------------------------------------- cardless icon language */

/* THE RULE: no boxes around icons. Tiles are transparent; whitespace
   separates; hover lifts the icon, washes a cobalt tint behind it, and plays
   its motion. Focus-visible draws the only outline an icon ever gets. */

.icon-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-ctl);
  color: var(--text);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.icon-tile:hover,
.icon-tile:focus-visible {
  background: var(--surface-2);
  color: var(--accent);
  transform: translateY(-3px);
}

.icon-tile__art {
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
}

/* Sampler: four labeled parallel columns, cardless. */
.sampler {
  padding-block: var(--sp-9) var(--sp-7);
  scroll-margin-top: var(--sp-6);
}

.howline {
  min-height: 3em;
  margin-top: var(--sp-3);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.howline strong {
  color: var(--text);
  font-weight: 600;
}

.sampler__cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-6) var(--sp-7);
  margin-top: var(--sp-5);
}

.sampler__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: var(--sp-1);
}

.sampler__name {
  margin-top: var(--sp-4);
  text-align: center;
  font: 600 var(--t-label) / 1.3 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.sampler-loading .icon-tile__art {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  animation: sampler-pulse 1.2s var(--ease) infinite;
}

@keyframes sampler-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

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

.hero {
  /* Two columns at desktop: copy left, live bell right. The markup is a single
     <div class="hero shell"> element, so the grid targets .hero itself. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-7);
  align-items: center;
  padding-block: var(--sp-8) var(--sp-9);
}

.hero__copy {
  max-width: 640px;
}

.hero__art {
  display: grid;
  /* Explicit minmax(0,1fr): an implicit auto track sizes itself to the film's
     480px, so the figure's max-width resolved against its own overflow and
     nothing clamped it on phones (document.scrollWidth was 496px at
     360/390/414). A 1fr track is the container's real width at every
     breakpoint, so max-width on the figure does the clamping. */
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: var(--sp-3);
}

.hero__art-note {
  margin: 0;
  font: 500 var(--t-label) / 1.4 var(--font-body);
  color: var(--muted);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-6);
  font: 500 var(--t-label) / 1.4 var(--font-body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts li:not(:last-child)::after {
  content: "·";
  margin-left: var(--sp-4);
  color: var(--accent);
}

/* -------------------------------------------------------- content blocks */

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

.section--tight {
  padding-block: var(--sp-6);
}

/* White lifted blocks: allowed for content, never wrapped around icon tiles. */
.block {
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--elev-1);
  padding: var(--sp-5);
}

.block--rise:hover {
  box-shadow: var(--elev-2);
}

.block h3 {
  margin-top: var(--sp-4);
  font: 600 var(--t-body) / 1.35 var(--font-body);
  color: var(--text);
}

.block p {
  margin-top: var(--sp-2);
  font-size: 14px;
  color: var(--muted);
}

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}

.feature-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-height: 88px;
}

.feature-visual .icon-tile {
  width: 64px;
  aspect-ratio: auto;
  min-height: 64px;
  border-radius: var(--radius-pill);
  /* The SVG is injected straight into the button and sizes itself at 1em. */
  font-size: 32px;
}

.codeblock {
  margin-top: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}

.codeblock .code-dim {
  color: var(--muted);
}

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

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-6);
  align-items: stretch;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--elev-1);
  transition: box-shadow var(--dur) var(--ease);
}

.plan:hover {
  box-shadow: var(--elev-2);
}

.plan__flag {
  position: absolute;
  top: -12px;
  left: var(--sp-5);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
}

.plan h2 {
  margin: 0 0 var(--sp-2);
  font: 600 var(--t-body) / 1.3 var(--font-body);
  color: var(--text);
}

.plan__desc {
  margin-top: var(--sp-1);
  font-size: 14px;
  color: var(--muted);
}

.plan__price-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.plan__price {
  font: 700 34px / 1.1 var(--font-display);
  letter-spacing: -0.03em;
  color: var(--text);
}

.plan__was {
  font-size: 14px;
  color: var(--muted);
  text-decoration: line-through;
}

.plan__note {
  margin-top: var(--sp-1);
  font-size: var(--t-label);
  color: var(--muted);
}

.plan__buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: var(--sp-4);
  padding: 0 var(--sp-5);
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}

.plan__buy:hover {
  box-shadow: var(--elev-2);
  color: var(--accent);
}

.plan--pop .plan__buy {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Payment choice (2026-11-28): the dual .plan__pay button group is gone - one
   .plan__buy per tier again. The buttons keep their direct Polar checkout
   hrefs (the static path); pricing.html's payment-method modal, opened from
   the click, offers the Dodo channel too. */

.plans-note {
  margin: var(--sp-4) 0 0;
  font-size: var(--t-label);
  color: var(--muted);
  text-align: center;
}

a.btn, a.plan__buy { position: relative; }
.btn.is-loading, .plan__buy.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::after, .plan__buy.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--accent);
  border-top-color: transparent;
  animation: btn-spin 0.7s linear infinite;
}
.btn--primary.is-loading::after, .plan__buy.is-loading::after {
  border-color: var(--accent-ink);
  border-top-color: transparent;
}
@keyframes btn-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::after, .plan__buy.is-loading::after {
    animation: none;
    border: 0;
    width: auto;
    height: auto;
    inset: auto;
    content: "…";
    font: 600 16px / 1 var(--font-body);
    color: var(--muted);
  }
}

.plan__list {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  font-size: 14px;
  color: var(--body);
}

.plan__list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: var(--sp-2);
  align-items: start;
}

.plan__list .art {
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1.4;
  color: var(--accent);
}

.after-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.guarantee {
  max-width: var(--w-prose);
  margin-inline: auto;
  margin-top: var(--sp-5);
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}

.guarantee strong {
  color: var(--text);
  font-weight: 600;
}

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

.faq {
  display: grid;
  gap: var(--sp-3);
  max-width: var(--w-prose);
  margin-inline: auto;
  margin-top: var(--sp-5);
}

.faq details {
  border-radius: var(--radius-ctl);
  background: var(--surface);
  box-shadow: var(--elev-1);
  padding: 0 var(--sp-4);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 52px;
  padding-block: var(--sp-2);
  font-size: var(--t-body);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-weight: 400;
  font-size: 20px;
  color: var(--muted);
}

.faq details[open] summary::after {
  content: "−";
}

.faq__a {
  padding-bottom: var(--sp-4);
  font-size: 14px;
  color: var(--muted);
}

.faq__a a,
.note a,
.plan__desc a,
.doc-section a,
.lede a,
.page-intro a,
.block p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-block: 15px;
  margin-block: -15px;
  /* Inline tap width: grow sideways without shifting the line. */
  padding-inline: 8px;
  margin-inline: -8px;
}

.faq__a a:hover,
.note a:hover,
.plan__desc a:hover,
.doc-section a:hover,
.lede a:hover,
.page-intro a:hover,
.block p a:hover {
  color: var(--accent-hover);
}

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

.footer {
  padding-block: var(--sp-8) var(--sp-6);
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-6);
}

.mast .brand,
.footer__top .brand {
  min-height: 44px;
}

.footer__tag {
  font-size: 14px;
  color: var(--muted);
  max-width: 36ch;
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-6);
  margin-top: var(--sp-7);
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------------- sub pages */

.page-head {
  padding-block: var(--sp-7) var(--sp-5);
}

.page-title {
  max-width: var(--w-prose);
  margin: 0 0 var(--sp-3);
  font: 700 var(--t-h2) / var(--lh-h2) var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text);
}

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

.doc-section {
  max-width: calc(var(--w-prose) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--sp-4);
}

.doc-section h2 {
  margin-top: var(--sp-6);
  font: 600 var(--t-body) / 1.35 var(--font-body);
  color: var(--text);
}

.doc-section p {
  margin-top: var(--sp-3);
}

.doc-section ul {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font-size: 14px;
  color: var(--body);
}

.doc-section li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--sp-2);
}

.doc-section li .art {
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.doc-code {
  margin-top: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  box-shadow: var(--elev-1);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}

.doc-code .code-dim {
  color: var(--muted);
}

/* Treatments page: four side-by-side live rows, cardless. */
.treatment-row {
  margin-top: var(--sp-6);
}

.treatment-row__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: var(--sp-2);
}

.treatment-row__grid .icon-tile__art {
  font-size: 40px;
}

.search {
  display: flex;
  gap: var(--sp-2);
  max-width: var(--w-prose);
  margin-inline: auto;
  margin-top: var(--sp-4);
}

.search__input {
  flex: 1;
  min-height: 48px;
  padding: 0 var(--sp-4);
  border: 0;
  border-radius: var(--radius-ctl);
  background: var(--surface);
  box-shadow: var(--elev-1);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: box-shadow var(--dur) var(--ease);
}

.search__input:hover {
  box-shadow: var(--elev-2);
}

.search__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.grid-empty {
  display: none;
  max-width: var(--w-prose);
  margin-inline: auto;
  margin-top: var(--sp-5);
  padding: var(--sp-5);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--elev-1);
  text-align: center;
}

.grid-empty.is-visible {
  display: grid;
  gap: var(--sp-3);
  justify-items: center;
}

.grid-empty__title {
  font-weight: 600;
  color: var(--text);
}

.grid-empty__text {
  font-size: 14px;
  color: var(--muted);
  max-width: 46ch;
}

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

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-6);
    padding-block: var(--sp-6) var(--sp-7);
  }

  .hero__art {
    justify-items: start;
  }

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

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

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

@media (max-width: 560px) {
  .sampler__cols {
    gap: var(--sp-5) var(--sp-4);
  }
}

@media (max-width: 720px) {
  /* Owner ruling 2026-11-29: ONE masthead row on phones — emblem left, burger
     right. The four links cannot share the row (they need 305px of 313px at
     360), so the nav becomes a dropdown panel opened by the burger. Only
     active under .js-nav: without JS the stacked inline nav stays usable. */
  .mast.js-nav {
    position: relative;
  }

  .mast.js-nav .mast__burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border-radius: var(--radius-ctl);
    color: var(--text);
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  }

  .mast.js-nav .mast__burger:hover {
    color: var(--accent);
    background: var(--surface-2);
  }

  .mast.js-nav .mast__burger svg {
    width: 24px;
    height: 24px;
  }

  /* Hamburger bars morph into a close glyph while open. */
  .mast.js-nav .mast__burger .bar {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  }

  .mast.js-nav .mast__burger[aria-expanded="true"] .bar-1 {
    transform: translateY(5px) rotate(45deg);
  }

  .mast.js-nav .mast__burger[aria-expanded="true"] .bar-2 {
    opacity: 0;
  }

  .mast.js-nav .mast__burger[aria-expanded="true"] .bar-3 {
    transform: translateY(-5px) rotate(-45deg);
  }

  /* The panel: the same nav element, floated below the row as a lifted white
     surface. Display toggles (no opacity dance) so reduced motion has nothing
     to opt out of. */
  .mast.js-nav .mast__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: var(--sp-3);
    right: var(--sp-3);
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-1);
    margin-left: 0;
    padding: var(--sp-2);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--elev-2);
  }

  .mast.js-nav.nav-open .mast__nav {
    display: flex;
  }

  .mast.js-nav .mast__nav a {
    padding-inline: var(--sp-3);
  }

  /* Leading marks on the panel items (owner feedback 2026-11-29: each item
     needs its own visible marker). Per-link Cuetra glyphs, inline-embedded
     from the pack's outline drawings; presentational (aria-hidden) and shown
     ONLY inside the open panel, so the desktop nav rects are unchanged. */
  .mast.js-nav.nav-open .mast__nav-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex: none;
    margin-right: var(--sp-3);
    color: var(--muted);
    transition: color var(--dur) var(--ease);
  }

  .mast.js-nav.nav-open .mast__nav a:hover .mast__nav-icon,
  .mast.js-nav.nav-open .mast__nav a:focus-visible .mast__nav-icon {
    color: var(--accent);
  }

  .mast__nav a {
    padding-inline: var(--sp-2);
  }

  /* Tighter link spacing on phones: at 360 the four items plus 24px gaps
     measured 329px against 313px available, wrapping "Docs" alone onto its
     own row. 16px gaps fit all four on one row (305px). Kept for the no-JS
     stacked fallback; the burger panel is column-shaped and ignores it. */
  .mast__nav {
    column-gap: var(--sp-4);
  }

  .mast__nav a,
  .sound-toggle {
    min-height: 44px;
  }

  /* Legacy flow pages (app.css): inline links gain tap area, no layout shift. */
  .checkout__alt a,
  .checkout__change a,
  .flownote a {
    padding-block: 15px;
    margin-block: -15px;
  }
}

@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;
  }

  .icon-tile:hover {
    transform: none;
  }
}

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

/* Docs page card sidebar: the site's floating-card language (white surface,
   radius-card, cobalt elev-1 shadow — no border), sticky inside the docs
   grid. Longhand font properties ONLY — a font shorthand containing var()
   components is the root cause of the flat-label bug this block replaces. */
.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
}

/* Grid item with min-width: 0 — keeps pre.doc-code scrolling inside its own
   overflow:auto box instead of stretching the 1fr track. */
.docs-body {
  min-width: 0;
}

.docs-sidebar {
  position: sticky;
  top: var(--sp-5);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--elev-1);
  padding: var(--sp-4);
  display: grid;
  gap: var(--sp-5);
}

.docs-sidebar .docs-group-label {
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--sp-2);
}

.docs-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
}

.docs-sidebar a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  min-height: 24px;
  display: inline-block;
  border-radius: var(--radius-ctl);
  padding: 4px 10px;
  margin: 0 calc(-1 * var(--sp-2));
}

.docs-sidebar a:hover {
  color: var(--accent);
  background: var(--surface-2);
}

.docs-sidebar a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    background: var(--surface-2);
    border-radius: var(--radius-card);
    box-shadow: none;
    padding: var(--sp-4);
  }
}

/* Docs panel switcher: the sidebar swaps .doc-panel blocks in place instead of
   navigating away — the page never reloads for a panel link. Longhand font
   properties ONLY (a font shorthand containing var() components is the root
   cause of the flat-label bug the sidebar block above replaces). */
.doc-panel[hidden] { display: none; }

.doc-panel {
  max-width: calc(var(--w-prose) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--sp-4);
}

/* The guide panel's four .doc-section blocks already carry this exact
   max-width and padding — neutralize theirs so the wrapper provides it once
   and the guide renders exactly as it did before the wrapper existed. */
.doc-panel > .doc-section {
  max-width: none;
  margin-inline: 0;
  padding-inline: 0;
  padding-block: 0;
}

.doc-panel h2 {
  margin-top: 0;
  font-family: var(--font-body);
  font-size: var(--t-body);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.doc-panel p {
  margin-top: var(--sp-3);
}

.doc-panel__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.doc-panel__link:hover {
  text-decoration: underline;
}

.docs-sidebar a.is-active {
  color: var(--accent);
  font-weight: 600;
  background: var(--surface-2);
  border-radius: var(--radius-ctl);
}

/* ------------------------------------------------------- ad films (2026-11-28) */

/* The owner's ad film is the hero's motion demo (index.html): the old 112px
   bell tile became the film itself - CARDLESS, exactly like the icon tiles
   (owner rule 2026-11-28: no card around the media). The film's own ground is
   the page's cool white, so it sits bare in the flow, edge to edge of its
   slot; the box is still reserved by the video's width/height attributes plus
   aspect-ratio, so the hero never shifts while the 2.3 MB film streams
   (preload="metadata"). The sound toggle floats ON the film, bottom-right -
   a floating control, not a card. The inline guard script holds the poster
   frame under prefers-reduced-motion - motion rests when the OS asks. */
.hero__demo {
  position: relative;
  margin: 0;
  /* width:100% + a definite 480px cap (not width:480px): the film fills the
     .hero__art track on narrow screens and keeps its 480px design size
     everywhere else. The fixed max-width also keeps the desktop auto track of
     .hero at exactly 480px, so the right-aligned hero layout is unchanged. */
  width: 100%;
  max-width: 480px;
}

.hero__demo video {
  display: block;
  width: 100%;
  /* height must be auto: the width/height attributes are presentational hints,
     so without it the box keeps the attribute height (540px) and aspect-ratio
     is ignored - the film letterboxes. auto + aspect-ratio keeps 16:9 at every
     width while the attributes still reserve the pre-CSS box. */
  height: auto;
  aspect-ratio: 16 / 9;
}

/* The film's sound control - CARDLESS TOO (owner rule 2026-11-28: the toggle
   gets no card, it must blend with the film). It is the site's own icon-tile
   button floating on the video: bare speaker glyph drawn in the icon language
   (24 grid, 1.75px stroke, currentColor), 44px hit area, hover/focus borrow
   the icon-tile's own states (cobalt wash, accent glyph, 3px lift) and the
   global :focus-visible ring. The only ground is a subtle translucent scrim -
   the page color at 72%, via color-mix on --bg - so the glyph keeps a light
   ground when dark film content passes underneath. */
.hero__demo .hero__demo__sound {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  width: 44px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}

.hero__demo .hero__demo__sound svg {
  width: 22px;
  height: 22px;
}

/* The hidden attribute is the no-JS default for the waves glyph; this scoped
   rule makes it unambiguous for SVG (the sync() script swaps the glyphs with
   inline style.display, which beats this rule when a glyph is shown). */
.hero__demo .hero__demo__sound svg[hidden] {
  display: none;
}

/* The ad strip (icons.html, treatments.html, the per-icon pages): the looping
   GIF film of the set in motion - CARDLESS like the icons (owner rule
   2026-11-28: no card around the media): no panel, no shadow, no radius; the
   film sits directly in the flow, capped at its native 640px so it is never
   upscaled. The img's width/height attributes reserve the box and
   loading="lazy" keeps the 419 KB off the first payload. Under
   prefers-reduced-motion the <picture> source swaps in the still frame
   (ad/cuetra-ad-still.png), so no CSS is needed for the swap. */
.ad-demo {
  margin: 0 auto;
  width: min(640px, 100%);
}

.ad-demo img {
  display: block;
  width: 100%;
  height: auto; /* same presentational-hint rule as the hero film */
  aspect-ratio: 16 / 9;
}

.ad-demo__note {
  margin: var(--sp-3) 0 0;
  font: 500 var(--t-label) / 1.4 var(--font-body);
  color: var(--muted);
  text-align: center;
}
