:root {
  color-scheme: light;
  --paper: #f6f3ea;
  --ink: #202c24;
  --forest: #253c2d;
  --pine: #3a513d;
  --muted: #516052;
  --line: #b9c1ad;
  --gold: #efc881;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Avenir Next", Avenir, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--body); }
a { color: #275033; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .13em; }
a:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid #a65427; outline-offset: 3px; }
header, footer { padding: 1rem max(5vw, calc((100vw - 70rem) / 2)); }
header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
header nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; justify-content: flex-end; }
header nav a { font-size: .88rem; }
.brand { font: 700 1.5rem/1 var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
main { max-width: 76rem; padding: 0 5vw 4rem; margin: auto; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.35rem, 6.5vw, 5rem); line-height: 1.01; letter-spacing: -.045em; margin: 0 0 1.1rem; }
h2 { font-size: clamp(1.55rem, 3.5vw, 2.35rem); margin: 2rem 0 .7rem; }
h3 { font-size: 1.28rem; margin: 0 0 .25rem; }
p { margin: 0 0 1rem; }
.intro { padding: clamp(2.5rem, 7vw, 5.4rem) 0 1.8rem; }
.intro > p { font-size: clamp(1.05rem, 2vw, 1.23rem); max-width: 58ch; color: var(--muted); }
.hero { background: var(--forest); color: var(--paper); margin: 2.5rem 0 2rem; padding: clamp(1.45rem, 5vw, 4rem); position: relative; overflow: hidden; }
.hero p { max-width: 48ch; color: #e7e9d9; }
.hero::after { content: ""; display: block; width: 85%; height: 12px; margin-top: 1.45rem; opacity: .48; background: repeating-linear-gradient(90deg, var(--gold) 0 1px, transparent 1px 18px); }
.actions { display: flex; gap: .85rem; flex-wrap: wrap; align-items: center; }
.button, button { display: inline-block; border: 0; border-radius: 3px; padding: .62rem .93rem; color: #fff; background: var(--forest); font: 650 1rem/1.4 var(--body); text-decoration: none; cursor: pointer; }
.hero .button { background: var(--gold); color: var(--ink); }
.hero .plain-link { color: var(--paper); }
.catalog, .related { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1.1rem 2rem; padding: 0; list-style: none; }
.catalog li, .related li { border-top: 1px solid var(--line); padding-top: .85rem; }
.catalog p { color: var(--muted); }
.workbench { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 0; max-width: 65rem; border: 1px solid var(--line); }
.fields, .result { padding: clamp(1rem, 4vw, 2rem); }
.fields { background: #fffcf4; display: grid; gap: .78rem; align-content: start; }
.pairs { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:.8rem; }
.result { background: #e4ebdc; align-content: center; }
.result output { display: block; font: 700 clamp(2.8rem, 8vw, 5rem)/1 var(--serif); letter-spacing: -.05em; overflow-wrap: anywhere; }
.result p { margin: .6rem 0 1rem; }
label { display: block; min-width: 0; font-size: .94rem; font-weight: 620; }
input { display: block; width: 100%; margin-top: .2rem; padding: .55rem .6rem; border: 1px solid #838f7d; border-radius: 3px; background: white; color: var(--ink); font: inherit; }
.prose { max-width: 72ch; }
.prose li { margin-bottom: .3rem; }
.prose aside { background: #eef0e4; border-left: 3px solid var(--pine); padding: .9rem 1rem; margin: 1rem 0; }
.source { font-size: .89rem; color: var(--muted); }
.ticket-copy { display: none; }
footer { border-top: 1px solid var(--line); }
footer p { margin: 0; font-size: .9rem; color: var(--muted); }
@media (max-width: 690px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .hero { margin-top: 1.35rem; }
  header { align-items: flex-start; }
}
@media print {
  body[data-page="ticket"] { background: white; font-size: 12pt; color: black; }
  body[data-page="ticket"] header, body[data-page="ticket"] footer, body[data-page="ticket"] main > :not(.ticket-copy) { display: none; }
  .ticket-copy { display: block; }
  .ticket-copy h2 { font-size: 26pt; }
  .ticket-copy dt { font-weight: 700; margin-top: .45rem; }
  .ticket-copy dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
}
