/* jackbird's landing page, drawn with the Deck theme's tokens (theme/tokens.css, copied in by
   scripts/build-landing.mjs): the page is a front panel, its sections modules screwed into it.
   Sizes in rem; hovers only inside (hover: hover). */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--mm-accent) 14%, transparent), transparent 70%),
    radial-gradient(50rem 30rem at -10% 40%, color-mix(in srgb, var(--mm-stripe-1) 12%, transparent), transparent 70%),
    var(--mm-bg);
  color: var(--mm-fg);
  font-family: var(--mm-font-sans);
  line-height: var(--mm-leading);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

.label, .section-label, .eyebrow {
  font-family: var(--mm-font-label);
  font-stretch: var(--mm-stretch-label);
  font-weight: var(--mm-weight-bold);
  letter-spacing: var(--mm-tracking-label);
  text-transform: uppercase;
}
.label { font-size: var(--mm-text-label); color: var(--mm-fg-muted); }

/* ---- the faceplate --------------------------------------------------------------------- */

.faceplate {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--mm-space-6);
  padding: var(--mm-space-3) max(1rem, calc((100vw - 1024px) / 2));
  border-bottom: var(--mm-border-width) solid var(--mm-chassis-lo);
  background:
    repeating-linear-gradient(90deg, var(--mm-brush) 0 1px, transparent 1px 3px),
    linear-gradient(var(--mm-chassis-hi), var(--mm-chassis));
  box-shadow: 0 1px 0 var(--mm-chassis-hi) inset, 0 .5rem 1.5rem rgba(0, 0, 0, .12);
}

/* The name in raised metal, as in the app's faceplate: the text draws the relief, a copy on top
   the sheen (no filter, which would blur it). */
.wordmark {
  position: relative;
  color: transparent;
  text-shadow: var(--mm-metal-shadow);
  font-family: var(--mm-font-label);
  font-stretch: var(--mm-stretch-label);
  font-weight: 800;
  font-size: var(--mm-text-xl);
  letter-spacing: .08em;
  line-height: var(--mm-leading-tight);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.wordmark::after {
  content: attr(data-label);
  content: attr(data-label) / "";
  position: absolute;
  inset: 0;
  background-image: var(--mm-metal-face);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
}
.wordmark.small { font-size: var(--mm-text-md); margin-right: var(--mm-space-2); }

.nav { display: flex; gap: var(--mm-space-5); margin-left: auto; }
.nav a {
  font-family: var(--mm-font-label);
  font-stretch: var(--mm-stretch-label);
  font-weight: var(--mm-weight-bold);
  font-size: var(--mm-text-label);
  letter-spacing: var(--mm-tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mm-fg-muted);
}
@media (hover: hover) {
  .nav a:hover { color: var(--mm-accent-ink); }
}

/* ---- keys and LEDs ---------------------------------------------------------------------- */

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mm-space-2);
  min-height: var(--mm-control-lg);
  padding: 0 var(--mm-space-4);
  border: var(--mm-border-width) solid var(--mm-border-strong);
  border-radius: var(--mm-radius-key);
  background: linear-gradient(var(--mm-key-top), var(--mm-key-bottom));
  box-shadow: var(--mm-key-shadow);
  color: var(--mm-fg);
  font: inherit;
  font-family: var(--mm-font-label);
  font-stretch: var(--mm-stretch-label);
  font-weight: var(--mm-weight-bold);
  font-size: var(--mm-text-sm);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.key svg { width: .875rem; height: .875rem; fill: currentColor; }
.key:active, .key.down { transform: translateY(1px); background: var(--mm-key-down); box-shadow: var(--mm-key-pressed); }
.key:focus-visible { outline: 2px solid var(--mm-accent); outline-offset: 2px; }
.key.primary {
  border-color: var(--mm-accent-hover);
  background: linear-gradient(var(--mm-accent), var(--mm-accent-hover));
  box-shadow: var(--mm-key-shadow-signal);
  color: var(--mm-on-accent-key);
}
.key.primary:active { box-shadow: var(--mm-key-pressed-signal); }
.key.big { min-height: 3rem; padding: 0 var(--mm-space-6); font-size: var(--mm-text-md); }
@media (hover: hover) {
  .key:hover { filter: brightness(1.04); }
}

/* The tone's selector: three keys side by side, icons alone, the chosen one down and lit. */
.tones { display: inline-flex; }
.tone { width: var(--mm-control-lg); padding: 0; border-radius: 0; }
.tone + .tone { margin-left: calc(-1 * var(--mm-border-width)); }
.tone:first-child { border-radius: var(--mm-radius-key) 0 0 var(--mm-radius-key); }
.tone:last-child { border-radius: 0 var(--mm-radius-key) var(--mm-radius-key) 0; }
.tone svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tone svg .solid { fill: currentColor; stroke: none; }
.tone[aria-checked="true"] { transform: translateY(1px); background: var(--mm-key-down); box-shadow: var(--mm-key-pressed); color: var(--mm-accent-ink); }
.tone:focus-visible { position: relative; }

.led {
  display: inline-block;
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--mm-led-off);
  box-shadow: var(--mm-led-inset);
}
.led.on { background: var(--mm-accent); box-shadow: 0 0 .4rem var(--mm-accent); }
.led.on.ok { background: var(--mm-ok-led); box-shadow: 0 0 .4rem var(--mm-ok-led); }
.led.on.warn { background: var(--mm-warn-led); box-shadow: 0 0 .4rem var(--mm-warn-led); }

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

main { display: grid; gap: 7rem; padding: 4rem max(1rem, calc((100vw - 1024px) / 2)) 6rem; }

.hero { display: grid; gap: 4rem; }
.pitch { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 4rem; align-items: end; }
.pitch > .eyebrow, .pitch > h1 { grid-column: 1; justify-self: start; }
.pitch > .lede, .pitch > .actions, .pitch > .note { grid-column: 2; }
.pitch > .lede { grid-row: 2; align-self: start; margin-top: 0; }
.pitch > .actions { grid-row: 3; margin-top: var(--mm-space-6); }
.pitch > .note { grid-row: 4; }
.pitch > h1 { grid-row: 2 / span 3; align-self: start; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--mm-space-2);
  margin: 0 0 var(--mm-space-5);
  padding: var(--mm-space-1) var(--mm-space-3);
  border: var(--mm-border-width) solid var(--mm-border);
  border-radius: var(--mm-radius-full);
  background: var(--mm-surface);
  font-size: var(--mm-text-label);
  color: var(--mm-fg-muted);
}

h1 {
  margin: 0;
  font-family: var(--mm-font-label);
  font-stretch: var(--mm-stretch-heading);
  font-weight: 800;
  font-size: clamp(2.4rem, 4.4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -.02em;
}
h1 em {
  display: block;
  font-style: normal;
  background: linear-gradient(100deg, var(--mm-stripe-1), var(--mm-stripe-2) 50%, var(--mm-stripe-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede { max-width: 34rem; margin: var(--mm-space-6) 0 0; font-size: 1.125rem; color: var(--mm-fg-muted); }
.actions { display: flex; flex-wrap: wrap; gap: var(--mm-space-3); margin-top: var(--mm-space-7); }
.actions .key { min-height: 3rem; padding: 0 var(--mm-space-6); font-size: var(--mm-text-md); }
.note { max-width: 30rem; margin: var(--mm-space-4) 0 0; font-size: var(--mm-text-xs); color: var(--mm-fg-subtle); }

/* The J-card stripes, over the footer. */
.stripes { display: grid; grid-template-rows: repeat(3, .375rem); }
.stripes span:nth-child(1) { background: var(--mm-stripe-1); }
.stripes span:nth-child(2) { background: var(--mm-stripe-2); }
.stripes span:nth-child(3) { background: var(--mm-stripe-3); border-radius: 0 0 var(--mm-radius-md) var(--mm-radius-md); }
.footer .stripes span:nth-child(3) { border-radius: 0; }


/* ---- the app's window --------------------------------------------------------------------- */

.shot { display: grid; justify-items: center; gap: var(--mm-space-4); }
/* The demo's stage. Its frame is the embedded demo's size: 1.5rem wider than the stage each side
   and above it, room for the demo's shadows, and 1078 by 724 in shape, as the release captures it
   (scripts/screenshots.cjs; 1078px wide where the stage is 1024px, which it is on most computers).
   The capture fills it, then the demo, over it. */
.stage { position: relative; width: 100%; }
.stage .frame { position: relative; margin: -1.5rem -1.5rem 0; aspect-ratio: 1078 / 724; }
.stage .frame img { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .live { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.stage.live-on .frame img { visibility: hidden; }
/* A phone's page has 1rem each side, and no demo over the capture: the frame no wider than it. */
@media (max-width: 640px) { .stage .frame { margin: -1rem -1rem 0; } }
/* Hidden until it has drawn its music (landing.js), then in place of the capture at once. */
.stage .live, .handset .live { opacity: 0; }
.stage.live-on .live, .handset.live-on .live { opacity: 1; }
/* The invitation to the demo, when the embedded app is asked for a folder. */
.invite {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  gap: var(--mm-space-3);
  width: min(26rem, 90%);
  padding: var(--mm-space-5);
  transform: translate(-50%, -50%);
  border: var(--mm-border-width) solid var(--mm-border-strong);
  border-radius: var(--mm-radius-lg);
  background: var(--mm-surface);
  box-shadow: var(--mm-shadow-lg);
}
.invite[hidden] { display: none; }
.invite p { grid-column: 1 / -1; margin: 0; color: var(--mm-fg-muted); }
.invite strong { color: var(--mm-fg); }

:root[data-theme="dark"] .only-light, :root:not([data-theme="dark"]) .only-dark { display: none; }
.caption { margin: var(--mm-space-5) 0 0; font-size: var(--mm-text-sm); color: var(--mm-fg-muted); text-align: center; }
.caption span { display: block; font-size: var(--mm-text-xs); color: var(--mm-fg-subtle); }

/* ---- features ------------------------------------------------------------------------------ */

.section-label {
  display: flex;
  align-items: center;
  gap: var(--mm-space-3);
  margin: 0 0 var(--mm-space-6);
  font-size: var(--mm-text-sm);
  color: var(--mm-fg-muted);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--mm-border); }

.modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--mm-space-4); }
.module {
  position: relative;
  padding: var(--mm-space-6);
  border: var(--mm-border-width) solid var(--mm-border);
  border-radius: var(--mm-radius-lg);
  background: linear-gradient(var(--mm-surface), var(--mm-surface)) padding-box;
  box-shadow: var(--mm-shadow-md);
  transition: transform .2s, box-shadow .2s;
}
/* Four screws in the corners: a module bolted to the panel. */
.module::before {
  content: "";
  position: absolute;
  inset: .6rem;
  pointer-events: none;
  background:
    radial-gradient(circle, var(--mm-border-strong) 0 .16rem, transparent .2rem) left top / .5rem .5rem no-repeat,
    radial-gradient(circle, var(--mm-border-strong) 0 .16rem, transparent .2rem) right top / .5rem .5rem no-repeat,
    radial-gradient(circle, var(--mm-border-strong) 0 .16rem, transparent .2rem) left bottom / .5rem .5rem no-repeat,
    radial-gradient(circle, var(--mm-border-strong) 0 .16rem, transparent .2rem) right bottom / .5rem .5rem no-repeat;
}
@media (hover: hover) {
  .module:hover { transform: translateY(-.25rem); box-shadow: var(--mm-shadow-lg); }
}
.module header { display: flex; align-items: center; gap: var(--mm-space-2); }
.module h3 {
  margin: var(--mm-space-4) 0 var(--mm-space-2);
  font-family: var(--mm-font-label);
  font-stretch: var(--mm-stretch-heading);
  font-size: var(--mm-text-xl);
  line-height: var(--mm-leading-tight);
}
.module p { margin: 0; color: var(--mm-fg-muted); font-size: .9375rem; }

/* ---- the phone ------------------------------------------------------------------------------ */

.phone { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); align-items: center; gap: 4rem; }
/* The phone: its screenshot, or the app itself over it (an iframe as large), in a hairline bezel,
   turned a little. */
.handset {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid #0d0e0f;
  border-radius: .75rem;
  box-shadow: var(--mm-shadow-lg), 0 0 0 1px var(--mm-border-strong);
  transform: rotate(-4deg);
}
/* The demo as a phone draws it, 324 by 551 in shape (18rem wide, as the release captures it). */
.handset { aspect-ratio: 324 / 551; }
.handset img { display: block; width: 100%; height: 100%; }
.handset .live { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.handset.live-on img { visibility: hidden; }
.phone .statement {
  margin: 0 0 var(--mm-space-4);
  font-family: var(--mm-font-label);
  font-stretch: var(--mm-stretch-heading);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
}
.phone p { max-width: 34rem; color: var(--mm-fg-muted); }

/* ---- platforms ------------------------------------------------------------------------------ */

/* The glyphs of "Get it": drawn as strokes in the ink around them. */
.glyph { flex: none; width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tab, .download .label, .way h3 { display: inline-flex; align-items: center; gap: .6em; }
.download .label .glyph { width: 1.5rem; height: 1.5rem; color: var(--mm-fg); }
/* The systems' own logos (Simple Icons, CC0; Windows' four panes drawn here): filled, not stroked. */
.glyph.logo { fill: currentColor; stroke: none; }

/* Get it: two tabs, the downloads (this device's first, larger) and the server. */
.tabs { display: flex; gap: var(--mm-space-2); margin-bottom: var(--mm-space-5); }
.tab {
  min-height: 2.5rem;
  padding: 0 var(--mm-space-5);
  border: var(--mm-border-width) solid var(--mm-border-strong);
  border-radius: var(--mm-radius-key);
  background: linear-gradient(var(--mm-key-top), var(--mm-key-bottom));
  box-shadow: var(--mm-key-shadow);
  color: var(--mm-fg);
  font: 700 var(--mm-text-sm) / 1 var(--mm-font-label);
  font-stretch: var(--mm-stretch-label);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.tab[aria-selected="true"] { transform: translateY(1px); background: var(--mm-key-down); box-shadow: var(--mm-key-pressed); color: var(--mm-accent-ink); }
.tab:focus-visible { outline: 2px solid var(--mm-accent); outline-offset: 2px; }
.panel[hidden] { display: none; }

.downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--mm-space-4); }
.download {
  display: grid;
  align-content: start;
  gap: var(--mm-space-2);
  padding: var(--mm-space-5);
  border: var(--mm-border-width) solid var(--mm-border-strong);
  border-radius: var(--mm-radius-lg);
  background: linear-gradient(var(--mm-key-top), var(--mm-key-bottom));
  box-shadow: var(--mm-key-shadow);
  color: var(--mm-fg);
  text-decoration: none;
}
.download strong { font-family: var(--mm-font-label); font-stretch: var(--mm-stretch-heading); font-size: var(--mm-text-lg); }
.download .file { color: var(--mm-fg-muted); font-size: var(--mm-text-sm); }
.download:active { transform: translateY(1px); background: var(--mm-key-down); box-shadow: var(--mm-key-pressed); }
.download:focus-visible { outline: 2px solid var(--mm-accent); outline-offset: 2px; }
/* This device's: first, the signal's colour, and a ribbon across its corner that says so. */
.download { position: relative; overflow: hidden; }
.download.mine { border-color: var(--mm-accent); }
.download.mine .label .glyph { color: var(--mm-accent-ink); }
.download.mine::after {
  content: attr(data-ribbon);
  position: absolute;
  top: 1.6rem;
  right: -3.4rem;
  width: 12rem;
  padding: .3rem 0;
  transform: rotate(45deg);
  background: var(--mm-accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  color: var(--mm-on-accent-key, #fff);
  font: 700 .625rem / 1 var(--mm-font-label);
  font-stretch: var(--mm-stretch-label);
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
}
@media (hover: hover) {
  .download:hover { border-color: var(--mm-accent); }
  .download:hover strong { color: var(--mm-accent-ink); }
}
.note { margin: var(--mm-space-4) 0 0; color: var(--mm-fg-muted); font-size: var(--mm-text-sm); }

.lead { max-width: 46rem; margin: 0 0 var(--mm-space-5); color: var(--mm-fg-muted); }
/* One above the other: a command's line has the page's width, and is read whole. */
.ways { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--mm-space-4); }
.way {
  display: grid;
  align-content: start;
  gap: var(--mm-space-3);
  min-width: 0;
  padding: var(--mm-space-5);
  border: var(--mm-border-width) solid var(--mm-border);
  border-radius: var(--mm-radius-lg);
  background: var(--mm-surface);
}
.way h3 { margin: 0; font-family: var(--mm-font-label); font-stretch: var(--mm-stretch-heading); font-size: var(--mm-text-lg); }
.way p { margin: 0; color: var(--mm-fg-muted); font-size: var(--mm-text-sm); }
.way pre {
  margin: 0;
  padding: var(--mm-space-3);
  overflow-x: auto;
  border-radius: var(--mm-radius-md);
  background: var(--mm-sunken);
  font: var(--mm-text-xs) / 1.5 var(--mm-font-mono);
}
.way code { font-family: var(--mm-font-mono); font-size: .92em; overflow-wrap: anywhere; }
.way pre code { overflow-wrap: normal; }
.way a:not(.file-link) { color: var(--mm-accent-ink); }
/* The commands' colours, written by hand in the page: a command, its flags, what it is given
   (an address, a variable), and what is only punctuation or a remark. */
.t-cmd { color: var(--mm-accent-ink); font-weight: var(--mm-weight-medium); }
.t-flag { color: var(--mm-ok); }
.t-str { color: var(--mm-warn); }
.t-op, .t-com { color: var(--mm-fg-subtle); }
.t-com { font-style: italic; }
.files { display: flex; flex-wrap: wrap; gap: var(--mm-space-2); }
.file-link {
  padding: var(--mm-space-1) var(--mm-space-3);
  border: var(--mm-border-width) solid var(--mm-border-strong);
  border-radius: var(--mm-radius-full);
  color: var(--mm-fg);
  font-size: var(--mm-text-xs);
  text-decoration: none;
}
@media (hover: hover) { .file-link:hover { border-color: var(--mm-accent); color: var(--mm-accent-ink); } }


/* ---- footer --------------------------------------------------------------------------------- */

.footer { border-top: var(--mm-border-width) solid var(--mm-chassis-lo); background: var(--mm-chassis); }
.footer p {
  margin: 0;
  padding: var(--mm-space-6) max(1rem, calc((100vw - 1024px) / 2));
  font-size: var(--mm-text-sm);
  color: var(--mm-fg-muted);
}

/* ---- narrower screens ----------------------------------------------------------------------- */

@media (max-width: 960px) {
  .pitch { grid-template-columns: minmax(0, 1fr); }
  .pitch > * { grid-column: 1 !important; grid-row: auto !important; }
  .pitch > .lede { margin-top: var(--mm-space-6); }
  .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  main { gap: 4.5rem; padding-top: 2.5rem; }
  .nav { display: none; }
  .tones { margin-left: auto; }
  .modules, .downloads { grid-template-columns: minmax(0, 1fr); }
  .phone { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 2.5rem; }
  .handset { max-width: 14rem; }
}

/* Grid items shrink to their track, never to their content. */
.hero > *, .pitch > * { min-width: 0; }
