* {
  box-sizing: border-box;
}
:root {
  --paper: #f8f4ed;
  --ink: #272019;
  --line: #d9cebb;
  --binding: #30251d;
  --quiet: #6e6254;
  --gold: #a97a3b;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.55 'Segoe UI',
    Arial,
    sans-serif;
}
header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 6vw;
  border-bottom: 1px solid var(--line);
}
header {
  min-height: 78px;
}
.brand {
  font:
    600 27px Georgia,
    serif;
  letter-spacing: -1.5px;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}
.brand i {
  font-weight: 400;
}
.seal {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--binding);
  color: #efddab;
  width: 38px;
  height: 38px;
  font: 32px/1 Georgia;
  margin-right: 6px;
}
.edition,
.eyebrow,
footer span:first-child {
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.edition {
  margin-right: auto;
  margin-left: 24px;
}
.edition b {
  color: var(--gold);
  padding: 0 8px;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.btn,
nav button,
.subtle {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 10px 15px;
  font-weight: 600;
}
.btn.primary {
  background: var(--binding);
  border-color: var(--binding);
  color: white;
}
.btn:hover,
nav button:hover {
  filter: brightness(0.92);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
nav {
  display: flex;
  gap: 8px;
}
.subtle {
  padding: 4px;
  border: 0;
  text-decoration: underline;
}
main {
  width: min(1120px, 90%);
  margin: auto;
  padding: 48px 0 60px;
  min-height: calc(100vh - 160px);
}
h1,
h2,
h3 {
  font-family: Georgia, serif;
  font-weight: 400;
  line-height: 1.12;
  margin: 12px 0 20px;
}
h1 {
  font-size: clamp(40px, 5vw, 73px);
  letter-spacing: -0.055em;
}
h2 {
  font-size: 34px;
  letter-spacing: -0.035em;
}
p {
  margin: 8px 0 18px;
}
.muted,
small {
  color: var(--quiet);
}
.eyebrow {
  color: #785a34;
}
.entry {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fffdf8;
}
.auth {
  align-self: center;
  padding: clamp(26px, 4vw, 62px);
}
.auth h2 {
  font-size: 40px;
}
.auth .btn.primary {
  width: 100%;
  margin: 14px 0;
}
.auth label,
.label {
  display: block;
  font-weight: 600;
  margin: 16px 0 6px;
}
input:not([type='checkbox']):not([type='radio']),
textarea {
  width: 100%;
  border: 1px solid #b9ac98;
  border-radius: 6px;
  padding: 11px;
  background: #fffefb;
  color: var(--ink);
}
textarea {
  min-height: 85px;
  resize: vertical;
}
.meta {
  display: flex;
  gap: 0;
  padding: 22px 0;
}
.meta span {
  padding: 0 28px;
  border-left: 1px solid var(--line);
  color: var(--quiet);
}
.meta span:first-child {
  padding-left: 0;
  border: 0;
}
.meta strong {
  font-family: Georgia;
  font-size: 23px;
  color: var(--ink);
  margin-right: 6px;
}
footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--quiet);
  font-size: 13px;
}
.row,
.actions,
.cardhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.actions {
  margin-top: 25px;
  flex-wrap: wrap;
}
.cards {
  display: grid;
  gap: 12px;
}
.card,
.panel {
  padding: 24px;
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card h2 {
  font-size: 25px;
  margin: 5px 0;
}
.pill {
  font-size: 12px;
  background: #f0e5d3;
  border-radius: 20px;
  padding: 5px 10px;
  color: #674925;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(170px, 235px) 1fr;
  gap: 32px;
}
.toc {
  align-self: start;
}
.toc summary {
  font-weight: 600;
  margin-bottom: 12px;
  cursor: pointer;
}
.toc button {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: baseline;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 5px;
  padding: 6px 9px;
  color: var(--quiet);
  font-size: 14px;
}
.toc button.active {
  background: #ebe0ce;
  color: #4d3824;
  font-weight: 700;
}
.toc small {
  font-variant-numeric: tabular-nums;
}
.step {
  padding: clamp(22px, 4vw, 48px);
}
.step h1 {
  font-size: clamp(32px, 4vw, 52px);
}
.original,
.answer,
.question {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.question {
  margin: 0 0 9px;
  font-weight: 600;
}
.field {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 22px 0 8px;
  margin: 0;
  min-width: 0;
}
.field legend {
  float: left;
  width: 100%;
}
.field legend + * {
  clear: both;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.choices label {
  position: relative;
  cursor: pointer;
}
.choices input {
  position: absolute;
  opacity: 0;
}
.choices span {
  display: block;
  border: 1px solid #beae95;
  border-radius: 6px;
  padding: 6px 11px;
  background: #fcf8f1;
}
.choices input:checked + span {
  background: var(--binding);
  color: white;
}
.choices input:focus-visible + span,
:focus-visible {
  outline: 3px solid #a4782f;
  outline-offset: 2px;
}
.listrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
}
.example {
  font-size: 14px;
  color: var(--quiet);
  margin: 8px 0;
}
.example summary {
  cursor: pointer;
}
.save {
  font-size: 13px;
  color: var(--quiet);
  min-height: 21px;
}
.stepbar {
  margin-bottom: 16px;
}
.outro {
  font: italic 22px/1.45 Georgia;
  border-left: 3px solid #b69a66;
  padding-left: 20px;
}
.report {
  max-width: 850px;
  margin: auto;
}
.report section {
  margin: 16px 0;
}
.report .answer {
  background: #f6f0e6;
  padding: 10px 14px;
  border-left: 2px solid #b3986c;
}
.chart {
  max-width: 520px;
  margin: 10px auto;
  display: block;
  width: 100%;
  height: auto;
}
.scoretable {
  display: grid;
  grid-template-columns: 1fr auto;
  margin: 12px 0;
}
.scoretable > * {
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
#notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #432f22;
  color: white;
  box-shadow: 0 4px 16px #0003;
  border-radius: 8px;
  padding: 12px 22px;
  z-index: 2;
  max-width: 90vw;
}
.invalid {
  outline: 2px solid #ad602e;
  outline-offset: 5px;
}
@media (max-width: 750px) {
  header,
  footer {
    padding: 14px 5%;
  }
  .edition {
    display: none;
  }
  main {
    padding: 24px 0;
  }
  .entry,
  .workspace {
    grid-template-columns: 1fr;
  }
  .meta {
    justify-content: space-between;
  }
  .meta span {
    padding: 0 8px;
    font-size: 12px;
  }
  .meta strong {
    display: block;
  }
  .workspace {
    gap: 12px;
  }
  .row,
  .cardhead {
    flex-wrap: wrap;
  }
  .auth {
    padding: 25px;
  }
  .toc[open] {
    max-height: 270px;
    overflow: auto;
  }
  .card {
    padding: 18px;
  }
  nav button {
    padding: 7px 9px;
  }
  .brand {
    font-size: 23px;
  }
  .seal {
    width: 30px;
    height: 30px;
    font-size: 24px;
  }
}
@page {
  size: A4;
  margin: 16mm;
}
@media print {
  body,
  main,
  .panel {
    background: white;
    color: black;
  }
  header,
  footer,
  nav,
  .noprint,
  #notice {
    display: none !important;
  }
  main,
  .report {
    width: 100%;
    max-width: none;
    padding: 0;
    min-height: 0;
  }
  .panel {
    border: 0;
    padding: 0;
  }
  .report section {
    margin: 10mm 0;
  }
  .report h2,
  .report .question {
    break-after: avoid;
  }
  .report h1 {
    font-size: 34pt;
  }
  .report h2 {
    font-size: 22pt;
  }
  .report .answer {
    white-space: pre-wrap;
    border-left: 1px solid gray;
  }
  .chart {
    max-width: 95mm;
  }
  .radarbox {
    break-inside: avoid;
  }
  .answer {
    orphans: 3;
    widows: 3;
  }
}
/* The black binding, gilt edges and warm writing paper echo the printed workbook. */
.seal { background: none; color: #88643d; font-size: 36px; }
header { background: #fbf9f4; }
.eyebrow, .edition { font-weight: 600; }
.btn { text-decoration: none; border-radius: 3px; }
.btn.primary { background: #30251d; border-color: #30251d; color: #fff9ef; }
.entry { border-radius: 4px; background: #fffdf9; box-shadow: 0 15px 45px -34px #48341680; }
.bookstage {
  position: relative; isolation: isolate; overflow: hidden; display: grid;
  grid-template-rows: auto 1fr auto; min-height: 525px;
  padding: 24px clamp(22px,3vw,42px);
  background: radial-gradient(ellipse at 25% 14%, #54422e 0, #30281f 30%, #1c1916 64%, #100f0e 100%);
  color: #e0caa6;
}
.bookstage::before, .bookstage::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 125%; height: 130%; border: 1px solid #c69b6345;
  border-radius: 50%; transform: rotate(-33deg); left: -42%; top: -38%;
}
.bookstage::after { left:-39%; top:-37%; border-color: #c69b6321; }
.stage-caption {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  font: 600 10px/1.4 "Segoe UI",sans-serif; letter-spacing:.2em;
}
.stage-caption.bottom { border-top: 1px solid #cab59245; padding-top: 15px; }
.bookscene { perspective: 900px; display: grid; place-items: center; padding: 28px 12px; }
.book {
  width: clamp(205px, 21vw, 280px); margin:0; position:relative;
  transform: rotateY(-14deg) rotateX(4deg) rotateZ(-5deg);
  transform-style: preserve-3d;
  box-shadow: 12px 20px 22px #08060485, 2px 2px 3px #080604b0;
}
.book img { display:block; width:100%; height:auto; border-radius:1px 3px 2px 1px; }
.book::before {
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:linear-gradient(90deg,#0005 0%,#fff3 1%,#0006 2%,transparent 4%,transparent 97%,#ffd89d15);
}
.book::after {
  content:""; position:absolute; left:100%; top:1px; bottom:1px; width:11px;
  transform-origin:left; transform:rotateY(62deg);
  background:repeating-linear-gradient(90deg,#b9a78c 0 1px,#e2d8c4 1px 3px);
  border-right:2px solid #28211b;
}
.auth h1 { max-width: 11ch; font: italic 400 clamp(36px,4vw,57px)/1.03 Georgia,serif; letter-spacing:-.05em; }
.ornament::before { content:"✦"; margin-right:10px; font-size:18px; color:#a87939; vertical-align:middle; }
.meta { border-bottom:1px solid var(--line); }
.library-head { margin:18px 0 36px; padding:clamp(22px,4vw,46px); color:#f9f1e4; background:linear-gradient(112deg,#161411,#392b20); border-left:3px solid #a78355; }
.library-head .eyebrow { color:#dcc5a0; }
.library-head h1 { margin-bottom:0; font-style:italic; }
.library-head .btn.primary { color:#342718; background:#ecdbbe; border-color:#ecdbbe; }
.card,.panel { border-radius:3px; }
.card { border-left:3px solid #b99a6d; }
.step { position:relative; background:#fffdfa; }
.page-progress { appearance:none; display:block; height:3px; width:100%; margin:0 0 25px; border:0; background:#eee6d8; color:#a17c48; }
.page-progress::-webkit-progress-bar { background:#eee6d8; }
.page-progress::-webkit-progress-value { background:#a17c48; }
.page-progress::-moz-progress-bar { background:#a17c48; }
.chapter-title { display:flex; gap:.3em; align-items:baseline; font-style:italic; }
.medallion { display:inline-grid; place-items:center; flex:none; width:1.6em; height:1.6em; align-self:center; border-radius:50%; background:linear-gradient(130deg,#8c6336,#a67c48); color:#fff8ec; font:italic .57em/1 Georgia,serif; letter-spacing:0; }
.step textarea { background:repeating-linear-gradient(to bottom,#fffdf9 0 27px,#eadfce 27px 28px); line-height:28px; background-position:0 8px; }
.outro { background:#f5ecdd; padding:16px 20px; }
.report h1,.report h2 { font-style:italic; }
.toc button.active { box-shadow:inset 2px 0 #97703e; }
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .book { transition:transform .62s cubic-bezier(.2,.7,.3,1); }
  .bookstage:hover .book { transform:rotateY(-5deg) rotateX(1deg) rotateZ(-2deg) translateY(-4px); }
  .btn { transition:background-color .18s,box-shadow .18s; }
  .btn:hover { box-shadow:0 2px 8px #50381920; }
}
@media(max-width:750px){
  .bookstage { min-height:0; padding:13px 20px; }
  .bookscene { padding:12px 0; }
  .book { width:clamp(108px,21vw,148px); }
  .stage-caption.bottom { padding-top:8px; }
  .stage-caption { font-size:9px; }
  .auth h1 { max-width:none; }
  .chapter-title { flex-wrap:wrap; }
}
@media print { .page-progress,.bookstage { display:none; } .panel { box-shadow:none; } }
/* Engraved cover and editorial archive share the geometry of the workbook. */
.engraving { position:absolute; width:100%; height:100%; inset:0; pointer-events:none; color:#cfac74; opacity:.55; }
.bookstage > .engraving { width:135%; height:110%; top:4%; left:-15%; opacity:.24; }
.stage-caption,.bookscene { position:relative; }
.folio-hero {
  isolation:isolate; position:relative; overflow:hidden; display:grid;
  grid-template-columns:1.08fr 1fr; align-items:center;
  color:#fcf5e9; background:radial-gradient(ellipse at 76% 35%,#524030 0,#30261d 33%,#1a1714 76%);
  border-radius:4px; padding:clamp(28px,5vw,66px); padding-bottom:68px; min-height:360px;
}
.folio-intro { z-index:1; }
.folio-intro h1 { font-size:clamp(56px,7vw,99px); line-height:.98; margin:0 0 18px; }
.folio-intro h1 i { color:#e6c8a1; }
.folio-intro p { margin-bottom:24px; color:#eee1ce; }
.folio-actions { display:flex; gap:12px; flex-wrap:wrap; }
.folio-actions .btn { color:#efe1cf; border-color:#9c8262; }
.folio-actions .primary { color:#332416; background:#ebd8b9; }
.folio-object { position:relative; display:grid; place-items:center; perspective:850px; }
.folio-object .book { width:clamp(125px,15vw,190px); transform:rotateY(-18deg) rotateZ(8deg); }
.folio-object .engraving { width:185%; height:180%; left:-34%; top:-38%; }
.folio-imprint { position:absolute; bottom:18px; left:5%; right:5%; display:flex; justify-content:space-between; gap:8px; border-top:1px solid #ab93774d; padding-top:11px; font-size:11px; color:#d8c6ae; }
.folio-imprint span:first-child { letter-spacing:.19em; }
.archive { margin-top:32px; }
.archive-heading { display:flex; align-items:baseline; justify-content:space-between; border-bottom:1px solid var(--line); margin-bottom:10px; }
.archive-heading h2 { margin:0 0 10px; }
.archive-heading span { font-size:13px; color:var(--quiet); }
.archive-empty { display:flex; align-items:center; gap:22px; padding:24px 0; color:var(--quiet); }
.archive-empty svg { flex:none; color:#9b784b; }
.archive-empty h3 { color:var(--ink); font-size:24px; margin:0 0 6px; }
.archive-empty p { margin:0; }
.field:focus-within .question { color:#754f23; }
.example { margin:5px 0 14px; }
.example summary { display:inline-flex; align-items:center; min-height:36px; gap:9px; color:#725329; }
.example summary::-webkit-details-marker { display:none; }
.example summary::before { content:""; width:6px; height:6px; border-right:1.5px solid; border-bottom:1.5px solid; transform:rotate(-45deg); }
.example[open] summary::before { transform:rotate(45deg); }
.example-note { padding:14px 20px; background:#f4ecde; border-inline-start:1px solid #a68048; margin:2px 0 12px; }
.example-note small { font:600 11px/1.5 'Segoe UI',sans-serif; letter-spacing:.04em; color:#735635; }
.example-note p { font:italic 18px/1.55 Georgia,serif; color:#413326; margin:6px 0 0; }
.radar-plate { border-radius:4px; padding:8px; background:radial-gradient(ellipse at 50% 44%,#494032,#221d18 78%); }
.radar-plate text { fill:#f5e7cf; }
.radar-plate svg polygon[fill="none"],.radar-plate line { stroke:#88765b; }
.radar-plate svg polygon:not([fill="none"]) { fill:#d6ac6e; stroke:#edce97; }
.radar-plate circle { fill:#ffe2a8; }
@media(min-width:751px){ .toc { position:sticky; top:16px; max-height:calc(100vh - 32px); overflow:auto; scrollbar-width:thin; } }
@media(hover:hover) and (prefers-reduced-motion:no-preference){
  .folio-object .book,.bookstage .engraving { transition:transform .65s cubic-bezier(.2,.65,.25,1); }
  .folio-hero:hover .book { transform:rotateY(-9deg) rotateZ(5deg) translateY(-3px); }
  .bookstage:hover .engraving { transform:translateX(6px) rotate(1deg); }
}
@media(max-width:640px){
  .folio-hero { grid-template-columns:minmax(0,1fr) 75px; gap:5px; min-height:275px; padding:24px 19px 61px; }
  .folio-intro h1 { font-size:clamp(41px,9vw,57px); }
  .folio-object .book { width:clamp(64px,17vw,106px); }
  .folio-actions { gap:6px; }
  .folio-actions .btn { font-size:14px; }
  .archive-empty { align-items:flex-start; gap:15px; }
}
@media print { .radar-plate { background:white; } .radar-plate text { fill:#332416; } }
.example-note ol { margin:8px 0; padding-left:1.45em; line-height:1.7; }
/* Portrait panels keep text on its own plane, like a two-page editorial spread. */
.portrait {
  position:relative; isolation:isolate; overflow:hidden; margin:0;
  min-width:0; perspective:1000px; background:#191512;
}
.portrait img {
  display:block; position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; object-position:50% 23%;
}
.portrait::after {
  content:""; position:absolute; inset:14px; border:1px solid #dfc19270;
  pointer-events:none;
}
.entry { grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); }
.entry .portrait { min-height:clamp(450px,42vw,600px); }
.folio-hero {
  grid-template-columns:minmax(0,1fr) minmax(0,.85fr); padding:0;
  min-height:0; background:linear-gradient(110deg,#15120f,#30251b);
}
.folio-intro { padding:clamp(32px,5vw,72px); }
.folio-hero .portrait { align-self:stretch; min-height:350px; }
.folio-hero .portrait img { object-position:50% 20%; }
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  .portrait img {
    transform:rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg)) scale(1.07);
    transition:transform .22s ease-out;
  }
}
@media (max-width:750px) {
  .entry { grid-template-columns:1fr; }
  .entry .portrait { min-height:0; height:clamp(175px,47vw,275px); }
  .entry .portrait img { object-position:50% 23%; }
  .folio-intro { padding:clamp(18px,4vw,32px); }
  .folio-hero { grid-template-columns:minmax(0,1.25fr) minmax(0,.85fr); }
  .folio-hero .portrait { min-height:250px; }
  .folio-hero .portrait img { object-position:49% 20%; }
  .portrait::after { inset:8px; }
}
