/*! DIY Sounds — © 2026 Glenn Mejias. All rights reserved.
 *  https://diysounds.com
 *  Not licensed for redistribution, reuse or derivative works.
 *  See /terms.html
 */
/*
 * The home page only (body.home), loaded after site.css.
 *
 * Plain on purpose. It is written for people building their first box, so it
 * reads like a helpful page rather than a product launch: the app's own font
 * (Source Sans 3) and palette (site.css tokens, so light/dark just works),
 * left-aligned sentence-case headings, real screenshots with captions, and
 * no badges, counters, glows or animation. Nothing here may leak outside
 * `body.home` — the topic pages use site.css alone.
 */

body.home {
  font-family: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
}

/* Header: the site's bar, set in the app's font, sentence case. */
body.home .name { font-weight: 600; }
body.home .header-links a {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--body);
}
body.home .header-links a:hover { background: var(--hover); color: var(--text); }
body.home .header-links a.coffee { color: var(--body); border-color: var(--edge); }
body.home .header-links a.hm-btn { margin-left: 6px; padding: 7px 14px; min-height: 0; font-size: 15px; font-weight: 600; color: var(--on-accent); }
body.home .header-links a.hm-btn:hover { background: var(--accent-hover); color: var(--on-accent); }

/* Type ---------------------------------------------------------------------- */

body.home h1,
body.home h2,
body.home h3 { font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
body.home h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 4.6vw, 48px);
  line-height: 1.12;
}
body.home h2 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 32px); line-height: 1.2; }
body.home h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; }
.hm-lede { margin: 0 0 14px; max-width: 34em; font-size: 19px; color: var(--body); }
.hm-sub { margin: 0 0 32px; max-width: 40em; color: var(--muted); }

/* Buttons and links --------------------------------------------------------- */

.hm-btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.hm-btn:hover { background: var(--accent-hover); }
.hm-btn:focus-visible, .hm-link:focus-visible, .hm-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hm-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.hm-link:hover { text-decoration-thickness: 2px; }

/* Hero ---------------------------------------------------------------------- */

.hm-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 120px 0 136px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
/* Behind the hero: the app's own response chart — a log-frequency grid and a
   6th-order bandpass curve — faint enough to read as paper, not content. */
.hm-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 100%);
}
.hm-chart .hm-grid line { stroke: var(--text); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hm-chart .hm-grid .maj { stroke-opacity: 0.07; }
.hm-chart .hm-grid .min { stroke-opacity: 0.035; }
.hm-chart .hm-axis text { fill: var(--muted); fill-opacity: 0.55; font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.hm-chart { color: var(--accent); }
.hm-chart .hm-curve {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.35;
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* The same chart paper behind every section, each with a curve the app
   draws: impedance under "How it works", the three box types under "Which
   box", cone movement under "Learn", port air speed under "What's new" and
   the ported response at the close. Faded top and bottom so the sections
   run into each other. */
.hm-charted { position: relative; overflow: hidden; isolation: isolate; }
.hm-chart-sec {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}
.hm-chart-sec .hm-curve { stroke-opacity: 0.42; }
.hm-chart-sec .hm-fill { opacity: 0.7; }
.hm-chart-sec .c-sealed { stroke-opacity: 0.32; stroke-dasharray: 6 6; }
.hm-chart-sec .c-ported { stroke-opacity: 0.45; }
.hm-chart-sec .c-bandpass { stroke-opacity: 0.32; stroke-dasharray: 2 5; }
/* With motion on, each section's curve draws itself as it scrolls into view. */
.hm-anim .hm-chart-sec .hm-curve {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.hm-anim .hm-chart-sec .c-sealed,
.hm-anim .hm-chart-sec .c-bandpass { stroke-dasharray: 6 6; stroke-dashoffset: 0; transition: opacity 1.4s ease 0.9s; }
.hm-anim .hm-chart-sec .c-bandpass { stroke-dasharray: 2 5; }
.hm-anim .hm-chart-sec .c-sealed,
.hm-anim .hm-chart-sec .c-bandpass,
.hm-anim .hm-chart-sec .hm-fill { opacity: 0; transition: opacity 1.4s ease 0.9s; }
.hm-anim .hm-chart-sec.is-in .hm-curve { stroke-dashoffset: 0; }
.hm-anim .hm-chart-sec.is-in .c-sealed,
.hm-anim .hm-chart-sec.is-in .c-bandpass { opacity: 1; }
.hm-anim .hm-chart-sec.is-in .hm-fill { opacity: 0.7; }
body.home .hm-hero h1 em { font-style: normal; color: var(--accent); }
.hm-hero .hm-btn {
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 8px 22px -10px var(--accent);
  transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.hm-hero .hm-btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 12px 26px -10px var(--accent); }

/* The hero screenshot: lifted off the page, with this design's real numbers
   pinned round it like the app's readouts. */
.hm-shot-wrap { position: relative; }
.hm-hero-shot img {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--edge));
  border-radius: 10px;
  box-shadow: 0 30px 60px -28px rgb(0 0 0 / 0.75), 0 0 0 6px color-mix(in srgb, var(--text) 4%, transparent);
}
:root[data-theme="light"] .hm-hero-shot img { box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.35), 0 0 0 6px rgb(0 0 0 / 0.03); }
.hm-callouts { margin: 0; padding: 0; list-style: none; }
.hm-callouts li {
  position: absolute;
  z-index: 1;
  padding: 7px 12px 8px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow-2);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hm-callouts span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.hm-callouts .c1 { top: -18px; left: 22%; }
.hm-callouts .c2 { top: 30%; left: -28px; }
.hm-callouts .c3 { top: 44%; right: -24px; }
.hm-callouts .c4 { bottom: -18px; left: 46%; }
.hm-hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: center;
}
.hm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 28px 0 0; }
/* The hero's three parts get room to breathe: title, sentence, buttons. */
body.home .hm-hero h1 { margin-bottom: 28px; }
.hm-hero .hm-lede { margin-bottom: 0; }
.hm-hero .hm-actions { margin-top: 40px; }
.hm-note { margin: 22px 0 0; font-size: 15px; color: var(--muted); }

/* Screenshots: a plain border and a caption. */
.hm-shot { margin: 0; }
.hm-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--edge);
  border-radius: 6px;
}
.hm-shot figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: left; }

/* Sections ------------------------------------------------------------------ */

.hm-section { padding: 72px 0; scroll-margin-top: 64px; }
.hm-section > .wrap > h2 + .hm-steps { margin-top: 28px; }
.hm-band { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* How it works: one step per row. The screenshot and a panel cut from the
   same app screen swap sides each row; the panel drifts as the page scrolls
   (js/home.js sets --py). */
.hm-steps {
  display: flex;
  flex-direction: column;
  gap: 104px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.hm-step {
  counter-increment: step;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px;
  align-items: center;
}
.hm-step:nth-child(even) .hm-step-text { order: 2; }
body.home .hm-step h3 { margin: 0 0 12px; font-size: clamp(23px, 2.4vw, 28px); }
.hm-step h3::before { content: counter(step) ". "; color: var(--accent); }
.hm-step p { margin: 0; max-width: 28em; font-size: 18px; color: var(--body); }
.hm-step-visual { position: relative; }
.hm-step-main img {
  border-radius: 10px;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.7);
}
.hm-ui {
  position: absolute;
  bottom: -36px;
  left: -44px;
  width: 34%;
  height: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--edge));
  border-radius: 8px;
  box-shadow: 0 26px 50px -18px rgb(0 0 0 / 0.8), 0 0 0 5px color-mix(in srgb, var(--bg) 70%, transparent);
  transform: translateY(calc(var(--py, 0px) * var(--pk, 1)));
  will-change: transform;
}
.hm-step:nth-child(even) .hm-ui { left: auto; right: -44px; }
:root[data-theme="light"] .hm-step-main img,
:root[data-theme="light"] .hm-ui { box-shadow: 0 24px 48px -26px rgb(0 0 0 / 0.45); }

/* Scroll reveal: only once js/home.js has added .hm-anim, so the page reads
   fine without script or with reduced motion. */
.hm-anim [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.hm-anim [data-reveal].is-in { opacity: 1; transform: none; }
/* A step row moves in parts: words, then the screenshot, then the panel. */
.hm-anim .hm-step[data-reveal] { opacity: 1; transform: none; }
.hm-anim .hm-step-text,
.hm-anim .hm-step-main,
.hm-anim .hm-ui {
  opacity: 0;
  transition: opacity 0.7s ease, translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), scale 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hm-anim .hm-step-text { translate: 0 24px; }
.hm-anim .hm-step-main { translate: 56px 0; scale: 0.97; transition-delay: 0.12s; }
.hm-anim .hm-step:nth-child(even) .hm-step-main { translate: -56px 0; }
.hm-anim .hm-ui { translate: 0 70px; transition-delay: 0.4s; }
.hm-anim .hm-step.is-in :is(.hm-step-text, .hm-step-main, .hm-ui) { opacity: 1; translate: 0 0; scale: 1; }

/* Hero: the curve draws itself and the number tags pop in after it. */
@media (prefers-reduced-motion: no-preference) {
  .hm-hero .hm-chart .hm-curve { stroke-dasharray: 1; animation: hm-draw 1.6s 0.2s cubic-bezier(0.4, 0, 0.2, 1) both; }
  .hm-hero .hm-chart .hm-fill { animation: hm-fade 1.2s 0.9s ease both; }
  .hm-callouts li { animation: hm-pop 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hm-callouts .c1 { animation-delay: 0.6s; }
  .hm-callouts .c2 { animation-delay: 0.75s; }
  .hm-callouts .c3 { animation-delay: 0.9s; }
  .hm-callouts .c4 { animation-delay: 1.05s; }
}
@keyframes hm-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hm-fade { from { opacity: 0; } }
@keyframes hm-pop { from { opacity: 0; translate: 0 10px; } }

.hm-aside {
  margin: 40px 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: 0 6px 6px 0;
  color: var(--body);
}
.hm-aside strong { color: var(--text); }

/* Which box: three plain choices. */
.hm-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hm-choice {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
}
.hm-choice:hover { border-color: var(--accent); }
body.home .hm-choice h3 { color: var(--accent); }
.hm-choice p { margin: 0; color: var(--body); }
.hm-more { margin: 24px 0 0; max-width: 46em; color: var(--muted); }
.hm-more a { color: var(--text); text-underline-offset: 3px; }
.hm-more a:hover { color: var(--accent); }

/* Learn: the guide (js/guide.js mounts its player in place of the poster),
   then the tutorial and a small glossary side by side. */
body.home .hero-guide { margin-top: 0; padding: 0; }
body.home .guide-poster { border: 1px solid var(--edge); border-radius: 8px; box-shadow: none; }
body.home .guide-poster-label { font-family: inherit; }
.hm-learn-more {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 40px;
  margin-top: 56px;
  align-items: start;
}
body.home .tutorial { scroll-margin-top: 80px; }
body.home .tutorial p { margin: 0 0 16px; color: var(--body); }
body.home .tutorial video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--edge);
  border-radius: 6px;
  box-shadow: none;
  background: #050607;
}
.hm-words dl { margin: 12px 0 18px; }
.hm-words dt { font-weight: 600; color: var(--text); }
.hm-words dd { margin: 2px 0 14px; color: var(--body); }

/* What's new: dated lines from the changelog. */
.hm-news { margin: 20px 0 22px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.hm-news li {
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.hm-news time { color: var(--muted); font-variant-numeric: tabular-nums; }
.hm-news span { color: var(--body); }
.hm-news strong { margin-right: 8px; color: var(--text); }

/* Closing ------------------------------------------------------------------- */

.hm-closing { padding: 72px 0 80px; }
.hm-closing p { margin: 0 0 22px; color: var(--body); }

/* Narrow -------------------------------------------------------------------- */

@media (max-width: 960px) {
  .hm-hero .wrap, .hm-learn-more { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hm-steps { gap: 80px; }
  .hm-step { grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 640px; }
  .hm-step:nth-child(even) .hm-step-text { order: 0; }
  .hm-step-visual { margin-right: 12px; }
  .hm-ui, .hm-step:nth-child(even) .hm-ui { left: auto; right: -12px; bottom: -28px; width: 38%; --pk: 0.5; }
}

@media (max-width: 760px) {
  body.home .wrap { padding: 0 16px; }
  .hm-hero { padding: 56px 0 72px; }
  .hm-chart:not(.hm-chart-sec) { -webkit-mask-image: none; mask-image: none; }
  .hm-chart { opacity: 0.6; }
  /* The callouts leave the picture and sit under it, two by two. */
  .hm-shot-wrap { display: flex; flex-direction: column-reverse; gap: 10px; }
  .hm-callouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hm-callouts li { position: static; white-space: normal; box-shadow: none; }
  .hm-section { padding: 56px 0; }
  .hm-steps { gap: 72px; }
  .hm-step p { font-size: 17px; }
  .hm-choices { grid-template-columns: minmax(0, 1fr); }
  .hm-news li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .hm-closing { padding: 56px 0 64px; }
  body.home .header-links a.hm-btn { padding: 6px 12px; }
}
