:root {
  color-scheme: light;
  --ink: #1c1915;
  --ink-soft: #3f392f;
  --paper: #f3eee4;
  --paper-2: #e7e0d2;
  --card: #fbf7ef;
  --rule: #d4cbb8;
  --brass: #8a6730;
  --stamp: #7c2d24;
  --good: #143d2e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(transparent 31px, rgba(28, 25, 21, 0.045) 32px);
  background-size: 100% 32px;
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.5;
}

a { color: var(--stamp); }
a:hover { color: var(--ink); }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--card);
  padding: 0.4rem 0.7rem;
}
.skip:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.4rem;
  background: var(--ink);
  color: var(--paper);
}

.brand {
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.18em;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.top nav { display: flex; gap: 1rem; }
.top nav a { color: var(--paper); text-decoration: none; }
.top nav a:hover { color: #e6d3a4; }

main {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.2rem 0 3rem;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h1 { font-size: clamp(2.3rem, 5vw, 4rem); margin: 0.2rem 0 0.8rem; max-width: 18ch; }
h2 { font-size: 1.7rem; margin: 0 0 0.6rem; }

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--brass);
  font-weight: 700;
}

.lede { font-size: 1.2rem; max-width: 42rem; }
.fine { color: var(--ink-soft); font-size: 0.92rem; }
.notice {
  border-left: 4px solid var(--brass);
  padding: 0.6rem 0.8rem;
  background: rgba(138, 103, 48, 0.08);
  max-width: 42rem;
}

.banner {
  border: 1px solid var(--stamp);
  background: #f6e6e1;
  padding: 0.75rem 0.9rem;
  max-width: 46rem;
}

.hero, .split, .report-head {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
}

.sample, .stamp, section, table, details, .actions form {
  background: var(--card);
  border: 1px solid var(--rule);
}

.sample { padding: 1.2rem; }
.sample-grade {
  font-family: var(--serif);
  font-size: 6rem;
  line-height: 0.85;
  margin: 0.4rem 0;
  color: var(--good);
}
.sample-line { margin-top: 0; }

button, .secondary, .ghost {
  font: inherit;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  letter-spacing: 0.02em;
}

button:hover { background: #000; }
.secondary { background: transparent; color: var(--ink); }
.ghost { background: transparent; color: var(--ink-soft); border-color: var(--rule); }

form { margin: 0.8rem 0 0.2rem; }

.fields { display: grid; gap: 0.75rem; max-width: 28rem; margin-top: 1.2rem; }
.fields label { display: grid; gap: 0.3rem; font-weight: 650; }
.fields input {
  font: inherit;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
}
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.steps ol, .plain { padding-left: 1.2rem; }
.steps { margin-top: 2.4rem; padding: 1.2rem 1.3rem 1.4rem; }
.split { margin-top: 1rem; }
.split > div, section { padding: 1.1rem 1.2rem; }
section + section { margin-top: 1rem; }

details { padding: 0.7rem 1rem; margin-top: 0.6rem; }
summary { cursor: pointer; font-weight: 650; }

.stamp {
  width: 9.5rem;
  height: 9.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-width: 6px;
  border-style: double;
  color: var(--paper);
}
.stamp span { font-family: var(--serif); font-size: 5.2rem; line-height: 0.8; }
.stamp small { letter-spacing: 0.14em; text-transform: uppercase; }
.grade-a { background: var(--good); border-color: #d7e4dc; }
.grade-b { background: #3f4b28; border-color: #d9e0c8; }
.grade-c { background: #6d5314; border-color: #ead9a4; }
.grade-d { background: #8a3d16; border-color: #f0d0bc; }
.grade-f { background: var(--stamp); border-color: #f0cfc9; }
.grade-incomplete { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }

.fixes { max-width: 46rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem; border-bottom: 1px solid var(--rule); }
th { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
code { font-family: var(--mono); font-size: 0.82rem; overflow-wrap: anywhere; }
td ul { margin: 0; padding-left: 1.1rem; }

.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.actions form { padding: 0.9rem 1rem; margin: 0; max-width: 22rem; }

footer {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}

@media (max-width: 800px) {
  .hero, .split, .report-head { grid-template-columns: 1fr; }
  h1 { max-width: none; }
  .stamp { width: 7rem; height: 7rem; }
  .stamp span { font-size: 3.8rem; }
}

@media print {
  body { background: #fff; }
  .top, .actions, footer, .skip { display: none; }
  main { width: auto; }
  .stamp, section, table { break-inside: avoid; }
}
