/*! DIY Sounds — © 2026 Glenn Mejias. All rights reserved.
 *  https://diysounds.com
 *  Not licensed for redistribution, reuse or derivative works.
 *  See /terms.html
 */
/*
 * One stylesheet for every marketing page.
 *
 * The landing page used to carry its CSS inline, which was fine while there
 * was one page. There are now a dozen, and a shared file that caches once is
 * both smaller over the site and the only way the pages stay consistent.
 */

/*
 * The palette is the app's light theme (web/src/index.css, the
 * `data-theme="light"` block): Material's default blue on its neutral greys,
 * Roboto, depth from shadow rather than outlines. Keep the two in step so the
 * site and the app read as one product.
 */
:root {
  color-scheme: light;
  --bg: #f5f5f5;
  --panel: #ffffff;
  --line: #e0e0e0;
  --text: #1c1c1c;
  --body: #3c3c3c;
  --muted: #616161;
  --accent: #1976d2;
  --accent-hover: #1565c0;
  --on-accent: #ffffff;
  --accent-wash: rgb(25 118 210 / 0.08);
  --measured: #0277bd;
  --edge: #bdbdbd;
  --hover: #eeeeee;
  --sunken: #f5f5f5;
  --danger: #c43c3c;
  --estimated: #a86a00;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 3px rgb(0 0 0 / 0.08);
  --shadow-2: 0 2px 4px rgb(0 0 0 / 0.08), 0 4px 14px rgb(0 0 0 / 0.1);
  --shadow-3: 0 12px 32px rgb(0 0 0 / 0.18), 0 4px 10px rgb(0 0 0 / 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Roboto, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); }

/* Header: the app's white top bar ----------------------------------------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--panel);
  box-shadow: var(--shadow-2);
  padding: 12px 0;
}
header.site .wrap { display: flex; align-items: center; gap: 12px; }
.mark { width: 32px; height: 32px; border-radius: 8px; display: block; object-fit: cover; }
.name { font-size: 18px; font-weight: 500; color: var(--text); text-decoration: none; }
.header-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.header-links a {
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.header-links a:hover { background: var(--accent-wash); color: var(--accent); }
.header-links a.primary { color: var(--accent); }
.free {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: 4px 12px;
}

/* The tools sub-bar, on the topic pages. */
nav.site {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  font-size: 14px;
}
nav.site .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
nav.site .nav-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
nav.site a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-decoration: none;
}
nav.site a:hover { color: var(--accent); }
nav.site a svg { color: var(--accent); flex: none; }

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

.hero { padding: 72px 0 56px; text-align: center; background: var(--panel); }
h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 500;
}
.lede {
  margin: 0 auto 32px;
  max-width: 560px;
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--muted);
}

/* Buttons: Material's contained (the one thing to press) and outlined. */
.cta,
.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 12px 26px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.cta {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-1);
}
.cta:hover { background: var(--accent-hover); box-shadow: var(--shadow-2); }
.cta-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--edge);
}
.cta-secondary:hover { background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 45%, var(--edge)); }
.cta-secondary svg { flex: none; }
.cta:focus-visible, .cta-secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cta-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Screenshots ------------------------------------------------------------- */

figure { margin: 0; }
.shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-2);
}
.hero-shot { margin-top: 48px; }

/* The hero reel: a muted autoplay loop, with a button for its soundtrack
   (js/reel.js shows it). The reel is black, so the frame is too. */
.hero-reel { position: relative; }
.hero-reel video { aspect-ratio: 16 / 9; object-fit: cover; background: #050607; box-shadow: var(--shadow-3); }
.reel-sound {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(5, 6, 7, 0.72);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.reel-sound:hover { border-color: #90caf9; }
.reel-sound:focus-visible { outline: 2px solid #90caf9; outline-offset: 2px; }
.reel-sound[hidden] { display: none; }
.reel-sound .on { display: none; }
.reel-sound.is-on .on { display: inline; }
.reel-sound.is-on .off { display: none; }

figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); text-align: center; }

/* Home page sections ------------------------------------------------------ */

/* The hero's "Watch the tutorial" glides down to it, unless motion is off. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.section { padding: 64px 0; }

/* The tutorial at the foot of the page: clear of the sticky header when the
   hero's button lands on it. */
.tutorial { scroll-margin-top: 88px; }
.tutorial .section-title { margin-bottom: 8px; }
.section-lede { margin: 0 0 28px; text-align: center; color: var(--muted); }
.tutorial video { aspect-ratio: 16 / 9; }
.section-tight { padding-top: 0; }
.section-title {
  margin: 0 0 28px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: center;
}

/* Four short features, as Material cards. */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature-card {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.feature-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--hover); }
.feature-card .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: var(--accent-wash);
  color: var(--accent);
}
.feature-card h3 { margin: 16px 16px 4px; font-size: 17px; font-weight: 500; }
.feature-card p { margin: 0 16px 18px; font-size: 14px; color: var(--muted); }

/* Article pages ----------------------------------------------------------- */

.article { padding: 56px 0 24px; }
.article h1 { font-size: clamp(30px, 5vw, 42px); text-align: left; margin-bottom: 16px; }
.article .lede { margin: 0 0 32px; max-width: none; text-align: left; }
.article h2 {
  margin: 44px 0 14px;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-weight: 600;
  scroll-margin-top: 24px;
}
.article h3 { margin: 28px 0 10px; font-size: 18px; font-weight: 600; }
.article p { margin: 0 0 16px; color: var(--body); }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; color: var(--body); }
.article li { margin-bottom: 8px; }
.article li::marker { color: var(--muted); }

/* Breadcrumbs, so the trail is visible as well as marked up. */
.crumbs { font-size: 13px; color: var(--muted); padding: 20px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* A formula, or any short block of maths. Scrolls rather than pushing the
   page sideways on a phone. */
.formula {
  display: block;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  color: var(--text);
  white-space: pre;
}
.formula .note {
  display: block;
  margin-top: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
}

/* A callout for the thing people get wrong. */
.aside {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 0 0 20px;
}
.aside p:last-child { margin-bottom: 0; }
.aside strong { color: var(--text); }

/* Tables: reference numbers, alignment comparisons. */
.table-scroll { overflow-x: auto; margin: 0 0 20px; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 15px;
}
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--text); font-weight: 600; white-space: nowrap; }
td { color: var(--body); }
caption { caption-side: bottom; padding-top: 10px; font-size: 13px; color: var(--muted); text-align: left; }

/* An inline call to action inside an article. */
.inline-cta {
  box-shadow: var(--shadow-1);
  border-radius: 8px;
  padding: 24px;
  margin: 32px 0;
  background: var(--panel);
  text-align: center;
}
.inline-cta h2 { margin: 0 0 8px; font-size: 20px; }
.inline-cta p { margin: 0 0 18px; color: var(--muted); }

/* FAQ. Real <details> so it works without script and the text is in the DOM
   for a crawler either way. */
.faq { margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  color: var(--accent);
  font-weight: 400;
  line-height: 1.4;
}
.faq[open] summary::before { content: "\2013"; }
.faq .answer { padding: 0 0 16px 24px; }
.faq .answer p { margin: 0 0 12px; color: var(--body); }
.faq .answer p:last-child { margin-bottom: 0; }

/* Card grid, for the "other calculators" block. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 0 0 20px; }
.card {
  display: block;
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  transition: box-shadow 0.15s;
}
.card:hover { box-shadow: var(--shadow-2); }
.cards-compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cards-compact .card { padding: 16px; }
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
}
.cards-compact .card h3 { font-size: 15px; font-weight: 500; }
.cards-compact .card p { font-size: 13px; }
.card h3 { margin: 0 0 6px; font-size: 17px; color: var(--text); }
.card p { margin: 0; font-size: 14px; color: var(--muted); }

/* Closing + footer -------------------------------------------------------- */

.closing { background: var(--panel); padding: 64px 0; text-align: center; }
.closing h2 { margin: 0 0 14px; font-size: 28px; font-weight: 500; letter-spacing: -0.01em; }
.closing p { margin: 0 auto 28px; max-width: 560px; color: var(--muted); }

footer.site {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  font-size: 14px;
  color: var(--muted);
}
footer.site .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--text); }
footer.site .spacer { margin-left: auto; }

@media (max-width: 760px) {
  .hero { padding: 56px 0 32px; }
  .hero-shot { margin-top: 36px; }
  .reel-sound { right: 8px; bottom: 8px; padding: 5px 10px; font-size: 12px; gap: 6px; }
  .reel-sound svg { width: 14px; height: 14px; }
  .section { padding: 44px 0; }
  .section-tight { padding-top: 0; }
  .header-links .hide-sm { display: none; }
  footer.site .spacer { margin-left: 0; }
  nav.site .wrap { gap: 14px; }
  nav.site .nav-label { display: none; }
}

/* The assistant ------------------------------------------------------------
   A round button above the fold's bottom-right corner, and the panel it opens.
   `js/ask.js` builds both; neither exists until the API says there is an
   assistant to talk to, so none of this is ever seen on a static preview.

   These pages have no dock and no status bar, so the offsets are plain numbers
   rather than the app's `--dock-h` arithmetic — there is nothing here for the
   button to ride above except the bottom of the window. */

.ask-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.2);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ask-fab:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.ask-fab:active { transform: scale(0.94); }
.ask-fab:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.ask-fab.is-open {
  background: var(--panel);
  border-color: var(--edge);
  color: var(--text);
}

.ask-float {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 140px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.18);
  overflow: hidden;
}

.ask-float[hidden] { display: none; }

.ask-float-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--sunken);
}

.ask-float-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.ask-float-close {
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.ask-float-close:hover { background: var(--hover); color: var(--text); }

/* Pushed right, beside the ×, so the title keeps the left edge. */
.ask-float-clear {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ask-float-clear:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.ask-float-clear:disabled { opacity: 0.5; cursor: default; }
.ask-float-clear[hidden] { display: none; }

.ask-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.ask-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
}

.ask-intro { display: flex; flex-direction: column; gap: 12px; }
.ask-starters { display: flex; flex-direction: column; gap: 6px; }

.ask-starter {
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.ask-starter:hover { background: var(--hover); }

.ask-turn {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  /* Answers are text, never markup — see the header of `js/ask.js`. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ask-turn-user {
  align-self: flex-end;
  max-width: 88%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
}

.ask-turn-model {
  background: var(--sunken);
  border: 1px solid var(--line);
  color: var(--text);
}

.ask-turn-model.is-error { border-color: var(--danger); color: var(--danger); }
.ask-turn.ask-waiting { padding: 14px 12px; }

.ask-signin-link { font-weight: 600; }

.ask-dots { display: inline-flex; gap: 5px; }

.ask-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: ask-dot 1.2s ease-in-out infinite;
}

.ask-dots i:nth-child(2) { animation-delay: 0.15s; }
.ask-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes ask-dot {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ask-dots i { animation: none; opacity: 0.5; }
}

.ask-composer { display: flex; flex-direction: column; gap: 8px; }

.ask-input {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--sunken);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.ask-input:focus { outline: none; border-color: var(--accent); }
.ask-input::placeholder { color: var(--muted); }

.ask-send {
  align-self: flex-end;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ask-send:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.ask-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.ask-note.is-spent { color: var(--estimated); font-weight: 560; }

.ask-signin-note {
  padding: 9px 11px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--sunken);
}

@media (max-width: 720px) {
  .ask-float {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    bottom: 80px;
    max-height: calc(100vh - 130px);
  }
  .ask-fab { right: 12px; bottom: 16px; }
}
