/* Markdown reader MKD-09. Instrument Sheet chassis, accent #2F5E4E (spruce). */
:root{
  --paper:#EDE9E2;
  --ink:#1E1D1B;
  --panel:#DEDACF;
  --line:#B7B0A2;
  --chassis:#2A2924;
  --accent:#2F5E4E;
  --on-accent:#EDE9E2;      /* paper type on the spruce desk, both schemes */
  --hair:rgba(237,233,226,.28);
  --font-ui:"Familjen Grotesk",system-ui,sans-serif;
  --font-spec:"Martian Mono",ui-monospace,monospace;
  --ease:cubic-bezier(.2,.8,.2,1);
  --settle:cubic-bezier(.34,1.4,.4,1);
  --slide:.3s;
}
@media (prefers-color-scheme:dark){
  :root{--paper:#1E1D1B;--ink:#EDE9E2;--panel:#2A2924;--line:#4A473F;--chassis:#111}
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--font-ui);font-size:1rem;line-height:1.55;overflow-x:hidden}
a{color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
button{font:inherit;color:inherit}
h1,h2,h3,p,dl,dd,dt,ol,ul,figure,pre,fieldset,blockquote{margin:0}
ol,ul{padding:0;list-style:none}
[hidden]{display:none!important}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* label strip */
.strip{max-width:1120px;margin:0 auto;padding:18px 32px 0;display:flex;justify-content:space-between;align-items:baseline;font-family:var(--font-spec);font-size:.75rem;font-weight:500;letter-spacing:.02em;border-bottom:1px solid var(--line)}
.strip-maker{text-decoration:none;padding-bottom:12px}
.strip-maker:hover{text-decoration:underline;text-underline-offset:3px}
.strip-code{padding-bottom:12px}

/* page */
.wrap{max-width:1120px;margin:0 auto;padding:40px 32px 0}
.title{font-size:4.5rem;font-weight:600;line-height:1;letter-spacing:-.01em;margin-bottom:16px}
.lede{font-size:1.125rem;max-width:60ch;margin-bottom:24px}
.lede strong{font-weight:600}
.section-head{font-size:2rem;font-weight:600;line-height:1.1;margin:0 0 14px}

/* controls: the desk's top rail, on paper */
.controls{display:flex;justify-content:space-between;align-items:flex-end;flex-wrap:wrap;gap:12px;margin-bottom:12px}
.modes{display:flex;border:1px solid var(--ink)}
.mode{padding:11px 18px;border:0;border-right:1px solid var(--ink);background:var(--paper);color:var(--ink);font-weight:500;line-height:1.2;cursor:pointer;border-radius:0}
.mode:last-child{border-right:0}
.mode:hover{background:var(--panel)}
.mode[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
.mode:focus-visible{outline-offset:-3px;outline-color:var(--accent)}
.actions{display:flex;flex-wrap:wrap;gap:10px}
.btn{position:relative;display:inline-block;padding:11px 16px;border:1px solid var(--ink);background:var(--paper);color:var(--ink);font-weight:500;line-height:1.2;cursor:pointer;border-radius:0;text-decoration:none}
.btn:hover{background:var(--panel)}
.btn:disabled{opacity:.45;cursor:default}
.btn:disabled:hover{background:var(--paper)}
.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.btn-primary:hover{background:var(--accent)}
.btn-primary.is-done{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.btn-primary .ticks{position:absolute;inset:0;pointer-events:none}
.btn-primary::before,.btn-primary::after,.btn-primary .ticks::before,.btn-primary .ticks::after{content:"";position:absolute;width:14px;height:14px;border:0 solid var(--accent);opacity:0;pointer-events:none}
.btn-primary::before{top:-6px;left:-6px;border-top-width:1px;border-left-width:1px}
.btn-primary::after{top:-6px;right:-6px;border-top-width:1px;border-right-width:1px}
.btn-primary .ticks::before{bottom:-6px;left:-6px;border-bottom-width:1px;border-left-width:1px}
.btn-primary .ticks::after{bottom:-6px;right:-6px;border-bottom-width:1px;border-right-width:1px}
.btn-primary:hover::before,.btn-primary:hover::after,.btn-primary:hover .ticks::before,.btn-primary:hover .ticks::after,
.btn-primary:focus-visible::before,.btn-primary:focus-visible::after,.btn-primary:focus-visible .ticks::before,.btn-primary:focus-visible .ticks::after{opacity:1}
.btn-primary:focus-visible{outline-color:var(--accent);outline-offset:4px}

/* the spruce desk: the one accent shape */
.desk{position:relative;background:var(--accent);color:var(--on-accent);padding:32px 40px 40px;min-height:520px}
.desk::before,.desk::after,.desk>.ticks::before,.desk>.ticks::after{content:"";position:absolute;width:14px;height:14px;border:0 solid var(--on-accent);pointer-events:none;z-index:3}
.desk::before{top:0;left:0;border-top-width:1px;border-left-width:1px}
.desk::after{top:0;right:0;border-top-width:1px;border-right-width:1px}
.desk>.ticks::before{bottom:0;left:0;border-bottom-width:1px;border-left-width:1px}
.desk>.ticks::after{bottom:0;right:0;border-bottom-width:1px;border-right-width:1px}
.desk.is-drag{outline:2px solid var(--on-accent);outline-offset:-10px}
.drop-hint{position:absolute;inset:0;display:none;align-items:center;justify-content:center;font-size:2rem;font-weight:600;background:var(--accent);z-index:4;pointer-events:none}
.desk.is-drag .drop-hint{display:flex}

/* desk top: the document tag and the readout */
.desk-top{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;flex-wrap:wrap;margin-bottom:22px;padding-bottom:18px;border-bottom:1px solid var(--hair)}
.doc{min-width:0;flex:1 1 320px}
.doc-title{font-size:clamp(1.5rem,2.6vw,2.125rem);font-weight:600;line-height:1.1;letter-spacing:-.01em;overflow-wrap:anywhere}
.doc-meta{font-size:.9375rem;margin-top:6px;opacity:.85}
.readout{display:flex;align-items:baseline;gap:0 .35em;line-height:1;flex-wrap:wrap;justify-content:flex-end}
.read-big{font-size:clamp(3.5rem,8vw,6.5rem);font-weight:600;letter-spacing:-.04em;font-variant-numeric:tabular-nums;display:inline-block}
.read-big.is-roll{animation:roll .26s var(--ease) both}
@keyframes roll{0%{transform:translateY(.22em);opacity:.4}100%{transform:none;opacity:1}}
.read-unit{font-size:clamp(1.25rem,2.4vw,1.75rem);font-weight:600;letter-spacing:-.01em}
.read-sub{font-size:1rem;font-weight:500;flex-basis:100%;text-align:right;margin-top:8px;opacity:.9}

/* the surface: rail, editor, sheet */
.surface{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:24px;align-items:start}
.rail{grid-column:span 3;position:sticky;top:16px;min-width:0;padding-left:18px}
.rail-head{font-size:1.125rem;font-weight:600;margin-bottom:10px;line-height:1.2}
.rail-empty{font-size:.9375rem;opacity:.8;max-width:26ch}
.toc li{margin:0;transform:translateX(-12px);opacity:0}
.desk.is-reader .toc li{transform:none;opacity:1;transition:transform .22s var(--settle),opacity .18s linear;transition-delay:calc(var(--i,0)*28ms)}
.toc button{display:block;width:100%;text-align:left;background:none;border:0;padding:5px 0;color:var(--on-accent);font-size:.9375rem;line-height:1.3;cursor:pointer;border-radius:0;opacity:.82;overflow-wrap:anywhere}
.toc button:hover{opacity:1;text-decoration:underline;text-underline-offset:3px}
.toc button:focus-visible{outline-color:var(--on-accent);outline-offset:1px}
.toc li.is-active button{opacity:1;font-weight:600}
.toc li[data-level="2"] button{padding-left:12px}
.toc li[data-level="3"] button{padding-left:24px}
.toc li[data-level="4"] button,.toc li[data-level="5"] button,.toc li[data-level="6"] button{padding-left:36px}
.bookmark{position:absolute;left:0;top:0;width:8px;height:22px;background:var(--on-accent);opacity:0;transition:top .28s var(--settle),opacity .18s linear;pointer-events:none}
.bookmark::after{content:"";position:absolute;left:0;bottom:-6px;border-left:4px solid var(--on-accent);border-right:4px solid var(--on-accent);border-bottom:6px solid transparent}
.bookmark.is-on{opacity:1}

.editor-wrap{grid-column:span 12;min-width:0;display:none}
.editor{display:block;width:100%;min-height:62vh;height:62vh;resize:vertical;font-family:var(--font-spec);font-size:.8125rem;line-height:1.7;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-radius:0;padding:22px 24px;tab-size:2;color-scheme:normal}
.editor::placeholder{color:var(--ink);opacity:.45}
.editor:focus-visible{outline:2px solid var(--on-accent);outline-offset:2px}

.sheet{grid-column:span 9;min-width:0;background:var(--paper);color:var(--ink);padding:48px 56px 64px;min-height:420px;transform:translateX(28px);opacity:0}
.desk.is-reader .sheet.is-in,.desk[data-mode="split"] .sheet{transform:none;opacity:1}
.desk.is-reader .sheet{transition:transform var(--slide) var(--settle),opacity .22s linear}

/* modes */
.desk[data-mode="split"] .rail{display:none}
.desk[data-mode="split"] .editor-wrap{display:block;grid-column:span 6}
.desk[data-mode="split"] .sheet{grid-column:span 6;padding:32px 36px 48px;height:62vh;min-height:62vh;overflow:auto;overscroll-behavior:contain}
.desk[data-mode="editor"] .rail,.desk[data-mode="editor"] .sheet{display:none}
.desk[data-mode="editor"] .editor-wrap{display:block}

/* the prose on the sheet */
.prose{max-width:68ch;font-size:1.0625rem;line-height:1.65}
.prose>*+*{margin-top:1em}
.prose h1,.prose h2,.prose h3,.prose h4,.prose h5,.prose h6{font-weight:600;line-height:1.15;letter-spacing:-.01em;scroll-margin-top:16px}
.prose h1{font-size:2.5rem;letter-spacing:-.02em}
.prose h2{font-size:1.75rem;margin-top:1.6em;padding-top:.6em;border-top:1px solid var(--line)}
.prose h3{font-size:1.3125rem;margin-top:1.4em}
.prose h4{font-size:1.0625rem}
.prose h5,.prose h6{font-size:1rem}
.prose h1+*,.prose h2+*,.prose h3+*,.prose h4+*{margin-top:.6em}
.prose p{overflow-wrap:anywhere}
.prose a{text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--accent)}
.prose a:hover{color:var(--accent)}
.prose strong{font-weight:600}
.prose code{font-family:var(--font-spec);font-size:.78em;background:var(--panel);padding:.1em .35em;overflow-wrap:anywhere}
.prose pre{font-family:var(--font-spec);font-size:.8125rem;line-height:1.6;background:var(--panel);border:1px solid var(--line);padding:16px 18px;overflow:auto;tab-size:2}
.prose pre code{background:none;padding:0;font-size:inherit}
.prose pre.raw-html{border-color:var(--accent)}
.prose blockquote{border-left:3px solid var(--accent);padding:2px 0 2px 20px;opacity:.92}
.prose blockquote>*+*{margin-top:.75em}
.prose ul,.prose ol{padding-left:1.5em}
.prose ul{list-style:disc}
.prose ol{list-style:decimal}
.prose li{margin-top:.3em}
.prose li>ul,.prose li>ol{margin-top:.3em}
.prose ul.tasks{list-style:none;padding-left:.25em}
.prose li.task input{width:16px;height:16px;margin:0 .45em 0 0;vertical-align:-2px;accent-color:var(--accent)}
.prose li.task.is-done{opacity:.7}
.prose table{border-collapse:collapse;width:100%;font-size:.9375rem;display:block;overflow-x:auto}
.prose th,.prose td{border:1px solid var(--line);padding:8px 12px;text-align:left;vertical-align:top}
.prose th{font-weight:600;background:var(--panel)}
.prose .al-center{text-align:center}
.prose .al-right{text-align:right}
.prose hr{border:0;border-top:1px solid var(--line);margin:2em 0}
.prose hr+h2{border-top:0;padding-top:0;margin-top:1.2em}
.prose img{max-width:100%;height:auto;display:block;border:1px solid var(--line)}
.prose del{opacity:.6}
.prose .empty{opacity:.6;font-size:1.25rem;font-weight:500;max-width:30ch}

/* reading line */
.reading{font-family:var(--font-spec);font-size:.75rem;font-weight:500;letter-spacing:.02em;white-space:pre;margin:12px 0 0}
.note-url{font-size:.9375rem;margin-top:8px;opacity:.85}

/* under the desk: library left, notes right */
.under{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:24px 32px;margin-top:40px;align-items:start}
.library{grid-column:span 7;min-width:0}
.side{grid-column:span 5;min-width:0}
.lib-top{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:6px}
.lib-top .section-head{margin-bottom:0}
.lib-actions{display:flex;gap:8px;flex-wrap:wrap}
.lib-actions .btn{padding:8px 12px;font-size:.9375rem}
.lib li{border-bottom:1px solid var(--line)}
.lib li:first-child{border-top:1px solid var(--ink)}
.lib button{display:flex;width:100%;justify-content:space-between;align-items:baseline;gap:16px;background:none;border:0;padding:12px 0;text-align:left;cursor:pointer;border-radius:0;font-size:1rem;color:var(--ink)}
.lib button:hover .lib-title{text-decoration:underline;text-underline-offset:3px}
.lib li.is-current button{font-weight:600}
.lib li.is-current .lib-title::before{content:"";display:inline-block;width:8px;height:14px;background:var(--accent);margin-right:10px;vertical-align:-1px}
.lib-title{min-width:0;overflow-wrap:anywhere}
.lib-meta{font-family:var(--font-spec);font-size:.6875rem;letter-spacing:.02em;white-space:nowrap;opacity:.8}
.lib-note{font-size:.9375rem;margin-top:14px;max-width:60ch;opacity:.85}
.panel{position:relative;border:1px solid var(--line);background:var(--panel);padding:24px 28px 28px;display:grid;gap:24px}
.panel-head{font-size:1.125rem;font-weight:500;margin-bottom:8px;line-height:1.3}
.field-note{font-size:.9375rem;opacity:.9}
.keys div{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid var(--line);font-size:.9375rem}
.keys div:last-child{border-bottom:0}
.keys dt{font-weight:500}
.keys dd{text-align:right}

/* notes */
.notes{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));margin-top:48px}
.notes>*{grid-column:span 8}
.notes p{max-width:68ch;margin-bottom:14px}
.notes .section-head{margin-top:14px}

.foot{max-width:1120px;margin:0 auto;padding:20px 32px 40px;font-size:.875rem;opacity:.8}
.foot p{max-width:70ch}

/* narrow screens */
@media (max-width:1000px){
  .surface{grid-template-columns:1fr;gap:20px}
  .rail{grid-column:span 1;position:relative;top:auto}
  .sheet,.desk[data-mode="split"] .sheet,.desk[data-mode="split"] .editor-wrap{grid-column:span 1}
  .desk[data-mode="split"] .editor{height:40vh;min-height:40vh}
  .desk[data-mode="split"] .sheet{height:auto;min-height:0;max-height:60vh}
  .under{grid-template-columns:1fr}
  .library,.side{grid-column:span 1}
  .notes>*{grid-column:span 12}
}
@media (max-width:640px){
  .strip{padding:14px 16px 0}
  .wrap{padding:28px 16px 0}
  .title{font-size:2.75rem}
  .lede{font-size:1rem}
  .controls{flex-direction:column;align-items:stretch}
  .modes{width:100%}
  .mode{flex:1;padding:11px 8px;text-align:center}
  .actions .btn{flex:1 1 auto;text-align:center;padding:11px 10px}
  .desk{padding:20px 14px 24px;min-height:0}
  .desk-top{margin-bottom:16px;padding-bottom:14px}
  .readout{justify-content:flex-start}
  .read-sub{text-align:left}
  .sheet,.desk[data-mode="split"] .sheet{padding:24px 18px 32px}
  .prose{font-size:1rem}
  .prose h1{font-size:2rem}
  .prose h2{font-size:1.5rem}
  .prose pre{padding:12px 14px}
  .editor{padding:14px}
  .section-head{font-size:1.625rem}
  .panel{padding:20px 16px 22px;gap:20px}
  .reading{white-space:pre-wrap;overflow-wrap:anywhere}
  .foot{padding:16px 16px 32px}
}

@media print{
  .strip,.title,.lede,.controls,.desk-top,.rail,.editor-wrap,.drop-hint,.reading,.note-url,.under,.notes,#funnel,.foot,.desk>.ticks{display:none!important}
  body{background:#fff;color:#000}
  .wrap{max-width:none;padding:0}
  .desk{background:none;padding:0;min-height:0;color:#000}
  .desk::before,.desk::after{display:none}
  .surface{display:block}
  .sheet{display:block!important;padding:0;height:auto!important;min-height:0;max-height:none!important;overflow:visible!important;transform:none!important;opacity:1!important;background:none;color:#000}
  .prose{max-width:none}
  .prose a{color:#000}
  .prose pre,.prose code,.prose th{background:none}
}

@media (prefers-reduced-motion:reduce){
  *{transition:none!important;animation:none!important}
  .sheet,.toc li{transform:none!important;opacity:1!important}
}
