/*
  Murmur distribution site.

  A conventional download page: fixed header, two-column hero, a stack of
  reading sections separated by hairlines, and a plain footer. The palette is
  the app's own Ember waveform palette (system pink through system orange) over
  a warm near-black field. The gradient belongs to the waveform, which is the
  one place the app itself uses it; everything else takes a single flat colour.

  This is the whole stylesheet. The page is static HTML with no build step
  beyond `build-page.mjs`, so the small reset below stands in for the one a CSS
  framework would otherwise supply.
*/

/* --------------------------------------------------------------------- reset */

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

h1,
h2,
h3 {
  font-size: inherit;
  font-weight: inherit;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: inherit;
}

img {
  display: block;
  max-width: 100%;
}

pre,
code {
  font: inherit;
}

/* ------------------------------------------------------------------- tokens */

:root {
  color-scheme: dark;

  /* Ember: the app's palette, from its leading stop to its trailing stop. */
  --ember: #ff375f;
  --ember-warm: #ff9f0a;

  --field: #0a0807;
  --field-raised: #12100e;

  --ink: #f7f2ed;
  --ink-soft: rgba(247, 242, 237, 0.72);
  --ink-muted: rgba(247, 242, 237, 0.56);

  /* Flat surfaces for the page: a faint fill and a hairline edge. */
  --surface: rgba(255, 255, 255, 0.028);
  --surface-edge: rgba(255, 255, 255, 0.1);
  --hairline: rgba(255, 255, 255, 0.08);

  /* Glass, kept for the one element that reproduces the app's own overlay. */
  --glass-edge: rgba(255, 255, 255, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.11);

  --shell-width: 64rem;
  --radius-surface: 12px;
  --radius-control: 10px;

  /* Short, opacity and transform only, no bounce and nothing that loops. */
  --motion-hover: 140ms ease-out;
  --motion-entrance: 420ms cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-ui:
    ui-sans-serif, -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica,
    Arial, sans-serif;
  --font-mono:
    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--field);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------- atmosphere */

/*
  Two ember washes behind the top of the page only. This is a hero backdrop, not
  a fixed layer that follows the reader down every section.
*/
.atmosphere {
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 42rem;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      56rem 30rem at 24% -6rem,
      rgba(255, 55, 95, 0.16),
      transparent 70%
    ),
    radial-gradient(
      40rem 26rem at 86% 4%,
      rgba(255, 159, 10, 0.09),
      transparent 68%
    );
}

/* ------------------------------------------------------------------ scaffold */

.shell {
  width: 100%;
  max-width: var(--shell-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* The header overlaps anything an in-page link scrolls to, so make room. */
section[id] {
  scroll-margin-top: 5rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-200%);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-control);
  background: var(--field-raised);
  border: 1px solid var(--surface-edge);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--ember-warm);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ controls */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  background: var(--ember);
  color: #1c0906;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: filter var(--motion-hover);
}

.button:hover {
  filter: brightness(1.07);
}

.button:active {
  filter: brightness(0.94);
}

.button-primary {
  padding: 0.85rem 1.6rem;
  font-size: 1.0625rem;
}

.button-compact {
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
}

/* -------------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--field) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.4vw, 1.6rem);
}

.site-nav a {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--motion-hover);
}

.site-nav a:hover {
  color: var(--ink);
}

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

.hero {
  padding-block: clamp(3rem, 7vw, 4.75rem) clamp(2.5rem, 6vw, 4rem);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}

.hero h1 {
  max-width: 16ch;
  font-size: clamp(2.15rem, 5vw, 3.05rem);
  font-weight: 640;
  line-height: 1.06;
  letter-spacing: -0.033em;
  text-wrap: balance;
}

.lede {
  margin-top: 1.15rem;
  max-width: 40ch;
  font-size: clamp(1.0625rem, 2vw, 1.2rem);
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.sub {
  margin-top: 0.7rem;
  max-width: 48ch;
  color: var(--ink-muted);
}

.hero-actions {
  margin-top: clamp(1.75rem, 4vw, 2.25rem);
}

.download-meta {
  margin-top: 0.9rem;
  max-width: 46ch;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.hero-note {
  margin-top: 0.5rem;
  max-width: 46ch;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.hero-note a {
  color: color-mix(in srgb, var(--ember-warm) 88%, var(--ink));
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

/* ------------------------------------------------------------------- capsule */

/*
  A scaled still of the app's recording overlay: 202x44 in the app, so the
  aspect ratio is fixed here and every interior size is derived from the height.
*/
.capsule-figure {
  --capsule-width: clamp(16rem, 34vw, 24rem);
  --capsule-height: calc(var(--capsule-width) * 44 / 202);

  display: flex;
  flex-direction: column;
  align-items: center;
}

.capsule-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: 1.25rem;
}

.capsule-glow {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  width: calc(var(--capsule-width) * 1.1);
  height: calc(var(--capsule-height) * 2.1);
  background: radial-gradient(
    closest-side,
    rgba(255, 110, 60, 0.28),
    transparent 76%
  );
  filter: blur(26px);
}

.capsule {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--capsule-height) * 0.06);
  width: var(--capsule-width);
  height: var(--capsule-height);
  padding-inline: calc(var(--capsule-height) * 0.24);
  border: 1px solid var(--glass-edge);
  border-radius: calc(var(--capsule-height) * 0.32);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.07),
      rgba(255, 255, 255, 0.022)
    ),
    rgba(12, 10, 9, 0.62);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 26px 60px -32px rgba(0, 0, 0, 0.95);
}

.capsule-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--capsule-height) * 0.052);
  width: 100%;
  height: calc(var(--capsule-height) * 0.45);
}

.capsule-bar {
  flex: 0 0 calc(var(--capsule-height) * 0.082);
  min-height: 3px;
  border-radius: 999px;
  transform-origin: center;
  animation: bar-breathe 1900ms ease-in-out infinite alternate;
}

@keyframes bar-breathe {
  from {
    transform: scaleY(0.52);
  }
  to {
    transform: scaleY(1);
  }
}

.capsule-timestamp {
  font-family: var(--font-mono);
  font-size: calc(var(--capsule-height) * 0.16);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
  color: rgba(247, 242, 237, 0.6);
}

/* Tied to the visual it describes, so the caption never outruns the capsule. */
.capsule-caption {
  margin-top: 0.5rem;
  max-width: var(--capsule-width);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------------ sections */

.section {
  border-top: 1px solid var(--hairline);
}

/*
  Heading in its own column beside the content, the way a reference page sets a
  section label. It folds above the content on narrow screens.
*/
.section-inner {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 5vw, 3rem);
  align-items: start;
  padding-block: clamp(2.75rem, 6vw, 4rem);
}

.section-inner-full {
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
}

.section h2 {
  font-size: 1.3125rem;
  font-weight: 620;
  letter-spacing: -0.022em;
  line-height: 1.25;
  text-wrap: balance;
}

.section-body > * + * {
  margin-top: 1rem;
}

.section-body p {
  max-width: 64ch;
  color: var(--ink-soft);
}

.section-body a {
  color: color-mix(in srgb, var(--ember-warm) 88%, var(--ink));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--motion-hover);
}

.section-body a:hover {
  color: var(--ember-warm);
}

.note {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

/* A command you are meant to copy, so it gets its own line and its own edge. */
.command {
  margin-top: 0.625rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--surface-edge);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-soft);
  overflow-x: auto;
}

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

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.75rem 2.5rem;
}

.features h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.features p {
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

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

.steps {
  list-style: decimal outside;
  padding-left: 1.5rem;
}

.steps > li + li {
  margin-top: 1.5rem;
}

.steps > li::marker {
  color: color-mix(in srgb, var(--ember-warm) 78%, var(--ink));
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.steps p {
  margin-top: 0.3rem;
  max-width: 58ch;
  color: var(--ink-muted);
}

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

/*
  The signing statement. A quiet panel, not an alert strip: this build is
  notarized, so the surface just holds the fact where a reader deciding whether
  to trust the download will look first.
*/
.callout {
  padding: clamp(1.15rem, 3vw, 1.5rem);
  border: 1px solid var(--surface-edge);
  border-radius: var(--radius-surface);
  background: var(--surface);
}

.callout h3 {
  font-size: 1.0625rem;
  font-weight: 620;
  letter-spacing: -0.015em;
  color: color-mix(in srgb, var(--ember-warm) 76%, var(--ink));
}

.callout p {
  margin-top: 0.6rem;
  max-width: 64ch;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------- facts */

.facts {
  border: 1px solid var(--surface-edge);
  border-radius: var(--radius-surface);
  overflow: hidden;
}

.fact {
  display: grid;
  grid-template-columns: minmax(8rem, 32%) 1fr;
  gap: 0.5rem 1.5rem;
  padding: 0.7rem clamp(0.85rem, 2vw, 1.1rem);
}

.fact:nth-child(odd) {
  background: var(--surface);
}

.fact + .fact {
  border-top: 1px solid var(--hairline);
}

.fact dt {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.fact dd {
  font-size: 0.9375rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

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

.site-footer {
  border-top: 1px solid var(--hairline);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 2rem clamp(2rem, 5vw, 3rem);
}

.footer-note {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.9375rem;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color var(--motion-hover);
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------- motion */

/*
  One entrance, on the hero only, so the page settles once and then holds
  still. Everything below the fold is present immediately.
*/
.hero-copy,
.hero-visual {
  animation: rise-in var(--motion-entrance) both;
}

.hero-visual {
  animation-delay: 90ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/*
  Reduce Motion keeps every end state and drops the movement that would
  otherwise get there, matching how the app treats its own animations.
*/
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-copy,
  .hero-visual,
  .capsule-bar {
    animation: none;
  }
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 56rem) {
  .section-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
}

/* The hero holds its two columns down to tablet width, where the copy would
   start breaking badly, and then becomes one left-aligned stack. */
@media (max-width: 48rem) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 8vw, 3rem);
  }

  .hero h1 {
    max-width: 20ch;
  }

  .hero-visual {
    justify-content: flex-start;
  }

  .capsule-figure {
    align-items: flex-start;
  }

  .capsule-caption {
    text-align: left;
  }
}

@media (max-width: 46rem) {
  /* The page is short and the footer repeats the resource links, so the
     section anchors give way to the download action rather than a menu. */
  .site-nav {
    display: none;
  }
}

@media (max-width: 34rem) {
  .fact {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }

  .button-primary {
    width: 100%;
  }
}

/* ------------------------------------------------------------------ contrast */

@media (prefers-contrast: more) {
  :root {
    --ink-soft: rgba(247, 242, 237, 0.9);
    --ink-muted: rgba(247, 242, 237, 0.82);
    --surface-edge: rgba(255, 255, 255, 0.22);
    --glass-edge: rgba(255, 255, 255, 0.2);
    --hairline: rgba(255, 255, 255, 0.18);
  }
}
