@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face { font-family: "Cormorant"; src: url("fonts/CormorantGaramond-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("fonts/CormorantGaramond-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("fonts/CormorantGaramond-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("fonts/CormorantGaramond-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* Walnut and brass, matched to the plugin (Source/PluginEditor.cpp: kBack, kGold, kText, kDim). */
:root {
  --lacquer: #17110d;
  --lacquer-2: #221913;
  --ivory: #e9dcc8;
  --mist: #b0a08a;
  --gold: #d8a660;
  --gold-deep: #b5823f;
  --line: color-mix(in srgb, var(--gold) 28%, transparent);
  --shadow: rgb(0 0 0 / 0.7);
  --serif: "Cormorant", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --page: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ivory);
  background:
    radial-gradient(90% 50% at 50% 0%, rgb(216 166 96 / 0.08), transparent 70%),
    var(--lacquer);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-underline-offset: 0.2em; }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: 0.005em; }

.eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.9rem;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--ivory);
  color: var(--lacquer);
  border-radius: 4px;
  z-index: 10;
}
.skip:focus { top: 1rem; }

/* Header */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
}
.wordmark {
  font-family: var(--sans);
  font-size: 1.45rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  color: var(--ivory);
  text-decoration: none;
}
.wordmark span {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15em;
  letter-spacing: 0.02em;
  color: var(--gold);
  margin-left: 0.3em;
}
.build { margin: 0 auto 0 0; color: var(--mist); font-size: 0.85rem; letter-spacing: 0.06em; }
.top-link {
  color: var(--ivory);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.2rem;
}

/* Hero: the santoor behind the headline, fading into the dark */
.hero {
  position: relative;
  margin-top: -5.5rem;
  padding: 9rem var(--gutter) 4.5rem;
  overflow: hidden;
  isolation: isolate;
}
.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
  z-index: -2;
  opacity: 0.9;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(23 17 13 / 0.92) 0%, rgb(23 17 13 / 0.8) 40%, rgb(23 17 13 / 0.35) 62%, rgb(23 17 13 / 0) 82%),
    linear-gradient(180deg, rgb(23 17 13 / 0.75) 0%, transparent 30%, transparent 60%, var(--lacquer) 100%);
}
.hero-copy { max-width: var(--page); margin: 0 auto; }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.04;
  margin: 0 0 1.5rem;
  max-width: 13em;
}
.hero h1 em { font-style: italic; font-weight: 400; color: var(--gold); }
.lede { margin: 0 0 2.25rem; color: var(--mist); max-width: 36em; font-size: 1.1rem; }

.downloads { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 1.1rem; }
.dl {
  display: flex;
  flex-direction: column;
  min-width: 15rem;
  padding: 0.9rem 1.4rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
  color: var(--ivory);
  text-decoration: none;
  background: rgb(23 17 13 / 0.55);
  transition: background-color 0.2s, color 0.2s;
}
.dl:hover { background: rgb(216 166 96 / 0.12); }
.dl.is-primary { background: var(--gold); color: var(--lacquer); }
.dl.is-primary:hover { background: color-mix(in srgb, var(--gold) 85%, white); }
.dl-title { font-weight: 600; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; }
.dl-meta { font-size: 0.85rem; opacity: 0.8; }
.hear { margin: 0 0 1rem; font-size: 0.95rem; }
.hear a { text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 0.1rem; }
.hear a::before { content: "\25B6"; font-size: 0.7em; margin-right: 0.6em; position: relative; top: -0.1em; }
.fineprint { margin: 0; font-size: 0.85rem; color: var(--mist); max-width: 36em; }

/* A few strings over a pair of bridges as a section divider (pure CSS) */
.strings {
  position: relative;
  height: 22px;
  max-width: var(--page);
  margin: 0 auto;
  background: repeating-linear-gradient(180deg, transparent 0 4px, rgb(233 220 200 / 0.5) 4px 5px) center / 100% 100% no-repeat;
  opacity: 0.35;
  -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
          mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.strings::before,
.strings::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 9px;
  height: 28px;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(var(--gold), var(--gold-deep));
}
.strings::before { left: 28%; }
.strings::after { right: 28%; }

/* Sections */
.showcase,
.listen,
.sound,
.controls,
.install,
.notes {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter);
}
.section-title { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.1; margin: 0 0 1.25rem; }
.install,
.notes { border-top: 1px solid var(--line); }

.screens { margin: 2rem auto 0; display: grid; max-width: 58rem; }
.shot {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 40px 90px var(--shadow), 0 0 0 1px rgb(216 166 96 / 0.18);
  transition: opacity 0.35s ease;
}
html:not([data-page="main"]) .shot[data-page="main"],
html:not([data-page="settings"]) .shot[data-page="settings"] { opacity: 0; }
.screens figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1rem;
  margin-top: 1.5rem;
  color: var(--mist);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}
.page-switch { display: inline-flex; gap: 0.3rem; }
.page-switch button {
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border: 0;
  border-bottom: 1.5px solid transparent;
  background: none;
  color: var(--mist);
  cursor: pointer;
}
.page-switch button[aria-pressed="true"] { color: var(--gold); border-bottom-color: var(--gold); }

.sound {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.sound-image {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 30px 70px var(--shadow), 0 0 0 1px rgb(216 166 96 / 0.15);
}
.sound-copy p { color: var(--mist); margin: 0 0 1rem; }
.facts {
  list-style: none;
  margin: 2rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.facts b { display: block; font-family: var(--serif); font-weight: 500; font-size: 2.4rem; line-height: 1; color: var(--gold); }
.facts span { font-size: 0.8rem; color: var(--mist); }

.controls-intro,
.install-intro { color: var(--mist); margin: 0 0 2.5rem; max-width: 42em; }
.groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.group { padding: 1.75rem 1.5rem 0.5rem 0; }
.group + .group { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.group h3 {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
.group dl { margin: 0; }
.group dt { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; line-height: 1.2; }
.group dd { margin: 0.15rem 0 1.1rem; color: var(--mist); font-size: 0.92rem; }

.os-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}
.os h3 { margin: 0 0 1rem; font-size: 1.5rem; }
.os ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.os li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.1rem 2.6rem;
  max-width: 34em;
  color: var(--mist);
}
.os li strong { color: var(--ivory); font-weight: 600; }
.os li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.05rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}
code {
  font-size: 0.86em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: rgb(239 232 220 / 0.08);
  color: var(--ivory);
  overflow-wrap: anywhere;
}

.notes ul { margin: 0 0 1.5rem; padding-left: 1.2rem; max-width: 44em; color: var(--mist); }
.notes li { margin-bottom: 0.5rem; }
.notes li::marker { color: var(--gold); }
details summary { cursor: pointer; color: var(--ivory); font-weight: 500; }
details pre {
  margin: 0.75rem 0 0;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--lacquer-2);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  color: var(--mist);
}

/* Listen: one row per example, a round play button, a thin progress line */
.listen-intro { color: var(--mist); margin: 0 0 2rem; max-width: 42em; }
.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.track {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.4rem 1.25rem;
  padding: 1.1rem 0 0;
}
.track h3 { margin: 0; font-size: 1.45rem; line-height: 1.2; }
.track p { margin: 0.1rem 0 0; color: var(--mist); font-size: 0.92rem; }
.time { color: var(--mist); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.play {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s;
}
.play::before {
  content: "";
  position: absolute;
  left: 52%;
  top: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 0.5rem 0 0.5rem 0.8rem;
  border-color: transparent transparent transparent var(--gold);
}
.play:hover { background: rgb(216 166 96 / 0.12); }
.track.is-playing .play { background: var(--gold); }
.track.is-playing .play::before {
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.75rem;
  height: 0.9rem;
  border: 0;
  border-left: 0.25rem solid var(--lacquer);
  border-right: 0.25rem solid var(--lacquer);
}
.bar { grid-column: 1 / -1; height: 1px; margin-top: 0.7rem; background: var(--line); }
.bar span { display: block; height: 2px; margin-top: -0.5px; width: 0; background: var(--gold); }

/* Sticky player: slides up on the first play, folds down to a tab with the chevron */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: linear-gradient(rgb(34 25 19 / 0.97), rgb(23 17 13 / 0.98));
  border-top: 1px solid var(--line);
  box-shadow: 0 -20px 50px rgb(0 0 0 / 0.45);
  backdrop-filter: blur(10px);
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.player.is-shown { transform: translateY(0); }
.player.is-shown.is-folded { transform: translateY(100%); }
html.player-open body { padding-bottom: 7.5rem; }
.player-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: min(22rem, 70vw);
  padding: 0.45rem 0.9rem 0.4rem;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgb(34 25 19 / 0.97);
  color: var(--mist);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.toggle-title { display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ivory); }
.player.is-folded .toggle-title { display: inline; }
.player.is-folded.is-playing .toggle-title::before { content: "\266A  "; color: var(--gold); }
.chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.3s;
}
.player.is-folded .chevron { transform: translateY(25%) rotate(-135deg); }
.player-body {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0.85rem var(--gutter) 0.9rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "controls meta time volume" "wave wave wave wave";
  align-items: center;
  gap: 0.5rem 1.5rem;
}
.player-controls { grid-area: controls; display: flex; align-items: center; gap: 0.35rem; }
.ctl {
  position: relative;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.ctl.main { width: 2.9rem; height: 2.9rem; border: 1px solid var(--gold); }
.ctl.main::before {
  content: "";
  position: absolute;
  left: 54%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.5rem 0 0.5rem 0.8rem;
  border-color: transparent transparent transparent var(--gold);
}
.player.is-playing .ctl.main { background: var(--gold); }
.player.is-playing .ctl.main::before {
  left: 50%;
  width: 0.75rem;
  height: 0.9rem;
  border: 0;
  border-left: 0.25rem solid var(--lacquer);
  border-right: 0.25rem solid var(--lacquer);
}
.ctl.prev::before,
.ctl.next::before,
.ctl.prev::after,
.ctl.next::after { content: ""; position: absolute; top: 50%; transform: translateY(-50%); }
.ctl.prev::before,
.ctl.next::before { width: 2px; height: 0.8rem; background: var(--ivory); }
.ctl.prev::after,
.ctl.next::after { border-style: solid; border-width: 0.4rem 0; border-color: transparent; }
.ctl.prev::before { left: 0.7rem; }
.ctl.prev::after { left: 0.8rem; border-right: 0.6rem solid var(--ivory); }
.ctl.next::before { right: 0.7rem; }
.ctl.next::after { right: 0.8rem; border-left: 0.6rem solid var(--ivory); }
.ctl:hover::before,
.ctl:hover::after { opacity: 0.8; }
.player-meta { grid-area: meta; min-width: 0; }
.player-title { margin: 0; font-family: var(--serif); font-size: 1.25rem; line-height: 1.2; }
.player-desc { margin: 0; color: var(--mist); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-time { grid-area: time; color: var(--mist); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-volume { grid-area: volume; display: flex; align-items: center; gap: 0.5rem; }
.speaker {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--mist);
  clip-path: polygon(0 30%, 40% 30%, 100% 0, 100% 100%, 40% 70%, 0 70%);
}
.player-volume input { width: 6.5rem; accent-color: var(--gold); }
.wave { grid-area: wave; height: 2.4rem; cursor: pointer; touch-action: none; }
.wave canvas { width: 100%; height: 100%; display: block; }
.track.is-current h3 { color: var(--gold); }

/* Post-download help */
.install-help {
  width: min(34rem, calc(100vw - 2rem));
  padding: 1.9rem 1.9rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(var(--lacquer-2), var(--lacquer));
  color: var(--ivory);
  box-shadow: 0 30px 80px var(--shadow);
}
.install-help::backdrop { background: rgb(0 0 0 / 0.6); backdrop-filter: blur(3px); }
.install-help h2 { font-size: 1.9rem; margin: 0 0 0.5rem; }
.help-intro { margin: 0 0 1.25rem; color: var(--mist); font-size: 0.95rem; }
.help-steps { display: none; margin: 0 0 1.25rem; padding-left: 1.3rem; color: var(--mist); }
.help-steps li { margin-bottom: 0.6rem; padding-left: 0.2rem; }
.help-steps li::marker { color: var(--gold); font-weight: 600; }
.install-help[data-os="mac"] .help-steps[data-os="mac"],
.install-help[data-os="windows"] .help-steps[data-os="windows"] { display: block; }
.help-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.help-close {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.7rem 1.5rem;
  border-radius: 2px;
  border: 0;
  background: var(--gold);
  color: var(--lacquer);
  cursor: pointer;
}
.help-more { font-size: 0.9rem; }

.bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--line);
  color: var(--mist);
  font-size: 0.85rem;
}
.bottom p { margin: 0; margin-right: auto; }
.bottom a { color: var(--mist); }

@media (max-width: 860px) {
  .wordmark { white-space: nowrap; font-size: 1.2rem; letter-spacing: 0.12em; }
  .build { display: none; }
  .hero { padding-top: 8rem; }
  .hero::after {
    background: linear-gradient(180deg, rgb(23 17 13 / 0.7) 0%, rgb(23 17 13 / 0.8) 50%, var(--lacquer) 100%);
  }
  .sound { grid-template-columns: 1fr; }
  .sound-image { aspect-ratio: 16 / 9; object-position: 50% 42%; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .group + .group { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .dl { min-width: 0; flex: 1 1 14rem; }
  .top-listen { display: none; }
  .top-link { margin-left: auto; }
  .player-body { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "controls meta time" "wave wave wave"; gap: 0.4rem 0.9rem; }
  .player-volume, .player-desc { display: none; }
  .ctl.prev, .ctl.next { width: 1.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shot,
  .dl,
  .player,
  .chevron { transition: none; }
}
