/* Freally MIDI Master — GitHub Pages site
   © 2026 Mike Weaver — All Rights Reserved.
   Mirrors the Freally Player / Capture / Snipper site styling. */

:root {
  /* ⛔⛔ **THE SELECT POPUP IS PAINTED BY THE OS, NOT BY THIS SHEET.** Without
     this, the roster's Kind and Tier dropdowns rendered their options as white
     text on the platform's white popup background — invisible until hovered,
     so the filters looked empty and unusable. `color-scheme` is the one control
     a page has over native widget painting, and it fixes scrollbars and every
     other form control on the site at the same time. */
  color-scheme: dark;

  /* ⛔⛔ **THE SAME PALETTE AS THE APP AND THE ICON** (2026-09-16). Mike:
     *"ensure that this is used across the board and even in the docs site"*.
     This page was navy-and-blue while the product it documents was black-and-
     green — a site a producer arrives at from the plugin and does not recognise.
     The accents are the icon's own greens, the neutrals its black. ⚠ `--muted`
     clears 8.18:1 on `--panel` here, well past the 4.5 small text needs; the app
     has a test for this and the docs site does not, so the values are picked
     with room rather than to the line. */
  --bg-top: #101c0c;
  --bg-bottom: #060a06;
  --panel: #0d150c;
  --panel-2: #101a0f;
  --border: #2a3a26;
  --text: #f4f8f2;
  --muted: #9db296;
  --accent: #79d920;
  --accent-2: #b2f842;
  --success: #22c55e;
  --warning: #f0b429;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg-top), transparent 60%),
    linear-gradient(180deg, #0a1408 0%, var(--bg-bottom) 100%);
  background-color: var(--bg-bottom);
  background-attachment: fixed;
}

/* ---- Site nav ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 20px 0;
}

.nav a {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.nav a:hover,
.nav a:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(121, 217, 32, 0.1);
}

.nav a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(121, 217, 32, 0.14);
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 40px 20px 28px;
}

.hero .logo {
  border-radius: 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  width: 288px;
  max-width: 72vw;
  height: auto;
}

.hero h1 {
  margin: 18px 0 8px;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .tagline {
  margin: 14px auto 0;
  max-width: 660px;
  color: var(--accent-2);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero .sub {
  margin: 12px auto 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 1.15rem;
}

/* ---- Layout ---- */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

/* ---- Feature highlights grid ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 28px 0 8px;
}

.feature-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.feature-card .ic {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 6px;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.feature-card p {
  margin: 0;
  color: #c9dcc4;
  font-size: 0.96rem;
}

/* ---- Release / section card ---- */
.release {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 28px;
  margin: 28px 0;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.35);
}

.release-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.badge {
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.95rem;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: rgba(121, 217, 32, 0.1);
}

.badge.upcoming {
  color: var(--muted);
  background: transparent;
}

.badge.done {
  color: #7ee2b8;
  border-color: rgba(126, 226, 184, 0.45);
  background: rgba(126, 226, 184, 0.12);
}

.date {
  color: var(--muted);
  font-size: 0.95rem;
}

.release h2 {
  margin: 22px 0 10px;
  font-size: 1.9rem;
  font-weight: 700;
}

.release h3 {
  margin: 22px 0 10px;
  font-size: 1.15rem;
}

.summary {
  color: #c9dcc4;
  font-size: 1.05rem;
  margin: 0;
}

.features {
  margin: 6px 0 0;
  padding-left: 20px;
}

.features li {
  margin: 8px 0;
  color: #d6e6d1;
}

/* ⚠ The changelog's release head is the version's own heading — an `<h2>`, so
   the outline reads Changelog → version → section and the date translates —
   drawn exactly as the badge-and-date row it replaced. Written by
   `scripts/docs-changelog.mjs`; after `.release h2` so it wins. */
.release-head h2 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

/* An entry that holds a nested list keeps its own words in a `<p>` (the unit
   `docs-i18n.mjs` keys), spaced like the entries around it. */
.features li > p {
  margin: 0;
}

/* ⚠ The release notes name long identifiers — `no_two_presets_in_a_genre_render_the_same_sound`
   is 47 characters of monospace — and one unbreakable run pushed a phone's page
   78px wider than its screen. They may break anywhere rather than scroll. */
.release code {
  overflow-wrap: anywhere;
}

.note {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

code {
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

kbd {
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.85em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
}

a {
  color: var(--accent);
}

/* ---- Downloads ---- */
.downloads {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/*
 * The nearer of the two: solid rather than dashed, and in the accent, so the
 * RC reads as news while "downloads — coming soon" stays the caveat beside it.
 */
.dl-placeholder--soon {
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(121, 217, 32, 0.08);
}

.dl-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.dl-note {
  width: 100%;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.os-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.os-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.92rem;
}

.os-chip svg {
  width: 18px;
  height: 18px;
  fill: #93aa8c;
  flex: none;
}

/* ---- Format chips (CLAP / VST3 / AU / standalone) ---- */
/* `justify-content` rather than relying on the hero's `text-align: center` —
   a flex container lays its own children out, so the hero's alignment does not
   reach them and the pills sit hard against the left edge of the page. */
.formats {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 0;
}

.format {
  padding: 6px 14px;
  border: 1px solid rgba(178, 248, 66, 0.35);
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(178, 248, 66, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---- Roadmap timeline ---- */
.roadmap {
  margin-top: 44px;
}

.roadmap h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.roadmap > p {
  color: var(--muted);
  margin-top: 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin: 10px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.timeline li > div {
  flex: 1;
}

.timeline strong {
  display: block;
  font-size: 1.05rem;
}

.timeline p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.soon {
  color: var(--muted);
  font-size: 0.82rem;
  border: 1px dashed var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.soon.now {
  color: var(--accent-2);
  border-color: rgba(178, 248, 66, 0.4);
}

.soon.done {
  color: #7ee2b8;
  border-style: solid;
  border-color: rgba(126, 226, 184, 0.45);
}

/* ---- Documentation layout ---- */
.toc {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 24px 0;
}

.toc h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 28px;
}

.toc li {
  margin: 5px 0;
  break-inside: avoid;
}

.toc a {
  color: #c9dcc4;
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

td {
  color: #d6e6d1;
}

/* ---- Search ---- */
.search-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 20px 0;
}

.search-box {
  width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.search-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(121, 217, 32, 0.15);
}

.search-results {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.search-results li {
  padding: 12px 16px;
  margin: 8px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.search-results a {
  font-weight: 600;
  text-decoration: none;
}

.search-results p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-empty {
  color: var(--muted);
  padding: 12px 4px;
}

/* ---- Footer ---- */
footer {
  text-align: center;
  color: var(--muted);
  padding: 30px 20px 56px;
  font-size: 0.9rem;
}

/* The artist-name disclaimer. Fine print, but on the page everyone lands on:
   docs/legal/disclaimer.md is the canonical text and this quotes its short form. */
.disclaimer {
  max-width: 760px;
  margin: 0 auto 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.6;
  opacity: 0.85;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ── The roster browser (TASK-105) ────────────────────────────────────────── */

.roster-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin: 1.5rem 0 0.5rem;
}

.roster-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.roster-controls input,
.roster-controls select {
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  /* ⚠ A real colour rather than `transparent`, so the closed control and its
     open popup agree. `transparent` looked correct only because the page behind
     it happened to be dark. */
  background: var(--panel-2);
  color: var(--text);
}

/* ⚠ Named explicitly as well as via `color-scheme`, for engines that honour
   option styling but not the scheme hint. Both are cheap; a filter nobody can
   read is not. */
.roster-controls select option {
  background-color: var(--panel-2);
  color: var(--text);
}

.roster-controls input {
  min-width: 16rem;
}

/* ⚠ 2,413 rows is a wide table on a phone. It scrolls inside its own box
   rather than making the page scroll sideways. */
table.roster {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

/* A product screenshot with its caption.

   ⛔ The site carried no screenshots at all until 2026-09-10 — only the icon —
   so a features page describing an editor showed nobody the editor. These come
   from `e2e/features.spec.ts`, which drives the real UI headlessly and
   photographs it, so a shot cannot drift from the product without the suite
   drifting with it.

   ⚠ `aspect-ratio` beside the intrinsic width/height, so the space is reserved
   before the file arrives and the page does not jump as it loads. */
figure.shot {
  margin: 28px 0 34px;
}

figure.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

figure.shot figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

/* ── The language picker ───────────────────────────────────────────────────
   In the site nav, which is the top of every page. A pill like its neighbours,
   so it reads as one more thing in the same row rather than as a control bolted
   on beside them. */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.lang:hover,
.lang:focus-within {
  border-color: var(--accent);
}

.lang__label {
  font-size: 0.94rem;
  line-height: 1;
}

.lang select {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 2px 2px 2px 0;
}

.lang select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ⚠ The options are drawn by the OS, which uses its own colours — so they need
   a readable pair of their own rather than inheriting a transparent background
   that renders white-on-white in a light system theme. */
.lang select option {
  background: #14161a;
  color: #e8eaed;
}

/* ⛔ **Right-to-left, for Arabic.** The whole page mirrors: `dir` is set on
   `<html>` by `i18n.js`, so anything that reads left-to-right by position rather
   than by logical property has to say so here. */
[dir='rtl'] .nav {
  direction: rtl;
}

[dir='rtl'] .lang {
  padding: 5px 12px 5px 10px;
}
