:root {
  --paper: #efeae0;
  --paper-2: #f7f3ea;
  --ink: #1f1b16;
  --muted: #57534e;
  --line: #d6d0c4;
  --rust: #b45309;
  --rust-dark: #9a3412;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

img {
  display: block;
}

.font-sans,
body {
  font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-mono,
.tabular {
  font-variant-numeric: tabular-nums;
}

.font-mono {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}

input {
  font-variant-numeric: tabular-nums;
}

.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-6xl { max-width: 72rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }
.w-full { width: 100%; }
.w-8 { width: 2rem; }
.min-w-\[36rem\] { min-width: 36rem; }
.h-auto { height: auto; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.block { display: block; }
.grid { display: grid; }
.hidden,
[hidden] { display: none !important; }

.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-x-4 { column-gap: 1rem; }
.gap-y-1 { row-gap: 0.25rem; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-5 { padding-top: 1.25rem; }
.pt-6 { padding-top: 1.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.pl-5 { padding-left: 1.25rem; }
.pr-3 { padding-right: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-14 { margin-top: 3.5rem; }
.mb-2 { margin-bottom: 0.5rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 999px; }
.border { border: 1px solid var(--line); }
.border-b { border-bottom: 1px solid var(--line); }
.border-t { border-top: 1px solid var(--line); }
.border-\[\#d6d0c4\] { border-color: #d6d0c4; }
.border-\[\#e7e0d4\] { border-color: #e7e0d4; }
.border-rust\/30 { border-color: rgba(180, 83, 9, 0.3); }
.border-collapse { border-collapse: collapse; }

.bg-paper { background: var(--paper); }
.bg-\[\#f7f3ea\] { background: #f7f3ea; }
.bg-ink { background: var(--ink); }
.bg-rust { background: var(--rust); }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-\[17px\] { font-size: 17px; }
.leading-none { line-height: 1; }
.leading-7 { line-height: 1.75; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.tracking-tight { letter-spacing: -0.02em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-\[0\.14em\] { letter-spacing: 0.14em; }
.uppercase { text-transform: uppercase; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-ink { color: var(--ink); }
.text-rust { color: var(--rust); }
.text-white { color: #fff; }
.text-\[\#fff7ed\] { color: #fff7ed; }
.text-\[\#57534e\] { color: #57534e; }
.text-\[\#78716c\] { color: #78716c; }
.text-\[\#44403c\] { color: #44403c; }
.text-\[\#292524\] { color: #292524; }
.underline { text-decoration: underline; }
.list-disc { list-style: disc; }
.cursor-pointer { cursor: pointer; }
.hover\:text-ink:hover { color: var(--ink); }
.disabled\:opacity-50:disabled { opacity: 0.5; }

.prose-pitch h2 { margin: 0; }
.prose-pitch p { margin: 0; }
.prose-pitch ul { margin: 0; }

.diagram-frame {
  background:
    linear-gradient(90deg, rgba(180, 83, 9, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(180, 83, 9, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: var(--paper-2);
}

.diagram-frame svg text {
  font-family: system-ui, sans-serif;
}

.fill-\[\#57534e\] { fill: #57534e; }
.fill-\[\#9a3412\] { fill: #9a3412; }

.pitch-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  outline: none;
}

.pitch-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--rust);
  border: 3px solid var(--paper);
  cursor: pointer;
}

.pitch-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--rust);
  border: 3px solid var(--paper);
  cursor: pointer;
}

.preset-btn.is-active {
  background: var(--rust);
  color: #fff7ed;
  border-color: var(--rust);
}

.measure-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #a8a29e;
  box-shadow: none;
  animation: none;
}

.measure-dot.is-live {
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

@media (min-width: 640px) {
  .sm\:py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .sm\:text-4xl { font-size: 2.25rem; }
  .sm\:text-5xl { font-size: 3rem; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:col-span-1 { grid-column: span 1 / span 1; }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-\[1\.15fr_0\.85fr\] {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .measure-dot.is-live {
    animation: none;
  }
}

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }
}
