/* styles.css — UI chrome only. Nothing here affects the drawing itself;
   the drawing's style lives in js/style.js. The page should feel like a tool
   made by the same hand as the sketches: warm paper, ink-coloured rules,
   no gradients, no icon fonts. */

:root {
  --paper: #f2ecdd;
  --desk: #e6e1d3;
  --ink: #232630;
  --ink-soft: #5a5c66;
  --rule: #b8b09c;
  --accent: #c1633f;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: 22px 18px 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

/* --- masthead ----------------------------------------------------------- */
.masthead {
  width: 100%;
  max-width: 980px;
  margin: 0 auto 14px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 10px;
}

.masthead h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.masthead h1 span { color: var(--accent); }

.tagline {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
}

/* --- controls ------------------------------------------------------------ */
main {
  width: 100%;
  max-width: 980px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: rgba(255, 253, 247, 0.66);
  min-height: 56px;
}

.group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.group--actions { margin-left: auto; }
.group[hidden] { display: none; }

.controls label {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.btn {
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1;
  padding: 8px 11px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.btn:hover { background: rgba(35, 38, 48, 0.08); }
.btn:active { transform: translateY(1px); }

.btn:focus-visible,
.controls input:focus-visible,
.controls select:focus-visible,
#sheet:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.btn--primary:hover { background: #3a3e4c; }

.btn:disabled {
  opacity: 0.5;
  cursor: progress;
}

.btn kbd {
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.75;
  margin-left: 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 3px;
}

.seed-input {
  font-family: var(--mono);
  font-size: 13px;
  width: 11ch;
  padding: 7px 7px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.controls select {
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 6px 6px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.group--slider input[type="range"] {
  width: 96px;
  accent-color: var(--ink);
}

.group--slider output {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  min-width: 4ch;
  text-align: right;
}

/* --- status + sheet ------------------------------------------------------ */
.status {
  min-height: 18px;              /* reserved: no layout shift when it fills */
  margin: 8px 2px 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
}

.recording-dialog {
  max-width: min(92vw, 420px);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(60, 50, 35, 0.24);
  padding: 22px;
}
.recording-dialog::backdrop { background: rgba(38, 38, 44, 0.28); }
.recording-dialog h2 { margin: 0 0 8px; font-family: var(--display); font-size: 25px; }
.recording-dialog p { margin: 0 0 18px; font-size: 14px; }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sheet-wrap {
  margin: 2px auto 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

#sheet {
  display: block;
  width: 100%;
  max-width: min(92vw, 940px);
  height: auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 10px 26px rgba(60, 50, 35, 0.16), 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#sheet.is-dragging {
  cursor: grabbing;
}

.hint {
  margin: 12px 2px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
}

.hint kbd, .colophon code {
  font-family: var(--mono);
  font-size: 10.5px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1px 4px;
  background: rgba(255, 253, 247, 0.7);
}

.colophon {
  max-width: 980px;
  margin: 26px auto 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
  color: var(--ink-soft);
  text-align: center;
}

.colophon p { margin: 0; }

/* --- narrow screens ------------------------------------------------------ */
@media (max-width: 720px) {
  body { padding: 14px 10px 32px; }
  .controls { gap: 8px 10px; }
  .group--actions { margin-left: 0; }
  .group--slider input[type="range"] { width: 74px; }
  .masthead h1 { font-size: 17px; }
  .hint { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
