/* Orbital UI, dressed like the rest of the Aural Alchemy tools (the Sampler's tokens and type: Cinzel titles, Jost
   text, Share Tech Mono labels; the site bar on top; the discreet "How it works" pill; tips on every control).
   Motion 150 to 250 ms, transform and opacity only (PRO EYES A). */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Jost:wght@300;400;500&family=Share+Tech+Mono&display=swap');
:root {
  --bg: #080e10; --panel: rgba(13, 22, 24, .64); --line: rgba(212, 168, 67, .18); --line2: rgba(212, 168, 67, .32);
  --fg: #e9e2d0; --mut: #8f9b94; --gold: #d4a843; --gold2: #f2cf63; --teal: #2dd4bf; --title: #f4ecd9;
  --mono: 'Share Tech Mono', ui-monospace, monospace;
  --glass: rgba(10, 16, 18, .72); --nav-h: 64px; --r: 16px;
}
body.in-suite { --nav-h: 0px; }
body.in-suite #site-nav, body.in-suite nav.aa-site-nav { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden;
  font: 300 15px/1.5 'Jost', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
#stage { position: fixed; left: 0; top: var(--nav-h); width: 100vw; height: calc(100dvh - var(--nav-h)); display: block; touch-action: none; }
body nav.aa-site-nav { z-index: 30; }

/* first run */
.begin { position: fixed; left: 50%; bottom: 22vh; transform: translateX(-50%); text-align: center; cursor: pointer; z-index: 5;
  padding: 14px 28px; border-radius: 999px; background: rgba(8, 14, 16, .45); border: 1px solid var(--line2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: opacity .25s ease-in, transform .25s ease-in; }
.begin span { display: block; font: 500 1.05rem 'Cinzel', serif; letter-spacing: .12em; color: var(--title); }
.begin small { font-family: var(--mono); color: var(--teal); letter-spacing: .3em; text-transform: uppercase; font-size: .62rem; }
.begin.gone { opacity: 0; transform: translateX(-50%) scale(.96); pointer-events: none; }

/* top bar: the tool's own header, the modes, Sound and Export, under the site bar */
.top { position: fixed; top: var(--nav-h); left: 0; right: 0; display: flex; align-items: center; gap: 14px; z-index: 4;
  padding: 14px 20px 10px; transition: opacity .25s ease-in; }
.brand { min-width: 0; }
.kick { display: block; font-family: var(--mono); font-size: .6rem; letter-spacing: .32em; text-transform: uppercase; color: var(--teal); }
.brand h1 { margin: 2px 0 0; font-family: 'Cinzel', serif; font-weight: 500; font-size: 1.6rem; letter-spacing: .16em; text-transform: uppercase; line-height: 1.1;
  background: linear-gradient(118deg, #b9eadf 0%, #f4ecd9 40%, #f2cf63 75%, #d4a843 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .value { margin: 2px 0 0; font: 500 .92rem/1.3 'Cinzel', serif; letter-spacing: .05em; color: var(--title); opacity: .85; }
.modes { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.modes::-webkit-scrollbar { display: none; }
.modes button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; color: var(--mut); cursor: pointer;
  white-space: nowrap; font-weight: 400; letter-spacing: .02em; transition: background .2s ease-out, color .2s ease-out; }
.modes button[aria-pressed="true"] { background: rgba(212, 168, 67, .16); color: var(--gold2); }
.top-actions { display: flex; gap: 8px; }
body.idle .top { opacity: 0; pointer-events: none; }
body.idle .dock { opacity: .35; }

/* chips and buttons */
.chip { border: 1px solid var(--line); background: var(--glass); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 400;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); white-space: nowrap; transition: border-color .2s ease-out, transform .15s ease-out; }
.chip:hover { border-color: var(--line2); }
.chip:active, .btn:active, .play:active { transform: scale(.97); }
.chip.gold { color: var(--gold2); border-color: var(--line2); }
a.chip { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
#playLink { color: var(--teal); border-color: rgba(45, 212, 191, .35); }
.chip.toggle[aria-pressed="true"] { color: var(--gold2); border-color: var(--gold); background: rgba(212, 168, 67, .14); }
.btn { border: 1px solid var(--line2); background: rgba(255, 255, 255, .03); border-radius: 12px; padding: 10px 16px; cursor: pointer; font-weight: 400; }
.btn.gold { background: linear-gradient(180deg, rgba(242, 207, 99, .22), rgba(212, 168, 67, .10)); color: var(--gold2); border-color: var(--gold); }
.btn:disabled { opacity: .45; cursor: default; }

/* dock */
.dock { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 999px; background: var(--glass);
  border: 1px solid var(--line); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); transition: opacity .25s ease-in;
  max-width: calc(100vw - 24px); }
.play { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1px solid var(--gold); cursor: pointer; color: var(--gold2);
  background: radial-gradient(circle at 50% 40%, rgba(242, 207, 99, .25), rgba(212, 168, 67, .06)); display: grid; place-items: center; transition: transform .15s ease-out; }
.play svg { width: 18px; height: 18px; fill: currentColor; }
.cycle { display: flex; align-items: center; gap: 6px; color: var(--mut); white-space: nowrap; font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; }
.step { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--gold2); }
.swatches { display: flex; gap: 6px; padding: 0 2px; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line2); cursor: pointer; padding: 0; transition: transform .15s ease-out; }
.swatches button[data-pal="gold"] { background: radial-gradient(circle at 35% 35%, #f2cf63, #8a6a2f); }
.swatches button[data-pal="prism"] { background: conic-gradient(#ff8a80, #ffd54f, #81c784, #4fc3f7, #b39ddb, #ff8a80); }
.swatches button[data-pal="aurora"] { background: linear-gradient(135deg, #eed180, #2dd4bf, #6f7bff); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--gold2); }
#evolveBtn .n { font-family: var(--mono); font-size: .72rem; color: var(--teal); margin-left: 6px; }

/* countdown, hint, toast */
.countdown { position: fixed; top: calc(var(--nav-h) + 92px); left: 50%; transform: translateX(-50%); z-index: 3;
  color: var(--mut); font-family: var(--mono); font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; transition: opacity .3s ease-out; pointer-events: none; }
.hint { position: fixed; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 76px); transform: translateX(-50%); z-index: 3;
  color: var(--gold2); font-size: .85rem; letter-spacing: .03em; opacity: 0; transition: opacity .4s ease-out; pointer-events: none; text-align: center; }
.hint.on { opacity: .9; }
#toast { position: fixed; left: 50%; top: calc(var(--nav-h) + 118px); transform: translateX(-50%); z-index: 6; padding: 8px 14px; border-radius: 999px;
  background: rgba(7, 12, 13, .9); border: 1px solid var(--line2); color: var(--title); font-size: .85rem; opacity: 0; transition: opacity .3s ease-out; pointer-events: none; white-space: nowrap; }
#toast.on { opacity: 1; }
.ring-label { position: fixed; z-index: 6; pointer-events: none; color: var(--title); font-size: .78rem; line-height: 1.35;
  padding: 6px 10px; border-radius: 10px; background: rgba(7, 12, 13, .92); border: 1px solid var(--line2); transform: translate(14px, -50%); white-space: nowrap; }
.ring-label b { color: var(--gold2); font-weight: 500; }
.ring-label span { color: var(--mut); }

/* tips (hover, focus, long press) and the guide: the house pattern of the Sampler */
#tip { position: fixed; z-index: 60; max-width: 280px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line2);
  background: rgba(6, 11, 12, .96); color: var(--fg); font: 400 .8rem/1.45 'Jost', sans-serif; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .9); pointer-events: none; }
.aa-guia { position: fixed; left: 14px; bottom: 14px; z-index: 40; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 9px; border-radius: 999px;
  border: 1px solid rgba(201, 168, 106, .35); background: rgba(10, 8, 6, .55); color: #cbb88f; font: 400 12px/1 'Jost', sans-serif; letter-spacing: .04em;
  opacity: .6; cursor: pointer; transition: opacity .2s, border-color .2s, color .2s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.aa-guia:hover, .aa-guia:focus-visible { color: #f2e8d5; border-color: #c9a86a; opacity: 1; outline: none; background: rgba(10, 8, 6, .7); }
body:has(.sheet:not([hidden])) .aa-guia { display: none; }   /* an open panel is never covered by the guide pill */
.guide { position: fixed; left: 14px; bottom: 52px; z-index: 41; width: min(360px, calc(100vw - 28px)); padding: 14px 16px 12px; border: 1px solid var(--line2);
  border-radius: 14px; background: rgba(7, 12, 13, .97); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9); font-size: .84rem; line-height: 1.45; }
.guide .gh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.guide .gh b { font: 500 .95rem 'Cinzel', serif; letter-spacing: .06em; color: var(--title); }
.guide ol { margin: 4px 0 10px; padding-left: 18px; }
.guide li { margin: 5px 0; }
.guide li b { color: var(--gold2); font-weight: 500; }
.glabel { display: flex; align-items: center; gap: 8px; color: var(--teal); font-size: .82rem; cursor: pointer; }
.glabel input { accent-color: var(--gold); }

/* sheets: right on desktop, bottom on phones */
.sheet { position: fixed; z-index: 7; top: calc(var(--nav-h) + 12px); right: 12px; bottom: 12px; width: min(380px, calc(100vw - 24px)); overflow-y: auto;
  background: rgba(7, 12, 13, .94); border: 1px solid var(--line2); border-radius: var(--r); padding: 16px 18px 22px;
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); animation: sheetIn .22s ease-out;
  scrollbar-width: thin; scrollbar-color: rgba(212, 168, 67, .4) transparent; }
.sheet.wide { width: min(620px, calc(100vw - 24px)); }
.sheet::-webkit-scrollbar { width: 6px; } .sheet::-webkit-scrollbar-thumb { background: rgba(212, 168, 67, .4); border-radius: 3px; } .sheet::-webkit-scrollbar-button { display: none; }
@keyframes sheetIn { from { opacity: 0; transform: translateX(12px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet h2 { margin: 0; font: 500 1.1rem 'Cinzel', serif; letter-spacing: .08em; color: var(--title); }
.x { border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--mut); cursor: pointer; width: 36px; height: 36px; }
.row { display: flex; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.row > label { width: 84px; color: var(--mut); font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; }
.row input[type=range] { flex: 1; accent-color: var(--gold); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--mut); }
.seg button[aria-pressed="true"] { color: var(--gold2); border-color: var(--gold); background: rgba(212, 168, 67, .12); }
.dim { color: var(--mut); } .small { font-size: .78rem; }
.sound-list h3 { margin: 16px 0 6px; font-family: var(--mono); font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--teal); font-weight: 400; }
.sound-list .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.sound-list button { text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); border-radius: 10px;
  padding: 9px 10px; cursor: pointer; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-list button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold2); background: rgba(212, 168, 67, .12); }
.sound-list button.locked { color: var(--mut); }
.sound-list .unlock { display: block; margin: 14px 0 0; color: var(--teal); font-size: .85rem; text-decoration: none; }
.keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.keys button, .scales button { border: 1px solid var(--line); background: transparent; border-radius: 10px; padding: 9px 0; cursor: pointer; color: var(--mut); }
.keys button[aria-pressed="true"], .scales button[aria-pressed="true"] { color: var(--gold2); border-color: var(--gold); background: rgba(212, 168, 67, .12); }
.scales { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 12px; }
.scales button { padding: 9px 10px; text-align: left; }
.adv h3 { margin: 16px 0 6px; font-family: var(--mono); font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--teal); font-weight: 400; }
.arow { display: grid; grid-template-columns: 110px 1fr 74px; align-items: center; gap: 10px; margin: 7px 0; }
.arow.wide { grid-template-columns: 110px 1fr; }
.arow.btns { grid-template-columns: repeat(3, auto); justify-content: start; margin-top: 16px; }
.arow label { color: var(--mut); font-size: .82rem; }
.arow input[type=range] { width: 100%; accent-color: var(--gold); }
.arow span { font-family: var(--mono); font-size: .72rem; color: var(--mut); text-align: right; }
.arow span.own { color: var(--gold2); }
#evolveBtn.pulse { border-color: var(--teal); box-shadow: 0 0 0 0 rgba(45, 212, 191, .5); animation: evoPulse 1.2s ease-out 2; }
@keyframes evoPulse { from { box-shadow: 0 0 0 0 rgba(45, 212, 191, .55); } to { box-shadow: 0 0 0 12px rgba(45, 212, 191, 0); } }
@media (max-width: 640px) { .arow { grid-template-columns: 92px 1fr 64px; } .arow.btns { grid-template-columns: 1fr; } }
.looks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.look { border: 1px solid var(--line); background: transparent; border-radius: 12px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.look canvas { width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; background: #000; }
.look b { font-weight: 500; color: var(--title); font-size: .88rem; }
.look span { font-size: .72rem; color: var(--mut); line-height: 1.35; }
.look[aria-pressed="true"] { border-color: var(--gold); background: rgba(212, 168, 67, .08); }
.look[aria-pressed="true"] b { color: var(--gold2); }
.look:disabled { opacity: .45; cursor: default; }
.previews { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.pv { border: 1px solid var(--line); background: transparent; border-radius: 12px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pv canvas { display: block; border-radius: 6px; background: #000; }
.pv span { font-size: .72rem; color: var(--mut); }
.pv[aria-pressed="true"] { border-color: var(--gold); background: rgba(212, 168, 67, .08); }
.pv[aria-pressed="true"] span { color: var(--gold2); }
.files { gap: 8px; }
.progress { margin-top: 10px; }
.ptxt { font-size: .85rem; color: var(--fg); font-variant-numeric: tabular-nums; }
.track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 8px 0 10px; }
.fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); transition: width .15s linear; }

@media (max-width: 1100px) { .brand .value { display: none; } }
@media (max-width: 640px) {
  .sheet, .sheet.wide { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 78dvh; }
  @keyframes sheetIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  /* phones: title and Sound/Export on one row, the five modes on their own full-width row */
  .top { flex-wrap: wrap; padding: 10px 10px 6px; gap: 8px; }
  .brand { order: 0; display: flex; align-items: baseline; gap: 8px; }
  .kick { display: none; }
  .brand h1 { font-size: 1.15rem; margin: 0; }
  .top-actions { order: 1; margin-left: auto; }
  .top-actions .chip { padding: 6px 12px; font-size: .82rem; }
  .modes { order: 2; width: 100%; margin: 0; justify-content: space-between; }
  .modes button { padding: 7px 8px; font-size: .78rem; }
  .countdown { top: calc(var(--nav-h) + 106px); }
  #toast { top: calc(var(--nav-h) + 128px); }
  .dock { flex-wrap: wrap; justify-content: center; border-radius: 22px; width: calc(100vw - 24px); gap: 8px; }
  .dock .chip { padding: 7px 11px; font-size: .82rem; }
  .hint { bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--dock-h, 104px) + 52px); }
  .cycle .lu { display: none; }
  .aa-guia { bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--dock-h, 104px) + 10px); }
  .aa-guia span { display: none; }
  .guide { bottom: 8px; left: 8px; width: calc(100vw - 16px); max-height: 46dvh; overflow-y: auto; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: 1ms !important; animation-duration: 1ms !important; } }
