/* Direction: field research notebook (art-direction roll, 18 Nov 2026).
   Flat ink, one brass signal, 52px bilingual margin, one motion moment (the margin fill). */
:root {
  --ground: #191612;
  --ink: #e9e1d2;
  --faded: #9c9282;
  --rule: #4a5245;
  --ochre: #8a6f4e;
  --brass: #c8a04a;
  --margin: 52px;
  --gutter: 10px;
  --line: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 240px;
  height: 282px;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font: 15px/20px serif;
  -webkit-text-size-adjust: 100%;
}

.sheet {
  position: relative;
  width: 240px;
  height: 282px;
  padding: 10px var(--gutter) 8px calc(var(--margin) + 10px);
  background-image: repeating-linear-gradient(to bottom, transparent 0 19px, rgba(74, 82, 69, 0.28) 19px 20px);
}

.rule { position: absolute; top: 0; bottom: 0; left: var(--margin); width: 1px; background: var(--rule); }
.rule-fill { position: absolute; top: 0; left: -0.5px; width: 2px; height: 100%; background: var(--brass); transform: scaleY(0); transform-origin: top; }
.recording .rule-fill { transition: transform 60s linear; transform: scaleY(1); }

.screen { display: flex; flex-direction: column; height: 100%; }
.screen[hidden] { display: none; }

/* Margin notes: Latin hand plus Arabic, hung into the left margin. */
.note { position: relative; height: 0; }
.note .latin, .note .arabic { position: absolute; right: calc(100% + 18px); width: 44px; text-align: right; color: var(--ochre); }
.note .latin { top: 0; font: 14px/18px cursive; }
.note .arabic { top: 17px; font: 13px/18px "Noto Naskh Arabic", serif; }

/* The one element that breaks the grid: it crosses the margin rule. */
.state {
  margin-left: calc(-1 * var(--margin) + 4px);
  font: 28px/40px cursive;
  color: var(--ink);
  white-space: nowrap;
}
.recording .state { color: var(--brass); }
.error .state { color: var(--ochre); }

.code {
  margin: 44px 0 12px calc(-1 * var(--margin) + 4px);
  font: 40px/40px monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 4px;
  color: var(--brass);
}

/* The scroll area spans the margin too, so the hung margin notes are not clipped. */
.scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  margin-left: calc(-1 * (var(--margin) + 10px));
  padding: 4px 0 0 calc(var(--margin) + 10px);
}
.scroll::-webkit-scrollbar { display: none; }
.entry { padding-bottom: var(--line); }
.body { color: var(--ink); }
.faded { color: var(--faded); font-style: italic; }
.mono { font: 14px/20px monospace; color: var(--ink); }
.hint { margin-top: 2px; }

.hold {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--faded);
  font: 14px/20px serif;
  font-style: italic;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.hold:focus-visible, .scroll:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }
.recording .hold { border-color: var(--brass); color: var(--brass); }

@media (prefers-reduced-motion: reduce) {
  .recording .rule-fill { transition: none; transform: scaleY(1); }
}
