:root {
  color-scheme: dark;
  --bg: #100f0d;
  --surface: #181613;
  --surface-raised: #201d18;
  --ink: #f8f4ec;
  --muted: #aaa297;
  --line: #373128;
  --accent: #ffb547;
  --accent-soft: rgba(255, 181, 71, 0.14);
  --danger: #ff7d6b;
  --success: #6ed69a;
  --max: 70rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 20rem;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 181, 71, 0.08), transparent 28rem),
    var(--bg);
  font-size: 1rem;
  line-height: 1.65;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible,
.drop-zone:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.site-header {
  width: min(calc(100% - 2rem), var(--max));
  height: 4.5rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgba(255, 181, 71, 0.45);
  border-radius: 0.5rem;
  background: var(--accent-soft);
}

.brand-mark i {
  display: block;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.brand-mark i:nth-child(1) { height: 0.45rem; }
.brand-mark i:nth-child(2) { height: 0.85rem; }
.brand-mark i:nth-child(3) { height: 0.62rem; }
.brand-mark i:nth-child(4) { height: 1rem; }

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.privacy-chip > span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0.25rem rgba(110, 214, 154, 0.1);
}

.site-nav,
.footer-links {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}
.site-nav a,
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 680;
  transition: color 150ms ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"],
.footer-links a:hover,
.footer-links a[aria-current="page"] { color: var(--accent); }

main { width: 100%; }
.tool-shell {
  width: min(calc(100% - 2rem), 56rem);
  min-height: calc(100vh - 4.5rem);
  margin: 0 auto;
  padding: clamp(2.6rem, 6vh, 5.25rem) 0 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tool-heading { margin-bottom: 1.6rem; }
.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(3.1rem, 8vw, 6rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
}
.tool-heading > p:last-child {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.analyzer-card {
  position: relative;
  padding: clamp(0.75rem, 2vw, 1rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.22);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.14);
}
.mode-tab {
  min-width: 0;
  min-height: 2.8rem;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 0.55rem;
  color: var(--muted);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}
.mode-tab:hover { color: var(--ink); }
.mode-tab.is-active {
  color: #241707;
  background: var(--accent);
}
.tab-number {
  margin-right: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.mode-panel {
  min-height: 14.75rem;
  border: 1px solid #312c25;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.012);
}

.drop-zone {
  min-height: 14.75rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #574d3e;
  border-radius: 0.85rem;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.drop-zone:hover,
.drop-zone:focus-within,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop-zone.is-dragging { transform: scale(0.995); }
.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.upload-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
}
.upload-icon svg,
.copy-button svg {
  width: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.drop-title { font-size: 1.2rem; font-weight: 720; }
.drop-subtitle { color: var(--muted); font-size: 0.92rem; }
.format-line {
  margin-top: 1.05rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.035em;
}

.tap-panel {
  padding: clamp(1rem, 3vw, 1.5rem);
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(12rem, 1fr);
  align-items: center;
  gap: 1.25rem;
}
.tap-button {
  min-height: 11rem;
  border: 1px solid rgba(255, 181, 71, 0.5);
  border-radius: 0.85rem;
  color: #241707;
  background: var(--accent);
  cursor: pointer;
  box-shadow: inset 0 -0.35rem 0 rgba(0, 0, 0, 0.13);
  transition: filter 130ms ease, transform 80ms ease, box-shadow 80ms ease;
  touch-action: manipulation;
}
.tap-button:hover { filter: brightness(1.06); }
.tap-button:active,
.tap-button.is-hit {
  transform: translateY(0.2rem);
  box-shadow: inset 0 -0.12rem 0 rgba(0, 0, 0, 0.13);
}
.tap-button span,
.tap-button small { display: block; }
.tap-button span {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 820;
  letter-spacing: -0.04em;
}
.tap-button small { margin-top: 0.25rem; font-size: 0.78rem; font-weight: 650; opacity: 0.72; }
.tap-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.tap-progress strong { color: var(--accent); font-size: 1.8rem; letter-spacing: -0.035em; }
.tap-progress span { color: var(--muted); font-size: 0.9rem; }
.secondary-button {
  grid-column: 2;
  justify-self: start;
  margin-top: -3rem;
  padding: 0.35rem 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}

.mic-panel {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.mic-visual {
  height: 3.5rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.27rem;
}
.mic-visual i {
  width: 0.25rem;
  height: 24%;
  border-radius: 1rem;
  background: var(--accent);
}
.mic-panel.is-listening .mic-visual i { animation: listen 820ms ease-in-out infinite alternate; }
.mic-panel.is-listening .mic-visual i:nth-child(2) { animation-delay: -510ms; }
.mic-panel.is-listening .mic-visual i:nth-child(3) { animation-delay: -180ms; }
.mic-panel.is-listening .mic-visual i:nth-child(4) { animation-delay: -690ms; }
.mic-panel.is-listening .mic-visual i:nth-child(5) { animation-delay: -320ms; }
.mic-panel.is-listening .mic-visual i:nth-child(6) { animation-delay: -750ms; }
.mic-panel.is-listening .mic-visual i:nth-child(7) { animation-delay: -430ms; }
@keyframes listen { to { height: 95%; } }
.mic-panel > strong { font-size: 1.2rem; }
.mic-panel > p { max-width: 34rem; margin: 0.25rem 0 1rem; color: var(--muted); font-size: 0.9rem; }
.primary-button {
  min-height: 3rem;
  padding: 0.65rem 1.5rem;
  border: 0;
  border-radius: 0.65rem;
  color: #241707;
  background: var(--accent);
  font-weight: 780;
  cursor: pointer;
}
.mic-panel.is-listening .primary-button {
  color: var(--ink);
  background: #34302a;
}
.microcopy { margin-top: 0.75rem; color: var(--muted); font-size: 0.76rem; }

.working-state {
  min-height: 14.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  border: 1px solid #312c25;
  border-radius: 0.85rem;
}
.working-state strong,
.working-state span { display: block; }
.working-state strong { font-size: 1.15rem; }
.working-state div > span { color: var(--muted); font-size: 0.9rem; }
.pulse-bars {
  height: 3.25rem;
  display: flex !important;
  align-items: center;
  gap: 0.25rem;
}
.pulse-bars i {
  width: 0.22rem;
  height: 45%;
  border-radius: 1rem;
  background: var(--accent);
  animation: pulse 750ms ease-in-out infinite alternate;
}
.pulse-bars i:nth-child(2) { animation-delay: -400ms; }
.pulse-bars i:nth-child(3) { animation-delay: -200ms; }
.pulse-bars i:nth-child(4) { animation-delay: -550ms; }
.pulse-bars i:nth-child(5) { animation-delay: -100ms; }
@keyframes pulse { to { height: 95%; } }

.result-panel {
  margin-top: 0.75rem;
  padding: clamp(1rem, 3vw, 1.65rem);
  border: 1px solid rgba(255, 181, 71, 0.25);
  border-radius: 0.85rem;
  background: rgba(255, 181, 71, 0.045);
}
.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
}
.result-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.text-button {
  padding: 0.25rem 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.estimate-chip {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bpm-readout {
  min-width: 0;
  margin: 1.15rem 0 0.7rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}
#bpm-value {
  min-width: 0;
  color: var(--accent);
  font-family: "Arial Narrow", "Roboto Condensed", ui-sans-serif, sans-serif;
  font-size: clamp(4.7rem, 15vw, 8rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.075em;
}
.bpm-unit { color: var(--muted); font-weight: 720; letter-spacing: 0.12em; }
.file-summary {
  min-width: 0;
  margin: 1.3rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}
#result-source {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-button {
  width: 100%;
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 0;
  border-radius: 0.7rem;
  color: #20160a;
  background: var(--accent);
  font-weight: 780;
  cursor: pointer;
  transition: filter 150ms ease, transform 150ms ease;
}
.copy-button:hover { filter: brightness(1.06); }
.copy-button:active { transform: translateY(1px); }
.result-caveat { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.78rem; text-align: center; }

.error-message {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 125, 107, 0.35);
  border-radius: 0.7rem;
  color: var(--danger);
  background: rgba(255, 125, 107, 0.08);
  font-size: 0.9rem;
}

.scope-row {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.scope-row span {
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.scope-row b { color: var(--ink); }

.content-section {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  padding: 5rem 0;
  display: grid;
  grid-template-columns: 5rem minmax(0, 46rem);
  gap: 2rem;
  border-top: 1px solid var(--line);
}
.section-number {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}
h2 {
  margin: 0 0 1.3rem;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.content-section p { margin: 0 0 1rem; color: #c7c0b6; }
.content-section p:last-child { margin-bottom: 0; }
.truth-section h2 { color: var(--accent); }

.static-page {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) 0 5rem;
}
.legal-hero {
  max-width: 54rem;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
.legal-hero h1 {
  max-width: 52rem;
  font-size: clamp(3rem, 7vw, 5.6rem);
  line-height: 0.98;
}
.legal-hero > p:last-child {
  max-width: 42rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}
.page-content {
  max-width: 52rem;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.page-content section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--line);
}
.page-content h2 { margin-bottom: 1rem; }
.page-content p,
.page-content li {
  color: #c7c0b6;
}
.page-content p { margin: 0 0 1rem; }
.page-content p:last-child { margin-bottom: 0; }
.page-content a { color: var(--accent); text-underline-offset: 0.2em; }
.info-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.info-grid > div {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.012);
}
.info-grid strong,
.info-grid span { display: block; }
.info-grid strong { color: var(--ink); }
.info-grid span { margin-top: 0.35rem; color: var(--muted); font-size: 0.88rem; }
.steps-list {
  margin: 0;
  padding-left: 1.25rem;
}
.steps-list li { margin-bottom: 0.7rem; padding-left: 0.4rem; }
.steps-list li:last-child { margin-bottom: 0; }
.contact-card {
  padding: clamp(1.25rem, 4vw, 2rem) !important;
  border: 1px solid rgba(255, 181, 71, 0.35) !important;
  border-radius: 1rem;
  background: var(--accent-soft);
}
.contact-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.contact-address {
  display: inline-block;
  max-width: 100%;
  margin: 0.35rem 0 1rem;
  font-size: clamp(1.35rem, 5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary {
  padding: 1.15rem 2.5rem 1.15rem 0;
  position: relative;
  list-style: none;
  cursor: pointer;
  font-weight: 680;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 400;
}
details[open] summary::after { content: "−"; }
details p { padding: 0 2.5rem 1.2rem 0; }

footer {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}
.footer-brand { color: var(--ink); font-weight: 720; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .pulse-bars i,
  .mic-panel.is-listening .mic-visual i { animation: none; }
}

@media (max-width: 42rem) {
  .site-header {
    height: auto;
    min-height: 4rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
  }
  .privacy-chip { display: none; }
  .site-nav {
    width: 100%;
    order: 3;
    justify-content: space-between;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
  }
  .site-nav a { font-size: 0.8rem; }
  .tool-shell {
    min-height: calc(100svh - 6.6rem);
    padding-top: 2.1rem;
    justify-content: flex-start;
  }
  .tool-heading { margin-bottom: 1.2rem; }
  h1 { font-size: clamp(3.2rem, 18vw, 5rem); }
  .mode-tab { min-height: 3rem; padding: 0.5rem 0.25rem; font-size: 0.78rem; }
  .tab-number { display: none; }
  .mode-panel,
  .drop-zone,
  .working-state { min-height: 13.25rem; }
  .drop-zone { padding: 1.15rem; }
  .tap-panel {
    padding: 0.85rem;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .tap-button { min-height: 7.8rem; }
  .tap-progress { align-items: center; text-align: center; }
  .secondary-button { grid-column: 1; justify-self: center; margin-top: 0; }
  .mic-panel { padding: 1.15rem; }
  .scope-row { grid-template-columns: 1fr; gap: 0.5rem; text-align: left; }
  .scope-row span { padding: 0.55rem 0.75rem; }
  .content-section { grid-template-columns: 1fr; gap: 0.8rem; padding: 3.5rem 0; }
  .static-page { padding-top: 3.5rem; }
  .legal-hero { padding-bottom: 3rem; }
  .legal-hero h1 { font-size: clamp(2.8rem, 14vw, 4.5rem); }
  .page-content section { padding: 2.5rem 0; }
  .info-grid { grid-template-columns: 1fr; }
  .file-summary { flex-direction: column; gap: 0.25rem; }
  .bpm-readout { gap: 0.55rem; }
  #bpm-value { font-size: clamp(4.5rem, 28vw, 7rem); }
  .bpm-unit { font-size: 0.78rem; }
  footer { flex-direction: column; }
  .footer-links { flex-wrap: wrap; gap: 0.45rem 1rem; }
}
