:root {
  color-scheme: light;
  --paper: #f3eee3;
  --sheet: #fffcf5;
  --ink: #292b23;
  --muted: #5b5e50;
  --rule: #d7cebd;
  --accent: #923e2b;
  --serif: Georgia, "Times New Roman", serif;
  font: 1rem/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
button, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { color: var(--ink); background: #ecd4bb; }

.wrap { width: min(69rem, calc(100% - 3rem)); margin-inline: auto; }
.masthead, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark { display: flex; align-items: center; gap: .65rem; font: 1.45rem/1 var(--serif); }
.help-link, .footer { color: var(--muted); font-size: .88rem; }
.help-link:hover, .link-button:hover { color: var(--accent); }

.intro { padding-block: clamp(2.4rem, 7vw, 4.4rem) 2rem; }
.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin-block: .12em .14em; font: 400 clamp(4.6rem, 12vw, 8rem)/.9 var(--serif); letter-spacing: -.07em; }
h1 span { color: var(--accent); }
.lede { max-width: 35rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, 16rem); gap: 1.3rem; align-items: start; }
.sheet, .stats { border: 1px solid var(--rule); border-radius: .65rem; }
.sheet { background: var(--sheet); }
.sheet-header, .toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; padding: .8rem 1.15rem; }
.sheet-header { justify-content: space-between; border-bottom: 1px solid var(--rule); }
.sheet-header h2 { font-size: .94rem; font-weight: 650; }

textarea {
  display: block;
  width: 100%;
  min-height: 15.4rem;
  resize: vertical;
  border: 0;
  padding: 1.1rem 1.15rem;
  color: var(--ink);
  background: transparent;
  font: 1.15rem/1.65 var(--serif);
}
textarea::placeholder { color: var(--muted); }
textarea:focus-visible { outline-offset: -3px; }

.toolbar { border-top: 1px solid var(--rule); }
button {
  border: 1px solid var(--rule);
  border-radius: .35rem;
  padding: .45rem .7rem;
  color: var(--ink);
  background: var(--sheet);
  font-size: .85rem;
  cursor: pointer;
}
button:not(:disabled):hover { border-color: var(--accent); }
button:disabled { color: var(--muted); cursor: default; }
.primary:not(:disabled) { color: var(--sheet); background: var(--accent); border-color: var(--accent); }
.primary:not(:disabled):hover { background: #783122; }
.link-button, .link-button:not(:disabled):hover { padding-inline: 0; border-color: transparent; text-decoration: underline; text-underline-offset: .22em; }
.feedback { padding: 0 1.15rem .8rem; color: var(--muted); font-size: .85rem; }
.feedback:empty { padding: 0; }

.stats { padding: 1rem 1.1rem; background: #ede5d5; }
.stats h2, .about h2 { font: 400 1.5rem/1.15 var(--serif); }
.stats dl { margin-top: .75rem; }
.stats dl div { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .2rem .5rem; border-top: 1px solid var(--rule); padding-block: .48rem; }
.stats dt, .storage-note { color: var(--muted); font-size: .85rem; }
.stats dd { font-variant-numeric: tabular-nums; font-weight: 650; }
.storage-note { margin-top: .7rem; }

.about { max-width: 43rem; margin-block: 3rem; scroll-margin-top: 1rem; }
.about p { margin-top: .6rem; color: var(--muted); }
.footer { border-top: 1px solid var(--rule); border-bottom: 0; }

@media (max-width: 44rem) {
  .wrap { width: calc(100% - 2rem); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .stats dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
}
