/* Morin Khuur Simulator — landing page, "Steppe night".
   Dark by design: it continues the app's own look (deep brown/black, amber light,
   blue male string, orange female string), with Mongolian ornament (khee key band,
   ulzii knot, ram's-horn corners) drawn for this page. */

:root {
  color-scheme: dark;

  --bg: #0b0907;
  --bg-raise: #110d0a;
  --surface: #17120e;
  --surface-2: #1e1712;
  --surface-3: #271e17;
  --line: rgba(243, 222, 186, 0.1);
  --line-strong: rgba(243, 222, 186, 0.2);
  --line-amber: rgba(246, 169, 48, 0.32);

  --text: #f4ecdd;
  --text-2: #d3c4ad;
  --text-3: #ab9881;

  --amber: #f6a930;
  --amber-hi: #ffc867;
  --amber-lo: #d48a1c;
  --wood: #e0a263;
  --male: #5aa8ff;
  --female: #ff9b3d;
  --night: #0d1729;
  --gold: #e8b54e;

  --font-display: "EB Garamond", "EB Garamond Fallback", "EB Garamond Fallback Noto", Georgia, serif;
  --font-body: "Golos Text", "Golos Fallback", "Golos Fallback Arial", "Golos Fallback Roboto", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 22px;
  --header-h: 72px;
  --knot-gap: var(--bg);

  --khee-amber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='30' viewBox='0 0 8 10'%3E%3Cpath d='M0 .5H8M0 9.5H8M0 8h2V2h6v4H6V4H4v4h4' fill='none' stroke='%23f6a930' stroke-width='.8'/%3E%3C/svg%3E");
  --khee-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='30' viewBox='0 0 8 10'%3E%3Cpath d='M0 .5H8M0 9.5H8M0 8h2V2h6v4H6V4H4v4h4' fill='none' stroke='%23e8b54e' stroke-width='.8'/%3E%3C/svg%3E");
}
@media (max-width: 859px) { :root { --header-h: 64px; } }

/* Width-matched local fallbacks: until the web fonts arrive, text wraps the same way, so nothing jumps. */
@font-face { font-family: "EB Garamond Fallback"; src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Times"); size-adjust: 96.5%; }
@font-face { font-family: "EB Garamond Fallback Noto"; src: local("Noto Serif"), local("NotoSerif"), local("Droid Serif"); size-adjust: 83%; }
@font-face { font-family: "Golos Fallback"; src: local("Segoe UI"); size-adjust: 108.5%; }
@font-face { font-family: "Golos Fallback Arial"; src: local("Arial"), local("ArialMT"), local("Helvetica Neue"), local("Helvetica"); size-adjust: 108.4%; }
@font-face { font-family: "Golos Fallback Roboto"; src: local("Roboto"), local("Noto Sans"); size-adjust: 106%; }

/* ---------- Language switch: both languages live in the HTML ---------- */
html[lang="mn"] [data-l="en"],
html:not([lang="mn"]) [data-l="mn"] { display: none !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--amber-hi); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffd88f; }
b, strong { color: var(--text); font-weight: 600; }
p { margin: 0 0 1em; }
h1, h2, h3 { color: var(--text); margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
q { quotes: "“" "”"; }
html[lang="mn"] q { quotes: "«" "»"; }
::selection { background: rgba(246, 169, 48, 0.35); color: #fff; }

:focus-visible { outline: 2.5px solid var(--amber-hi); outline-offset: 3px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.skip {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--amber); color: #1b1205; font-weight: 700; text-decoration: none;
  transform: translateY(-300%); opacity: 0;
}
.skip:focus { transform: none; opacity: 1; color: #1b1205; }

/* ---------- Type ---------- */
.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.05rem, 1.3rem + 2.7vw, 3.45rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.35rem + 0.8vw, 2rem);
  line-height: 1.12;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 16px;
  color: var(--amber);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 26px; height: 1.5px; background: linear-gradient(90deg, transparent, var(--amber)); }
.lead {
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.18rem);
  line-height: 1.7;
  color: var(--text-2);
  max-width: 40em;
  text-wrap: pretty;
}
.section { position: relative; padding-block: clamp(52px, 6.2vw, 84px); }
.section-head { max-width: 780px; margin-bottom: clamp(32px, 4.5vw, 52px); }
.section-head .h2 { margin-bottom: 18px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .lead { margin-inline: auto; }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .25s ease, background-color .2s, border-color .2s, color .2s, filter .2s;
}
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 1rem; }
.btn-xl { min-height: 62px; padding: 0 26px; font-size: 1.02rem; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 0.88rem; }
.btn-primary {
  color: #1b1205;
  background: linear-gradient(180deg, #ffd47e 0%, #f6a930 52%, #e48f19 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(120, 60, 0, 0.25), 0 14px 34px -12px rgba(246, 169, 48, 0.75);
}
.btn-primary:hover { color: #1b1205; filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); filter: brightness(.97); }
.btn-ghost { color: var(--text); background: rgba(255, 240, 215, 0.04); border-color: rgba(243, 222, 186, 0.24); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 240, 215, 0.08); border-color: rgba(246, 169, 48, 0.5); }
.btn svg { flex: none; }
.btn-stack { display: grid; text-align: left; line-height: 1.2; }
.btn-label { font-weight: 700; font-size: 1.04rem; }
.btn-sub { font-weight: 500; font-size: 0.78rem; opacity: .78; font-variant-numeric: tabular-nums; margin-top: 2px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  color: var(--text-2); background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: color .2s, background-color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--text); background: rgba(255,240,215,.06); border-color: var(--line); }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 0; border: 0; background: none; cursor: pointer;
  color: var(--amber-hi); font-weight: 600; font-size: 0.92rem;
  text-decoration: underline; text-decoration-color: rgba(246,169,48,.45); text-underline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  transition: background-color .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled, .site-header.menu-open {
  background: rgba(11, 9, 7, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--text); }
.brand img { width: 36px; height: 36px; flex: none; }
.brand-name { font-weight: 700; font-size: 0.98rem; line-height: 1.15; }
.site-nav { display: flex; gap: 2px; margin-left: auto; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-size: 0.93rem; font-weight: 500;
  transition: color .2s, background-color .2s;
}
.site-nav a:hover { color: var(--text); background: rgba(255,240,215,.05); }
.site-nav .nav-extra { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.lang {
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.25);
}
.lang button {
  min-width: 42px; min-height: 34px; padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--text-2); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em;
  cursor: pointer; transition: background-color .2s, color .2s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--amber); color: #1b1205; }
.header-dl { color: var(--amber-hi); border-color: var(--line-amber); background: rgba(246,169,48,.08); }
.header-dl:hover { color: #1b1205; background: var(--amber); border-color: var(--amber); }
.menu-btn { display: none; border-color: var(--line-strong); }
.menu-btn .i-shut, .menu-btn[aria-expanded="true"] .i-open { display: none; }
.menu-btn[aria-expanded="true"] .i-shut { display: block; }

@media (max-width: 1159px) {
  .menu-btn { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    display: none; flex-direction: column; gap: 0;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    padding: 8px var(--gutter) 20px;
    background: rgba(13, 10, 8, 0.97);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 50px -20px rgba(0,0,0,.8);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 6px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav .nav-extra { display: flex; color: var(--amber-hi); }
}
@media (max-width: 719px) { .header-gh { display: none; } }
@media (max-width: 679px) { .header-dl { display: none; } }
@media (max-width: 420px) {
  .brand { gap: 10px; }
  .brand img { width: 32px; height: 32px; }
  .brand-name { font-size: 0.88rem; max-width: 9.5em; }
  .header-inner { gap: 10px; }
  .lang button { min-width: 38px; padding: 0 8px; }
}

/* ---------- Hero ---------- */
.hero {
  --hero-pb: clamp(36px, 6vh, 64px);
  position: relative;
  min-height: clamp(600px, 100vh, 1040px);
  min-height: clamp(600px, 100svh, 1040px);
  padding: calc(var(--header-h) + clamp(20px, 4.5vh, 52px)) 0 var(--hero-pb);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(56% 52% at 74% 74%, rgba(246, 169, 48, 0.15), transparent 70%),
    radial-gradient(42% 40% at 8% 6%, rgba(90, 168, 255, 0.075), transparent 70%),
    linear-gradient(180deg, #050508 0%, #09080a 40%, #130d09 80%, #0b0907 100%);
}
.hero::before { /* film grain */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-sky {
  position: absolute; inset: 0 0 30% 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent);
  mask-image: linear-gradient(180deg, #000 40%, transparent);
}
.sky-layer { position: absolute; inset: 0; }
.stars { width: 100%; height: 100%; }
/* twinkling: whole layers fade, so it stays on the compositor */
.tw { animation: twinkle 4.2s ease-in-out infinite alternate; will-change: opacity; }
.tw2 { animation-duration: 5.6s; animation-delay: -2s; }
.tw3 { animation-duration: 3.3s; animation-delay: -1.2s; }
@keyframes twinkle { from { opacity: .15; } to { opacity: 1; } }

.hero-hills {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 0;
  width: 100%; height: clamp(90px, 14vw, 190px);
  pointer-events: none;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "copy" "dl" "visual" "player";
  gap: 22px;
}
/* phones: show the instrument before the (GitHub) actions, smaller */
html[data-os="mobile"] .hero-grid { grid-template-areas: "copy" "visual" "dl" "player"; }
.hero-copy { grid-area: copy; max-width: 650px; }
.hero-dl { grid-area: dl; max-width: 650px; }
.hero-visual { grid-area: visual; }
.hero-player, .hero-listen-fallback { grid-area: player; }
.hero-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px 6px 10px; border-radius: 999px;
  background: rgba(246, 169, 48, 0.1); border: 1px solid rgba(246, 169, 48, 0.32);
  color: var(--amber-hi); font-size: 0.8rem; font-weight: 600;
}
.pill-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.pill-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--amber);
  animation: ping 2.4s ease-out infinite; will-change: transform, opacity;
}
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(3.4); opacity: 0; } }
.hero-tags { color: var(--text-3); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  /* sized so each line of the title ("The morin khuur," / "таны компьютер дээр.") fits its column */
  --col: calc(100vw - 2 * var(--gutter));
  font-size: min(clamp(2.7rem, 1.45rem + 4.3vw, 5.2rem), calc(var(--col) / 7.7));
  line-height: 1;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
  text-wrap: balance;
}
.hero-title em {
  font-style: italic; font-weight: 500;
  background: linear-gradient(100deg, #ffd88f 0%, #f6a930 45%, #ff9b3d 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-right: .06em;
  display: block;
}
html[lang="mn"] .hero-title { font-size: min(clamp(2.3rem, 1.2rem + 3.2vw, 3.9rem), calc(var(--col) / 10)); line-height: 1.05; }
.hero-lead { font-size: clamp(1.02rem, .97rem + .32vw, 1.17rem); line-height: 1.68; color: var(--text-2); max-width: 36em; margin-bottom: 0; }
.hero-lead i { color: var(--text); }

/* download area: platform from <head> (data-os / data-arch), no layout shift */
.dl-win .dl-row, .dl-other .dl-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.dl-other { display: none; }
html[data-os="mac"] .dl-win, html[data-os="linux"] .dl-win, html[data-os="cros"] .dl-win, html[data-os="mobile"] .dl-win { display: none; }
html[data-os="mac"] .dl-other, html[data-os="linux"] .dl-other, html[data-os="cros"] .dl-other, html[data-os="mobile"] .dl-other { display: block; }
.pf { display: none; }
html[data-os="mobile"] .pf-mobile, html[data-os="mac"] .pf-mac, html[data-os="linux"] .pf-linux, html[data-os="cros"] .pf-cros,
html[data-os="mac"] .pf-desk, html[data-os="linux"] .pf-desk, html[data-os="cros"] .pf-desk { display: inline; }
html[data-os="mobile"] .dl-share { display: block; }
.only-arm { display: none; }
html[data-arch="arm"] .only-arm { display: inline; }
html[data-arch="arm"] .only-x64 { display: none; }
.dl-other-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; color: var(--text); font-weight: 700; font-size: 1.05rem;
}
.dl-other-title::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.dl-note { margin: 16px 0 0; color: var(--text-2); font-size: 0.96rem; line-height: 1.6; max-width: 36em; }
.dl-share { margin: 6px 0 0; }
.share-done, .can-share .if-copy, .if-share { display: none; }
.can-share .if-share { display: inline; }
.is-done .share-idle { display: none; }
.is-done .share-done { display: inline; }
.dl-more { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 14px 0 0; font-size: 0.88rem; }
.dl-more-label { color: var(--text-3); }
.dl-more a { color: var(--text-2); text-decoration: underline; text-decoration-color: rgba(246,169,48,.45); }
.dl-more a:hover { color: var(--amber-hi); }
.dl-hint { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; color: var(--text-3); font-size: 0.84rem; line-height: 1.5; }
.dl-hint svg { flex: none; margin-top: 2px; color: var(--amber); }
.dl-hint b { color: var(--text-2); font-weight: 600; }

/* the instrument */
.hero-visual { --vh: min(150px, calc((100vw - 2 * var(--gutter)) * 0.41)); position: relative; height: var(--vh); }
html[data-os="mobile"] .hero-visual { --vh: min(118px, calc((100vw - 2 * var(--gutter)) * 0.33)); margin-block: 4px; }
.khuur-stage {
  position: absolute; left: 50%; top: 50%;
  height: calc(var(--vh) * 2.405); aspect-ratio: 420 / 1010;
  transform: translate(-50%, -50%) rotate(-90deg) scaleX(-1);
}
.khuur, .k-bow, .k-bow svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.k-glow {
  position: absolute; left: -45%; right: -45%; top: 45%; bottom: -12%;
  background: radial-gradient(closest-side, rgba(246,169,48,.40), rgba(217,131,29,.14) 50%, transparent);
  animation: glow 6s ease-in-out infinite alternate; will-change: opacity;
}
@keyframes glow { from { opacity: .7; } to { opacity: 1; } }
.k-bow { animation: bow 3.6s ease-in-out infinite alternate; will-change: transform; }
@keyframes bow { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
.vib-amp { opacity: 0; transition: opacity .25s; }
.audio-on .vib-amp { opacity: var(--amp, .9); transition: none; }
.audio-on .vib { transform-box: fill-box; transform-origin: center; animation: vib .12s ease-in-out infinite alternate; }
.audio-on .vib-f { animation-duration: .095s; }
@keyframes vib { from { transform: scaleX(1); } to { transform: scaleX(.3); } }
.audio-on .k-glow { animation-duration: 1.4s; }
.hero.anim-off *, .anim-off, .anim-off * { animation-play-state: paused !important; }

@media (min-width: 860px) {
  .hero-title { --col: calc((min(1200px, 100vw - 2 * var(--gutter)) - 40px) * 0.56); }
  .hero-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    grid-template-areas: "copy visual" "dl visual" "player visual";
    grid-template-rows: auto auto auto;
    column-gap: 40px; row-gap: 26px;
    align-content: center;
    min-height: calc(min(100svh, 1040px) - var(--header-h) - clamp(20px, 4.5vh, 52px) - var(--hero-pb));
  }
  html[data-os] .hero-grid { grid-template-areas: "copy visual" "dl visual" "player visual"; }
  .hero-grid > .hero-dl { margin-top: -2px; }
  html[data-os] .hero-visual { position: relative; height: auto; margin: 0; align-self: stretch; min-height: 0; }
  .khuur-stage {
    left: 50%; top: auto; bottom: calc(-1 * var(--hero-pb) + 6px);
    height: min(calc(100svh - var(--header-h) - 24px), 880px);
    transform: translateX(-50%);
  }
}
/* short laptop screens: keep the CTA in the first view */
@media (min-width: 860px) and (max-height: 820px) {
  .hero { padding-top: calc(var(--header-h) + 16px); --hero-pb: 26px; }
  .hero-eyebrow { margin-bottom: 14px; }
  .hero-title { font-size: min(clamp(2.5rem, 1rem + 3.8vw, 4.1rem), calc(var(--col) / 7.7)); margin-bottom: 16px; }
  html[lang="mn"] .hero-title { font-size: min(clamp(2.3rem, 1rem + 3.4vw, 3.6rem), calc(var(--col) / 10)); }
  .hero-lead { font-size: 1.01rem; line-height: 1.6; margin-bottom: 22px; }
  .dl-more, .dl-hint { margin-top: 8px; }
  /* the hero runs taller than the screen here: hang the instrument from the top so it is whole in the first view */
  .khuur-stage { top: -6px; bottom: auto; height: calc(100svh - var(--header-h) - 22px); }
}
@media (max-width: 859px) {
  .hero { padding-top: calc(var(--header-h) + clamp(14px, 3vh, 40px)); }
}
@media (max-width: 479px) {
  .hero-tags { display: none; }
  .hero-eyebrow { margin-bottom: 16px; }
  .hero-lead { font-size: 1rem; line-height: 1.6; margin-bottom: 22px; }
  .hero-title { margin-bottom: 18px; }
  .btn-xl { padding: 0 20px; }
  .dl-win .dl-row .btn, .dl-other .dl-row .btn { flex: 1 1 auto; }
}

/* hear it first: a small remote for the demos */
.hero-player {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  column-gap: 16px; row-gap: 12px;
  max-width: 650px; align-self: start;
  padding: 14px 16px 14px 14px; border-radius: 22px;
  border: 1px solid var(--line-amber);
  background: linear-gradient(180deg, rgba(34, 26, 19, 0.82), rgba(18, 14, 11, 0.82));
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.9);
}
.hp-play {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  border: 0; background: var(--amber); color: #1b1205; cursor: pointer;
  box-shadow: 0 0 26px rgba(246,169,48,.45);
  transition: transform .15s, background-color .2s;
}
.hp-play:hover { background: #ffb948; }
.hp-play:active { transform: scale(.96); }
.hp-play svg { margin-left: 1px; }
.hp-main { display: grid; gap: 8px; min-width: 0; }
.hp-kicker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; min-width: 0; font-size: 0.8rem; line-height: 1.3; }
.hp-title { flex: none; color: var(--amber); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .76rem; }
.hp-now { min-width: 0; color: var(--text-3); }
.hp-time { margin-left: auto; flex: none; color: var(--text-3); font-variant-numeric: tabular-nums; }
.hp-ab { display: inline-flex; flex-wrap: wrap; gap: 3px; justify-self: start; padding: 3px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(0,0,0,.3); }
.hp-ab button {
  min-height: 34px; padding: 4px 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-2); font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: background-color .2s, color .2s;
}
.hp-ab button b { font-weight: 800; color: inherit; margin-right: 2px; }
.hp-ab button:hover { color: var(--text); background: rgba(255,240,215,.06); }
.hp-ab button[aria-pressed="true"] { background: var(--amber); color: #1b1205; }
.hp-bar { height: 3px; border-radius: 3px; background: rgba(243,222,186,.14); overflow: hidden; }
.hp-bar span { display: block; height: 100%; background: var(--amber); transform-origin: left center; transform: scaleX(var(--f, 0)); }
.hp-pads { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.hp-pads-label { color: var(--text-3); font-size: 0.82rem; margin-right: 2px; }
.hp-pads button {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 32px; padding: 3px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(255,240,215,.03);
  color: var(--text-2); font-size: 0.8rem; font-weight: 600; cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}
.hp-pads button::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); transition: background-color .2s, box-shadow .2s; }
.hp-pads button:hover { color: var(--text); border-color: var(--line-amber); }
.hp-pads button[aria-pressed="true"] { border-color: var(--amber); color: var(--amber-hi); background: rgba(246,169,48,.1); }
.hp-pads button[aria-pressed="true"]::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.hero-player.is-playing .hp-play { box-shadow: 0 0 0 6px rgba(246,169,48,.14), 0 0 30px rgba(246,169,48,.5); }
.hero-listen-fallback { display: none; justify-self: start; color: var(--text-2); font-weight: 600; font-size: 0.95rem; }
html:not(.enhanced) .hero-player { display: none; }
html:not(.enhanced) .hero-listen-fallback { display: inline-block; }
@media (max-width: 479px) {
  .hero-player { padding: 12px; column-gap: 12px; border-radius: 18px; }
  .hp-play { width: 50px; height: 50px; }
}

/* ---------- Facts strip ---------- */
.facts { position: relative; padding: 8px 0 0; }
.facts-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts-list li { display: flex; flex-direction: column; gap: 6px; padding: 24px 18px; border-right: 1px solid var(--line); }
.facts-list li:nth-child(2n) { border-right: 0; }
.facts-list li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.fact-num {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.1rem, 1.7rem + 1.5vw, 2.9rem); line-height: 1;
  color: var(--amber-hi); white-space: nowrap; font-variant-numeric: lining-nums;
}
.fact-num small { font-size: .55em; color: var(--amber); font-weight: 600; }
.fact-text { font-size: 0.9rem; line-height: 1.5; color: var(--text-2); }
@media (min-width: 900px) {
  .facts-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .facts-list li { padding: 30px 28px; }
  .facts-list li:nth-child(2n) { border-right: 1px solid var(--line); }
  .facts-list li:last-child { border-right: 0; }
  .facts-list li:nth-child(-n+2) { border-bottom: 0; }
}

/* ---------- About: Fig. 1 + legend, Fig. 2 ---------- */
.about-grid { display: grid; gap: 36px; }
.about-copy { grid-row: 1; }
.about-copy .h2 { margin-bottom: 20px; }
.fig1 { margin: 0; display: grid; justify-items: center; gap: 12px; }
.fig1-svg { height: min(460px, 110vw); width: auto; }
.fig1 figcaption, .strings-figure figcaption { color: var(--text-3); font-family: var(--font-display); font-style: italic; font-size: 1.02rem; }
.f-line { stroke: #e2c69c; stroke-opacity: .72; stroke-width: 1.7; }
.f-lead { stroke: var(--amber); stroke-opacity: .55; stroke-width: 1.3; }
.f-mark circle { fill: #120e0b; stroke: var(--amber); stroke-width: 1.8; }
.f-mark text { fill: var(--amber-hi); font-family: var(--font-body); font-weight: 700; font-size: 18px; }
.anatomy { display: grid; gap: 0 32px; margin-top: 26px; }
.anatomy li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.anatomy h3 { font-size: 1.04rem; font-weight: 600; line-height: 1.35; margin-bottom: 3px; }
.anatomy p { margin: 0; font-size: 0.96rem; line-height: 1.58; }
.anat-num {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1.6px solid var(--amber); color: var(--amber-hi); font-weight: 700; font-size: 0.85rem;
  background: rgba(246,169,48,.06);
}
.num-male { border-color: var(--male); color: #a8d0ff; box-shadow: 0 0 12px rgba(90,168,255,.35); }
.num-female { border-color: var(--female); color: #ffc58f; box-shadow: 0 0 12px rgba(255,155,61,.35); }
.fig2-row { display: grid; gap: 22px; margin-top: 44px; align-items: center; }
.strings-figure {
  margin: 0; padding: clamp(14px, 3vw, 24px) clamp(14px, 3vw, 24px) 16px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: radial-gradient(80% 120% at 50% 0%, rgba(246,169,48,.07), transparent 60%), linear-gradient(180deg, var(--surface-2), var(--surface));
}
.strings-svg { width: 100%; height: auto; }
.strings-figure figcaption { margin-top: 8px; }
.tunings {
  margin: 0; padding: 16px 20px;
  border-left: 2px solid var(--amber);
  background: linear-gradient(90deg, rgba(246,169,48,.07), transparent 80%);
  border-radius: 0 12px 12px 0;
  color: var(--text-2); font-size: 0.98rem;
}
@media (min-width: 640px) { .anatomy { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .about-grid { grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); gap: 56px; align-items: start; }
  .about-copy { grid-row: auto; }
  .fig1 { position: sticky; top: calc(var(--header-h) + 24px); }
  .fig1-svg { height: min(600px, calc(100vh - var(--header-h) - 110px)); }
  .fig2-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; }
}

/* ---------- Ornament: khee key band and ulzii divider ---------- */
.khee {
  height: 30px;
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
  background: var(--khee-amber) repeat-x center / 24px 30px;
  opacity: .62;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.knot-gap { stroke: var(--knot-gap, #0b0907); }
.divider-knot { display: flex; align-items: center; gap: 18px; max-width: 520px; margin: 0 auto clamp(36px, 5vw, 56px); color: var(--amber); }
.divider-knot::before, .divider-knot::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(246,169,48,.5)); }
.divider-knot::after { background: linear-gradient(90deg, rgba(246,169,48,.5), transparent); }
.divider-knot svg { width: 66px; height: 42px; opacity: .9; }

/* ---------- Parts ---------- */
.part-num {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; color: var(--amber);
}
.part-app { font-family: var(--font-body); color: var(--text-3); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; }
.part .h3 { margin-bottom: 12px; }
.part-text p { font-size: 0.99rem; line-height: 1.66; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips li {
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(255, 240, 215, 0.03);
  color: var(--text-2); font-size: 0.8rem; font-weight: 500; line-height: 1.5;
}
.chips li.chip-accent { border-color: var(--line-amber); color: var(--amber-hi); background: rgba(246,169,48,.07); }
.chips-lg li { padding: 8px 16px; font-size: 0.9rem; }
.shot {
  position: relative; display: block; aspect-ratio: 16 / 10;
  border-radius: 14px; overflow: hidden; background: #120e0b;
  border: 1px solid rgba(243, 222, 186, 0.14);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.5);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .3s;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot:hover { transform: translateY(-3px); border-color: rgba(246,169,48,.4); box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), 0 0 50px -12px rgba(246,169,48,.35); }
.shot-zoom {
  position: absolute; top: 12px; right: 12px;
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: rgba(11, 9, 7, 0.72); color: var(--text); border: 1px solid var(--line-strong);
  opacity: 0; transform: scale(.9); transition: opacity .25s, transform .25s;
}
.shot:hover .shot-zoom, .shot:focus-visible .shot-zoom { opacity: 1; transform: none; }
@media (hover: none) { .shot-zoom { opacity: .9; transform: none; } }
/* framed screenshot with ram's-horn corners */
.frame { position: relative; padding: clamp(8px, 1.2vw, 14px); border: 1px solid var(--line-amber); border-radius: 6px; background: rgba(246,169,48,.03); }
.frame .shot { border-radius: 4px; }
.corner { position: absolute; width: 46px; height: 46px; color: var(--amber); pointer-events: none; z-index: 2; }
.corner.tl { top: -12px; left: -12px; }
.corner.tr { top: -12px; right: -12px; transform: scaleX(-1); }
.corner.bl { bottom: -12px; left: -12px; transform: scaleY(-1); }
.corner.br { bottom: -12px; right: -12px; transform: scale(-1, -1); }
@media (max-width: 599px) { .corner { width: 34px; height: 34px; } .corner.tl, .corner.tr { top: -9px; } .corner.bl, .corner.br { bottom: -9px; } .corner.tl, .corner.bl { left: -9px; } .corner.tr, .corner.br { right: -9px; } }
.part-feature { display: grid; gap: 34px; align-items: center; margin-bottom: 40px; }
.parts-grid { display: grid; gap: 22px; }
.part-card { display: flex; flex-direction: column; padding: 12px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.part-card .part-text { padding: 20px 12px 12px; }
@media (min-width: 820px) {
  .parts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .part-card .part-text { padding: 24px 20px 16px; }
}
@media (min-width: 1000px) {
  .part-feature { grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.6fr); gap: 52px; margin-bottom: 48px; }
}

/* ---------- Listen ---------- */
.listen { padding-top: clamp(40px, 5vw, 64px); background: radial-gradient(45% 30% at 50% 28%, rgba(90,168,255,.05), transparent 100%); }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 7px; background: var(--amber); color: #1b1205; font-size: 0.75rem; font-weight: 800; letter-spacing: .06em; }
.synth-tag { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 0.78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.synth-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--male); box-shadow: 0 0 8px var(--male); }
.ab {
  position: relative; overflow: hidden; display: grid; gap: 26px;
  padding: clamp(22px, 4vw, 44px); border-radius: 28px;
  border: 1px solid var(--line-amber);
  background:
    radial-gradient(70% 90% at 100% 100%, rgba(246,169,48,.14), transparent 60%),
    radial-gradient(50% 70% at 0% 0%, rgba(90,168,255,.06), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 40px 90px -50px rgba(0,0,0,.9);
  margin-bottom: 22px;
}
.ab .h3 { margin-bottom: 12px; }
.ab-info p { font-size: 1rem; }
.ab-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 0; padding: 4px; border: 1px solid var(--line-strong); border-radius: 16px; background: rgba(0, 0, 0, 0.3); max-width: 100%; }
.ab-switch label { position: relative; display: block; cursor: pointer; }
.ab-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ab-switch label > span {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border-radius: 12px;
  color: var(--text-2); font-weight: 600; font-size: 0.93rem; transition: background-color .2s, color .2s;
}
.ab-switch label > span b { color: inherit; font-weight: 800; }
.ab-switch label > span small { color: inherit; opacity: .7; font-variant-numeric: tabular-nums; }
.ab-switch input:checked + span { background: var(--amber); color: #1b1205; }
.ab-switch label:hover input:not(:checked) + span { color: var(--text); background: rgba(255,240,215,.06); }
.ab-switch input:focus-visible + span { outline: 2.5px solid var(--amber-hi); outline-offset: 2px; }
.ab-player { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 28px); }
.p-main { flex: 1; min-width: 0; }
.p-play {
  flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  border: 1.5px solid var(--line-amber); background: rgba(246,169,48,.08); color: var(--amber-hi); cursor: pointer;
  transition: background-color .2s, color .2s, transform .15s, box-shadow .3s;
}
.p-play:hover { background: rgba(246,169,48,.18); }
.p-play:active { transform: scale(.96); }
.p-play svg { margin-left: 1px; }
.i-pause { display: none; }
.is-playing .i-play { display: none; }
.is-playing .i-pause { display: block; }
.is-playing .p-play { background: var(--amber); color: #1b1205; border-color: var(--amber); box-shadow: 0 0 0 6px rgba(246,169,48,.12), 0 0 30px rgba(246,169,48,.45); }
.p-play-lg { width: 76px; height: 76px; background: var(--amber); color: #1b1205; border-color: var(--amber); box-shadow: 0 16px 40px -12px rgba(246,169,48,.7); }
.p-play-lg:hover { background: #ffb948; }
.p-wave { position: relative; height: 56px; --p: 0%; }
.ab .p-wave { height: 88px; }
.p-wave svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.p-wave .w-base { fill: rgba(243, 222, 186, 0.2); }
.p-wave .w-played { fill: var(--amber); clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.ab[data-active="1"] .w-played { fill: var(--female); }
/* playhead: a full-width layer moved with a transform, so playback never triggers layout */
.p-head { position: absolute; top: -4px; bottom: -4px; left: 0; width: 100%; transform: translateX(var(--p)); pointer-events: none; opacity: 0; transition: opacity .2s; }
.p-head::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 10px rgba(255,240,215,.6); }
.is-playing .p-head, .has-played .p-head { opacity: .9; }
.p-seek { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.p-wave:has(.p-seek:focus-visible) { outline: 2.5px solid var(--amber-hi); outline-offset: 5px; border-radius: 6px; }
.p-time { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--text-3); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.p-style-name { color: var(--text-2); font-weight: 600; text-align: center; }
.tracks { display: grid; gap: 18px; }
.track {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px;
  padding: 22px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: border-color .3s, box-shadow .3s;
}
.track.is-playing { border-color: var(--line-amber); box-shadow: 0 0 60px -30px rgba(246,169,48,.5); }
.track h3 { font-size: 1.08rem; font-weight: 600; line-height: 1.35; margin: 4px 0 4px; }
.track-desc { font-size: 0.93rem; line-height: 1.55; margin: 0 0 14px; color: var(--text-2); }
.track .p-wave { height: 44px; }
.listen-note { margin: 24px 0 0; color: var(--text-3); font-size: 0.88rem; max-width: 52em; }
@media (min-width: 760px) { .tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .ab { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 48px; } }
/* progressive enhancement: native players until main.js takes over */
.native audio { width: 100%; margin-top: 6px; }
.native p { margin: 10px 0 0; font-size: 0.9rem; }
html:not(.enhanced) .p-play, html:not(.enhanced) .p-wave, html:not(.enhanced) .p-time, html:not(.enhanced) .lang,
html:not(.enhanced) .ab-switch, html:not(.enhanced) .ab-player, html:not(.enhanced) .menu-btn, html:not(.enhanced) .copy-btn, html:not(.enhanced) .dl-share { display: none !important; }
html:not(.enhanced) .track { grid-template-columns: minmax(0, 1fr); }
html.enhanced .native { display: none; }

/* ---------- How ---------- */
.pipeline { display: grid; gap: 16px; counter-reset: step; }
.pipeline li { position: relative; counter-increment: step; padding: 26px 24px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.pipeline li::before { content: counter(step, decimal-leading-zero); position: absolute; top: 22px; right: 22px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); letter-spacing: .08em; }
.pipe-icon { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 18px; border-radius: 16px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.pipeline h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.pipeline p { margin: 0; font-size: 0.95rem; line-height: 1.6; }
@media (max-width: 679px) {
  .pipeline li { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 16px; padding: 20px 18px; }
  .pipe-icon { grid-row: span 2; width: 52px; height: 52px; margin: 0; border-radius: 14px; }
  .pipe-icon svg { width: 34px; height: 34px; }
  .pipeline li::before { top: 18px; right: 18px; }
}
@media (min-width: 680px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) {
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
  .pipeline li:not(:last-child)::after {
    content: ""; position: absolute; top: 55px; right: -18px; width: 14px; height: 14px; z-index: 1;
    border-top: 2px solid var(--amber); border-right: 2px solid var(--amber); transform: rotate(45deg); opacity: .7;
  }
}
.accuracy { display: grid; gap: 16px; margin-top: 22px; }
.acc-card { display: flex; flex-direction: column; padding: 26px 26px 24px; border-radius: var(--radius); border: 1px solid var(--line-amber); background: radial-gradient(90% 80% at 0% 0%, rgba(246,169,48,.1), transparent 60%), var(--surface); }
.acc-num { display: flex; align-items: baseline; flex-wrap: wrap; min-height: 58px; margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 2.1rem + 1.3vw, 3.2rem); line-height: 1; color: var(--amber-hi); font-variant-numeric: lining-nums; }
.acc-unit { font-size: .55em; color: var(--amber); margin-left: .12em; }
.acc-check { align-items: center; }
.acc-viz { width: 100%; max-width: 320px; height: auto; margin: 0 0 14px; overflow: visible; }
.acc-viz text { font-family: var(--font-body); }
.acc-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 16px; min-height: 48px; align-content: center; }
.acc-checks li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-amber); color: var(--amber-hi); font-size: 0.82rem; font-weight: 600; }
.acc-checks li::before { content: "✓"; color: var(--amber); }
.acc-card > p:last-child { margin: auto 0 0; font-size: 0.97rem; line-height: 1.6; }
@media (min-width: 860px) { .accuracy { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; } }
.styles {
  display: grid; gap: 22px; align-items: center; margin-top: 22px; padding: clamp(24px, 4vw, 40px);
  border-radius: 26px; border: 1px solid var(--line);
  background: radial-gradient(60% 120% at 100% 50%, rgba(255,155,61,.08), transparent 60%), linear-gradient(180deg, var(--surface-2), var(--surface));
}
.styles .h3 { margin-bottom: 12px; }
.styles p { margin: 0; font-size: 1rem; }
.styles .chips { margin-top: 0; }
@media (min-width: 960px) { .styles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; } }

/* ---------- Heritage: night-blue band with gold khee ---------- */
.heritage { padding-bottom: clamp(48px, 6vw, 80px); }
.heritage-band {
  --knot-gap: #0e192c;
  position: relative;
  padding: clamp(84px, 9vw, 124px) 0;
  background: radial-gradient(60% 90% at 20% 50%, rgba(232,181,78,.10), transparent 70%), linear-gradient(180deg, #0c1626, #0e192c 50%, #0c1626);
  color: #e8e2d4;
}
.heritage-band::before, .heritage-band::after {
  content: ""; position: absolute; left: 0; right: 0; height: 30px;
  background: var(--khee-gold) repeat-x left center / 24px 30px; opacity: .55;
}
.heritage-band::before { top: 20px; }
.heritage-band::after { bottom: 20px; }
.heritage-inner { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
.heritage-knot { width: clamp(140px, 22vw, 260px); height: auto; aspect-ratio: 132 / 82; color: var(--gold); filter: drop-shadow(0 0 30px rgba(232,181,78,.25)); }
.heritage .eyebrow { color: var(--gold); }
.heritage .eyebrow::before { background: linear-gradient(90deg, transparent, var(--gold)); }
.heritage .h2 { margin-bottom: 18px; }
.heritage-statement { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.95rem); line-height: 1.3; color: #f4ecdd; max-width: 30em; margin-bottom: 16px; }
.heritage-statement em { color: var(--gold); font-style: italic; }
.heritage-text { color: #c9c3b6; max-width: 40em; }
.unesco-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(232,181,78,.45); color: #f3d491; text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: background-color .2s, border-color .2s; }
.unesco-link:hover { color: #ffe3a6; background: rgba(232,181,78,.1); border-color: var(--gold); }
.unesco-host { color: #a9a395; font-weight: 500; font-size: 0.85rem; }
.heritage :focus-visible { outline-color: #f3d491; }
.heritage-points { display: grid; gap: 18px; margin-top: clamp(32px, 4vw, 48px); }
.heritage-points li { padding-left: 20px; border-left: 2px solid var(--line-amber); }
.heritage-points h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.heritage-points p { margin: 0; font-size: 0.97rem; }
@media (min-width: 860px) {
  .heritage-inner { grid-template-columns: auto minmax(0, 1fr); }
  .heritage-points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
}

/* ---------- Contribute ---------- */
.contribute-grid { display: grid; gap: 40px; align-items: center; }
.contribute .h2 { margin-bottom: 20px; }
.who { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.who li { padding: 6px 13px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--text-2); border: 1px dashed var(--line-strong); }
.terminal { border-radius: 18px; overflow: hidden; border: 1px solid var(--line-strong); background: #080605; box-shadow: 0 40px 80px -40px rgba(0,0,0,.95), 0 0 0 1px rgba(0,0,0,.6); }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #1a1410, #120e0b); }
.terminal-bar > span { width: 11px; height: 11px; border-radius: 50%; background: #3a2e24; flex: none; }
.terminal-bar > span:first-child { background: #e0625a; }
.terminal-bar > span:nth-child(2) { background: var(--amber); }
.terminal-bar > span:nth-child(3) { background: #5bb36a; }
.terminal-bar p { margin: 0 0 0 10px; color: var(--text-3); font-size: 0.8rem; font-weight: 600; min-width: 0; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex: none; min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(255,240,215,.04); color: var(--text-2); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.copy-btn:hover { color: var(--text); border-color: var(--line-amber); }
.copy-btn .ico-done, .copy-btn .copy-done, .copy-btn.is-done .ico-copy, .copy-btn.is-done .copy-idle { display: none; }
.copy-btn.is-done .ico-done, .copy-btn.is-done .copy-done { display: inline; }
.copy-btn.is-done { color: var(--amber-hi); border-color: var(--line-amber); }
.terminal pre { margin: 0; padding: 20px 20px 8px; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.85; color: #f1e6d2; white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal .t-c { color: #9a8870; }
.terminal-foot { margin: 0; padding: 4px 20px 18px; color: var(--text-3); font-size: 0.86rem; }
@media (min-width: 960px) { .contribute-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; } }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; gap: 28px; }
.faq-head .h2 { margin-bottom: 16px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  position: relative; display: block; padding: 20px 48px 20px 0;
  color: var(--text); font-weight: 600; font-size: 1.05rem; line-height: 1.45;
  cursor: pointer; list-style: none; border-radius: 8px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; position: absolute; right: 6px; top: 50%;
  width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; border: 1px solid var(--line-amber);
  background: linear-gradient(var(--amber-hi), var(--amber-hi)) center / 10px 1.8px no-repeat, linear-gradient(var(--amber-hi), var(--amber-hi)) center / 1.8px 10px no-repeat;
  transition: transform .25s ease, background-color .2s;
}
.faq-list details[open] summary::after { transform: rotate(45deg); background-color: rgba(246,169,48,.12); }
.faq-list summary:hover { color: var(--amber-hi); }
.faq-a { padding: 0 48px 22px 0; }
.faq-a p { margin: 0; font-size: 1rem; line-height: 1.7; }
@media (min-width: 960px) {
  .faq-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 72px; }
  .faq-head { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
}

/* ---------- Download ---------- */
.download { overflow: hidden; isolation: isolate; border-top: 1px solid var(--line); }
.download-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 50% at 50% 22%, rgba(246,169,48,.16), transparent 70%), radial-gradient(30% 40% at 20% 80%, rgba(90,168,255,.06), transparent 70%), radial-gradient(30% 40% at 80% 80%, rgba(255,155,61,.07), transparent 70%);
}
.download-logo { width: 88px; height: 88px; margin: 0 auto 22px; filter: drop-shadow(0 16px 40px rgba(246,169,48,.35)); }
.dl-cards { display: grid; gap: 16px; max-width: 1000px; margin: 0 auto; }
.dl-card {
  position: relative; display: grid; gap: 4px; padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--text); text-decoration: none; transition: border-color .25s, transform .25s, box-shadow .3s;
}
.dl-card:hover { color: var(--text); border-color: var(--line-amber); transform: translateY(-3px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
.dl-badge { justify-self: start; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: var(--amber); color: #1b1205; font-size: 0.72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; visibility: hidden; }
.dl-card-title { font-weight: 700; font-size: 1.15rem; }
.dl-card-sub { color: var(--text-3); font-size: 0.92rem; }
.dl-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.dl-size { color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.92rem; }
.dl-go { display: inline-flex; align-items: center; gap: 8px; color: var(--amber-hi); font-weight: 700; font-size: 0.93rem; }
html[data-os="win"]:not([data-arch="arm"]) .dl-card[data-card="x64"],
html[data-os="win"][data-arch="arm"] .dl-card[data-card="arm64"] {
  border-color: rgba(246, 169, 48, 0.6);
  background: radial-gradient(90% 90% at 50% 0%, rgba(246,169,48,.14), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 0 0 1px rgba(246,169,48,.2), 0 30px 70px -30px rgba(246,169,48,.35);
}
html[data-os="win"]:not([data-arch="arm"]) .dl-card[data-card="x64"] .dl-badge,
html[data-os="win"][data-arch="arm"] .dl-card[data-card="arm64"] .dl-badge { visibility: visible; }
html:not([data-os="win"]) .dl-badge { display: none; }
.dl-all { margin: 22px 0 0; text-align: center; font-weight: 600; }
.dl-bottom { display: grid; gap: 18px; max-width: 1000px; margin: 40px auto 0; }
.first-run, .dl-alt { padding: clamp(22px, 3vw, 30px); border-radius: var(--radius); border: 1px solid var(--line); background: rgba(23, 18, 14, 0.7); }
.first-run .h3, .dl-alt .h3 { font-size: clamp(1.4rem, 1.2rem + .6vw, 1.7rem); margin-bottom: 8px; }
.first-run > p, .dl-alt p { font-size: 0.97rem; }
.steps { display: grid; gap: 12px; margin-top: 18px; }
.steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: start; font-size: 0.93rem; line-height: 1.5; }
.step-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--amber); color: #1b1205; font-weight: 800; font-size: 0.82rem; }
.step-viz {
  grid-column: 2; display: flex; flex-direction: column; justify-content: center; gap: 6px;
  height: 78px; padding: 10px 12px; border-radius: 8px;
  background: linear-gradient(180deg, #1d5aa6, #174a8a); color: #fff; font-size: 0.74rem; line-height: 1.25;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.step-viz b { color: #fff; font-weight: 600; font-size: 0.82rem; }
.step-viz u { color: #dbe9ff; text-underline-offset: 2px; }
.step-viz-2 u { align-self: flex-start; padding: 2px 6px; border-radius: 4px; outline: 2px solid var(--amber-hi); outline-offset: 1px; }
.step-viz-3 { align-items: flex-end; }
.step-viz-3 i { font-style: normal; padding: 5px 12px; border: 1px solid #fff; border-radius: 3px; outline: 2px solid var(--amber-hi); outline-offset: 2px; }
.steps li > span:last-child { grid-column: 2; }
.steps q { color: var(--text); }
.dl-alt-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 0; font-weight: 600; }
@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps li { grid-template-columns: minmax(0, 1fr); }
  .step-viz, .steps li > span:last-child { grid-column: 1; }
}
@media (min-width: 820px) { .dl-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 960px) { .dl-bottom { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; } }

/* ---------- Footer ---------- */
.site-footer { padding: 48px 0 40px; border-top: 1px solid var(--line); background: #080605; --knot-gap: #080605; }
.footer-grid { display: grid; gap: 24px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 40px; height: 40px; }
.footer-name { margin: 0; color: var(--text); font-weight: 700; }
.footer-small { margin: 0; color: var(--text-3); font-size: 0.86rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--text-2); font-size: 0.92rem; text-decoration: none; }
.footer-links a:hover { color: var(--amber-hi); text-decoration: underline; }
.footer-fine { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--text-3); font-size: 0.84rem; }
.footer-knot { flex: none; width: 34px; height: 22px; color: var(--amber); opacity: .8; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: auto 1fr; align-items: center; }
  .footer-links { justify-content: flex-end; }
  .footer-fine { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); }
}

/* ---------- Now playing (mini player) ---------- */
.mini {
  position: fixed; z-index: 60; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  padding: 8px 8px 8px 8px; border-radius: 18px;
  border: 1px solid var(--line-amber); background: rgba(20, 15, 11, 0.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -16px rgba(0,0,0,.9);
}
.mini-play { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--amber); color: #1b1205; cursor: pointer; }
.mini-text { display: grid; min-width: 0; line-height: 1.3; }
.mini-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; font-size: 0.9rem; }
.mini-time { color: var(--text-3); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.mini-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.mini-close:hover { color: var(--text); border-color: var(--line); }
.mini-close { grid-row: 1; grid-column: 3; }
.mini-bar { grid-row: 2; grid-column: 1 / -1; height: 2px; margin: 2px 6px 0; border-radius: 2px; background: rgba(243,222,186,.12); overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--amber); transform-origin: left; transform: scaleX(var(--f, 0)); }
@media (min-width: 700px) { .mini { left: auto; right: 20px; bottom: 20px; width: 380px; } }

/* ---------- Lightbox ---------- */
.lightbox { width: min(96vw, 1680px); max-width: none; max-height: 94vh; padding: 0; border: 0; border-radius: 14px; overflow: visible; background: transparent; color: var(--text); }
.lightbox::backdrop { background: rgba(5, 4, 3, 0.9); }
.lightbox img { width: 100%; height: auto; max-height: 90vh; object-fit: contain; border-radius: 14px; border: 1px solid var(--line-strong); background: #120e0b; }
.lightbox-close { position: absolute; top: -52px; right: 0; background: rgba(23,18,14,.9); border-color: var(--line-strong); color: var(--text); }
@media (max-width: 600px) { .lightbox-close { top: auto; bottom: -54px; right: 50%; transform: translateX(50%); } }

/* ---------- Reveal on scroll (only once main.js runs) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal-on .reveal:not(.in) { opacity: 0; transform: translateY(18px); }
  .reveal-on .reveal { transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .001ms !important; }
  .tw { opacity: .6; }
}

/* the flat sign is in neither web font: use a symbol font at a readable size */
.flat { font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "DejaVu Sans", serif; font-size: 1.12em; line-height: 1; }

@media print {
  .site-header, .hero-sky, .hero-hills, .hero-player, .p-play, .p-wave, .p-time, .mini { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- 404 ---------- */
.nf-body {
  min-height: 100vh; min-height: 100svh;
  background:
    radial-gradient(50% 45% at 50% 60%, rgba(246, 169, 48, 0.13), transparent 70%),
    radial-gradient(42% 40% at 8% 6%, rgba(90, 168, 255, 0.07), transparent 70%),
    linear-gradient(180deg, #050508 0%, #09080a 45%, #130d09 85%, #0b0907 100%);
}
.nf { display: grid; justify-items: center; align-content: center; gap: 14px; min-height: 100vh; min-height: 100svh; padding: 40px var(--gutter); text-align: center; }
.nf-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--text); font-weight: 600; text-decoration: none; }
.nf-brand:hover { color: var(--text); }
.nf-brand > span { display: grid; text-align: left; line-height: 1.25; }
.nf-sep { display: none; }
.nf-knot { width: 96px; height: 60px; color: var(--amber); }
.nf-code { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(4.5rem, 3rem + 7vw, 8rem); line-height: 1; color: var(--amber-hi); letter-spacing: 0.02em; }
.nf-title { display: grid; gap: 6px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); line-height: 1.15; text-wrap: balance; }
.nf-mn { font-style: italic; font-weight: 500; color: var(--amber-hi); }
.nf-text { max-width: 34em; margin: 4px 0 10px; }
.nf-text span { display: block; }
.nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.nf-foot { margin: 18px 0 0; font-size: 0.92rem; }
