:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --ink: #171821;
  --line: #c9c6bf;
  --blue: #253eb5;
  --pale-blue: #e5eaff;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, sans-serif;
  --mono: ui-monospace, "Courier New", monospace;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
h1, h2, p { margin: 0; }

.masthead, main { width: min(100% - 4rem, 78rem); margin-inline: auto; }
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 5.25rem;
  border-bottom: 1px solid var(--ink);
}
.masthead a { display: inline-flex; align-items: center; gap: 0.65rem; }
.brand { text-decoration: none; font-weight: 750; font-size: 1.05rem; }
.brand-mark {
  width: 1.35rem;
  aspect-ratio: 1;
  background: linear-gradient(var(--blue) 0 20%, transparent 20% 40%, var(--blue) 40% 60%, transparent 60% 80%, var(--blue) 80%);
}
.jump { color: var(--blue); font-size: 0.85rem; text-underline-offset: 0.2em; }
.jump:hover { text-decoration-thickness: 2px; }
main { padding-bottom: 4rem; }

.intro { padding: clamp(2.7rem, 6vw, 6rem) 0 clamp(1.8rem, 3.5vw, 3.3rem); }
.intro h1 {
  font-family: var(--serif);
  font-size: clamp(3.15rem, 9vw, 8.4rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.08em;
}
.intro em { color: var(--blue); font-weight: 400; }
.intro p { color: #484956; margin-top: 1.25rem; font-size: clamp(.98rem, 1.7vw, 1.14rem); }

.editor { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(18rem, 1fr); border: 1px solid var(--ink); }
.specimen { background: var(--pale-blue); min-width: 0; color: #172c98; display: flex; flex-direction: column; }
.specimen-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1.25rem, 3vw, 2.4rem);
  border-bottom: 1px solid #7e8fdb;
}
.specimen-bar h2, .specimen-bar span { font: 650 .77rem/1.2 var(--mono); }
.specimen-paper {
  flex: 1;
  min-height: 18rem;
  display: flex;
  align-items: center;
  padding: clamp(1.3rem, 4vw, 3.5rem);
}
.sample {
  --sample-size: 72px;
  font-size: var(--sample-size);
  line-height: 1.04;
  letter-spacing: -0.05em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  width: 100%;
}
.serif { font-family: var(--serif); }
.grotesk { font-family: var(--sans); }
.mono { font-family: var(--mono); letter-spacing: -0.07em; }

.controls {
  background: #fffdf8;
  border-left: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 1.45rem;
  padding: clamp(1.35rem, 3.3vw, 2.5rem);
}
.controls h2 { font-size: 1.06rem; }
.field { display: grid; gap: .55rem; }
.controls label, legend { font-size: 0.82rem; font-weight: 680; }
textarea {
  color: var(--ink);
  width: 100%;
  min-height: 6rem;
  padding: .65rem .72rem;
  resize: vertical;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 0;
}
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .55rem; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices button {
  min-height: 2.8rem;
  border: 1px solid var(--line);
  border-right-width: 0;
  padding: .4rem;
  background: transparent;
  color: var(--ink);
}
.choices button:last-child { border-right-width: 1px; }
.choices button:hover { background: var(--pale-blue); }
.choices button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.choices button:focus-visible { z-index: 1; }
.field-heading, .range-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
output { color: var(--blue); font: 700 .86rem/1.2 var(--mono); }
input[type="range"] { width: 100%; margin: 0; accent-color: var(--blue); min-height: 1.6rem; }
.range-labels { color: #555565; font: .73rem/1.2 var(--mono); }
.reset {
  border: 0;
  border-top: 1px solid var(--line);
  padding: .8rem 0 .1rem;
  display: flex;
  justify-content: space-between;
  color: var(--blue);
  background: transparent;
  font-size: .84rem;
  font-weight: 680;
}
.reset:hover { text-decoration: underline; }
noscript p { margin-top: 1rem; }

@media (max-width: 46rem) {
  .masthead, main { width: calc(100% - 2rem); }
  .masthead { min-height: 4.2rem; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .specimen-paper { min-height: 13rem; }
  .controls { border-left: 0; border-top: 1px solid var(--ink); }
}
