/* ==========================================================================
   ashtray audio · responder — site
   the page is the plugin's faceplate at poster scale: graphite surfaces,
   recessed trays, matte white keys, one flat red for a lit led. nothing glows.
   every value comes from tokens.css (generated from /tokens by build_tokens.py).
   ========================================================================== */

@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/BarlowCondensed-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/BarlowSemiCondensed-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/BarlowSemiCondensed-600.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --gutter: clamp(var(--space-4), 3.2vw, var(--space-10));
  --section: clamp(var(--space-20), 11vw, var(--space-40));
  --t-label: 13px;
  --t-body: clamp(16px, 0.35vw + 15px, 18px);
  --t-lede: clamp(18px, 0.6vw + 16px, 22px);
  --t-h2: clamp(40px, 5.2vw, 76px);
  --t-h3: clamp(20px, 1vw + 16px, 24px);
  --t-poster: clamp(64px, 12.4vw, 200px);
  --t-hero: clamp(56px, 7.4vw, 120px);
  --t-price: clamp(120px, 17vw, 240px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--color-surface-deep); scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--color-surface-base); color: var(--color-text-primary);
  font-family: var(--font-ui); font-weight: 500; font-size: var(--t-body); line-height: 1.55;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-weight: 700; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: var(--radius-control); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--space-4); top: -100px; z-index: 50; }
.skip:focus { top: var(--space-3); background: var(--key-bg); color: var(--key-fg); padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); }
kbd { font: inherit; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: var(--radius-inner); background: var(--color-surface-chip); box-shadow: inset 0 0 0 1px var(--color-border-strong); color: var(--color-text-secondary); }

/* --------------------------------------------------------------- keys: matte white, as on the plugin */
.key {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--size-control); padding: 0 var(--space-4); border-radius: var(--radius-control);
  background: var(--key-bg); color: var(--key-fg); box-shadow: var(--shadow-key);
  font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color var(--duration-switch) var(--ease-standard);
}
.key:hover { background: var(--key-bg-hover); }
.key:active { background: var(--key-bg-press); box-shadow: none; transform: translateY(1px); }
.key:disabled { opacity: 0.4; cursor: not-allowed; transform: none; background: var(--key-bg); }
.key svg { width: 14px; height: 14px; }
.key-hero { height: 48px; padding: 0 var(--space-6); font-size: 17px; }
.key-dark { background: var(--color-action-secondary); color: var(--color-text-primary); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), inset 0 0 0 1px var(--color-border-strong); }
.key-dark:hover { background: var(--color-surface-hover); }
.key-dark:active { background: var(--color-surface-chip); }
.key-wide { width: 100%; }

.led { display: inline-block; width: var(--size-led); height: var(--size-led); border-radius: 50%; background: var(--color-signal-led-off); flex: 0 0 auto; }
.key:not(.key-dark) .led { background: #B9B6AF; }
.led.is-on, .on-led { background: var(--color-signal-led); }

.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--space-2); border-radius: var(--radius-inner); background: var(--color-surface-chip); color: var(--color-text-tertiary); font-size: 12px; font-weight: 600; }

.tray { background: var(--color-surface-sunken); border-radius: var(--radius-panel); box-shadow: var(--shadow-tray), 0 1px 0 rgba(255, 255, 255, 0.03); }
.screen { background: var(--color-surface-screen); border-radius: var(--radius-panel); box-shadow: inset 0 0 0 1px var(--color-surface-hover), inset 0 2px 8px rgba(0, 0, 0, 0.8); }

/* --------------------------------------------------------------- top bar: the plugin header */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-6);
  height: var(--size-control-lg); padding: 0 var(--gutter);
  background: var(--color-surface-base); box-shadow: inset 0 -1px 0 var(--color-border-subtle);
}
.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--color-text-primary); }
.mark { height: 28px; width: auto; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1; }
.nav { display: flex; gap: var(--space-1); margin-left: auto; }
.nav a { display: inline-flex; align-items: center; height: var(--size-control-sm); padding: 0 var(--space-3); border-radius: var(--radius-control); color: var(--color-text-tertiary); font-size: 15px; text-decoration: none; }
.nav a:hover { color: var(--color-text-primary); background: var(--color-surface-chip); }
.key-buy { height: var(--size-control); }
.key-price { color: #55595F; font-weight: 600; }

/* --------------------------------------------------------------- shared section frame */
main > section { padding: var(--section) var(--gutter) 0; max-width: calc(var(--size-page) + 2 * var(--gutter)); margin: 0 auto; }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-6); align-items: end; margin-bottom: var(--space-10); }
.section-head h2 { font-family: var(--font-display); font-size: var(--t-h2); line-height: 0.88; letter-spacing: -0.01em; }
.section-head p { color: var(--color-text-secondary); font-size: var(--t-lede); line-height: 1.45; max-width: var(--size-measure); padding-bottom: 0.3em; }

/* --------------------------------------------------------------- 1 · hero: the claim beside the plugin */
main > section.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: var(--space-14);
  min-height: min(calc(100svh - var(--size-control-lg)), 960px); padding-top: var(--space-14); padding-bottom: var(--space-14);
  max-width: calc(1440px + 2 * var(--gutter));
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; }
.hero-kicker { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 15px; line-height: 1; color: var(--color-text-secondary); }
.hero-title { margin-top: var(--space-6); font-family: var(--font-display); font-size: var(--t-hero); line-height: 0.9; letter-spacing: -0.015em; }
.hero-title span { display: block; }
.line-call { color: var(--color-signal-dry); }
.line-response { color: var(--color-text-primary); padding-left: 0.5em; }   /* the answer comes a beat later */
.lede { margin-top: var(--space-8); font-size: var(--t-lede); line-height: 1.45; color: var(--color-text-secondary); max-width: 34rem; }
.hero-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-8); }
.formats { margin-top: var(--space-4); font-size: var(--t-label); line-height: 1.5; color: var(--color-text-tertiary); }
.hero-device { align-self: center; }

/* screen header, shared by the player and the 404 */
.screen-head { display: flex; align-items: center; gap: var(--space-2); font-size: 15px; line-height: 1; }
.screen-head b { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.head-meta { margin-left: auto; font-size: 13px; color: var(--color-text-tertiary); }
.poster { font-family: var(--font-display); font-weight: 700; font-size: var(--t-poster); line-height: 0.86; letter-spacing: -0.015em; }

/* --------------------------------------------------------------- 2 · listen: the a/b player */
.player { display: grid; gap: var(--space-3); }
.examples { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-1); padding: var(--space-2); }
.example {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control); background: var(--color-surface-chip); box-shadow: inset 0 0 0 1px var(--color-border-subtle);
  text-align: left; transition: background-color var(--duration-switch) var(--ease-standard);
}
.example b { font-family: var(--font-display); font-size: 21px; line-height: 1.05; }
.example span { font-size: var(--t-label); color: var(--color-text-tertiary); }
.example:hover { background: var(--color-surface-hover); }
.example[aria-checked="true"] { background: var(--key-bg); color: var(--key-fg); box-shadow: var(--shadow-key); }
.example[aria-checked="true"] span { color: #45484D; }
.example.is-missing b::after { content: " · soon"; font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--color-text-tertiary); }
.example[aria-checked="true"].is-missing b::after { color: #45484D; }

.deck { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--space-3); }
.player-screen { position: relative; display: flex; flex-direction: column; padding: var(--space-4) var(--space-5) var(--space-5); }
.player-screen canvas { flex: none; width: 100%; height: 240px; margin-top: var(--space-4); }
.screen-msg { position: absolute; inset: 56px 0 0; display: grid; place-items: center; padding: var(--space-6); text-align: center; color: var(--color-text-tertiary); font-size: 15px; }
.screen-msg[hidden] { display: none; }
.player.is-empty .player-screen { min-height: 0; }
.player.is-empty .player-screen canvas { height: 120px; }
.controls { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--color-surface-raised); border-radius: var(--radius-panel); box-shadow: inset 0 0 0 1px var(--color-border-subtle); }
.key-play { width: 100%; }
.key-play .i-stop { display: none; }
.key-play[aria-pressed="true"] .i-play { display: none; }
.key-play[aria-pressed="true"] .i-stop { display: inline; }
.rocker { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); padding: var(--space-1); border-radius: var(--radius-panel); background: var(--color-surface-sunken); box-shadow: var(--shadow-tray); }
.rocker button { height: 56px; border-radius: var(--radius-control); font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--color-text-tertiary); transition: background-color var(--duration-press) var(--ease-standard), color var(--duration-press) var(--ease-standard); }
.rocker button:hover { color: var(--color-text-primary); background: var(--color-surface-chip); }
.rocker button[aria-checked="true"] { background: var(--key-bg); color: var(--key-fg); box-shadow: var(--shadow-key); }
.hint { margin-top: auto; font-size: 12px; line-height: 2; color: var(--color-text-tertiary); }

.carry { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-panel); box-shadow: inset 0 0 0 1px var(--color-border-subtle); }
.carry p { color: var(--color-text-secondary); }
.carry b { color: var(--color-text-primary); font-weight: 600; }
.noscript { padding: var(--space-4) var(--space-5); color: var(--color-text-secondary); }
.noscript ul { list-style: none; margin-top: var(--space-2); }

/* --------------------------------------------------------------- 3 · how it works */
.cycle { margin: 0; }
.cycle svg { width: 100%; height: auto; overflow: visible; }
.cy-grid rect { fill: var(--color-surface-screen); }
.cy-grid line { stroke: var(--color-border-subtle); stroke-width: 1; }
.cy-grid line:first-of-type { stroke: var(--color-border-strong); stroke-width: 2; }
.cy-label text { fill: var(--color-text-tertiary); font-family: var(--font-ui); font-size: 15px; }
.cy-label text:nth-child(-n+2) { fill: var(--color-text-primary); font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.cy-call rect { fill: var(--color-signal-dry); }
.cy-ghost rect { fill: var(--color-signal-dry); opacity: 0.22; }
.cy-response rect { fill: var(--color-signal-wet); }
.cy-shift line, .cy-shift path { stroke: var(--color-text-tertiary); stroke-width: 2; fill: none; }
.cy-led { fill: var(--color-signal-led); }
.cycle-cap { display: none; margin-top: var(--space-3); color: var(--color-text-secondary); font-size: 15px; }
.cycle-cap b { color: var(--color-text-primary); font-weight: 600; }

.chain { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-6); padding: var(--space-3); }
.chain { background: var(--color-surface-sunken); border-radius: var(--radius-panel); box-shadow: var(--shadow-tray); }
.chain li { display: inline-flex; align-items: center; gap: var(--space-2); height: var(--size-control-sm); padding: 0 var(--space-3); border-radius: var(--radius-control); background: var(--color-surface-chip); box-shadow: inset 0 0 0 1px var(--color-border-subtle); color: var(--color-text-secondary); font-size: 15px; }
.chain li + li::before { content: "›"; margin: 0 var(--space-1) 0 calc(-1 * var(--space-4)); padding-right: var(--space-2); color: var(--color-text-tertiary); }
.chain li:first-child { background: var(--key-bg); color: var(--key-fg); font-weight: 600; box-shadow: var(--shadow-key); }

.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-10); margin-top: var(--space-14); }
.notes h3 { font-family: var(--font-display); font-size: var(--t-h3); line-height: 1.1; margin-bottom: var(--space-2); }
.notes p { color: var(--color-text-secondary); }

/* --------------------------------------------------------------- 4 · inside */
.device { margin: 0; padding: clamp(var(--space-2), 1.4vw, var(--space-5)); background: var(--color-surface-deep); border-radius: var(--radius-dialog); box-shadow: inset 0 0 0 1px var(--color-border-subtle), 0 30px 80px rgba(0, 0, 0, 0.45); }
.device img { width: 100%; height: auto; border-radius: var(--radius-panel); }
.specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-8) var(--space-6); margin-top: var(--space-14); }
.spec h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--t-h3); line-height: 1.1; margin-bottom: var(--space-2); }
.spec p { color: var(--color-text-secondary); }
.spec-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); align-items: baseline; gap: var(--space-6); padding-bottom: var(--space-6); box-shadow: inset 0 -1px 0 var(--color-border-subtle); }
.spec-wide p { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.chips { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); }
.chips span { display: inline-flex; align-items: center; height: var(--size-control-sm); min-width: 36px; justify-content: center; padding: 0 var(--space-2); border-radius: var(--radius-control); background: var(--color-surface-chip); box-shadow: inset 0 0 0 1px var(--color-border-subtle); color: var(--color-text-secondary); font-size: 15px; }
.chips span.on { background: var(--key-bg); color: var(--key-fg); font-weight: 600; box-shadow: var(--shadow-key); }

/* --------------------------------------------------------------- 5 · license: the plugin's license card, enlarged */
.license { padding-bottom: var(--section) !important; }
.license-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); background: var(--color-surface-raised); border-radius: var(--radius-dialog); box-shadow: inset 0 0 0 1px var(--color-border-strong); overflow: hidden; }
.price-col { display: flex; flex-direction: column; gap: var(--space-3); padding: clamp(var(--space-6), 3vw, var(--space-10)); background: var(--color-surface-base); box-shadow: inset -1px 0 0 var(--color-border-subtle); }
.price-col h2 { font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--color-text-tertiary); }
.price { font-family: var(--font-display); font-weight: 700; font-size: var(--t-price); line-height: 0.8; letter-spacing: -0.02em; margin: var(--space-4) 0 var(--space-2); }
.price-note { color: var(--color-text-secondary); margin-bottom: var(--space-4); }
.trial-line { margin-top: var(--space-4); font-size: 15px; color: var(--color-text-tertiary); }
.trial { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.trial .key { font-size: 14px; padding: 0 var(--space-3); }
.terms { display: flex; flex-direction: column; gap: var(--space-6); padding: clamp(var(--space-6), 3vw, var(--space-10)); }
.lic-grid { padding: 0 var(--space-4); border-radius: var(--radius-panel); background: var(--color-surface-sunken); box-shadow: inset 0 0 0 1px var(--color-surface-hover); }
.lic-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); min-height: 48px; }
.lic-row + .lic-row { box-shadow: inset 0 1px 0 var(--color-surface-chip); }
.lic-row span { color: var(--color-text-tertiary); font-size: 15px; }
.lic-row b { font-weight: 600; text-align: right; }
.fine { list-style: none; display: grid; gap: var(--space-3); }
.fine li { display: grid; grid-template-columns: var(--size-led) 1fr; gap: var(--space-3); align-items: baseline; color: var(--color-text-secondary); font-size: 15px; }

/* --------------------------------------------------------------- footer */
.foot { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-8); align-items: baseline; padding: var(--space-8) var(--gutter); background: var(--color-surface-deep); box-shadow: inset 0 1px 0 var(--color-border-subtle); color: var(--color-text-tertiary); font-size: 15px; }
.foot-sign { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--color-text-primary); grid-row: span 3; }
.foot-small { font-size: var(--t-label); }

/* --------------------------------------------------------------- narrower */
@media (max-width: 1080px) {
  main > section.hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: var(--space-10); padding-top: var(--space-10); }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes { gap: var(--space-6); }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .key-buy { margin-left: auto; }
  .section-head { grid-template-columns: 1fr; gap: var(--space-3); }
  .examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck { grid-template-columns: 1fr; }
  .controls { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; }
  .hint { grid-column: 1 / -1; margin-top: 0; }
  .notes { grid-template-columns: 1fr; }
  .license-card { grid-template-columns: 1fr; }
  .price-col { box-shadow: inset 0 -1px 0 var(--color-border-subtle); }
}
@media (max-width: 640px) {
  :root { --t-poster: clamp(58px, 22vw, 112px); }
  :root { --t-hero: clamp(48px, 15vw, 72px); }
  .hero-title { margin-top: var(--space-4); }
  .lede { margin-top: var(--space-6); }
  .hero-actions { margin-top: var(--space-6); }
  .hero-actions .key { flex: 1 1 100%; }
  .carry { flex-direction: column; align-items: stretch; }
  .controls { grid-template-columns: 1fr; }
  .specs { grid-template-columns: 1fr; }
  .spec-wide { grid-template-columns: 1fr; gap: var(--space-2); }
  .chain li { font-size: 14px; }
  .cy-label { display: none; }
  .cycle-cap { display: block; }
  .lic-row { flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--space-3) 0; }
  .lic-row b { text-align: left; }
  .foot { grid-template-columns: 1fr; }
  .foot-sign { grid-row: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------- 404 */
.lost { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }
.lost-screen { width: min(100%, 960px); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-6); padding: var(--space-5) var(--space-6) var(--space-8); }
.lost-screen .poster { margin-top: var(--space-14); }
.lost-note { color: var(--color-text-secondary); font-size: var(--t-lede); }
