/* Amaze Sound shared styles, light redesign 2026-09-28.
   Pages built on this file do not load styles.css; the older campus,
   community, defense and review pages still do. */

@font-face {
  font-family: "Geist Pixel";
  src: url("assets/fonts/geist-pixel/GeistPixel-Square.woff2") format("woff2");
  font-display: swap;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-pixel: "Geist Pixel", ui-monospace, "SF Mono", Menlo, monospace;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f6f5f2;
  --bg-2: #eeede8;
  --panel: #ffffff;
  --text: #1d1d1b;
  --muted: #5f5e58;
  --line: rgba(29, 29, 27, 0.12);
  --line-strong: rgba(29, 29, 27, 0.24);
  --hover: rgba(29, 29, 27, 0.06);
  --accent: #7d5e07;
  --accent-hover: #654700;
  --accent-soft: rgba(247, 232, 157, 0.7);
  --btn: #f7e89d;
  --btn-hover: #f1dd8a;
  --btn-ink: #322707;
  --glow: #c39810;
  --header-bg: rgba(246, 245, 242, 0.86);
  --panel-shadow: 0 18px 48px rgba(29, 29, 27, 0.14), 0 2px 6px rgba(29, 29, 27, 0.06);
  --terrain: rgba(29, 29, 27, 0.72);
  --art-shadow: drop-shadow(0 14px 22px rgba(29, 29, 27, 0.14)) drop-shadow(0 2px 4px rgba(29, 29, 27, 0.1));
  --art-edge: rgba(29, 29, 27, 0.07);
  --glare: rgba(255, 255, 255, 0.55);

  --wrap: 1200px;
  --gutter: 24px;
  --header-h: 84px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #131312;
  --bg-2: #1a1a18;
  --panel: #1e1e1c;
  --text: #eeede9;
  --muted: #a5a49d;
  --line: rgba(238, 237, 233, 0.11);
  --line-strong: rgba(238, 237, 233, 0.24);
  --hover: rgba(238, 237, 233, 0.07);
  --accent: #eadc96;
  --accent-hover: #f6edb7;
  --accent-soft: rgba(234, 220, 150, 0.13);
  --btn: #ead88a;
  --btn-hover: #f3e6a4;
  --btn-ink: #281e00;
  --glow: #eadc96;
  --header-bg: rgba(19, 19, 18, 0.84);
  --panel-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --terrain: rgba(238, 237, 233, 0.62);
  --art-shadow: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.5)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  --art-edge: rgba(238, 237, 233, 0.09);
  --glare: rgba(255, 255, 255, 0.4);
  color-scheme: dark;
}

/* The site color is one pale yellow; the homepage uses nothing else. Each
   product also has its own color: anything marked data-product (a product
   page's body, a download or changelog block) switches the accent and button
   colors to that product's. */
[data-product="o2distance"] { /* lilac */
  --accent: #725195;
  --accent-hover: #5a3d78;
  --accent-soft: rgba(114, 81, 149, 0.1);
  --btn: #dfc8fd;
  --btn-hover: #d5b9f7;
  --btn-ink: #2d1f3c;
}
[data-product="duopuler"] { /* raspberry, after the plug-in's pink UI */
  --accent: #a52a6e;
  --accent-hover: #86205a;
  --accent-soft: rgba(165, 42, 110, 0.1);
  --btn: #f7a8cf;
  --btn-hover: #f196c4;
  --btn-ink: #3d0f28;
}
[data-product="kisspeter"] { /* mint */
  --accent: #04755d;
  --accent-hover: #045b48;
  --accent-soft: rgba(4, 117, 93, 0.1);
  --btn: #a1e5cf;
  --btn-hover: #88dbc1;
  --btn-ink: #022e24;
}
[data-product="shotpan"] { /* pink */
  --accent: #96455b;
  --accent-hover: #783246;
  --accent-soft: rgba(150, 69, 91, 0.1);
  --btn: #fec1ce;
  --btn-hover: #faafbf;
  --btn-ink: #3c1a23;
}
[data-product="oceaniapan"] { /* ocean blue */
  --accent: #2e65a0;
  --accent-hover: #1d4f82;
  --accent-soft: rgba(46, 101, 160, 0.1);
  --btn: #b6d8ff;
  --btn-hover: #9fcbfe;
  --btn-ink: #102840;
}
[data-product="yla2a-ex"] { /* silver */
  --accent: #5a6183;
  --accent-hover: #454b69;
  --accent-soft: rgba(90, 97, 131, 0.1);
  --btn: #cdd3ee;
  --btn-hover: #bec6e5;
  --btn-ink: #222534;
}
[data-product="magma-bass"] { /* lava */
  --accent: #974934;
  --accent-hover: #7a3623;
  --accent-soft: rgba(151, 73, 52, 0.1);
  --btn: #ffc4b4;
  --btn-hover: #fcb39f;
  --btn-ink: #3d1c13;
}
[data-product="yla3a"] { /* night indigo */
  --accent: #4d56a5;
  --accent-hover: #3b4390;
  --accent-soft: rgba(77, 86, 165, 0.1);
  --btn: #c9cdfb;
  --btn-hover: #b8bdf6;
  --btn-ink: #1b1e40;
}
[data-product="y1176"] { /* lime */
  --accent: #596c00;
  --accent-hover: #445300;
  --accent-soft: rgba(89, 108, 0, 0.1);
  --btn: #d7ec8c;
  --btn-hover: #cbe476;
  --btn-ink: #242c00;
}
[data-product="kisspeter-ex"] { /* azure */
  --accent: #1b6891;
  --accent-hover: #135274;
  --accent-soft: rgba(27, 104, 145, 0.1);
  --btn: #a9dcf5;
  --btn-hover: #93d1ef;
  --btn-ink: #0a2837;
}
[data-product="aimstorm"] { /* apricot */
  --accent: #8e5308;
  --accent-hover: #704002;
  --accent-soft: rgba(142, 83, 8, 0.1);
  --btn: #f8caa1;
  --btn-hover: #f1bb89;
  --btn-ink: #392005;
}
[data-product="goodmeter"] { /* butter yellow */
  --accent: #7b6801;
  --accent-hover: #5b4c03;
  --accent-soft: rgba(123, 104, 1, 0.1);
  --btn: #efde9c;
  --btn-hover: #e5d180;
  --btn-ink: #2f2600;
}
[data-product="audio-doctor"] { /* orchid */
  --accent: #89497b;
  --accent-hover: #6e3562;
  --accent-soft: rgba(137, 73, 123, 0.1);
  --btn: #f5c2e7;
  --btn-hover: #edb1de;
  --btn-ink: #371b31;
}
[data-product="cloud"] { /* honey cream, after the plug-in's pale-yellow UI */
  --accent: #85621a;
  --accent-hover: #6c4f12;
  --accent-soft: rgba(133, 98, 26, 0.1);
  --btn: #f1d58f;
  --btn-hover: #ebca78;
  --btn-ink: #3a2b08;
}
[data-product="mixprep"] { /* stone */
  --accent: #6e614d;
  --accent-hover: #564b39;
  --accent-soft: rgba(110, 97, 77, 0.1);
  --btn: #ddd3c3;
  --btn-hover: #d1c6b3;
  --btn-ink: #2b261d;
}
[data-theme="dark"] [data-product="o2distance"] {
  --accent: #d4baf4;
  --accent-hover: #e7d5ff;
  --accent-soft: rgba(212, 186, 244, 0.12);
  --btn: #d6bef5;
  --btn-hover: #e5d0ff;
  --btn-ink: #251932;
}
[data-theme="dark"] [data-product="duopuler"] {
  --accent: #f5a3cb;
  --accent-hover: #fbc4de;
  --accent-soft: rgba(245, 163, 203, 0.12);
  --btn: #f4a6cc;
  --btn-hover: #f9bfdb;
  --btn-ink: #340f24;
}
[data-theme="dark"] [data-product="kisspeter"] {
  --accent: #8cdac1;
  --accent-hover: #b6ecd9;
  --accent-soft: rgba(140, 218, 193, 0.12);
  --btn: #93dcc5;
  --btn-hover: #abead5;
  --btn-ink: #00261d;
}
[data-theme="dark"] [data-product="shotpan"] {
  --accent: #f8b1c0;
  --accent-hover: #ffd0d9;
  --accent-soft: rgba(248, 177, 192, 0.12);
  --btn: #f9b5c3;
  --btn-hover: #ffcbd5;
  --btn-ink: #32141c;
}
[data-theme="dark"] [data-product="oceaniapan"] {
  --accent: #9fcbfe;
  --accent-hover: #c8e1fe;
  --accent-soft: rgba(159, 203, 254, 0.12);
  --btn: #a5cffe;
  --btn-hover: #c2defe;
  --btn-ink: #0c2036;
}
[data-theme="dark"] [data-product="yla2a-ex"] {
  --accent: #bfc6e4;
  --accent-hover: #d8ddf3;
  --accent-soft: rgba(191, 198, 228, 0.12);
  --btn: #c2c9e5;
  --btn-hover: #d4daf3;
  --btn-ink: #1c1e2b;
}
[data-theme="dark"] [data-product="magma-bass"] {
  --accent: #f9b4a1;
  --accent-hover: #fed3c7;
  --accent-soft: rgba(249, 180, 161, 0.12);
  --btn: #fab9a7;
  --btn-hover: #fecec1;
  --btn-ink: #33160e;
}
[data-theme="dark"] [data-product="yla3a"] {
  --accent: #b9c1ff;
  --accent-hover: #d5daff;
  --accent-soft: rgba(185, 193, 255, 0.12);
  --btn: #bec5fd;
  --btn-hover: #d2d7ff;
  --btn-ink: #161a36;
}
[data-theme="dark"] [data-product="y1176"] {
  --accent: #c8df7c;
  --accent-hover: #deefa6;
  --accent-soft: rgba(200, 223, 124, 0.12);
  --btn: #cce283;
  --btn-hover: #dcee9f;
  --btn-ink: #1e2400;
}
[data-theme="dark"] [data-product="kisspeter-ex"] {
  --accent: #91d0f2;
  --accent-hover: #bfe4f8;
  --accent-soft: rgba(145, 208, 242, 0.12);
  --btn: #98d3f2;
  --btn-hover: #b4e0f7;
  --btn-ink: #06202e;
}
[data-theme="dark"] [data-product="aimstorm"] {
  --accent: #efbc8d;
  --accent-hover: #fbd6b5;
  --accent-soft: rgba(239, 188, 141, 0.12);
  --btn: #f0c094;
  --btn-hover: #fcd2ab;
  --btn-ink: #2f1903;
}
[data-theme="dark"] [data-product="goodmeter"] {
  --accent: #e4d186;
  --accent-hover: #ebdfaa;
  --accent-soft: rgba(228, 209, 134, 0.12);
  --btn: #e6d58e;
  --btn-hover: #f4e5a7;
  --btn-ink: #261f00;
}
[data-theme="dark"] [data-product="audio-doctor"] {
  --accent: #ebb3dd;
  --accent-hover: #f9d0ed;
  --accent-soft: rgba(235, 179, 221, 0.12);
  --btn: #edb7df;
  --btn-hover: #f9caed;
  --btn-ink: #2e1528;
}
[data-theme="dark"] [data-product="cloud"] {
  --accent: #ebcd87;
  --accent-hover: #f4dea8;
  --accent-soft: rgba(235, 205, 135, 0.12);
  --btn: #e9cb85;
  --btn-hover: #f1d89f;
  --btn-ink: #2e2206;
}
[data-theme="dark"] [data-product="mixprep"] {
  --accent: #d1c6b4;
  --accent-hover: #e5ddd0;
  --accent-soft: rgba(209, 198, 180, 0.12);
  --btn: #d3c9b8;
  --btn-hover: #e3d9cb;
  --btn-ink: #231f17;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
  overflow-x: clip;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* Keep a lone character off the last line of short Chinese text. */
h1,
h2,
h3,
p,
li {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.px {
  font-family: var(--font-pixel);
  letter-spacing: 0.02em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-h);
}

.brand {
  --word-h: 66px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
}

/* The "Ama / oun" signature, drawn by tools/generate_brand_signature.py into
   assets/brand-signature.svg. The file is used as a mask so it takes the text
   color. The text stays in the page for search engines but is pushed out of
   sight. (The earlier Nunito wordmark is assets/brand-wordmark.svg, viewBox
   6372 x 727, at --word-h 27px, or clamp(16px, 5.4vw, 20px) on phones. A
   golden-frame version, assets/brand/ama-oun-frame-236-outline-black.svg at
   viewBox 974.5 x 602.3 and --word-h 68px / 52px, was tried on 2026-09-30 and
   put aside on 2026-10-05.) */
.brand-word {
  flex: none;
  width: calc(var(--word-h) * 549.3 / 427.6);   /* the SVG's viewBox */
  height: var(--word-h);
  overflow: hidden;
  background: currentColor;
  text-indent: 100%;
  white-space: nowrap;
  -webkit-mask: url("assets/brand-signature.svg?v=4") center / 100% 100% no-repeat;
  mask: url("assets/brand-signature.svg?v=4") center / 100% 100% no-repeat;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
}

.nav-link:hover,
.nav-link[aria-expanded="true"] {
  background: var(--hover);
}

.nav-link[aria-current] {
  color: var(--accent);
}

.nav-caret {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  transition: transform 0.2s ease;
}

.nav-link[aria-expanded="true"] .nav-caret {
  transform: rotate(180deg);
}

.mega {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  width: min(620px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--panel-shadow);
}

.mega[hidden] {
  display: none;
}

/* Keeps the menu open while the pointer crosses the gap under the header. */
.mega::before {
  content: "";
  position: absolute;
  inset: -30px 0 auto;
  height: 30px;
}

.mega-title {
  display: flex;
  justify-content: space-between;
  margin: 0 10px 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.mega a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
}

.mega a:hover {
  background: var(--hover);
}

.mega a[aria-current] .mega-name {
  color: var(--accent);
}

.mega-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.mega-desc {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.mega-foot {
  grid-column: 1 / -1;
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.mega-foot a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--hover);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .theme-half {
  fill: currentColor;
  transition: transform 0.35s ease;
  transform-origin: 50% 50%;
}

[data-theme="dark"] .theme-toggle .theme-half {
  transform: rotate(180deg);
}

/* EN / 中: a plain link to the same page in the other language, so it works
   without JavaScript too. */
.lang-toggle {
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.lang-toggle:lang(zh-CN) {
  font-size: 14px;
  letter-spacing: 0;
}

.menu-toggle {
  display: none;
}

.menu-toggle path {
  transition: transform 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.menu-toggle[aria-expanded="true"] .l1 {
  transform: translateY(3px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .l2 {
  transform: translateY(-3px) rotate(-45deg);
}

html:not(.js) .theme-toggle,
html:not(.js) .os-switch {
  display: none;
}

.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0;
  overflow-y: auto;
  z-index: 45;
  padding: 12px var(--gutter) 48px;
  background: var(--bg);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu nav {
  display: grid;
  gap: 2px;
  max-width: 560px;
  margin-inline: auto;
}

.mobile-title {
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.mobile-menu a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  text-decoration: none;
}

.mobile-menu a small {
  color: var(--muted);
  font-size: 12.5px;
  text-align: right;
}

.mobile-menu a[aria-current] > span {
  color: var(--accent);
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  :root {
    --header-h: 64px;
  }

  .brand {
    --word-h: 50px;
    gap: 9px;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  .js .main-nav {
    display: none;
  }

  .js .menu-toggle {
    display: inline-grid;
  }

  .nav-link {
    padding-inline: 9px;
  }
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--btn);
  color: var(--btn-ink);
}

.btn-primary:hover {
  background: var(--btn-hover);
}

/* Download buttons carry a white disc at the left end, with an arrow in the
   button's ink color on top of it. */
.btn-primary[download] {
  position: relative;
  gap: 12px;
  padding-left: 6px;
}

.btn-primary[download]::before {
  content: "";
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
}

.btn-primary[download]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2.5v8M4.5 7.5 8 11l3.5-3.5M3 13.5h10'/%3E%3C/svg%3E") center / 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2.5v8M4.5 7.5 8 11l3.5-3.5M3 13.5h10'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-off {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  cursor: default;
}

.btn small {
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0.78;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Outside a product's own colors the accent is the pale yellow, too light for
   text on the light background. There, links keep the text color and sit on
   a pale yellow stripe that fills in on hover. */
html:not([data-theme="dark"]) .text-link:not([data-product] *) {
  color: var(--text);
  background: linear-gradient(var(--btn), var(--btn)) 0 100% / 100% 0.42em no-repeat;
  transition: background-size 0.15s ease;
}

html:not([data-theme="dark"]) .text-link:not([data-product] *):hover {
  background-size: 100% 100%;
  text-decoration: none;
}

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

/* ---------- Product art: the image is the card ---------- */

.art-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: var(--stage, 4 / 3);
  padding: var(--stage-pad, 7%);
  container-type: size;
  text-decoration: none;
}

.tilt {
  position: relative;
  width: min(100cqw, 100cqh * var(--ar, 1), var(--art-max, 100cqw));
  aspect-ratio: var(--ar, 1);
  border-radius: var(--art-radius, 6px);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  touch-action: pan-y;
  will-change: transform;
}

.tilt.is-active {
  transition: transform 0.08s linear;
}

.tilt img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  filter: var(--art-shadow);
  -webkit-user-drag: none;
  user-select: none;
}

.tilt:not([data-tilt-shape]) img {
  box-shadow: 0 0 0 1px var(--art-edge);
}

.tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), var(--glare), transparent 58%);
  mix-blend-mode: soft-light;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.tilt.is-active .tilt-glare {
  opacity: 1;
}

.tilt-text {
  display: grid;
  place-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  text-align: center;
}

.tilt-text strong {
  font-family: var(--font-pixel);
  font-size: clamp(22px, 9cqw, 34px);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.tilt-text span {
  color: var(--muted);
  font-size: 12.5px;
}

@media (prefers-reduced-motion: reduce) {
  .tilt,
  .tilt.is-active {
    transform: none;
    transition: none;
  }
}

/* ---------- Home ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 40px;
  padding-block: 64px 40px;
}

.hero h1 {
  margin-bottom: 18px;
  font-size: clamp(34px, 4.4vw, 54px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.hero .kaomoji {
  display: inline-block;
  color: var(--accent);
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  transform-origin: 50% 90%;
}

@media (prefers-reduced-motion: no-preference) {
  .hero .kaomoji {
    animation: kaomoji-hop 2.4s ease-in-out 0.6s 2 both;
  }
}

@keyframes kaomoji-hop {
  0%, 30%, 100% { transform: none; }
  10% { transform: translateY(-0.18em) rotate(-4deg); }
  20% { transform: translateY(0) rotate(3deg); }
}

.hero-lead {
  max-width: 30em;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 18px);
}

.terrain {
  position: relative;
  margin: 0;
}

/* The map fades out toward uneven edges (assets/home-terrain-fade.png, made by
   tools/generate_home_terrain_fade.py), so no rectangle shows. The fade eats the
   outer lines, so the map is drawn a bit wider than its column; main clips the
   few pixels that would pass the screen edge on narrow windows. */
.terrain-map {
  position: relative;
  margin-inline: -10% -6%;
  aspect-ratio: 640 / 420;
  -webkit-mask: url("assets/home-terrain-fade.png?v=1") center / 100% 100% no-repeat;
  mask: url("assets/home-terrain-fade.png?v=1") center / 100% 100% no-repeat;
}

.terrain-lines,
.terrain-reveal,
.terrain-glow {
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: url("assets/home-terrain.svg?v=matterhorn-1") center / contain no-repeat;
  mask: url("assets/home-terrain.svg?v=matterhorn-1") center / contain no-repeat;
}

/* As on the old homepage, the map is nearly invisible until the pointer passes
   over it; then it shows in a soft circle that follows the mouse. Touch screens
   and reduced motion get the whole map, faint and still. */
.terrain-lines {
  color: var(--terrain);
  opacity: 0.28;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .terrain-lines {
    opacity: 0.12;
  }
}

.terrain-reveal {
  color: var(--terrain);
  opacity: 0;
  transition: opacity 0.32s ease;
  -webkit-mask:
    url("assets/home-terrain.svg?v=matterhorn-1") center / contain no-repeat,
    radial-gradient(circle 190px at var(--tx, 50%) var(--ty, 50%), #000 20%, rgba(0, 0, 0, 0.84) 48%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask:
    url("assets/home-terrain.svg?v=matterhorn-1") center / contain no-repeat,
    radial-gradient(circle 190px at var(--tx, 50%) var(--ty, 50%), #000 20%, rgba(0, 0, 0, 0.84) 48%, transparent 100%);
  mask-composite: intersect;
}

.terrain-glow {
  color: var(--glow);
  opacity: 0;
  transition: opacity 0.4s ease;
  -webkit-mask:
    url("assets/home-terrain.svg?v=matterhorn-1") center / contain no-repeat,
    radial-gradient(circle 170px at var(--tx, 50%) var(--ty, 50%), #000 25%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask:
    url("assets/home-terrain.svg?v=matterhorn-1") center / contain no-repeat,
    radial-gradient(circle 170px at var(--tx, 50%) var(--ty, 50%), #000 25%, transparent 100%);
  mask-composite: intersect;
}

.terrain[data-active] .terrain-reveal,
.terrain[data-active] .terrain-glow {
  opacity: 1;
}

.terrain figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.terrain figcaption a {
  text-underline-offset: 3px;
}

.product-section {
  padding-block: 40px 24px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.4;
}

.section-head p {
  color: var(--muted);
  font-size: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product .art-stage {
  --stage-pad: 9% 6%;
}

.product h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
}

.product h3 a {
  text-decoration: none;
}

.product h3 a:hover {
  color: var(--accent);
}

.ver {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.product-desc {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.tags {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.product-links {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

@media (max-width: 1080px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-block: 40px 16px;
  }

  /* One column: let the faded edges run out to the screen edges. */
  .terrain-map {
    margin-inline: calc(var(--gutter) * -1);
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 20px;
  }
}

@media (max-width: 460px) {
  :root {
    --gutter: 18px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product .art-stage {
    --stage: 16 / 10;
  }
}

/* ---------- Product page ---------- */

.p-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  padding-block: 56px 64px;
}

.p-hero .art-stage {
  --stage: 1 / 1;
  --stage-pad: 6%;
}

.kicker {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.p-hero h1 {
  margin-bottom: 10px;
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.p-oneliner {
  margin-bottom: 16px;
  font-size: clamp(18px, 1.7vw, 21px);
  font-weight: 600;
  line-height: 1.5;
}

.p-intro {
  max-width: 34em;
  color: var(--muted);
}

.p-hero .actions {
  margin-top: 28px;
}

.spec-line {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
}

.spec-line a {
  margin-left: 6px;
}

.p-section {
  padding-block: 56px;
  border-top: 1px solid var(--line);
}

.p-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px 56px;
  margin-bottom: 36px;
}

.p-section-head h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 650;
  line-height: 1.3;
}

.p-section-head p {
  color: var(--muted);
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list h3 {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
}

.feature-list h3 span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.feature-list p {
  color: var(--muted);
  font-size: 15px;
}

.demo {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.demo-shell {
  position: relative;
  width: min(100%, 640px);
  height: 800px;
  overflow: hidden;
  border-radius: 8px;
  background: #090d0f;
  box-shadow: 0 24px 56px rgba(29, 29, 27, 0.2), 0 0 0 1px var(--art-edge);
}

.demo-shell iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 640px;
  height: 800px;
  border: 0;
  background: #090d0f;
  transform-origin: top left;
}

.demo-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  width: min(100%, 640px);
  color: var(--muted);
  font-size: 13px;
}

.specs {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.specs > div {
  display: grid;
  grid-template-columns: minmax(96px, 180px) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.specs dt {
  color: var(--muted);
  font-size: 14px;
}

.specs dd {
  margin: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.note {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 14px;
}

.note strong {
  color: var(--text);
  font-weight: 600;
}

.cta {
  display: grid;
  justify-items: start;
  gap: 16px;
  margin-block: 8px 24px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: 18px;
  background: var(--bg-2);
}

.cta h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 650;
  line-height: 1.3;
}

.cta p {
  color: var(--muted);
  font-size: 14.5px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 14px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.code-block {
  margin: 12px 0 0;
  padding: 12px 16px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 14px;
  line-height: 1.7;
}

.code-block code {
  font-size: 13px;
}

@media (max-width: 900px) {
  .p-hero {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-block: 28px 48px;
  }

  .p-hero .art-stage {
    --stage: 5 / 4;
    width: min(100%, 560px);
    margin-inline: auto;
  }

  .p-section-head {
    grid-template-columns: 1fr;
  }
}

/* Dark mode only: the Pixel Blast particle field (products/pixel-blast.js)
   behind the product hero, across the full window width. main clips the
   sideways overflow. Light mode shows nothing. */
.burst-canvas {
  display: none;
}

[data-theme="dark"] .burst-host {
  position: relative;
  isolation: isolate;
}

[data-theme="dark"] .burst-canvas {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: -1;
  display: block;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.56;
}

/* A soft dark pool behind the hero text keeps it readable over the particles. */
[data-theme="dark"] .burst-host > div:not(.art-stage) {
  position: relative;
}

[data-theme="dark"] .burst-host > div:not(.art-stage)::before {
  content: "";
  position: absolute;
  inset: -6% -5%;
  z-index: -1;
  border-radius: 48px;
  background: rgba(19, 19, 18, 0.86);
  filter: blur(34px);
  pointer-events: none;
}

[data-theme="dark"] [data-product="goodmeter"] {
  --burst-a: #ffdb62;
  --burst-b: #42c9f4;
}

/* AimStorm keeps its original white field with red sparks. */
[data-theme="dark"] [data-product="aimstorm"] {
  --burst-a: #ffffff;
  --burst-b: #f0443e;
}

/* The GOODMETER art is a cut-out; over the particles its edge line would
   cast a rectangular shadow. */
[data-theme="dark"] [data-product="goodmeter"] .burst-host .tilt img {
  box-shadow: none;
}

@media (max-width: 760px) {
  [data-theme="dark"] .burst-canvas {
    opacity: 0.44;
  }
}

/* Wide panels sit above the text instead of beside it. */
.p-hero-wide {
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

/* The stage takes the panel's own ratio (set inline), so the text lines up with its edges. */
.p-hero-wide .art-stage {
  --stage-pad: 0;
  width: min(100%, 980px);
  margin-block: 8px 16px;
}

.p-hero-wide > * {
  width: min(100%, 980px);
  margin-inline: auto;
}

.p-hero-wide .p-intro {
  max-width: 40em;
}

.p-hero .tilt-text strong {
  font-size: clamp(30px, 11cqw, 60px);
}

.p-hero .tilt-text span {
  font-size: clamp(13px, 3.4cqw, 17px);
}

/* ---------- Page heading (download, about) ---------- */

.page-head {
  padding-block: 56px 28px;
}

.page-head h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 4.2vw, 48px);
  font-weight: 650;
  line-height: 1.2;
}

.page-head p {
  max-width: 36em;
  color: var(--muted);
}

/* ---------- Download page ---------- */

.os-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 20px;
  padding-top: 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.os-switch {
  display: inline-flex;
}

/* Tabs sit on a thin bar in the button color; the chosen one gets the thick bar. */
.os-switch button {
  min-width: 124px;
  padding: 8px 20px 12px;
  border: 0;
  background: transparent;
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--btn) 70%, transparent);
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.2s ease, color 0.15s ease;
}

.os-switch button:hover {
  color: var(--text);
}

.os-switch button[aria-pressed="true"] {
  box-shadow: inset 0 -5px 0 var(--btn);
  color: var(--text);
}

.os-bar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 13.5px;
}

.os-bar-links a {
  text-decoration: none;
}

.os-bar-links a:hover {
  color: var(--accent);
}

/* Sticky OS bar needs extra room for anchor jumps. */
html:has(.os-bar) {
  scroll-padding-top: calc(var(--header-h) + 84px);
}

.dl-group {
  padding-top: 40px;
}

.dl-group > h2 {
  margin-bottom: 4px;
  font-size: 22px;
  font-weight: 650;
}

.dl {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}

.dl .art-stage {
  --stage-pad: 8%;
  align-self: start;
}

.dl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 4px;
}

.dl-head h3 {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
}

.dl-head h3 a {
  text-decoration: none;
}

.dl-head h3 a:hover {
  color: var(--accent);
}

.dl-desc {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14.5px;
}

.dl-os .actions {
  gap: 10px;
}

.dl-req {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
}

[data-os-view="mac"] .dl-os[data-os="win"],
[data-os-view="win"] .dl-os[data-os="mac"] {
  display: none;
}

.dl-os + .dl-os {
  margin-top: 16px;
}

[data-os-view] .dl-os + .dl-os {
  margin-top: 0;
}

.dl-more {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
}

.dl-more .link-row a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.dl-more .link-row a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

details summary {
  width: fit-content;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 2px 1px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

details[open] summary::before {
  transform: rotate(45deg);
}

details summary:hover {
  color: var(--accent);
}

.detail-body {
  margin: 8px 0 4px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 13.5px;
}

.detail-body ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-body li {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}

.detail-body li > span:first-child {
  min-width: 150px;
  color: var(--text);
}

.detail-body code {
  color: var(--muted);
  word-break: break-all;
}

@media (max-width: 700px) {
  .dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .dl .art-stage {
    --stage: 16 / 9;
    width: min(100%, 360px);
  }

  .dl-os .btn {
    width: 100%;
  }

  /* On phones the bar would cover too much of the screen. */
  .os-bar {
    position: static;
  }

  html:has(.os-bar) {
    scroll-padding-top: calc(var(--header-h) + 24px);
  }
}

/* ---------- Changelog and manuals ---------- */

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--muted);
  font-size: 13.5px;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
}

.page-head .toc {
  margin-top: 20px;
}

.p-section-head h2 a {
  text-decoration: none;
}

.p-section-head h2 a:hover {
  color: var(--accent);
}

.log-list {
  display: grid;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log-list > li {
  display: grid;
  grid-template-columns: minmax(96px, 180px) minmax(0, 1fr);
  gap: 6px 16px;
}

.log-ver strong {
  display: block;
  font-size: 17px;
  font-weight: 650;
}

.log-ver time {
  color: var(--muted);
  font-size: 13.5px;
}

.log-list ul,
.steps {
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
  font-size: 15px;
}

.log-list ul li + li,
.steps li + li {
  margin-top: 8px;
}

.steps strong {
  color: var(--text);
  font-weight: 600;
}

.steps {
  max-width: 44em;
}

.manual-grid p {
  color: var(--muted);
  font-size: 15px;
}

.manual-grid strong {
  color: var(--text);
  font-weight: 600;
}

.manual-grid p + p,
.manual-grid p + .steps,
.manual-grid .steps + p {
  margin-top: 8px;
}

/* Marks a fact nobody has confirmed yet. */
.todo {
  display: inline-block;
  padding: 0 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  font-size: 13px;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px 48px;
}

/* Four blocks read better as 2 × 2 than 3 + 1. */
.manual-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
}

.manual-grid h3 {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 650;
}

@media (max-width: 700px) {
  .log-list > li {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 72px;
  padding-block: 28px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a,
.footer-legal a {
  text-decoration: none;
}

.footer-links a:hover,
.footer-legal a:hover {
  color: var(--text);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.dl-group + .p-section {
  margin-top: 48px;
}

.detail-note {
  margin: 10px 0 0;
  color: var(--muted);
}
