/* downloads.midicake.com
 *
 * One stylesheet for the product index and every product page. Dark, because every other
 * Midicake surface is - the demo, Connect and the device itself.
 *
 * The --brand-* values are Connect's tokens verbatim (midicake-connect
 * src/styles/02-tokens.css), which is the web-side source of truth, and are the same four
 * the web demo carries in una-web/ui/src/styles.css. They are the UNA track colours:
 * melody magenta, chord green, bass orange, mod/control cyan.
 *
 * Note --brand-orange is the BRAND orange. The device's LCD orange is #ffa600 and its
 * button LED orange is #ff8a00; three oranges, all deliberate, none to be conformed to
 * the others.
 */

:root {
  color-scheme: dark;

  --brand-magenta: #ff00ff;
  --brand-orange: #ff8e00;
  --brand-green: #00ff00;
  --brand-cyan: #00ffff;

  --bg: #0d0d0f;
  --plate: #121215;
  --plate-2: #17171b;
  --line: #2a2a30;
  --text: #ddd;
  --muted: #8a8a92;

  --measure: 46rem;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

code,
kbd,
pre,
.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

a {
  color: var(--brand-cyan);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand-green);
}

:focus-visible {
  outline: 2px solid var(--brand-magenta);
  outline-offset: 2px;
  border-radius: 3px;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

.masthead {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
}

.masthead .wrap {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
}

.masthead .sep {
  color: var(--line);
}

.masthead .section {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.hero {
  padding: 3rem 0 2rem;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-orange);
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(2.1rem, 6vw, 3rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.25rem;
  margin: 2.75rem 0 0.75rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1rem;
  margin: 1.75rem 0 0.5rem;
}

.headline {
  font-size: 1.15rem;
  color: var(--text);
  margin: 0 0 1rem;
}

.releaseMeta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.75rem;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid currentColor;
  vertical-align: 0.1em;
}

.tag.beta {
  color: var(--brand-magenta);
}

/* --- the download button -------------------------------------------------------------- */

.downloadRow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1.25rem 0 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--brand-orange);
  color: #000;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  border: 0;
  cursor: pointer;
  /* 44px minimum touch target, the same floor the demo's chrome uses. */
  min-height: 44px;
}

.btn:hover {
  background: #ffa53a;
  color: #000;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 500;
}

.btn.secondary:hover {
  background: var(--plate-2);
  color: var(--text);
  border-color: var(--muted);
}

.fileFacts {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
}

.fileFacts .hash {
  word-break: break-all;
}

/* --- callout boxes -------------------------------------------------------------------- */

.callout {
  background: var(--plate);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-magenta);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 2rem 0;
}

.callout h3 {
  margin-top: 0;
  color: var(--brand-magenta);
}

.callout ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.callout li + li {
  margin-top: 0.35rem;
}

.callout.quiet {
  border-left-color: var(--line);
}

.callout.quiet h3 {
  color: var(--text);
}

/* --- release notes -------------------------------------------------------------------- */

.notes {
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
}

/* Every heading level inside the notes gets the same treatment. The renderer demotes a
   note's headings by two levels so they cannot outrank the page's own <h2>, which means
   the "### New" the notes are actually written with arrives as an h5 - and an unstyled h5
   is SMALLER than the body text beneath it, so the section labels read as an afterthought.
   The depth is right for the document outline; the size should not follow it. */
.notes h3,
.notes h4,
.notes h5,
.notes h6 {
  color: var(--brand-green);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin: 1.75rem 0 0.4rem;
}

.notes > :first-child {
  margin-top: 0;
}

.notes ul {
  padding-left: 1.2rem;
}

.notes li {
  margin: 0.35rem 0;
}

.notes strong {
  color: #fff;
}

.notes code {
  background: var(--plate-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.88em;
}

/* --- steps ---------------------------------------------------------------------------- */

ol.steps {
  padding-left: 1.3rem;
}

ol.steps li {
  margin: 0.6rem 0;
}

/* --- the archive table ---------------------------------------------------------------- */

.tableWrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--plate);
}

/* The one column allowed to wrap. Two filenames of this length will not fit beside the
   other three columns on a phone, and a nowrap here pushed the Notes column off the edge
   even at desktop width. */
td.files {
  white-space: normal;
  min-width: 14rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: var(--plate);
}

td.version {
  font-weight: 650;
}

/* --- verification snippets ------------------------------------------------------------ */

pre {
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-size: 0.86rem;
  margin: 0.4rem 0 1rem;
}

.copy {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  min-height: 28px;
}

.copy:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* --- product index -------------------------------------------------------------------- */

.products {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  gap: 1rem;
}

.products a {
  display: block;
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  color: var(--text);
}

.products a:hover {
  border-color: var(--brand-orange);
  color: var(--text);
}

.products .name {
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.products .blurb {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.products li.soon a {
  pointer-events: none;
  opacity: 0.45;
}

/* --- states and footer ---------------------------------------------------------------- */

.state {
  color: var(--muted);
  padding: 1.5rem 0;
}

.state.error {
  color: var(--brand-magenta);
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.87rem;
}

footer a {
  color: var(--muted);
  text-decoration: underline;
}

footer a:hover {
  color: var(--brand-cyan);
}

footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-bottom: 0.8rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
