:root {
  color-scheme: light;
  --ink: #16201c;
  --muted: #66746e;
  --panel: #f7f3ea;
  --line: #d7d0c2;
  --field: #fbfaf5;
  --accent: #2d6f73;
  --accent-strong: #174e53;
  --warm: #c05f3c;
  --dot: #060706;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: #e8e4da;
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 10;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
}

.skip-link:focus {
  opacity: 1;
  pointer-events: auto;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 100vh;
}

.stage {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  cursor: crosshair;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(135deg, #fffefa 0%, #f0f8f4 50%, #fdf5ee 100%);
  touch-action: none;
}

.trace-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.target-dot {
  --dot-size: 22px;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24), 0 8px 20px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  will-change: left, top;
}

.stage-message {
  position: absolute;
  left: clamp(20px, 5vw, 72px);
  bottom: clamp(24px, 8vh, 96px);
  max-width: 520px;
  pointer-events: none;
}

.stage-message h1 {
  margin: 0 0 10px;
  font-size: clamp(2.4rem, 7vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.stage-message p {
  max-width: 34rem;
  margin: 0;
  color: #41514b;
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.5;
}

.stage-message.is-hidden {
  opacity: 0;
}

.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(22, 32, 28, 0.9);
  font-size: clamp(6rem, 20vw, 16rem);
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
}

.countdown.is-visible {
  opacity: 1;
}

.record-hint {
  position: absolute;
  left: 50%;
  top: 24px;
  max-width: min(520px, calc(100% - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(23, 78, 83, 0.24);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  color: #174e53;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.is-record-armed .record-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
  padding: 22px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -18px 0 36px rgba(36, 34, 28, 0.08);
}

.brand-row,
.status-strip,
.range-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: 1.45rem;
}

.safety-note,
.privacy-note {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.safety-note {
  border: 1px solid #dfc9be;
  background: #fff9f3;
  color: #684230;
}

.privacy-note {
  border: 1px solid rgba(45, 111, 115, 0.24);
  background: #f7fffb;
  color: #2d5b5a;
}

.status-strip {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-strip span:first-child {
  color: var(--ink);
  font-weight: 750;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  min-height: 42px;
  border: 1px solid #bcb5a9;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #938b7d;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

button.primary {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: white;
}

.donate-button {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid #7b4231;
  border-radius: 8px;
  background: var(--warm);
  color: white;
  font-weight: 800;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease;
}

.donate-button:hover {
  background: #a94f32;
  transform: translateY(-1px);
}

.donate-button.large {
  min-width: 170px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 1.2rem;
}

.field,
.control-group,
.toggles {
  display: grid;
  gap: 8px;
}

.field span,
.range-row span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.range-row strong {
  font-size: 0.88rem;
}

input[type="text"],
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  padding: 0 11px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.toggles {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #35433e;
  font-size: 0.94rem;
  font-weight: 650;
}

.is-recording .stage {
  cursor: none;
}

.is-playing .stage {
  cursor: none;
}

.site-info {
  background: #fffdf8;
  border-top: 1px solid var(--line);
}

.site-info.alt {
  background: #f7fffb;
}

.info-inner {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 56px 0;
}

.info-lede {
  max-width: 780px;
}

.info-lede h2,
.support-row h2 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.08;
}

.info-lede p,
.support-row p,
.site-footer p {
  color: #41514b;
  font-size: 1rem;
  line-height: 1.65;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.info-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.info-grid h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.info-grid p {
  margin: 0;
  color: #41514b;
  line-height: 1.55;
}

.support-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.support-row p {
  max-width: 680px;
  margin: 0;
}

.support-actions {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 190px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px min(36px, 5vw);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.site-footer p {
  margin: 0;
  font-size: 0.92rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.legal-page {
  width: min(820px, calc(100% - 36px));
  margin: 0 auto;
  padding: 56px 0;
}

.legal-page h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.legal-page h2 {
  margin: 32px 0 8px;
  font-size: 1.25rem;
}

.legal-page p {
  color: #41514b;
  line-height: 1.65;
}

.legal-page code {
  color: var(--ink);
  font-weight: 750;
}

.footer-donate {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.footer-donate:hover {
  transform: none;
}

.donate-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 32, 28, 0.62);
}

.donate-overlay[hidden] {
  display: none;
}

.donate-modal {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  text-align: center;
}

.donate-modal h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
}

.donate-modal img {
  width: min(260px, 82vw);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.donate-modal p:not(.eyebrow) {
  margin: 14px 0 0;
  color: #41514b;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 1.55rem;
  line-height: 1;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 62vh;
  }

  .control-panel {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
    box-shadow: 0 -18px 36px rgba(36, 34, 28, 0.08);
  }

  .toggles {
    margin-top: 0;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .support-row,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .support-actions {
    justify-items: stretch;
  }

  .site-footer {
    align-items: flex-start;
  }
}
