/* ============================================================================
   Harmony Lab — public marketing page
   ----------------------------------------------------------------------------
   Standalone. No build step, no framework, no shared pipeline with the app.
   The palette is lifted verbatim from the app's default `console` theme
   (src/index.css, [data-theme='console']) so the page and the product look like
   the same object:

     --bg #0b0b0d   --topbar/--panel #16161a   --panel2 #1f1f25   --line #2c2c34
     --text #f7f7f9  --muted #8e8e98  --faint #5c5c66
     --accent #f3b54a on --accent-ink #241a00
     --safe #5bbf95  --color #6f9bd0  --tension #cf8a82

   Type is the app's: Archivo for everything, JetBrains Mono for the readouts
   and labels — the places a musician expects monospace.
   ============================================================================ */

:root {
  --bg: #0b0b0d;
  --panel: #16161a;
  --panel2: #1f1f25;
  --line: #2c2c34;
  --text: #f7f7f9;
  --muted: #8e8e98;
  --faint: #5c5c66;
  --accent: #f3b54a;
  --accent-ink: #241a00;
  --safe: #5bbf95;
  --color: #6f9bd0;
  --tension: #cf8a82;

  /* Body copy sits between --text and --muted: dimmer than a heading, still
     comfortably readable at length on a phone in a dark room. */
  --ink: #c9c9d2;

  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5vw, 40px);
  --band: clamp(60px, 9vw, 116px);
  --wrap: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  font-weight: 700;
  z-index: 50;
}
.skip:focus {
  left: 8px;
  top: 8px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── header ───────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 11, 13, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 6px;
}

.brand-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.head-cta {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(243, 181, 74, 0.34);
  border-radius: 999px;
  padding: 7px 15px;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.head-cta:hover {
  background: rgba(243, 181, 74, 0.1);
  border-color: rgba(243, 181, 74, 0.6);
}

/* ── shared type ──────────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
  max-width: 220px;
}

h1 {
  font-size: clamp(2.45rem, 8.4vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 28px;
  text-wrap: balance;
}
h1 em {
  font-style: normal;
  color: var(--accent);
}

h2 {
  font-size: clamp(1.75rem, 4.6vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 800;
  margin: 0 0 24px;
  text-wrap: balance;
}

.prose {
  max-width: 62ch;
}
.prose p {
  color: var(--ink);
  margin: 0 0 18px;
  font-size: clamp(16px, 2.2vw, 18px);
}
.prose p:last-child {
  margin-bottom: 0;
}
.prose em {
  color: var(--text);
  font-style: italic;
}

.note {
  max-width: 62ch;
  color: var(--muted);
  font-size: 15px;
  margin: 30px 0 0;
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

.band {
  padding: var(--band) 0;
}

/* ── hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: clamp(56px, 11vw, 128px) 0 clamp(64px, 10vw, 120px);
  overflow: hidden;
}

/* A wash of the mark's own gradient, bled off the top-right corner. Not an
   image — just the brand's three colours at very low opacity, so the hero has
   depth without a stock photograph in it. */
.hero::before {
  content: '';
  position: absolute;
  top: -32%;
  right: -18%;
  width: 780px;
  height: 780px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 209, 102, 0.13),
    rgba(176, 127, 208, 0.09) 42%,
    rgba(78, 163, 255, 0.05) 62%,
    transparent 72%
  );
  pointer-events: none;
}
.hero .wrap {
  position: relative;
}

.lede {
  max-width: 56ch;
  font-size: clamp(17px, 2.6vw, 21px);
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 16px;
}
.lede strong {
  color: var(--text);
  font-weight: 700;
}
.lede-2 {
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 18px);
  margin-bottom: 0;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.005em;
  padding: 14px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: #ffc665;
}

.btn-ghost {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--faint);
  background: var(--panel2);
}

.btn-note {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.cta-fine {
  max-width: 56ch;
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ── pull quote ───────────────────────────────────────────────────────── */

.pull {
  margin: 40px 0 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  max-width: 46ch;
  font-size: clamp(19px, 3.2vw, 25px);
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--text);
}

/* ── pathways diagram ─────────────────────────────────────────────────── */

.diagram {
  margin: 40px 0 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}

.diagram-cap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  background: #101014;
  font-size: 12.5px;
  color: var(--faint);
}

.mono-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 7px;
}

.diagram-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
}

.dh-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.dh-chord {
  font-family: var(--mono);
  font-size: clamp(30px, 8vw, 44px);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.dh-key {
  font-size: 14px;
  color: var(--muted);
}

.tier {
  display: flex;
  gap: 20px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
}
.tier:last-child {
  border-bottom: 0;
}

.tier-id {
  flex: none;
  width: 84px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: 3px;
}
.tier-safe .tier-id { color: var(--safe); }
.tier-color .tier-id { color: var(--color); }
.tier-tension .tier-id { color: var(--tension); }

.tier-body {
  min-width: 0;
}

.tier-name {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.012em;
}

.notes {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
}
.notes li {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  min-width: 34px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--ink);
}

/* The one note that carries the tier's identity, filled in the tier's colour. */
.tier-safe .notes li.hit,
.tier-color .notes li.hit,
.tier-tension .notes li.hit {
  color: #08130c;
  font-weight: 700;
}
.tier-safe .notes li.hit { background: var(--safe); border-color: var(--safe); }
.tier-color .notes li.hit { background: var(--color); border-color: var(--color); }
.tier-tension .notes li.hit { background: var(--tension); border-color: var(--tension); }

.tier-why {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 56ch;
}
.tier-why b {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
}

/* ── local-first facts ────────────────────────────────────────────────── */

.band-local h2 em {
  font-style: normal;
}

.facts {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.facts li {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 8px 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.fact-k {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 4px;
}
.fact-v {
  color: var(--ink);
  font-size: 16px;
  max-width: 62ch;
}
.fact-v em {
  color: var(--text);
  font-style: italic;
}

.caveat {
  margin: 36px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--muted);
  border-radius: 0 12px 12px 0;
  background: var(--panel);
  max-width: 68ch;
}
.caveat-h {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.caveat p {
  margin: 0;
  color: var(--ink);
  font-size: 15.5px;
}
.caveat code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  word-break: break-all;
}

/* ── feature grid ─────────────────────────────────────────────────────── */

.grid {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.grid li {
  background: var(--panel);
  padding: 24px 22px 26px;
}
.grid h3 {
  margin: 0 0 9px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ── sources ──────────────────────────────────────────────────────────── */

.sources {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.sources li {
  display: flex;
  gap: 22px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.src-n {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--faint);
  padding-top: 4px;
  width: 34px;
}
.sources h3 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.sources p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 60ch;
}

/* ── limitations ──────────────────────────────────────────────────────── */

.limits {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  max-width: 66ch;
}
.limits li {
  position: relative;
  padding: 0 0 0 26px;
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 15.5px;
}
.limits li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 10px;
  height: 1px;
  background: var(--tension);
}

/* ── closer ───────────────────────────────────────────────────────────── */

.closer {
  padding: var(--band) 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #101014, var(--bg));
}
.closer h2 {
  margin-bottom: 18px;
}
.closer-p {
  max-width: 58ch;
  color: var(--ink);
  font-size: clamp(16px, 2.3vw, 18px);
  margin: 0;
}

/* ── footer ───────────────────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0;
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.foot-mid {
  flex: 1;
  min-width: 160px;
}
.site-foot a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.site-foot a:hover {
  color: var(--accent);
}

/* ── phone ────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .head-cta {
    font-size: 11px;
    padding: 6px 12px;
  }

  h1 {
    letter-spacing: -0.03em;
  }

  /* The hard-wrapped headlines are set for a wide measure; on a phone let the
     browser wrap them instead, or a short line hangs alone.
     REQUIRES a space before each <br> in the markup — see the comment on the
     hero <h1> in index.html. Without it the halves butt together here. */
  h1 br,
  h2 br {
    display: none;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    justify-content: center;
    padding: 15px 20px;
  }

  /* Tier label above its body: 84px of gutter is a third of a 390px screen. */
  .tier {
    flex-direction: column;
    gap: 10px;
    padding: 20px 16px;
  }
  .tier-id {
    width: auto;
    padding-top: 0;
  }
  .diagram-cap,
  .diagram-head {
    padding-left: 16px;
    padding-right: 16px;
  }

  .facts li {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .fact-k {
    padding-top: 0;
  }

  .caveat {
    padding: 18px 18px;
  }

  .sources li {
    gap: 14px;
  }

  .eyebrow::after {
    max-width: 90px;
  }
}
