/* SPDX-License-Identifier: GPL-3.0-only
 * The firmware's look: the ICE palette and its derived tokens (Felucca's palette, ux_mix: MID 70 %, DIM 42 %, SEL 80 %, RAISE 12 %),
 * Cascadia Mono, the knob cards with their 270-degree rings, the 16-trig strip, the page strip. */
@font-face {
  font-family: "Cascadia Mono";
  src: url("fonts/CascadiaMono.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
:root {
  --bg: #081018; --surf: #142434; --text: #e4f0f8; --theme: #50b8ec; --accent: #ff8c64;
  --mid: #a2adb5; --dim: #646e76; --sel: #4296c2; --raise: #2d3d4c; --rec: #ff4848; --line: #1f3245;
  --mono: "Cascadia Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --r: 4px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--mono); -webkit-font-smoothing: antialiased; }
::selection { background: var(--sel); color: var(--bg); }
:focus-visible { outline: 2px solid var(--theme); outline-offset: 2px; }
code { font: inherit; color: var(--theme); }
b { font-weight: 600; }
.dim { color: var(--dim); }

/* the header: the device's top row */
.head { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 16px; padding: 14px max(16px, calc(50vw - 440px));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; letter-spacing: .04em; color: var(--text); text-decoration: none; }
.flavor { color: var(--accent); font-weight: 600; }
.tag { margin-left: auto; color: var(--mid); font-size: 13px; letter-spacing: .06em; }
/* the site's navigation: the device's keys, the page you are on in the accent */
.nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { font-size: 12px; letter-spacing: .06em; padding: 5px 10px; border-radius: 3px; color: var(--mid); text-decoration: none; background: transparent; }
.nav a:hover { background: var(--raise); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--bg); font-weight: 600; }

main { max-width: 880px; margin: 0 auto; padding: 0 16px 48px; }

/* the splash */
.hero { text-align: center; padding: 48px 0 16px; }
.rings { display: flex; justify-content: center; gap: clamp(16px, 5vw, 40px); }
.hero .ring { width: clamp(52px, 12vw, 76px); }
.title { margin: 26px 0 0; font-size: clamp(34px, 8vw, 54px); font-weight: 600; letter-spacing: .02em; line-height: 1; }
.ver { margin: 0 0 14px; color: var(--mid); font-size: 13px; letter-spacing: .06em; }
.motto { margin: 14px 0 6px; color: var(--theme); font-size: clamp(16px, 3.4vw, 22px); font-weight: 600; letter-spacing: .08em; }
.lead { max-width: 560px; margin: 0 auto; color: var(--mid); font-size: 14px; }

/* a ring: 270 degrees from 7:30 o'clock, the value arc in the theme (hot: the accent) */
.ring { display: block; overflow: visible; }
.ring circle { fill: none; stroke-width: 3; stroke-linecap: round; transform: rotate(135deg); transform-origin: 50% 50%;
  stroke-dasharray: calc(var(--len, 1) * 80.1) 106.8; }
.ring .trk { stroke: var(--raise); --len: 1; }
.ring .val { stroke: var(--theme); --len: var(--r, 0); transition: stroke-dasharray .12s linear, stroke .15s; }
.ring.hot .val { stroke: var(--accent); }
.hero .ring .val { animation: sweep 1.1s cubic-bezier(.3, .7, .3, 1) both; }
.hero .ring:nth-child(2) .val { animation-delay: .12s; }
.hero .ring:nth-child(3) .val { animation-delay: .24s; }
.hero .ring:nth-child(4) .val { animation-delay: .36s; }
@keyframes sweep { from { stroke-dasharray: 0 106.8; } }

/* the page strip: the device's eight boxes, three of them here */
.pages { display: flex; gap: 8px; margin: 28px 0 8px; }
.page { flex: 1; text-decoration: none; color: var(--dim); font-size: 12px; letter-spacing: .06em; }
.page b { display: block; height: 14px; border-radius: 2px; background: var(--raise); margin-bottom: 6px; transition: background .2s; }
.page.done b { background: var(--sel); }
.page.on b { background: var(--accent); }
.page.on, .page.done { color: var(--mid); }

/* steps */
.step { margin-top: 36px; }
.step[hidden], .install[hidden] { display: none; }
h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; letter-spacing: .08em; color: var(--text); }
h2 .num { display: inline-block; min-width: 2.6em; padding: 1px 6px; margin-right: 6px; border-radius: 3px; background: var(--raise);
  color: var(--theme); text-align: center; }
h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--mid); }
.msg { min-height: 1.4em; margin: 10px 0 0; color: var(--mid); font-size: 14px; }
.msg.err { color: var(--rec); }
.note { color: var(--mid); font-size: 13px; max-width: 640px; }

/* drop zones: a card waiting */
.drop { position: relative; display: grid; place-items: center; gap: 4px; padding: 34px 16px; border-radius: var(--r);
  background: var(--surf); border: 1px dashed var(--raise); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--theme); background: color-mix(in srgb, var(--surf) 85%, var(--theme)); }
.drop.small { padding: 18px 16px; margin-top: 16px; }
.drop-t { font-weight: 600; letter-spacing: .06em; }
.drop-s { color: var(--mid); font-size: 13px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* the budget: the 16 trigs, each a sixteenth of the ROM */
.meter { margin-bottom: 4px; }
.trigs { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; }
.trigs i { height: 30px; border-radius: 2px; background: var(--raise); position: relative; overflow: hidden; }
.trigs i:nth-child(4n + 1) { margin-left: 3px; }
.trigs i:first-child { margin-left: 0; }
.trigs i > s { position: absolute; inset: 0 auto 0 0; background: var(--sel); text-decoration: none; }
.trigs i.full { background: var(--sel); }
.trigs i.beat.full { background: var(--theme); }
.over .trigs i.full, .over .trigs i > s { background: var(--rec); }
.meter-t { margin: 8px 0 0; color: var(--mid); font-size: 13px; letter-spacing: .02em; }
.over .meter-t { color: var(--rec); }

/* cards: a knob card per sample (label, ring, value) */
.cards { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.card { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 6px 10px; border-radius: var(--r); background: var(--surf);
  cursor: pointer; user-select: none; transition: background .15s; }
.card:hover { background: color-mix(in srgb, var(--surf) 88%, var(--text)); }
.card .lbl { font-size: 12px; letter-spacing: .04em; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.card .ring { width: 46px; margin: 4px 0 2px; }
.card .v { font-size: 22px; font-weight: 600; color: var(--theme); line-height: 1.1; }
.card .v small { font-size: 11px; color: var(--mid); font-weight: 400; margin-left: 2px; }
.card .sub { font-size: 11px; color: var(--dim); letter-spacing: .04em; }
.card.hot .lbl, .card.hot .v { color: var(--accent); }
.card:focus-visible { outline-offset: 0; }

/* the user's samples: a wide card with the controls */
.cards.wide { grid-template-columns: 1fr; }
.ucard { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--surf);
  border-left: 3px solid var(--accent); }
.ucard .card { background: transparent; padding: 0; }
.ucard .card:hover { background: transparent; }
.ucard .ed { display: grid; gap: 10px; min-width: 0; }
.ucard canvas { width: 100%; height: 56px; display: block; border-radius: 2px; background: var(--bg); color: var(--theme); }
.fields { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: end; }
.f { display: grid; gap: 2px; font-size: 11px; letter-spacing: .06em; color: var(--mid); }
.f input { width: 7.2em; padding: 5px 7px; border: 1px solid var(--raise); border-radius: 3px; background: var(--bg); color: var(--text); font: 14px var(--mono); }
.f input.name { width: 10ch; text-transform: uppercase; color: var(--theme); font-weight: 600; }
.f input:focus { border-color: var(--theme); outline: none; }
.f.chk { grid-auto-flow: column; align-items: center; gap: 6px; padding-bottom: 6px; font-size: 12px; cursor: pointer; }
.f.chk input { width: auto; accent-color: var(--theme); }
.tools { display: flex; gap: 6px; margin-left: auto; }
.err { color: var(--rec); font-size: 12px; }

/* keys: the device's buttons */
.key { font: 600 13px var(--mono); letter-spacing: .06em; padding: 10px 16px; border: 0; border-radius: 3px; background: var(--raise); color: var(--text);
  cursor: pointer; transition: filter .15s, transform .05s; }
.key:hover:not(:disabled) { filter: brightness(1.2); }
.key:active:not(:disabled) { transform: translateY(1px); }
.key:disabled { opacity: .35; cursor: default; }
.key.hot { background: var(--accent); color: var(--bg); }
.key.mini { padding: 4px 9px; font-size: 12px; }
.row-h { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; }
.keys { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* the install: the trigs run, the playhead in the accent */
.install { margin-top: 16px; }
.trigs.run i.lit { background: var(--sel); }
.trigs.run i.ph { background: var(--accent); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 12px 0 0; }
.chips li { font-size: 11px; letter-spacing: .06em; padding: 3px 8px; border-radius: 3px; background: var(--raise); color: var(--dim); }
.chips li.past { color: var(--mid); }
.chips li.on { background: var(--accent); color: var(--bg); }

footer { max-width: 880px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
footer code { color: var(--mid); }

@media (max-width: 560px) {
  .ucard { grid-template-columns: 1fr; }
  .ucard .card { grid-auto-flow: column; justify-content: start; gap: 12px; }
  .tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hero .ring .val { animation: none; } .ring .val { transition: none; } }

/* ------------------------------------------------------------ the site: home and manual */
a { color: var(--theme); }
a:hover { color: var(--text); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 56px; }
.eyebrow { font-size: 12px; letter-spacing: .1em; color: var(--accent); font-weight: 600; margin: 0 0 6px; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
a.key { display: inline-block; text-decoration: none; }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid3 { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.panel { background: var(--surf); border-radius: var(--r); padding: 18px 18px 16px; }
.panel h3 { margin: 0 0 8px; color: var(--text); font-size: 15px; }
.panel p, .panel li { color: var(--mid); font-size: 14px; }
.panel ul { margin: 8px 0 0; padding-left: 18px; }
.flav { border-top: 3px solid var(--theme); }
.flav.pcm { border-top-color: var(--accent); }
.flav .big { font-size: 26px; font-weight: 600; letter-spacing: .02em; color: var(--text); margin: 0; }
.flav .motto2 { color: var(--theme); font-size: 13px; letter-spacing: .08em; margin: 2px 0 10px; font-weight: 600; }
.flav.pcm .motto2 { color: var(--accent); }
.section { margin-top: 56px; }
.section > h2 { font-size: 13px; letter-spacing: .1em; color: var(--mid); margin-bottom: 16px; }
.feat h3 { display: flex; align-items: center; gap: 10px; }
.feat .ring { width: 26px; flex: none; }

/* the manual: a contents column and the text */
.doc { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; font-size: 13px; padding-right: 6px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc ol ol { padding-left: 12px; margin: 2px 0 8px; }
.toc a { display: block; padding: 3px 0; color: var(--mid); text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--accent); }
.toc .h { color: var(--dim); font-size: 11px; letter-spacing: .1em; margin: 14px 0 4px; }
.prose { max-width: 760px; }
.prose h2 { font-size: 22px; letter-spacing: .02em; margin: 56px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.prose h2:first-child { margin-top: 8px; border-top: 0; }
.prose h3 { font-size: 16px; letter-spacing: .02em; color: var(--text); margin: 32px 0 8px; scroll-margin-top: 70px; }
.prose h4 { font-size: 14px; color: var(--theme); margin: 22px 0 6px; letter-spacing: .04em; }
.prose p, .prose li { color: #c9d6de; font-size: 14.5px; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin: 3px 0; }
.prose strong { color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 13.5px; }
.prose th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .08em; color: var(--mid); padding: 7px 10px; border-bottom: 1px solid var(--raise); }
.prose td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: #c9d6de; }
.prose tr:hover td { background: color-mix(in srgb, var(--surf) 60%, transparent); }
.prose .tw { overflow-x: auto; }
kbd { font: 600 12px var(--mono); padding: 1px 6px; border-radius: 3px; background: var(--raise); color: var(--text); border-bottom: 2px solid #1a2836; white-space: nowrap; }
kbd.b { background: #22313f; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; padding: 1px 6px; border-radius: 3px; vertical-align: 1px; }
.badge.fm { background: color-mix(in srgb, var(--theme) 22%, transparent); color: var(--theme); }
.badge.pcm { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.badge.both { background: var(--raise); color: var(--mid); }
.callout { border-left: 3px solid var(--theme); background: var(--surf); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; margin: 14px 0; }
.callout.warn { border-left-color: var(--accent); }
.callout.bad { border-left-color: var(--rec); }
.callout p { margin: 4px 0; }
.screen { width: 240px; max-width: 100%; image-rendering: pixelated; border-radius: 6px; border: 1px solid var(--raise); }
figure { margin: 16px 0; }
figcaption { color: var(--dim); font-size: 12px; margin-top: 6px; }

@media (max-width: 860px) {
  .doc { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 12px; columns: 2 200px; column-gap: 24px; }
  .toc ol ol { display: none; }   /* only the chapters here; the sections are a click away */
  .toc .h { break-after: avoid; }
}
@media (max-width: 560px) { .nav a { padding: 4px 7px; font-size: 11px; } }
