/* =====================================================
   FERMATA WORKS MUSIC TOOLS
   Teal · gold · soft paper grain
   ===================================================== */

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

@font-face {
  font-family: 'Bravura';
  src: url('/fonts/Bravura.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'BravuraText';
  src: url('/fonts/BravuraText.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --bg:          #f3f6f7;
  --bg-alt:      #e8eef0;
  --surface:     #ffffff;
  --border:      #d5dbde;
  --border-dark: #aeb8bc;
  --teal:        #1A7A8C;
  --teal-2:      #146576;
  --teal-deep:   #0e3d45;
  --gold:        #F4B400;
  --gold-soft:   rgba(244, 180, 0, 0.14);
  --ink:         #161616;
  --text:        #161616;
  --text-2:      #4A4F55;
  --text-3:      #8A9098;
  --success:     #059669;
  --error:       #dc2626;

  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;
  --font-math: 'STIX Two Text', 'Times New Roman', Times, serif;

  --radius: 14px;
  --radius-sm: 8px;
  --btn-radius: 0 10px 0 10px;
  --btn-radius-hover: 10px 0 10px 0;

  --shadow-sm: 0 1px 4px rgba(14, 61, 69, 0.05), 0 1px 2px rgba(14, 61, 69, 0.03);
  --shadow-md: 0 8px 28px rgba(14, 61, 69, 0.08), 0 2px 8px rgba(14, 61, 69, 0.04);

  --surface-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --site-header-h: 72px;
}

html { font-size: 16px; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

main {
  position: relative;
  z-index: 1;
  min-height: 60vh;
  padding-top: var(--site-header-h);
}

/* ── Header / nav ─────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
}
.navbar {
  background: rgba(243, 246, 247, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.navbar.scrolled,
.site-header.is-scrolled .navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #000;
}
/* Match FermataWorks Marching header logo sizing */
.nav-logo {
  max-width: 320px;
  max-height: 18px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.nav-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.nav-brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: var(--teal-deep);
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.nav-link {
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--teal); background: rgba(26, 122, 140, 0.08); }
.nav-link--admin { color: var(--teal) !important; }
.mobile-menu-link--danger { color: var(--error) !important; }
.nav-donate {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-donate--desktop {
  color: var(--teal-deep);
  font-weight: 700;
}
.nav-donate--desktop:hover {
  color: var(--teal);
}
.nav-donate--mobile {
  display: none;
  width: 2.35rem;
  height: 2.35rem;
  justify-content: center;
  border-radius: 999px;
  color: var(--teal-deep);
}
.nav-donate--mobile:hover,
.nav-donate--mobile:focus-visible {
  background: rgba(26, 122, 140, 0.1);
  color: var(--teal);
}
.nav-heart {
  display: block;
  flex: 0 0 auto;
}
.mobile-menu-donate {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin-left: 0;
}
.btn-nav-external {
  display: inline-flex;
  align-items: center;
  height: 2.2rem;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-deep);
  transition: border-radius 0.25s var(--ease-out), border-color 0.15s, background 0.15s;
}
.btn-nav-external:hover {
  border-radius: 10px 0 10px 0;
  border-color: var(--teal);
  background: rgba(26, 122, 140, 0.06);
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-hamburger:hover,
.nav-hamburger:focus-visible {
  background: rgba(26, 122, 140, 0.08);
  outline: none;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--teal-deep);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
  pointer-events: none;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.mobile-menu[hidden] {
  display: none !important;
}
.mobile-menu:not([hidden]) {
  display: flex;
}
.mobile-menu-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.mobile-menu-close {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.mobile-menu-close:hover { background: var(--bg-alt); }
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  gap: 0.25rem;
}
.mobile-menu-nav > a {
  padding: 0.95rem 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal-deep);
  border-bottom: 1px solid var(--border);
}
body.mobile-menu-open { overflow: hidden; }

/* Flash */
.site-flash {
  position: fixed;
  top: calc(var(--site-header-h) + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: min(520px, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  background: var(--surface);
}
.site-flash--error { border: 1px solid #fecaca; color: var(--error); }
.site-flash--success { border: 1px solid #a7f3d0; color: var(--success); }
.site-flash button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: inherit;
}

/* Buttons */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--btn-radius);
  transition: border-radius 0.28s var(--ease-out), transform 0.2s, background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--gold);
  color: var(--ink);
  border: none;
}
.btn-primary:hover {
  border-radius: 10px 0 10px 0;
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--teal-deep);
  border: 1.5px solid rgba(14, 61, 69, 0.28);
}
.btn-outline:hover {
  border-radius: 10px 0 10px 0;
  border-color: var(--teal);
  background: rgba(26, 122, 140, 0.06);
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 4.5rem 0 3.75rem;
  background:
    linear-gradient(160deg, #eaf3f5 0%, var(--bg) 48%, #f7f4ea 100%);
}
.hero-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background:
    radial-gradient(ellipse 55% 60% at 20% 40%, rgba(26, 122, 140, 0.18), transparent 70%),
    radial-gradient(ellipse 45% 50% at 85% 20%, rgba(244, 180, 0, 0.22), transparent 68%);
  pointer-events: none;
  z-index: 0;
  animation: heroGlow 10s ease-in-out infinite alternate;
}
.hero-wave {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -1px;
  height: 90px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 18px,
      rgba(26, 122, 140, 0.08) 18px 19px
    );
  mask-image: linear-gradient(180deg, transparent, #000 35%, #000 70%, transparent);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
  animation: waveDrift 18s linear infinite;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  opacity: 0;
  animation: riseIn 0.7s var(--ease-out) 0.05s forwards;
}
.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  opacity: 0;
  animation: riseIn 0.75s var(--ease-out) 0.12s forwards;
}
.hero-logo {
  width: min(420px, 82vw);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(14, 61, 69, 0.08));
}
.hero-brand-tools {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--teal-deep);
}
.hero-sub {
  max-width: 34rem;
  margin: 0 auto 1.75rem;
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  color: var(--text-2);
  opacity: 0;
  animation: riseIn 0.75s var(--ease-out) 0.22s forwards;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0;
  animation: riseIn 0.75s var(--ease-out) 0.32s forwards;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes heroGlow {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2%, 3%, 0) scale(1.04); }
}
@keyframes waveDrift {
  from { transform: translateX(0); }
  to { transform: translateX(-19px); }
}

/* Tools section */
.section-tools {
  position: relative;
  padding: 3.75rem 0 4rem;
  background:
    linear-gradient(180deg, transparent, rgba(26, 122, 140, 0.03)),
    var(--bg);
}
.section-tools::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: var(--surface-grain);
  background-size: 280px 280px;
  pointer-events: none;
}
.section-header {
  max-width: 40rem;
  margin-bottom: 2rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--teal-deep);
  margin-bottom: 0.55rem;
}
.section-lead {
  color: var(--text-2);
  font-size: 1.05rem;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.tool-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) 0 var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, border-radius 0.25s;
}
.tool-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius) 0 var(--radius) 0;
}
.tool-tile-media {
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.tool-tile-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.tool-tile-body {
  padding: 1.1rem 1.15rem 1.25rem;
}
.tool-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.tool-name {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tool-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #8a6800;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tool-badge--live {
  background: rgba(26, 122, 140, 0.12);
  color: var(--teal-2);
}
a.tool-tile--live { color: inherit; }
.tool-blurb {
  color: var(--text-2);
  font-size: 0.95rem;
}

.section-note {
  padding: 3.5rem 0 4.25rem;
  background:
    linear-gradient(135deg, rgba(26, 122, 140, 0.08), transparent 55%),
    linear-gradient(320deg, rgba(244, 180, 0, 0.1), transparent 50%),
    var(--bg-alt);
}
.note-inner { max-width: 40rem; }
.note-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--teal-deep);
  margin-bottom: 0.65rem;
}
.note-copy { color: var(--text-2); font-size: 1.05rem; }

/* Legal / pages */
.page-section { padding: 2.75rem 0 4rem; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--teal-deep);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.page-subtitle {
  color: var(--text-3);
  margin-bottom: 1.75rem;
}
.legal-page { max-width: 46rem; }
.legal-body h2 {
  margin: 1.75rem 0 0.55rem;
  font-size: 1.15rem;
  color: var(--teal-deep);
}
.legal-body p,
.legal-body li {
  color: var(--text-2);
  margin-bottom: 0.7rem;
}
.legal-body ul {
  padding-left: 1.2rem;
  margin-bottom: 0.85rem;
}
.legal-body a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.error-page {
  max-width: 28rem;
  padding: 2rem 0 3rem;
  text-align: center;
  margin: 0 auto;
}
.error-page h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--teal-deep);
  margin-bottom: 0.5rem;
}
.error-page p {
  color: var(--text-2);
  margin-bottom: 1.25rem;
}

/* Ad slots (ready for Google Ads) */
.ad-slot {
  margin: 1.5rem auto;
  max-width: 1120px;
  padding: 0 1.5rem;
}
.ad-slot-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
}
.ad-slot-placeholder {
  min-height: 90px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-3);
  font-size: 0.85rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: #eef3f4;
  padding: 2.5rem 0 2rem;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  gap: 1.25rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.footer-icon { width: 36px; height: 36px; }
.footer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.footer-brand-text strong {
  font-size: 0.98rem;
  color: var(--teal-deep);
}
.footer-brand-text span {
  font-size: 0.85rem;
  color: var(--text-3);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
}
.footer-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
}
.footer-nav a:hover { color: var(--teal); }
.footer-copy {
  font-size: 0.82rem;
  color: var(--text-3);
}

/* Responsive */
/* ── Tool pages / Metric Modulation ───────────── */
.tool-page {
  padding: 2rem 0 4rem;
  background:
    linear-gradient(180deg, rgba(26, 122, 140, 0.04), transparent 28%),
    var(--bg);
}
.tool-page-inner { max-width: 1100px; }
.tool-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-3);
}
.tool-crumb a { color: var(--teal); }
.tool-crumb a:hover { text-decoration: underline; }

.tools-group {
  margin-top: 1.75rem;
}
.tools-group:first-of-type {
  margin-top: 0.35rem;
}
.section-tools .tools-group {
  margin-top: 1.5rem;
}
.tools-group-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--teal-deep);
  margin: 0 0 0.35rem;
}
.tools-group-title a {
  color: inherit;
  text-decoration: none;
}
.tools-group-title a:hover {
  color: var(--teal);
  text-decoration: underline;
}
.tools-group-blurb {
  color: var(--text-2);
  font-size: 0.95rem;
  margin: 0 0 0.85rem;
}
.tool-related {
  margin: 2.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.tool-related-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--teal-deep);
  margin: 0 0 1rem;
}
.tool-related-grid {
  margin-bottom: 0;
}
.tool-support {
  margin: 1.75rem 0 0.25rem;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.45;
  text-align: center;
}
.tool-support h2{
  margin: 4rem auto 2rem auto; 
}
.tool-support a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tool-support a:hover {
  color: var(--teal-deep);
}

.donate-page {
  max-width: 32rem;
}
.donate-lead {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}
.donate-blurb {
  color: var(--text-2);
  font-size: 1.02rem;
  line-height: 1.5;
  margin: 0 0 1.75rem;
}
.donate-error {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.25);
  color: var(--error);
  font-weight: 600;
}
.donate-form {
  display: grid;
  gap: 1.15rem;
}
.donate-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.donate-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}
.donate-amount-wrap {
  display: flex;
  align-items: stretch;
  width: 9.5rem;
  max-width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.donate-amount-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 122, 140, 0.15);
}
.donate-currency {
  display: flex;
  align-items: center;
  padding: 0 0.15rem 0 0.95rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-2);
  line-height: 1;
}
.donate-input,
.donate-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.donate-input {
  height: 3rem;
  padding: 0 0.95rem;
}
.donate-amount-wrap .donate-input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding-left: 0.45rem;
  font-variant-numeric: tabular-nums;
}
.donate-amount-wrap .donate-input:focus {
  outline: none;
  box-shadow: none;
}
.donate-input::placeholder,
.donate-textarea::placeholder {
  color: var(--text-3);
  font-weight: 500;
}
.donate-input:focus,
.donate-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 122, 140, 0.15);
}
.donate-textarea {
  min-height: 7rem;
  padding: 0.85rem 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  resize: vertical;
}
.donate-submit {
  justify-self: start;
  margin-top: 0.25rem;
  min-width: 12rem;
}
.donate-secure,
.donate-unavailable {
  margin: 0.35rem 0 0;
  color: var(--text-3);
  font-size: 0.88rem;
}
.donate-thanks {
  max-width: 36rem;
  text-align: center;
}
.donate-thanks-copy {
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}
.donate-thanks-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.tool-header { margin-bottom: 1.5rem; }
.tool-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--teal-deep);
  margin-bottom: 0.4rem;
}
.tool-lead { color: var(--text-2); font-size: 1.05rem; }

.mmc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) 0 var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.15rem 1.1rem 1.25rem;
  margin-bottom: 2.25rem;
}
.mmc-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mmc-set {
  background:
    linear-gradient(160deg, rgba(26, 122, 140, 0.05), transparent 55%),
    #fbfcfd;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.05rem 1.05rem 1.15rem;
  min-width: 0;
  overflow: visible;
}
.mmc-set-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.75rem;
}
.mmc-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 0.75rem;
}
.mmc-field {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-width: 0;
}
.mmc-note {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 6.75rem;
  width: 6.75rem;
  min-height: 3.5rem;
  padding: 0.2rem 0;
  color: var(--ink);
  background: transparent;
  border: none;
  overflow: visible;
}

/* Bravura / SMuFL */
.bravura {
  display: block;
  font-family: Bravura, BravuraText, serif !important;
  font-style: normal;
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: normal;
  font-variant-ligatures: none;
  white-space: nowrap;
}
.bravura--dotted { letter-spacing: 0.14em; }
.bravura-group {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  font-family: Bravura, BravuraText, serif !important;
  font-size: 2.05rem;
  line-height: 1;
  white-space: nowrap;
}
.bravura-group--wide {
  font-size: 1.7rem;
}
.bravura-group--xwide {
  font-size: 1.35rem;
}
.bravura-tuplet-num {
  display: block;
  font-family: var(--font-sans), Inter, system-ui, sans-serif !important;
  font-size: 0.945rem; /* 70% of 1.35rem */
  font-weight: 800;
  font-style: normal;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
  transform: translateY(-8px);
}
.bravura-notes {
  display: block;
  font-family: Bravura, BravuraText, serif !important;
  letter-spacing: 0.12em;
  line-height: 1;
  white-space: nowrap;
}
/* Beamed tuplets: SVG text glyphs + vector beams (scale like normal type) */
.bravura-beamed-svg {
  display: block;
  overflow: visible;
  color: inherit;
  max-width: 100%;
  /* width/height set in em by bravura-beams.js from viewBox */
}
.mmc-input {
  flex: 0 0 5.5rem;
  width: 5.5rem;
  height: 2.85rem;
  padding: 0 0.55rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mmc-input::placeholder {
  color: var(--text-3);
  font-weight: 600;
  font-size: 0.8rem;
}
.mmc-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 122, 140, 0.15);
}
.mmc-copy {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--teal-deep);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.mmc-copy ion-icon {
  font-size: 1rem;
  pointer-events: none;
}
.mmc-copy:hover {
  border-color: var(--teal);
  background: rgba(26, 122, 140, 0.08);
  color: var(--teal);
}
.mmc-copy:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 122, 140, 0.15);
}
.mmc-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 1000;
  transform: translateX(-50%) translateY(0.75rem);
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.mmc-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Metric Modulation Finder */
.mmf {
  margin: 2.25rem 0 2.5rem;
}
.mmf-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--teal-deep);
  margin-bottom: 0.35rem;
}
.mmf-lead {
  color: var(--text-2);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.mmf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) 0 var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.15rem 1.1rem 1.25rem;
}
.mmf-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}
.mmf-side {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.mmf-note {
  flex: 0 0 6.75rem;
  width: 6.75rem;
}
.mmf-note--result {
  min-height: 3.5rem;
}
.mmf-note-placeholder {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  border: 1.5px dashed rgba(213, 219, 222, 0.95);
  border-radius: 6px;
  background: rgba(251, 252, 253, 0.9);
}
.mmf-input {
  flex: 0 0 5.5rem;
  width: 5.5rem;
  height: 2.85rem;
  box-sizing: border-box;
}
.mmf-actual {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
  white-space: nowrap;
}
.mmf-actual--alt {
  margin-top: 0.35rem;
}
.mmf-arrow {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
  padding-bottom: 0.15rem;
}
.mmf-alts {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.mmf-alts-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.75rem;
  text-align: center;
}
.mmf-alts-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.25rem;
}
.mmf-alt {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
}
.mmf-note--alt {
  min-height: 3.25rem;
}

/* BPM to Milliseconds */
.btm {
  margin: 0 0 2rem;
}
.btm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) 0 var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.25rem 1.15rem 1.35rem;
}
.btm-row--top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem 2.25rem;
  margin-bottom: 1.1rem;
}
.btm-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.btm-field--ms {
  align-items: center;
  margin-bottom: 1.15rem;
}
.btm-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}
.btm-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.btm-input {
  flex: 0 0 6.5rem;
  width: 6.5rem;
}
.btm-input--ms {
  flex-basis: 8rem;
  width: 8rem;
}
.btm-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}
.btm-preset {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.25rem;
  padding: 0.45rem 0.35rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(160deg, rgba(26, 122, 140, 0.05), transparent 55%),
    #fbfcfd;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.btm-preset:hover {
  border-color: var(--teal);
  background: rgba(26, 122, 140, 0.08);
}
.btm-preset:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 122, 140, 0.15);
}
.btm-preset.is-active {
  border-color: var(--teal);
  background: rgba(26, 122, 140, 0.12);
  box-shadow: inset 0 0 0 1px rgba(26, 122, 140, 0.25);
}
.btm-preset-note {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  pointer-events: none;
}
.btm-preset-note .bravura {
  font-size: 1.65rem;
}
.btm-preset-note .bravura-group {
  font-size: 1.35rem;
  gap: 0.3rem;
}
.btm-preset-note .bravura-tuplet-num {
  font-size: 0.75rem;
  transform: translateY(-4px);
}
.btm-preset--single .btm-preset-note {
  transform: translateY(0.28em);
}
.btm-preset--triplet-eighth .btm-preset-note {
  transform: translateY(-0.28em);
}
.btm-preset--triplet-eighth .bravura-group {
  gap: 0.08rem;
}
.btm-preset--triplet-eighth .bravura-tuplet-num {
  transform: translateY(2px);
}
.btm-summary {
  margin: 0.55rem 0 0;
  max-width: 28rem;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.35;
}
.btm-formulas {
  display: grid;
  gap: 2.25rem;
  margin: 1.75rem auto 1rem;
  max-width: 36rem;
  text-align: center;
}
.btm-formula-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--teal-deep);
  margin: 0 0 1rem;
  text-align: center;
}
.btm-formula-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0;
  font-family: var(--font-math);
  font-size: 1.35rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.btm-formula-side {
  white-space: nowrap;
}
.btm-formula-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 8.5rem;
  line-height: 1.25;
}
.btm-formula-num {
  padding: 0 0.45rem 0.35rem;
  border-bottom: 1.5px solid currentColor;
  white-space: nowrap;
}
.btm-formula-den {
  padding: 0.35rem 0.45rem 0;
  white-space: nowrap;
}
.btm + .tool-share {
  margin-top: 1.35rem;
}

.tool-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 2rem 0 0.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}
.tool-share-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tool-share-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tool-share-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--teal-deep);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--btn-radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease-out), border-radius 0.2s var(--ease-out), border-color 0.2s, background 0.2s, color 0.2s;
}
.tool-share-btn ion-icon {
  font-size: 1.25rem;
  pointer-events: none;
}
.tool-share-btn--copy { color: var(--teal-deep); }
.tool-share-btn--facebook { color: #1877F2; }
.tool-share-btn--x { color: #0F1419; }
.tool-share-btn--reddit { color: #FF4500; }
.tool-share-btn--linkedin { color: #0A66C2; }
.tool-share-btn--email { color: var(--teal-deep); }
.tool-share-btn:hover {
  border-radius: var(--btn-radius-hover);
  transform: translateY(-2px);
  color: #fff;
}
.tool-share-btn--copy:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.tool-share-btn--facebook:hover { background: #1877F2; border-color: #1877F2; }
.tool-share-btn--x:hover { background: #0F1419; border-color: #0F1419; }
.tool-share-btn--reddit:hover { background: #FF4500; border-color: #FF4500; }
.tool-share-btn--linkedin:hover { background: #0A66C2; border-color: #0A66C2; }
.tool-share-btn--email:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.tool-share-btn:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 2px;
}
.tool-share-copied {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal-deep);
}
.tool-copy-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal-deep);
  margin-bottom: 0.7rem;
}
.tool-copy p {
  color: var(--text-2);
  margin-bottom: 0.85rem;
  font-size: 1.02rem;
}
.tool-copy a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tool-font-note {
  font-size: 0.92rem !important;
  color: var(--text-3) !important;
}

@media (max-width: 900px) {
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mmc-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btm-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --site-header-h: 56px; }
  .nav-inner {
    padding: 0.7rem 1rem;
    gap: 0.75rem;
  }
  .nav-links,
  .btn-nav-external { display: none !important; }
  .nav-donate--mobile { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .nav-hamburger { display: flex; }
  .hero { padding: 3.25rem 0 3rem; }
  .hero-actions { width: 100%; }
  .hero-actions .btn-primary,
  .hero-actions .btn-outline { width: 100%; }
  .section-tools,
  .section-note { padding: 2.75rem 0 3rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .page-section { padding: 2rem 0 3rem; }
  .tool-page { padding: 1.5rem 0 3rem; }
  .mmc { padding: 0.9rem 0.75rem 1rem; }
  .mmc-fields { grid-template-columns: 1fr; }
  .mmc-note { min-height: 3.25rem; }
  .mmc-input { flex-basis: 6.25rem; width: 6.25rem; height: 2.75rem; }
  .bravura { font-size: 1.95rem; }
  .bravura-group { font-size: 1.85rem; }
  .bravura-group--wide { font-size: 1.5rem; }
  .bravura-group--xwide { font-size: 1.2rem; }
  .mmf-row { gap: 0.75rem; }
  .mmf-arrow { transform: rotate(90deg); padding: 0; }
  .mmf-note { flex-basis: 5.75rem; width: 5.75rem; }
  .mmf-input { flex-basis: 5.5rem; width: 5.5rem; }
  .btm-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btm-row--top { gap: 0.85rem; }
  .tool-share { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-glow,
  .hero-wave,
  .hero-eyebrow,
  .hero-brand,
  .hero-sub,
  .hero-actions { animation: none; opacity: 1; }
}
