* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; height: 100%; overflow: hidden; scroll-behavior: auto; }
body { height: 100svh; margin: 0; overflow: hidden; color: var(--ink); background: var(--desk); font-family: var(--serif); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; z-index: -1; inset: 0; background: radial-gradient(ellipse at 48% 25%, #65554165, transparent 68%), repeating-linear-gradient(93deg, transparent 0 5px, #0a080510 6px 7px), linear-gradient(135deg, var(--desk-light), var(--desk) 65%); pointer-events: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 7px; border-radius: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 20; top: 12px; left: 12px; padding: 12px 18px; background: var(--paper-light); transform: translateY(-160%); font-family: var(--sans); font-size: 14px; }
.skip-link:focus { transform: translateY(0); }
.workbench { position: relative; width: calc(100% - 2 * var(--sheet-gutter)); height: calc(100svh - 2 * var(--sheet-gutter)); margin: var(--sheet-gutter) auto; }
.bench-controls, .bench-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #d4c5a9; font-family: var(--sans); font-size: 10px; font-weight: 400; letter-spacing: .16em; }
.bench-controls { position: absolute; z-index: 10; top: 12px; right: 14px; justify-content: flex-end; }
.bench-mark { opacity: .65; }
.quiet-control { min-height: 44px; padding: 8px 12px; border: 0; color: var(--ink); background: var(--paper-light); font-size: 11px; letter-spacing: .08em; cursor: pointer; }
.quiet-control span { margin-left: 13px; font-size: 16px; }
.quiet-control:focus-visible { outline-color: var(--focus); }
.keyboard-control:not(:focus-visible) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.bench-footer { margin-top: 20px; opacity: .65; font-size: 9px; }
.paper-stage { display: grid; place-items: center; width: 100%; height: 100%; perspective: 1700px; outline: 0; }
.paper { position: relative; isolation: isolate; width: var(--sheet-width, 100%); height: var(--sheet-height, 100%); min-height: 0; box-shadow: var(--paper-shadow); transform-origin: 50% 50%; }
.paper-material, .fold-face { background-color: var(--paper); background-image: url("./paper-texture.svg"), radial-gradient(ellipse at 45% 38%, #fff8e666 0, transparent 69%), radial-gradient(ellipse at 0 100%, #a57e3820, transparent 49%), radial-gradient(ellipse at 100% 0, #b28c4220, transparent 45%), linear-gradient(110deg, #c7b48d28, transparent 15%, #fff8e222 50%, transparent 87%, #a8885833); background-blend-mode: multiply, normal, normal, normal, normal; background-repeat: no-repeat; }
.paper-material { position: absolute; isolation: isolate; inset: 0; background-size: 100% 100%; pointer-events: none; }
.paper[data-intro-state="unfolding"] { box-shadow: none; }
.paper[data-intro-state="unfolding"] > .paper-material { visibility: hidden; }
.paper-crease { position: absolute; inset: 0; pointer-events: none; opacity: .32; }
.paper-crease--horizontal { background: repeating-linear-gradient(transparent 0 calc(var(--fold-size) - 3px), #8c74551f calc(var(--fold-size) - 2px), #fff9e894 calc(var(--fold-size) - 1px), transparent var(--fold-size)); }
.paper-crease--vertical { background: repeating-linear-gradient(90deg, transparent 0 calc(var(--fold-size) - 3px), #8c74551b calc(var(--fold-size) - 2px), #fff9e87a calc(var(--fold-size) - 1px), transparent var(--fold-size)); }
.paper-content { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; padding: clamp(12px, 4svh, 36px) 44px clamp(12px, 3svh, 24px); }
.folio-header.visually-hidden { position: absolute; }
.index-view { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.paper[data-intro-state="unfolding"] .paper-content { visibility: hidden; }
.folio-header { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 20px; text-align: center; }
.folio-header h1 { font-size: clamp(31px, 3.5vw, 48px); font-weight: 400; line-height: 1.05; letter-spacing: -.045em; margin: 0; }
.folio-header h1 a { display: inline-block; }
.folio-subtitle { margin: 10px 0 0; color: var(--ink-soft); font-size: 16px; font-style: italic; letter-spacing: .025em; }
.folio-signature { justify-self: start; margin-top: 5px; font-style: italic; font-size: 25px; color: var(--ink-soft); transform: rotate(-7deg); }
.folio-number { justify-self: end; margin-top: 6px; font-family: var(--sans); font-size: 9px; letter-spacing: .12em; color: var(--ink-soft); }
.drawing-field { position: relative; flex: 1; min-height: 0; margin-top: 5px; }
.study { position: absolute; display: block; padding: 3px; mix-blend-mode: multiply; transition: filter 220ms ease; }
.study img { display: block; width: 100%; height: 100%; object-fit: contain; }
.inkflow-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.study--portrait { top: 6%; left: 34%; width: 32%; height: 84%; }
.study:hover { filter: contrast(1.06); }
.study:focus-visible { outline-style: dashed; outline-width: 1px; border-radius: 44% 45% 32% 34%; }
.study--missing { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--ink-faint); border-radius: 50%; font-size: 64px; font-style: italic; }
.drawing-slot { position: absolute; opacity: .5; border: 1px dashed #806d472f; border-radius: 48% 52% 43% 54%; pointer-events: none; transform: rotate(-9deg); }
.drawing-slot::before, .drawing-slot::after { content: ""; position: absolute; height: 1px; width: 12px; background: #806d4733; left: calc(50% - 6px); top: 50%; }
.drawing-slot::after { transform: rotate(90deg); }
.drawing-slot__center { position: absolute; width: 5px; height: 5px; border: 1px solid #806d4733; border-radius: 50%; left: calc(50% - 2px); top: calc(50% - 2px); }
:is(.drawing-slot--engineering, .study--engineering) { width: 22%; height: 28%; left: 5%; top: 11%; transform: rotate(-14deg); }
:is(.drawing-slot--movement, .study--movement) { width: 20%; height: 37%; right: 3%; top: 3%; transform: rotate(13deg); }
:is(.drawing-slot--cooking, .study--cooking) { width: 24%; height: 25%; left: 7%; bottom: 11%; transform: rotate(8deg); }
:is(.drawing-slot--art, .study--art) { width: 23%; height: 28%; right: 4%; bottom: 9%; transform: rotate(-6deg); }
.index-note { margin: -13px 0 22px; text-align: center; font-size: 15px; font-style: italic; letter-spacing: .025em; color: var(--ink-soft); }
.folio-footer { display: flex; justify-content: flex-end; margin-top: auto; color: var(--ink-soft); font-family: var(--sans); font-size: 9px; letter-spacing: .14em; }
.footer-rule { height: 1px; flex: 1; background: linear-gradient(90deg, var(--rule), #9d875816); }
.chapter-view { display: flex; flex: 1; flex-direction: column; min-height: 0; padding-top: clamp(0px, 3svh, 28px); }
.return-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--ink-soft); font-size: 14px; font-style: italic; }
.chapter-layout { display: grid; flex: 1; grid-template-columns: 1fr .9fr; grid-template-rows: minmax(0, 1fr); gap: clamp(16px, 5vw, 65px); align-items: center; min-height: 0; width: 100%; max-width: 900px; margin: 0 auto; padding-block: 14px; }
.chapter-copy { min-height: 0; max-height: 100%; overflow: auto; padding: 8px; }
.chapter-kicker { color: var(--ink-soft); font-family: var(--sans); text-transform: uppercase; font-size: 9px; letter-spacing: .22em; margin: 0 0 19px; }
.chapter-copy h2 { margin: 0 0 23px; font-weight: 400; font-size: clamp(40px, 5vw, 68px); letter-spacing: -.04em; }
.chapter-copy h2:focus { outline: 0; }
.chapter-copy p:not(.chapter-kicker) { font-size: 18px; line-height: 1.8; max-width: 47ch; }
.chapter-pending { font-style: italic; color: var(--ink-soft); }
.chapter-figure { display: flex; align-items: center; margin: 0; width: 100%; height: 100%; min-height: 0; max-width: 350px; mix-blend-mode: multiply; }
.chapter-figure img { display: block; width: 100%; height: 100%; object-fit: contain; }
.fold-grid { position: absolute; z-index: 3; inset: 0; perspective: 2400px; pointer-events: none; }
.fold-panel { position: absolute; width: var(--fold-size); height: var(--fold-size); transform-style: preserve-3d; }
.fold-face { position: absolute; inset: 0; transform: translateZ(var(--face-depth)); backface-visibility: visible; background-size: var(--sheet-width) var(--sheet-height); background-position: calc(-1 * var(--tile-x)) calc(-1 * var(--tile-y)); box-shadow: inset 0 1px #fff9e82f, inset 1px 0 #fff9e827, inset 0 -1px #8c745514, inset -1px 0 #8c745514, 0 2px 5px #6a503722; }
.noscript-anchor { display: block; }
html:not(.js) .chapter-view { border-top: 1px solid var(--rule); }
html:not(.js) .bench-controls { visibility: hidden; }

@media (min-width: 1500px) {
  .paper-content { padding-inline: 55px; }
}

@media (max-width: 800px) {
  .paper-content { padding: clamp(12px, 4svh, 30px) 28px clamp(12px, 3svh, 22px); }
  .study--portrait { left: 27%; width: 46%; height: 78%; top: 9%; }
  :is(.drawing-slot--engineering, .study--engineering) { left: 0; width: 23%; height: 24%; top: 11%; }
  :is(.drawing-slot--movement, .study--movement) { right: 0; width: 23%; height: 31%; top: 2%; }
  :is(.drawing-slot--cooking, .study--cooking) { left: 0; width: 25%; bottom: 6%; height: 22%; }
  :is(.drawing-slot--art, .study--art) { right: 0; width: 25%; bottom: 8%; height: 23%; }
  .chapter-layout { gap: 20px; }
  .folio-signature { font-size: 22px; }
}

@media (max-width: 520px) {
  :root { --sheet-gutter: 4px; }
  .bench-controls { top: 6px; right: 8px; font-size: 8px; letter-spacing: .09em; }
  .quiet-control { font-size: 10px; }
  .quiet-control span { margin-left: 5px; }
  .paper-content { padding: clamp(12px, 4svh, 29px) 20px clamp(12px, 3svh, 22px); }
  .folio-header { gap: 10px; grid-template-columns: 1fr auto 1fr; }
  .folio-header h1 { font-size: 32px; white-space: nowrap; }
  .folio-subtitle { font-size: 14px; margin-top: 8px; }
  .folio-signature { font-size: 15px; margin-top: 8px; }
  .folio-number { font-size: 7px; margin-top: 9px; letter-spacing: 0; }
  .drawing-field { margin-top: 12px; }
  .study--portrait { left: 12%; width: 76%; height: 77%; top: 10%; }
  .drawing-slot { opacity: .34; }
  :is(.drawing-slot--engineering, .study--engineering) { width: 29%; height: 13%; left: 0; top: 0; }
  :is(.drawing-slot--movement, .study--movement) { width: 23%; height: 19%; right: 0; top: 0; }
  :is(.drawing-slot--cooking, .study--cooking) { width: 32%; height: 14%; left: 0; bottom: 0; }
  :is(.drawing-slot--art, .study--art) { width: 29%; height: 15%; right: 0; bottom: 0; }
  .index-note { margin: 8px 0 25px; font-size: 13px; }
  .folio-footer { font-size: 8px; gap: 12px; }
  .bench-footer { font-size: 8px; margin: 15px 4px 0; letter-spacing: .08em; }
  .chapter-view { padding-top: 0; }
  .chapter-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 12px 0; }
  .chapter-kicker { margin-bottom: 10px; }
  .chapter-copy h2 { font-size: clamp(30px, 7svh, 45px); margin-bottom: 12px; }
  .chapter-copy p:not(.chapter-kicker) { font-size: 16px; }
  .chapter-figure { width: 75%; justify-self: center; max-width: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (max-width: 380px) {
  .folio-header { grid-template-columns: 1fr; }
  .folio-signature, .folio-number { display: none; }
}
