:root {
  color-scheme: dark;
  --background: #17131e;
  --surface: #211d2a;
  --text: #eee9f5;
  --muted: #b4aabd;
  --border: #41364d;
  --accent: #f18ade;
  --mint: #89dac6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .23em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
.page { max-width: 1168px; margin: 0 auto; padding: 0 36px; }
.site-header, .site-header nav, footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header { padding: 30px 0; border-bottom: 1px solid var(--border); }
.site-header nav { font-size: 14px; color: var(--muted); }
.site-header a { text-decoration: none; }
.wordmark { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 29px; font-weight: 750; letter-spacing: -2px; color: var(--accent); }
.wordmark span { color: var(--mint); }
.intro { padding: 64px 0 42px; }
.eyebrow { font: 12px/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--mint); letter-spacing: .06em; }
h1 { margin: 18px 0 22px; font-size: clamp(38px, 5.8vw, 68px); line-height: 1.08; font-weight: 650; letter-spacing: -.045em; }
h1 span { color: var(--accent); }
.lede { max-width: 600px; font-size: 19px; line-height: 1.6; color: var(--muted); }
.lede em { color: var(--text); }
.definition { margin-top: 28px; font: 12px/1.8 ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--muted); }
.definition strong { color: var(--accent); }
.definition span { margin: 0 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.demo-navigation { margin-bottom: 20px; }
.demo-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.gallery-theme-controls { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 13px; color: var(--muted); }
.gallery-theme-controls select { border: 1px solid var(--border); border-radius: 6px; padding: 9px 30px 9px 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.category-description { margin: 18px 0 0; max-width: 760px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.demo-categories { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 9px; }
.demo-categories a { padding: 9px 14px; border-radius: 5px; color: var(--muted); font-size: 13px; line-height: 1.4; text-decoration: none; }
.demo-categories a[aria-current] { color: var(--text); background: #302239; }
.demo-options { position: relative; display: flex; gap: 22px; padding: 12px 4px 4px; margin-top: 6px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.demo-options a { flex-shrink: 0; padding: 12px 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; line-height: 1.4; text-decoration: none; white-space: nowrap; }
.demo-options a[aria-current] { border-bottom-color: var(--accent); color: var(--text); }
.demo-navigation a:hover { color: var(--text); }
.demo-navigation a:focus-visible { outline-offset: 2px; }
.recording-label { flex-basis: 100%; color: var(--muted); font: 11px/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.recording-label span { color: var(--mint); padding-right: 7px; }
.recording { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; margin-bottom: 16px; scroll-margin-top: 16px; }
.recording-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 22px 0; }
.recording-heading h3 { margin: 0; font: 500 20px/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.recording-summary { margin: 8px 22px 20px; max-width: 790px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.recording-kind { flex-shrink: 0; font: 11px/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--mint); }
.theme-preview-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 22px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.show-theme-preview, .play-recording { border: 1px solid var(--border); border-radius: 5px; padding: 7px 10px; background: var(--background); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.show-theme-preview:hover { border-color: var(--accent); }
.preview-status { flex: 1 1 260px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.recording-image { display: block; width: 100%; height: auto; }
.play-recording { border-color: var(--accent); }
.play-recording span { color: var(--accent); padding-right: 7px; }
.play-recording:hover { background: #38263f; }
.player { min-width: 0; }
.player .ap-wrapper { background: var(--surface); }
.player .ap-player { --term-color-background: #211d2a; --term-color-foreground: #eee9f5; }
#feedback .ap-player { --term-color-background: #f7f5fa; --term-color-foreground: #32283d; }
.recording-caption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 12px 24px; padding: 18px 22px; border-top: 1px solid var(--border); }
.recording-caption p { flex: 1 1 320px; }
.recording-caption p { max-width: 610px; margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.download { white-space: nowrap; font-size: 12px; line-height: 1.8; }
.recording-details { padding: 0 22px 20px; }
.recording-ingredients { display: grid; gap: 8px; margin: 0 0 16px; font-size: 13px; line-height: 1.7; }
.recording-ingredients div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
.recording-ingredients dt { color: var(--text); font-weight: 550; }
.recording-ingredients dd { margin: 0; color: var(--muted); }
.recording-ingredients code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.example-source { font-size: 13px; }
.playback-note, .player-message { color: var(--muted); font-size: 12px; line-height: 1.7; }
.player-message { padding: 0 22px; }
.recording-run, .api-example { margin: 0 22px 24px; min-width: 0; }
.api-example h4 { font-size: 13px; font-weight: 550; margin: 0 0 10px; }
.api-example p, .recording-run > p { color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.api-example pre { margin: 0; padding: 18px; border: 1px solid var(--border); border-radius: 6px; background: var(--background); color: var(--mint); font-size: 13px; line-height: 1.8; overflow-x: auto; }
.api-example code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.component-options, .supporting-apis, .related-entries, .style-coverage { margin: 0 22px 20px; padding-left: 14px; border-left: 2px solid var(--border); color: var(--muted); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.component-options strong, .supporting-apis strong, .related-entries strong { color: var(--text); font-weight: 550; }
.api-doc-link { color: var(--muted); font-size: 12px; }
.run-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 18px; margin-bottom: 10px; }
.run-heading h4 { margin: 0; font-size: 13px; font-weight: 550; }
.run-heading a { font-size: 12px; color: var(--muted); }
.recording-run pre { margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--background); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.recording-run code, .run-note kbd { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.run-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.run-note kbd { color: var(--text); }
.setup-note { margin: 28px 0; }
.setup-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.project-note { padding: 22px 0; border-top: 1px solid var(--border); }
.project-note p { max-width: 830px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.project-note strong { color: var(--text); font-weight: 550; }
footer { border-top: 1px solid var(--border); padding: 24px 0 30px; color: var(--muted); font: 11px/1.8 ui-monospace, "SFMono-Regular", Consolas, monospace; }
footer span span { padding: 0 8px; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 10; padding: 12px; background: var(--surface); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

@media (max-width: 700px) {
  .page { padding: 0 18px; }
  .site-header { padding: 22px 0; }
  .site-header nav { font-size: 12px; gap: 18px; }
  .intro { padding: 38px 0 28px; }
  .lede { font-size: 17px; }
  .demo-navigation { margin-bottom: 14px; }
  .demo-toolbar { gap: 14px; }
  .demo-categories { flex: 1 1 100%; justify-content: space-between; }
  .demo-categories a { text-align: center; flex: 1; padding: 9px 10px; }
  .gallery-theme-controls { margin-left: 0; }
  .category-description { margin-top: 14px; font-size: 13px; }
  .demo-options { gap: 20px; }
  .recording-label { display: none; }
  .recording-heading { padding: 16px 14px 0; flex-wrap: wrap; gap: 8px; }
  .recording-heading h3 { font-size: 18px; }
  .recording-summary { margin: 8px 14px 16px; }
  .theme-preview-controls { padding: 12px 14px; gap: 8px; }
  .recording-caption { padding: 14px; flex-direction: column; gap: 12px; }
  .recording-caption p { flex-basis: auto; }
  .recording-details { padding: 0 14px 16px; }
  .recording-ingredients div { grid-template-columns: 1fr; gap: 0; }
  .recording-run, .api-example { margin: 0 14px 20px; }
  .component-options, .supporting-apis, .related-entries, .style-coverage { margin: 0 14px 20px; }
  .recording-run pre { padding: 12px; }
  footer { align-items: start; flex-direction: column; gap: 6px; }
}
