/* ==========================================================================
   Online Guitar Tuner & Metronome
   A quiet toolkit for guitarists — styles
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f2eadf;
  --bg-deep: #e9ddcd;
  --surface: #fbf7ef;
  --surface-raised: #fffaf2;
  --surface-muted: #f4ecdf;
  --surface-hover: #f7efe4;
  --ink: #17251e;
  --ink-soft: #536158;
  --ink-faint: #626e64;
  --line: rgba(26, 43, 34, 0.13);
  --line-strong: rgba(26, 43, 34, 0.23);
  --accent: #ae4c24;
  --accent-hover: #963d1b;
  --accent-soft: #f2ded0;
  --accent-ink: #8e3d1a;
  --success: #357d54;
  --danger: #a33d35;
  --cream: #fbf6eb;
  --green: #1b3a2e;
  --green-hover: #234b3a;
  --nav-active-bg: #1b3a2e;
  --nav-active-ink: #f7efe2;
  --play-active-bg: #1b3a2e;
  --play-active-ink: #f7efe2;
  --tip-bg: #1b3a2e;
  --tip-ink: #f8f0e3;
  --tip-muted: rgba(248, 240, 227, 0.68);
  --tip-accent: #e9a97c;
  --shadow: 0 34px 90px rgba(49, 35, 21, 0.1), 0 5px 20px rgba(49, 35, 21, 0.05);
  --shadow-soft: 0 18px 50px rgba(49, 35, 21, 0.08);
  --shadow-lift: 0 14px 30px rgba(49, 35, 21, 0.13);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-ui: "Aptos", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --dial-bg-deep: #101f19;
  --dial-wash-a: #2a4c3b;
  --dial-wash-b: #14251d;
  --dial-ink: #f5ead9;
  --dial-muted: #a9b6aa;
  --dial-rim: rgba(245, 234, 217, 0.18);
  --dial-track: rgba(245, 234, 217, 0.16);
  --dial-tick: rgba(245, 234, 217, 0.32);
  --dial-tick-major: rgba(245, 234, 217, 0.72);
  --dial-good: #a1d8aa;
  --dial-good-halo: rgba(161, 216, 170, 0.22);
  --dial-marker: #f1a171;
  --dial-marker-halo: rgba(241, 161, 113, 0.2);
  --dial-danger: #f1a171;

  --metro-body-a: #f2e5d0;
  --metro-body-b: #d8c4a5;
  --metro-face-a: #fbf4e8;
  --metro-face-b: #ecdfcb;
  --metro-edge: rgba(255, 255, 255, 0.24);
  --metro-edge-soft: rgba(34, 53, 42, 0.23);
  --metro-scale: rgba(31, 52, 41, 0.28);
  --metro-arm: #213b2f;
  --metro-pivot: #1a3126;
  --metro-shadow: rgba(0, 0, 0, 0.26);
  --metro-base-line: rgba(28, 47, 37, 0.38);
  --metro-inset: rgba(28, 47, 37, 0.08);
  --metro-weight-notch: #f8ecdd;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1612;
  --bg-deep: #0a110d;
  --surface: #16221b;
  --surface-raised: #1b2921;
  --surface-muted: #1d2b23;
  --surface-hover: #223329;
  --ink: #f1e8da;
  --ink-soft: #a7b4a9;
  --ink-faint: #8d9a90;
  --line: rgba(241, 232, 218, 0.12);
  --line-strong: rgba(241, 232, 218, 0.22);
  --accent: #e28c5f;
  --accent-hover: #ed9d72;
  --accent-soft: #38271f;
  --accent-ink: #f0a77c;
  --success: #83c99d;
  --danger: #ee9189;
  --cream: #fbf6eb;
  --green: #244534;
  --green-hover: #2b503d;
  --nav-active-bg: #f1e8da;
  --nav-active-ink: #17251e;
  --play-active-bg: #f1e8da;
  --play-active-ink: #17251e;
  --tip-bg: #1f3529;
  --tip-ink: #f4eadb;
  --tip-muted: rgba(244, 234, 219, 0.65);
  --tip-accent: #eba87d;
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.32), 0 5px 20px rgba(0, 0, 0, 0.18);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.22);
  --shadow-lift: 0 14px 30px rgba(0, 0, 0, 0.28);

  --dial-bg-deep: #0b1510;
  --dial-wash-a: #223c2e;
  --dial-wash-b: #0e1c15;
  --dial-rim: rgba(241, 232, 218, 0.16);
  --dial-track: rgba(241, 232, 218, 0.14);
  --dial-tick: rgba(241, 232, 218, 0.3);
  --dial-tick-major: rgba(241, 232, 218, 0.68);
  --metro-body-a: #f0e2cc;
  --metro-body-b: #cfb995;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 84% -4%, rgba(208, 155, 84, 0.18), transparent 31rem),
    radial-gradient(circle at 2% 20%, rgba(66, 111, 88, 0.1), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.033;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

[data-theme="dark"] body::before {
  opacity: 0.05;
  mix-blend-mode: screen;
}

::selection {
  background: var(--accent);
  color: var(--cream);
}

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

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hidden,
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 1000;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--danger);
  color: #fff;
  font-size: 15px;
  box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   Shared typography
   ========================================================================== */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.19em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-line {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
  flex: 0 0 auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 23px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.button svg {
  width: 17px;
  height: 17px;
  transition: transform 180ms ease;
}

.button--primary {
  background: var(--green);
  color: var(--cream);
  box-shadow: 0 10px 24px rgba(27, 58, 46, 0.18);
}

.button--primary:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(27, 58, 46, 0.23);
}

.button--primary:hover svg {
  transform: translateY(2px);
}

.button--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button--ghost:hover {
  border-color: var(--ink);
  background: var(--surface-raised);
  transform: translateY(-1px);
}

.button--ghost:hover svg {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
}

.header-inner {
  width: 100%;
  max-width: 1236px;
  height: 82px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  justify-self: start;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--green);
  flex: 0 0 auto;
  border-radius: 14px;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand:hover .brand-mark {
  transform: rotate(-5deg) translateY(-1px);
}

.brand-mark svg {
  width: 42px;
  height: 42px;
  stroke: none;
  filter: drop-shadow(0 4px 8px rgba(27, 58, 46, 0.14));
}

[data-theme="dark"] .brand-mark {
  color: #284937;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 5px;
  line-height: 1.16;
}

.brand-copy strong {
  max-width: 280px;
  font-size: clamp(14px, 1.45vw, 18px);
  font-weight: 760;
  letter-spacing: 0.01em;
  line-height: 1.16;
}

html[data-language="en"] .brand-copy strong {
  font-size: clamp(12px, 1.25vw, 16px);
  letter-spacing: -0.02em;
}

.brand-copy span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.tool-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
}

.tool-nav-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 41px;
  padding: 0 17px 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.tool-nav-button span {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.tool-nav-button small {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  opacity: 0.58;
}

.tool-nav-button:hover {
  color: var(--ink);
  background: var(--surface-raised);
}

.tool-nav-button.is-active {
  background: var(--nav-active-bg);
  color: var(--nav-active-ink);
  box-shadow: 0 5px 14px rgba(21, 38, 29, 0.16);
}

.tool-nav-button.is-active small {
  opacity: 0.62;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}

.local-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.local-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 13%, transparent);
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  min-width: 55px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.language-toggle svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.7;
}

.language-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--ink);
  transform: translateY(-1px);
}

.language-toggle[data-language="zh"] {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.theme-icon {
  width: 17px;
  height: 17px;
}

.theme-icon--sun {
  display: none;
}

[data-theme="dark"] .theme-icon--sun {
  display: block;
}

[data-theme="dark"] .theme-icon--moon {
  display: none;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 72px;
  width: 100%;
  max-width: 1236px;
  margin: 0 auto;
  padding: 76px 28px 58px;
}

.hero-copy {
  max-width: 760px;
}

.hero-eyebrow {
  margin-bottom: 22px;
  color: var(--ink-soft);
}

.hero h1 {
  margin: 0;
  font-size: clamp(50px, 6vw, 78px);
  font-weight: 710;
  letter-spacing: -0.065em;
  line-height: 1.08;
}

html[data-language="en"] .hero h1 {
  font-size: clamp(44px, 5.5vw, 72px);
  letter-spacing: -0.052em;
  line-height: 1.06;
}

.hero h1 em {
  position: relative;
  display: inline-block;
  color: var(--accent);
  font-style: normal;
  font-weight: 710;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  right: 0.02em;
  bottom: -0.09em;
  left: 0.05em;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.18;
  transform: rotate(-1deg);
}

.hero-lede {
  max-width: 530px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.01em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 33px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  width: fit-content;
}

.hero-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.hero-meta li + li::before {
  content: "";
  width: 2px;
  height: 2px;
  margin: 0 13px;
  border-radius: 50%;
  background: var(--ink-faint);
  opacity: 0.65;
}

.hero-stamp {
  position: relative;
  display: grid;
  place-items: center;
  width: 300px;
  height: 300px;
  justify-self: end;
  color: var(--ink-soft);
  overflow: hidden;
  border-radius: 50%;
}

.hero-stamp::before {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 85, 43, 0.11), transparent 68%);
  filter: blur(2px);
}

.stamp-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: stamp-spin 48s linear infinite;
}

.stamp-border {
  stroke: var(--line-strong);
  stroke-width: 1;
  fill: none;
}

.stamp-hairline {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 1 7;
  fill: none;
}

.stamp-text {
  fill: var(--ink-soft);
  stroke: none;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.32em;
}

.stamp-fork {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.stamp-wave {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.stamp-dot {
  fill: var(--accent);
  stroke: none;
}

.stamp-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.stamp-center span {
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.stamp-center strong {
  margin: 2px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 1;
}

.stamp-center small {
  margin-top: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.hero-copy > * {
  animation: rise-in 680ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.hero-copy > :nth-child(2) {
  animation-delay: 50ms;
}

.hero-copy > :nth-child(3) {
  animation-delay: 110ms;
}

.hero-copy > :nth-child(4) {
  animation-delay: 160ms;
}

.hero-copy > :nth-child(5) {
  animation-delay: 210ms;
}

.hero-stamp {
  animation: fade-in 900ms 160ms ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes stamp-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Studio shell
   ========================================================================== */

.studio {
  position: relative;
  width: calc(100% - 56px);
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.studio::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  z-index: 2;
  pointer-events: none;
}

.studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 62px;
  padding: 16px 26px 16px 30px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-raised) 55%, transparent);
}

.studio-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.studio-index {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.studio-rule {
  width: 27px;
  height: 1px;
  background: var(--line-strong);
}

.studio-title strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.studio-en {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  white-space: nowrap;
}

.studio-head-tools {
  display: flex;
  align-items: center;
  gap: 24px;
}

.studio-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.studio-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color 160ms ease, border-color 160ms ease;
}

.guide-link svg {
  width: 12px;
  height: 12px;
}

.guide-link:hover {
  color: var(--accent);
  border-color: currentColor;
}

.tool-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  animation: view-in 380ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tool-stage {
  min-width: 0;
  padding: 28px 34px 24px;
}

/* ==========================================================================
   Shared stage header
   ========================================================================== */

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 21px;
}

.stage-heading .eyebrow {
  margin-bottom: 8px;
}

.stage-heading h2 {
  margin: 0;
  font-size: clamp(27px, 2.6vw, 33px);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 1.18;
}

/* ==========================================================================
   Tuner
   ========================================================================== */

.mic-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  min-height: 57px;
  padding: 6px 15px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.mic-toggle:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.mic-glyph {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  transition: background-color 220ms ease, color 220ms ease;
}

.mic-glyph > svg {
  width: 20px;
  height: 20px;
}

.mic-waves {
  position: absolute;
  right: 4px;
  bottom: 6px;
  display: none;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}

.mic-waves i {
  display: block;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  animation: wave 700ms ease-in-out infinite alternate;
}

.mic-waves i:nth-child(2) {
  height: 8px;
  animation-delay: 130ms;
}

.mic-waves i:nth-child(3) {
  height: 6px;
  animation-delay: 260ms;
}

@keyframes wave {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

.mic-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 3px;
}

.mic-copy strong {
  font-size: 15px;
  font-weight: 680;
  line-height: 1.2;
  white-space: nowrap;
}

.mic-copy small {
  color: var(--ink-faint);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.mic-toggle:not(.is-on):not(.is-requesting) .mic-copy small {
  color: var(--play-active-ink);
}

.mic-toggle.is-on {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: var(--surface-hover);
}

.mic-toggle.is-on .mic-glyph {
  background: var(--accent);
  color: var(--cream);
}

.mic-toggle.is-on .mic-waves {
  display: flex;
}

.mic-toggle.is-requesting {
  opacity: 0.74;
  pointer-events: none;
}

.mic-toggle.is-requesting .mic-glyph {
  animation: soft-pulse 1s ease-in-out infinite;
}

@keyframes soft-pulse {
  50% { opacity: 0.55; }
}

.mic-toggle:disabled {
  cursor: wait;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: -3px 0 18px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  color: var(--ink);
}

.alert-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--danger);
}

.alert-copy {
  min-width: 0;
  flex: 1;
}

.alert-copy strong {
  display: block;
  font-size: 14.5px;
  font-weight: 680;
}

.alert-copy p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.alert-copy code {
  padding: 1px 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.alert-close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.alert-close:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}

.alert-close svg {
  width: 14px;
  height: 14px;
}

.dial-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0 0;
}

.dial-shell {
  position: relative;
  width: min(100%, 418px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--dial-bg-deep);
  color: var(--dial-ink);
  box-shadow:
    0 30px 55px -22px rgba(10, 25, 18, 0.58),
    0 7px 20px rgba(10, 25, 18, 0.13),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  transition: box-shadow 400ms ease;
  isolation: isolate;
}

.dial-shell::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  border: 1px solid rgba(245, 234, 217, 0.08);
  pointer-events: none;
}

.dial-shell::after {
  content: "";
  position: absolute;
  inset: 24%;
  z-index: -1;
  border-radius: 50%;
  background: var(--dial-good-halo);
  opacity: 0;
  filter: blur(30px);
  transition: opacity 450ms ease;
  pointer-events: none;
}

.dial-shell.is-intune {
  box-shadow:
    0 30px 58px -22px rgba(10, 25, 18, 0.6),
    0 0 0 1px color-mix(in srgb, var(--dial-good) 22%, transparent),
    0 0 50px -10px color-mix(in srgb, var(--dial-good) 24%, transparent);
}

.dial-shell.is-intune::after {
  opacity: 1;
}

.dial-shell.is-error {
  box-shadow:
    0 30px 58px -22px rgba(10, 25, 18, 0.6),
    0 0 0 1px color-mix(in srgb, var(--dial-danger) 28%, transparent);
}

.dial-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke: none;
}

.dial-plate {
  fill: var(--dial-bg-deep);
}

.dial-rim {
  fill: none;
  stroke: var(--dial-rim);
  stroke-width: 1;
}

.dial-inner-ring {
  fill: none;
  stroke: rgba(245, 234, 217, 0.065);
  stroke-width: 1;
}

.dial-dash-ring {
  fill: none;
  stroke: var(--dial-track);
  stroke-width: 1;
  stroke-dasharray: 1 8;
  opacity: 0.55;
}

.dial-arc {
  fill: none;
  stroke: var(--dial-track);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.dial-intune-arc {
  fill: none;
  stroke: var(--dial-good);
  stroke-width: 4.5;
  stroke-linecap: round;
  opacity: 0.7;
}

.dial-tick {
  stroke: var(--dial-tick);
  stroke-width: 1;
}

.dial-tick.is-major {
  stroke: var(--dial-tick-major);
  stroke-width: 1.5;
}

.dial-tick.is-center {
  stroke: var(--dial-good);
  stroke-width: 2;
}

.dial-arc-label {
  fill: var(--dial-muted);
  stroke: none;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-anchor: middle;
  dominant-baseline: middle;
}

.dial-arc-label.is-zero {
  fill: var(--dial-good);
  font-weight: 700;
}

.pitch-marker {
  transform-box: view-box;
  transform-origin: 210px 210px;
  transition: transform 160ms cubic-bezier(0.22, 0.8, 0.3, 1), opacity 250ms ease;
  opacity: 0.45;
}

.marker-halo {
  fill: var(--dial-marker-halo);
  stroke: none;
}

.marker-dot {
  fill: var(--dial-marker);
  stroke: none;
  filter: url(#markerGlow);
  transition: fill 250ms ease;
}

.dial-shell.is-detecting .pitch-marker {
  opacity: 1;
}

.dial-shell.is-intune .marker-halo {
  fill: var(--dial-good-halo);
}

.dial-shell.is-intune .marker-dot {
  fill: var(--dial-good);
}

.dial-center-tick {
  fill: none;
  stroke: rgba(245, 234, 217, 0.22);
  stroke-width: 1;
}

.dial-display {
  position: absolute;
  top: 38%;
  left: 0;
  right: 0;
  z-index: 1;
  text-align: center;
  pointer-events: none;
}

.dial-label {
  display: block;
  color: var(--dial-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  opacity: 0.74;
}

.note-line {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: clamp(77px, 8.9vw, 102px);
  margin-top: 4px;
  color: var(--dial-ink);
  line-height: 1;
}

[data-theme="dark"] .dial-shell .note-line {
  color: var(--dial-ink);
}

.note-letter {
  font-family: var(--font-display);
  font-size: clamp(79px, 9.2vw, 106px);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.note-accidental {
  margin: 7px 0 0 1px;
  color: var(--dial-ink);
  font-family: var(--font-display);
  font-size: clamp(27px, 3.2vw, 37px);
  font-weight: 400;
  line-height: 1;
  opacity: 0.88;
}

.note-accidental:empty {
  display: none;
}

.note-octave {
  top: 0;
  margin: 8px 0 0 3px;
  color: var(--dial-muted);
  font-family: var(--font-ui);
  font-size: clamp(15px, 1.7vw, 19px);
  font-weight: 500;
  letter-spacing: 0;
}

.cents-line {
  margin-top: 3px;
  color: var(--dial-ink);
  font-family: var(--font-mono);
  font-size: clamp(14px, 1.6vw, 17px);
  letter-spacing: -0.01em;
  line-height: 1.4;
  transition: color 250ms ease;
}

.dial-shell.is-intune .cents-line {
  color: var(--dial-good);
}

.dial-shell.is-close .cents-line {
  color: var(--dial-marker);
}

.freq-line {
  margin-top: 5px;
  color: var(--dial-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.dial-direction {
  position: absolute;
  bottom: 9.3%;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--dial-muted);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  opacity: 0.76;
}

.dial-direction--flat {
  left: 12.5%;
}

.dial-direction--sharp {
  right: 12.5%;
}

.direction-symbol {
  color: var(--dial-ink);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 0.7;
  opacity: 0.86;
}

.dial-screw {
  position: absolute;
  top: 8.5%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(245, 234, 217, 0.16);
  box-shadow: inset 0 0 0 1px rgba(245, 234, 217, 0.08);
  z-index: 2;
}

.dial-screw--1 { left: 25%; }
.dial-screw--2 { right: 25%; }

.dial-caption {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  margin: 17px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
}

.caption-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: background-color 250ms ease, box-shadow 250ms ease;
}

.dial-caption.is-listening .caption-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
  animation: soft-pulse 1.6s ease-in-out infinite;
}

.dial-caption.is-intune .caption-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 13%, transparent);
}

.dial-caption.is-error .caption-dot {
  background: var(--danger);
}

.strings-block {
  margin-top: 21px;
}

.strings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.strings-head span:last-child {
  color: var(--accent);
  font-weight: 650;
  letter-spacing: 0.02em;
}

.string-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.string-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  min-height: 66px;
  padding: 9px 9px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.string-pill:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 7px 15px rgba(34, 42, 35, 0.07);
}

.string-pill-top {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.string-number {
  align-self: flex-start;
  margin-right: auto;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.string-pill-top svg {
  width: 12px;
  height: 12px;
  color: var(--ink-faint);
  opacity: 0.75;
  transition: color 160ms ease, opacity 160ms ease;
}

.string-name {
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.95;
}

.string-name .string-accidental {
  display: inline;
  margin-left: 1px;
  font-family: var(--font-display);
  font-size: 0.58em;
  line-height: 1;
  vertical-align: top;
}

.string-name sup {
  margin-left: 1px;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  vertical-align: super;
}

.string-frequency {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.string-frequency span {
  opacity: 0.65;
}

.string-pill.is-active {
  border-color: color-mix(in srgb, var(--accent) 43%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-raised));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}

.string-pill.is-active .string-number,
.string-pill.is-active .string-frequency {
  color: var(--accent-ink);
}

.string-pill.is-active .string-name {
  color: var(--accent-ink);
}

.string-pill.is-active .string-pill-top svg {
  color: var(--accent);
  opacity: 1;
}

.string-pill.is-sounding .string-pill-top svg {
  color: var(--accent);
  opacity: 1;
  animation: speaker-bounce 500ms ease-in-out infinite alternate;
}

@keyframes speaker-bounce {
  from { transform: scale(0.9); }
  to { transform: scale(1.08); }
}

.stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.level-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.level-label {
  color: var(--ink-faint);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.level-meter {
  position: relative;
  width: 122px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.level-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), var(--accent));
  transition: width 90ms linear;
}

.level-target {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 68%;
  width: 1px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  opacity: 0.75;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.privacy-note svg {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   Side panels
   ========================================================================== */

.tool-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  padding: 28px 25px 25px;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--surface) 50%, transparent), transparent 19rem),
    var(--surface-muted);
}

.side-section {
  min-width: 0;
}

.side-section + .side-section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.side-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.side-heading > span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.side-heading h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: 0.015em;
}

.select-shell {
  position: relative;
}

.select-shell select {
  width: 100%;
  height: 46px;
  padding: 0 40px 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
  appearance: none;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.select-shell select:hover {
  border-color: var(--line-strong);
}

.select-shell select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.select-shell > svg {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 15px;
  height: 15px;
  color: var(--ink-faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.side-copy {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.72;
}

.preset-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.preset-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 31px;
  height: 23px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-raised) 60%, transparent);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1;
}

.calibration-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-raised);
}

.step-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.step-button:hover {
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--ink);
}

.step-button:active {
  transform: scale(0.95);
}

.step-button svg {
  width: 14px;
  height: 14px;
}

.calibration-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.calibration-value strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.calibration-value span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tip-card {
  position: relative;
  margin-top: auto;
  padding: 19px 18px 18px;
  border-radius: 17px;
  background: var(--tip-bg);
  color: var(--tip-ink);
  overflow: hidden;
}

.tip-card::after {
  content: "♪";
  position: absolute;
  right: 12px;
  bottom: -25px;
  color: var(--tip-ink);
  font-family: var(--font-display);
  font-size: 92px;
  line-height: 1;
  opacity: 0.05;
  pointer-events: none;
}

.tip-label {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--tip-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.tip-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 7px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.tip-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--tip-muted);
  font-size: 14px;
  line-height: 1.75;
}

.side-foot-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -2px 0 0;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.5;
}

.side-foot-note svg {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   Metronome
   ========================================================================== */

.signature-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 7px 13px 7px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-raised);
}

.signature-fraction {
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.signature-caption {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.tempo-deck {
  position: relative;
  overflow: hidden;
  padding: 20px 26px 23px;
  border-radius: 23px;
  background:
    radial-gradient(circle at 84% 42%, rgba(215, 160, 90, 0.12), transparent 18rem),
    radial-gradient(circle at 0% 100%, rgba(130, 169, 141, 0.09), transparent 18rem),
    var(--dial-bg-deep);
  color: var(--dial-ink);
  box-shadow:
    0 26px 48px -25px rgba(10, 25, 18, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.055);
  isolation: isolate;
}

.tempo-deck::before {
  content: "";
  position: absolute;
  top: -94px;
  right: -70px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(245, 234, 217, 0.065);
  border-radius: 50%;
  pointer-events: none;
}

.tempo-deck::after {
  content: "";
  position: absolute;
  right: 13%;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border: 1px dashed rgba(245, 234, 217, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.deck-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(245, 234, 217, 0.11);
  color: var(--dial-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
}

.deck-header span:last-child {
  color: var(--dial-ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  opacity: 0.76;
}

.deck-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(170px, 0.7fr);
  gap: 22px;
  padding-top: 16px;
}

.tempo-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.tempo-editor {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tempo-step {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(245, 234, 217, 0.18);
  border-radius: 50%;
  background: rgba(245, 234, 217, 0.02);
  color: var(--dial-ink);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.tempo-step:hover {
  border-color: rgba(245, 234, 217, 0.38);
  background: rgba(245, 234, 217, 0.08);
}

.tempo-step:active {
  transform: scale(0.94);
}

.tempo-step svg {
  width: 14px;
  height: 14px;
}

.tempo-number-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.tempo-number {
  width: 3.15ch;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--dial-ink);
  font-family: var(--font-display);
  font-size: clamp(72px, 8vw, 105px);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.83;
  font-variant-numeric: tabular-nums lining-nums;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
  cursor: text;
  transition: background-color 160ms ease;
}

.tempo-number:hover {
  background: rgba(245, 234, 217, 0.04);
}

.tempo-number:focus {
  outline: none;
  background: rgba(245, 234, 217, 0.07);
  box-shadow: 0 0 0 3px rgba(241, 161, 113, 0.16);
}

.tempo-number::-webkit-outer-spin-button,
.tempo-number::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.tempo-unit {
  color: var(--dial-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
}

.tempo-marking {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 7px 0 0 48px;
  color: var(--dial-ink);
  line-height: 1.4;
}

.tempo-marking span:first-child {
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
  letter-spacing: -0.01em;
}

.marking-dot {
  color: var(--dial-muted);
  font-size: 13.5px;
  opacity: 0.55;
}

.tempo-marking span:last-child {
  color: var(--dial-muted);
  font-size: 11.5px;
  letter-spacing: 0.05em;
}

.tempo-slider {
  width: calc(100% - 12px);
  height: 4px;
  margin: 22px 6px 0;
  border-radius: 999px;
  background: linear-gradient(to right, var(--dial-marker) var(--range-progress, 43%), rgba(245, 234, 217, 0.15) var(--range-progress, 43%));
  appearance: none;
  cursor: pointer;
}

.tempo-slider::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--dial-bg-deep);
  border-radius: 50%;
  background: var(--dial-ink);
  box-shadow: 0 0 0 1px rgba(245, 234, 217, 0.45), 0 3px 8px rgba(0, 0, 0, 0.2);
  appearance: none;
  transition: transform 140ms ease;
}

.tempo-slider:hover::-webkit-slider-thumb {
  transform: scale(1.14);
}

.tempo-slider::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.tempo-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid var(--dial-bg-deep);
  border-radius: 50%;
  background: var(--dial-ink);
  box-shadow: 0 0 0 1px rgba(245, 234, 217, 0.45);
}

.tempo-slider:focus {
  outline: none;
}

.tempo-slider:focus-visible {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--dial-marker);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-top: 8px;
  color: var(--dial-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.76;
}

.tempo-presets {
  display: flex;
  gap: 6px;
  margin-top: 16px;
}

.preset-tempo {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  padding: 6px 4px 5px;
  border: 1px solid rgba(245, 234, 217, 0.13);
  border-radius: 8px;
  background: rgba(245, 234, 217, 0.015);
  color: var(--dial-ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.preset-tempo small {
  color: var(--dial-muted);
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  opacity: 0.76;
}

.preset-tempo:hover,
.preset-tempo.is-current {
  border-color: rgba(241, 161, 113, 0.5);
  background: rgba(241, 161, 113, 0.1);
}

.preset-tempo.is-current {
  color: #f4b18a;
}

.metro-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 20px;
  border-left: 1px solid rgba(245, 234, 217, 0.1);
}

.metronome-art {
  width: min(100%, 168px);
  height: auto;
  max-height: 210px;
  filter: drop-shadow(0 17px 18px rgba(0, 0, 0, 0.2));
  overflow: visible;
}

.metro-scale {
  fill: none;
}

.pendulum-arm {
  transform-box: view-box;
  transform-origin: 130px 271px;
  transition: transform var(--swing-duration, 470ms) cubic-bezier(0.44, 0.03, 0.56, 1);
  will-change: transform;
}

.pendulum-arm.is-right {
  transform: rotate(15deg);
}

.pendulum-arm.is-left {
  transform: rotate(-15deg);
}

.pendulum-arm.is-idle {
  transform: rotate(0deg);
  transition-duration: 650ms;
}

.metro-led {
  fill: rgba(241, 161, 113, 0.2);
  stroke: none;
  transition: fill 100ms ease, filter 100ms ease;
}

.metro-led.is-lit {
  fill: #f3aa7c;
  filter: drop-shadow(0 0 6px rgba(243, 170, 124, 0.9));
}

.beat-lights {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 10px;
  margin-top: 1px;
}

.beat-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 1px solid rgba(245, 234, 217, 0.26);
  border-radius: 50%;
  background: transparent;
  transition: background-color 90ms linear, border-color 90ms linear, transform 110ms ease, box-shadow 110ms ease;
}

.beat-dot.is-accent {
  border-color: rgba(241, 161, 113, 0.42);
}

.beat-dot.is-active {
  border-color: var(--dial-marker);
  background: var(--dial-marker);
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(241, 161, 113, 0.35);
}

.beat-dot.is-accent.is-active {
  background: #f3b58d;
  border-color: #f3b58d;
}

.beat-readout {
  min-height: 14px;
  margin: 9px 0 0;
  color: var(--dial-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-align: center;
  text-transform: uppercase;
}

.transport {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.play-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 59px;
  padding: 6px 22px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff9f0;
  cursor: pointer;
  box-shadow: 0 12px 26px -9px rgba(185, 85, 43, 0.5);
  transition: background-color 200ms ease, color 200ms ease, transform 180ms ease, box-shadow 200ms ease;
}

.play-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -10px rgba(185, 85, 43, 0.56);
}

.play-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.17);
}

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

.play-icon-stop {
  display: none;
}

.play-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.play-copy strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.play-copy small {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.13em;
  opacity: 0.67;
}

.play-button.is-playing {
  background: var(--play-active-bg);
  color: var(--play-active-ink);
  box-shadow: 0 12px 26px -12px rgba(21, 38, 29, 0.55);
}

.play-button.is-playing .play-icon-play {
  display: none;
}

.play-button.is-playing .play-icon-stop {
  display: block;
}

.tap-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 57px;
  padding: 6px 18px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 160ms ease, box-shadow 180ms ease;
}

.tap-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.tap-button.is-tapped {
  animation: tap-flash 260ms ease;
  border-color: var(--accent);
}

@keyframes tap-flash {
  50% {
    transform: scale(0.975);
    background: var(--accent-soft);
  }
}

.tap-glyph {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tap-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.tap-copy strong {
  font-size: 14.5px;
  font-weight: 650;
  white-space: nowrap;
}

.tap-copy small {
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.tap-feedback {
  flex: 1;
  min-width: 90px;
  min-height: 16px;
  margin: 0;
  color: var(--accent-ink);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-align: right;
}

.tap-feedback.is-error {
  color: var(--danger);
}

/* ==========================================================================
   Metronome side controls
   ========================================================================== */

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.signature-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.signature-option:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.signature-option strong {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.signature-option small {
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.signature-option.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-raised));
}

.signature-option.is-active strong,
.signature-option.is-active small {
  color: var(--accent-ink);
}

.subdivision-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.subdivision-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 2px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.subdivision-option strong {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}

.subdivision-option small {
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.3;
}

.subdivision-option:hover {
  border-color: var(--line-strong);
}

.subdivision-option.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-raised));
  color: var(--accent-ink);
}

.subdivision-option.is-active small {
  color: var(--accent-ink);
  opacity: 0.8;
}

.timbre-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.timbre-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 9px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.timbre-option span {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.4;
}

.timbre-option small {
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: -0.01em;
  line-height: 1.4;
  white-space: nowrap;
}

.timbre-option:hover {
  border-color: var(--line-strong);
}

.timbre-option.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-raised));
  color: var(--accent-ink);
}

.timbre-option.is-active small {
  color: var(--accent-ink);
  opacity: 0.8;
}

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.switch-row > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.switch-row strong {
  font-size: 13.5px;
  font-weight: 650;
}

.switch-row small {
  color: var(--ink-faint);
  font-size: 11.5px;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: transform 190ms cubic-bezier(0.22, 0.8, 0.3, 1), background-color 190ms ease;
}

.switch-row input:checked + .switch-track {
  border-color: var(--accent);
  background: var(--accent);
}

.switch-row input:checked + .switch-track::after {
  background: #fff9f0;
  transform: translateX(16px);
}

.switch-row input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.volume-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
}

.volume-row label {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.volume-row input[type="range"] {
  width: 100%;
  height: 3px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--volume-progress, 70%), var(--line) var(--volume-progress, 70%));
  appearance: none;
  cursor: pointer;
}

.volume-row input[type="range"]::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid var(--surface-muted);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  appearance: none;
}

.volume-row input[type="range"]::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.volume-row input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface-muted);
  border-radius: 50%;
  background: var(--accent);
}

.volume-row input[type="range"]:focus {
  outline: none;
}

.volume-row input[type="range"]:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 17%, transparent);
}

.volume-row output {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-align: right;
}

/* ==========================================================================
   Guide & FAQ
   ========================================================================== */

.guide {
  width: 100%;
  max-width: 1236px;
  margin: 94px auto 0;
  padding: 0 28px;
}

.section-heading {
  max-width: 620px;
  margin-bottom: 30px;
}

/* The English guide heading needs a little more room to stay on one line
   at the largest type size; the rule is scoped to this section only. */
@media (min-width: 981px) {
  .guide .section-heading {
    max-width: 700px;
  }
}

.section-heading h2,
.faq-intro h2 {
  margin: 0;
  font-size: clamp(31px, 4vw, 46px);
  font-weight: 690;
  letter-spacing: -0.06em;
  line-height: 1.18;
}

.section-heading > p:last-child,
.faq-intro > p:nth-of-type(2) {
  max-width: 490px;
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.8;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 256px;
  padding: 23px 22px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.guide-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.guide-number {
  position: absolute;
  top: 20px;
  right: 21px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.guide-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  margin-bottom: 27px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.guide-icon svg {
  width: 16px;
  height: 16px;
}

.guide-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 660;
  letter-spacing: -0.035em;
}

.guide-card p {
  max-width: 31em;
  margin: 8px 0 16px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.75;
}

.guide-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.guide-card--accent {
  border-color: transparent;
  background:
    radial-gradient(circle at 100% 0%, rgba(233, 169, 124, 0.14), transparent 15rem),
    var(--tip-bg);
  color: var(--tip-ink);
}

.guide-card--accent:hover {
  border-color: transparent;
  box-shadow: 0 18px 48px -20px rgba(20, 36, 27, 0.55);
}

.guide-card--accent .guide-number {
  color: var(--tip-muted);
}

.guide-card--accent .guide-icon {
  border-color: rgba(248, 240, 227, 0.17);
  background: rgba(248, 240, 227, 0.07);
  color: var(--tip-accent);
}

.guide-card--accent p {
  color: var(--tip-muted);
}

.guide-card--accent .guide-tag {
  border-color: rgba(248, 240, 227, 0.15);
  color: var(--tip-accent);
}

.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(36px, 7vw, 94px);
  margin-top: 90px;
  padding-top: 55px;
  border-top: 1px solid var(--line);
}

.faq-intro {
  align-self: start;
  position: sticky;
  top: 110px;
}

.faq-intro h2 {
  font-size: clamp(28px, 3.4vw, 39px);
}

html[data-language="en"] .faq-intro {
  container-type: inline-size;
}

html[data-language="en"] .faq-intro h2 {
  font-size: min(34px, 8.3cqw);
  white-space: nowrap;
}

.faq-intro > p:nth-of-type(2) {
  margin-top: 13px;
  max-width: 330px;
  font-size: 15px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}

.text-link svg {
  width: 13px;
  height: 13px;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 2px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-plus {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: var(--ink-faint);
}

.faq-plus::before,
.faq-plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 200ms ease;
}

.faq-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item[open] .faq-plus::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.faq-item[open] summary {
  color: var(--accent-ink);
}

.faq-item summary:hover .faq-plus {
  color: var(--accent);
}

.faq-answer {
  padding: 0 34px 21px 2px;
}

.faq-answer p {
  max-width: 61ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.85;
}

.faq-answer code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 105px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-muted) 56%, transparent);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  align-items: start;
  gap: 40px;
  width: 100%;
  max-width: 1236px;
  margin: 0 auto;
  padding: 38px 28px 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark--footer {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.brand-mark--footer svg {
  width: 36px;
  height: 36px;
}

.footer-brand > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-brand strong {
  font-size: 15px;
  font-weight: 720;
  letter-spacing: 0.04em;
}

.footer-brand-name {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.footer-brand-tag {
  margin-left: 5px;
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.footer-brand p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.footer-note {
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.8;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.01em;
  text-align: right;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 981px) {
  /* Keep the two desktop columns close in height: the metronome controls are
     already dense enough without the extra practice card. */
  .tool-view[data-view="metronome"] .tool-side .tip-card {
    display: none;
  }
}

@media (max-width: 1120px) {
  .tool-view {
    grid-template-columns: minmax(0, 1fr) 312px;
  }

  .tool-stage {
    padding: 27px 28px 23px;
  }

  .tool-side {
    padding: 26px 22px 23px;
  }

  .hero {
    gap: 40px;
  }
}

@media (max-width: 980px) {
  .tool-view {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 28px;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 26px 28px 28px;
  }

  .side-section + .side-section {
    padding-top: 0;
    border-top: 0;
  }

  .side-section:nth-child(1) {
    grid-column: 1;
  }

  .tool-side .tip-card {
    margin-top: 0;
  }

  .tool-side .side-foot-note {
    grid-column: 1 / -1;
    margin: 0;
  }

  .tool-side > .tip-card {
    grid-column: 1 / -1;
  }

  .tool-side .calibration-control {
    max-width: 300px;
  }

  #metronomeView ~ .tool-side,
  .tool-view[data-view="metronome"] .tool-side {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .tool-view[data-view="metronome"] .tool-side .side-section:nth-child(3) {
    grid-column: 1;
  }

  .tool-view[data-view="metronome"] .tool-side .tip-card {
    grid-column: 2;
    grid-row: 2;
  }

  .metronome-art {
    width: min(100%, 152px);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 34px;
  }

  html[data-language="en"] .hero h1 {
    font-size: clamp(40px, 5.4vw, 54px);
  }

  .hero-stamp {
    width: 230px;
    height: 230px;
  }

  .stamp-center {
    width: 122px;
    height: 122px;
  }

  .stamp-center strong {
    font-size: 40px;
  }

  .footer-inner {
    grid-template-columns: 1.1fr 1fr;
  }

  .footer-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--line);
    text-align: left;
  }
}

@media (max-width: 940px) {
  .local-chip {
    display: none;
  }
}

@media (max-width: 880px) {
  .tool-nav-button small {
    display: none;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: calc(150px + env(safe-area-inset-top));
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand tools"
      "nav nav";
    height: auto;
    padding: 12px max(18px, env(safe-area-inset-right)) 11px max(18px, env(safe-area-inset-left));
    gap: 10px 14px;
  }

  .site-header {
    position: sticky;
  }

  .brand {
    grid-area: brand;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
  }

  .brand-mark svg {
    width: 37px;
    height: 37px;
  }

  .brand-copy strong {
    font-size: 13.5px;
  }

  .header-tools {
    grid-area: tools;
    gap: 9px;
  }

  .local-chip {
    display: none;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .language-toggle {
    height: 38px;
    min-width: 47px;
    padding: 0 9px;
    gap: 4px;
    font-size: 11.5px;
  }

  .language-toggle svg {
    width: 13px;
    height: 13px;
  }

  .tool-nav {
    grid-area: nav;
    width: 100%;
    padding: 3px;
    gap: 2px;
  }

  .tool-nav-button {
    flex: 1;
    justify-content: center;
    min-height: 37px;
    padding: 0 12px;
  }

  .tool-nav-button small {
    display: none;
  }

  .hero {
    display: block;
    padding: 48px max(20px, env(safe-area-inset-right)) 37px max(20px, env(safe-area-inset-left));
  }

  .hero-eyebrow {
    margin-bottom: 17px;
    font-size: 11.5px;
  }

  .hero h1 {
    font-size: clamp(42px, 11.4vw, 58px);
    letter-spacing: -0.065em;
  }

  html[data-language="en"] .hero h1 {
    font-size: clamp(32px, 9.2vw, 46px);
    letter-spacing: -0.045em;
    line-height: 1.07;
  }

  .hero-lede {
    margin-top: 22px;
    font-size: 15px;
    line-height: 1.8;
  }

  .hero-actions {
    margin-top: 23px;
  }

  .button {
    min-height: 47px;
    padding: 0 19px;
    font-size: 15px;
  }

  .hero-meta {
    margin-top: 25px;
    padding-top: 15px;
  }

  .hero-meta li {
    font-size: 12px;
  }

  .hero-meta li + li::before {
    margin: 0 9px;
  }

  .hero-stamp {
    display: none;
  }

  .studio {
    width: auto;
    margin-right: max(12px, env(safe-area-inset-right));
    margin-left: max(12px, env(safe-area-inset-left));
    border-radius: 22px;
  }

  .studio-head {
    min-height: 54px;
    padding: 13px 16px;
    gap: 12px;
  }

  .studio-title {
    gap: 8px;
  }

  .studio-title strong {
    font-size: 14px;
  }

  .studio-en {
    display: none;
  }

  .studio-rule {
    width: 15px;
  }

  .studio-head-tools {
    gap: 0;
  }

  .studio-status {
    display: none;
  }

  .guide-link {
    font-size: 12px;
  }

  .tool-stage {
    padding: 22px 16px 20px;
  }

  .stage-head {
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }

  .stage-heading h2 {
    font-size: 27px;
  }

  .stage-heading .eyebrow {
    font-size: 11.5px;
    margin-bottom: 6px;
  }

  .mic-toggle {
    min-height: 48px;
    max-width: 100%;
    margin-left: auto;
    padding: 4px 10px 4px 4px;
    gap: 8px;
    border-radius: 13px;
  }

  .mic-glyph {
    width: 39px;
    height: 39px;
    border-radius: 9px;
  }

  .mic-copy strong {
    font-size: 13.5px;
  }

  .mic-copy small {
    font-size: 11px;
  }

  .dial-shell {
    width: min(100%, 352px);
  }

  .dial-area {
    padding-top: 0;
  }

  .note-letter {
    font-size: min(24vw, 86px);
  }

  .note-line {
    height: min(22vw, 80px);
  }

  .note-octave {
    font-size: 15px;
    margin-top: 5px;
  }

  .dial-caption {
    margin-top: 14px;
    font-size: 13px;
  }

  .dial-direction {
    bottom: 8.4%;
    font-size: 10.5px;
  }

  .direction-symbol {
    font-size: 15px;
  }

  .strings-block {
    margin-top: 18px;
  }

  .strings-head {
    margin-bottom: 7px;
    font-size: 11px;
  }

  .string-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .string-pill {
    min-height: 59px;
    padding: 8px;
    border-radius: 9px;
  }

  .string-name {
    font-size: 22px;
  }

  .string-frequency {
    font-size: 11px;
  }

  .stage-foot {
    margin-top: 15px;
    padding-top: 12px;
    gap: 12px;
  }

  .privacy-note {
    display: none;
  }

  .tool-side {
    display: flex;
    gap: 22px;
    padding: 22px 16px 23px;
  }

  .side-section + .side-section {
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }

  .tool-side .calibration-control {
    max-width: none;
  }

  .tool-side .side-foot-note {
    margin: 0;
  }

  .tip-card {
    margin-top: 0;
  }

  .signature-chip {
    margin-left: auto;
  }

  .signature-fraction {
    font-size: 20px;
  }

  .signature-caption {
    display: none;
  }

  .tempo-deck {
    padding: 17px 16px 19px;
    border-radius: 19px;
  }

  .deck-body {
    grid-template-columns: minmax(0, 1fr) 138px;
    gap: 13px;
    padding-top: 14px;
  }

  .tempo-editor {
    gap: 5px;
  }

  .tempo-step {
    width: 31px;
    height: 31px;
  }

  .tempo-step svg {
    width: 12px;
    height: 12px;
  }

  .tempo-number {
    width: 3.1ch;
    font-size: clamp(60px, 15vw, 84px);
  }

  .tempo-unit {
    font-size: 10px;
  }

  .tempo-marking {
    margin-left: 36px;
    margin-top: 5px;
  }

  .tempo-marking span:first-child {
    font-size: 15px;
  }

  .tempo-slider {
    margin-top: 17px;
  }

  .tempo-presets {
    margin-top: 12px;
  }

  .metro-visual {
    padding-left: 12px;
  }

  .metronome-art {
    width: min(100%, 122px);
  }

  .beat-lights {
    gap: 5px;
    margin-top: 0;
  }

  .beat-dot {
    width: 6px;
    height: 6px;
  }

  .beat-readout {
    font-size: 11px;
    margin-top: 7px;
  }

  .signature-grid {
    gap: 5px;
  }

  .signature-option {
    padding: 7px 3px 6px;
  }

  .timbre-option small {
    font-size: 10px;
  }

  .transport {
    margin-top: 15px;
    gap: 8px;
  }

  .play-button {
    flex: 1;
    justify-content: center;
    min-height: 54px;
    padding-right: 18px;
  }

  .play-icon {
    width: 42px;
    height: 42px;
  }

  .tap-button {
    min-height: 54px;
    padding-right: 14px;
  }

  .tap-glyph {
    width: 40px;
    height: 40px;
  }

  .tap-copy small {
    display: none;
  }

  .tap-feedback {
    flex-basis: 100%;
    min-width: 0;
    min-height: 12px;
    text-align: left;
  }

  .guide {
    margin-top: 63px;
    padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  }

  .section-heading {
    margin-bottom: 22px;
  }

  .section-heading h2 {
    font-size: 37px;
  }

  .section-heading > p:last-child {
    font-size: 15px;
  }

  .guide-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .guide-card {
    min-height: 0;
    padding: 20px 19px 17px;
    border-radius: 17px;
  }

  .guide-icon {
    width: 33px;
    height: 33px;
    margin-bottom: 19px;
  }

  .guide-icon svg {
    width: 15px;
    height: 15px;
  }

  .guide-card h3 {
    font-size: 18px;
  }

  .guide-card p {
    font-size: 14px;
    margin: 7px 0 13px;
  }

  .faq {
    display: block;
    margin-top: 59px;
    padding-top: 38px;
  }

  .faq-intro {
    position: static;
    margin-bottom: 27px;
  }

  .faq-intro h2 {
    font-size: 34px;
  }

  .faq-intro > p:nth-of-type(2) {
    margin-top: 11px;
  }

  .text-link {
    margin-top: 17px;
  }

  .faq-item summary {
    padding: 17px 0;
    font-size: 15px;
  }

  .faq-answer {
    padding: 0 22px 18px 0;
  }

  .faq-answer p {
    font-size: 14px;
  }

  .site-footer {
    margin-top: 62px;
  }

  .footer-inner {
    display: flex;
    flex-direction: column;
    gap: 23px;
    padding: 29px max(20px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }

  .footer-brand strong {
    font-size: 15px;
  }

  .footer-note {
    font-size: 11.5px;
  }

  .footer-meta {
    width: 100%;
    padding-top: 14px;
    font-size: 10.5px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    gap: 7px;
  }

  .hero-actions .button {
    flex: 1;
    padding: 0 14px;
    gap: 9px;
    font-size: 14.5px;
  }

  .hero-meta li:nth-child(2) {
    display: none;
  }

  .stage-head {
    align-items: flex-start;
  }

  .mic-toggle .mic-copy small {
    display: none;
  }

  .mic-toggle {
    min-height: 44px;
  }

  .mic-glyph {
    width: 35px;
    height: 35px;
  }

  .dial-shell {
    width: min(100%, 302px);
  }

  .dial-display {
    top: 37.5%;
  }

  .dial-label {
    font-size: 10px;
  }

  .note-letter {
    font-size: min(24vw, 76px);
  }

  .note-line {
    height: min(22vw, 69px);
  }

  .cents-line {
    font-size: 13.5px;
    margin-top: 1px;
  }

  .freq-line {
    font-size: 11.5px;
    margin-top: 2px;
  }

  .dial-caption {
    max-width: 95%;
    font-size: 12px;
    line-height: 1.5;
  }

  .dial-direction {
    display: none;
  }

  .string-name {
    font-size: 21px;
  }

  .string-pill-top svg {
    width: 10px;
    height: 10px;
  }

  .level-meter {
    width: 96px;
  }

  .tempo-deck {
    padding-left: 13px;
    padding-right: 13px;
  }

  .deck-body {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 7px;
  }

  .tempo-step {
    width: 27px;
    height: 27px;
  }

  .tempo-number {
    font-size: clamp(56px, 16.7vw, 72px);
    width: 2.9ch;
  }

  .tempo-unit {
    display: none;
  }

  .tempo-marking {
    margin-left: 30px;
  }

  .tempo-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .preset-tempo {
    font-size: 12.5px;
    padding: 5px 2px 4px;
  }

  .preset-tempo small {
    font-size: 10.5px;
  }

  .metro-visual {
    padding-left: 9px;
  }

  .metronome-art {
    width: 100%;
  }

  .beat-lights {
    gap: 4px;
  }

  .beat-dot {
    width: 5px;
    height: 5px;
  }

  .transport {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .play-button {
    padding-left: 5px;
    padding-right: 10px;
    gap: 7px;
  }

  .tap-button {
    padding-left: 5px;
    padding-right: 10px;
    gap: 7px;
  }

  .tap-glyph {
    width: 36px;
    height: 36px;
    font-size: 11px;
  }

  .play-icon {
    width: 38px;
    height: 38px;
  }

  .play-copy strong,
  .tap-copy strong {
    font-size: 13.5px;
  }

  .tap-copy small {
    display: none;
  }

  .faq-item summary {
    align-items: flex-start;
  }

  .faq-plus {
    margin-top: 4px;
  }
}

@media (max-width: 350px) {
  html[data-language="zh"] .hero h1 {
    font-size: 39px;
    letter-spacing: -0.06em;
  }

  .deck-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .metro-visual {
    padding: 11px 0 0;
    border-top: 1px solid rgba(245, 234, 217, 0.1);
    border-left: 0;
  }

  .metronome-art {
    width: 88px;
  }

  .beat-lights {
    margin-top: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .stamp-ring {
    animation: none;
  }
}

/* ==========================================================================
   Footer link
   ========================================================================== */

.footer-link {
  display: inline-block;
  color: inherit;
  font: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer-note {
  align-self: end;
  text-align: center;
}

@media (min-width: 981px) {
  .footer-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .footer-note {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }

  .footer-meta {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 980px) {
  .footer-note {
    grid-column: 1 / -1;
    justify-self: center;
    align-self: center;
    text-align: center;
  }
}

@media (max-width: 760px) {
  .footer-note {
    align-self: stretch;
    text-align: center;
  }
}

@media (min-width: 761px) {
  .header-inner--simple {
    grid-template-columns: 1fr auto;
  }
}

/* ==========================================================================
   Privacy policy page
   ========================================================================== */

.legal {
  width: 100%;
  max-width: 1236px;
  margin: 0 auto;
  padding: 64px 28px 0;
}

.legal-inner {
  max-width: 720px;
}

.legal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 50px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.legal-lede {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.75;
}

.legal-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.legal-section p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.8;
}

.legal-section p + p {
  margin-top: 12px;
}

.legal-back {
  margin: 44px 0 0;
}

@media (max-width: 760px) {
  .legal {
    padding: 40px 20px 0;
  }

  .legal-section {
    margin-top: 28px;
    padding-top: 22px;
  }

  .legal-section h2 {
    font-size: 17.5px;
  }
}

/* Microphone troubleshooting note */
.tuner-help {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.tuner-help-icon {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  color: var(--accent);
  stroke-width: 1.7;
}

.tuner-help-copy strong {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.tuner-help-copy p {
  max-width: 64ch;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 760px) {
  .tuner-help {
    padding: 13px 14px;
    border-radius: 12px;
  }

  .tuner-help-copy p {
    font-size: 12.5px;
  }
}
