/* thesis.css — what the MSc thesis page and the PhD page (phd-thesis.html) share: the Work page's surfaces (black and ivory), type
   (Figtree headlines, mono labels) and brass, the header, the rail and the title screen. On the MSc page the story has its own
   sheets, its sheets have msc-figures.css, and the figures have theirs (msc-*.css). */
:root{
  --black:#0b100e;--ink:#11100f;--ivory:#f1ece0;--muted-b:#a7a69c;--muted-i:#66625b;--line-i:rgba(241,236,224,.22);--line-k:rgba(17,16,15,.16);
  --brass:#b48a3a;--brass-hi:#d4ad62;--brass-glow:rgba(180,138,58,.55);--sheet:#e6e0cf;--sheet2:#d9d3c2;--forest:#1f3b2d;
  --sans:Figtree,sans-serif;--mono:'JetBrains Mono',monospace;
  --reveal:.8s;--ui:cubic-bezier(.4,0,.2,1);--phys:cubic-bezier(.16,1,.3,1);
  --pad:clamp(1.25rem,2.65vw,3rem);
}
/* The seven medicine classes, one palette for the whole page (var(--cls-<kind in lower case, non-letters as '-'>)). Stepped for
   the black sections (at least 3:1 on #0b100e) and darker under the ivory ones (at least 3:1 on #f1ece0). A class is never shown
   by colour alone: names and legends carry it too. */
:root,section.black{--cls-non-opioid-analgesic:#b7893b;--cls-opioid:#c45e3d;--cls-adjuvant:#749742;--cls-sedative:#8379ca;--cls-antiemetic:#279c94;--cls-supplement:#bc668e;--cls-vaccine:#4086bd}
section.ivory{--cls-non-opioid-analgesic:#976b15;--cls-opioid:#a94524;--cls-adjuvant:#55751d;--cls-sedative:#6154a8;--cls-antiemetic:#007b74;--cls-supplement:#9f4471;--cls-vaccine:#0f68a2}
/* The three dose tiers, one palette for the whole page: low, standard, high (as msc-bottles.js, msc-survival.js and the syringe draw
   them). Never by colour alone: the name, and where there is room the range, stands with the mark. */
:root,section.black{--t-low:#7cc3b8;--t-standard:#f1ece0;--t-high:#d4ad62}
section.ivory{--t-low:#23756c;--t-standard:#11100f;--t-high:#a3782a}

html{background:var(--black);scroll-behavior:smooth}
body{margin:0;background:var(--black);color:var(--ivory);font-family:var(--mono);-webkit-font-smoothing:antialiased;overflow-x:clip}
a{color:inherit}
[hidden]{display:none!important}
.vh{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
::selection{background:rgba(180,138,58,.45)}


/* ---------- surfaces and the shared vocabulary of the Work page ---------- */
section{position:relative;box-sizing:border-box;padding:calc(var(--pad) + 88px) var(--pad) calc(var(--pad) + 56px);overflow:hidden}
section.black{background:var(--black);color:var(--ivory)}
section.ivory{background:var(--ivory);color:var(--ink)}
section.black+section.black{border-top:1px solid rgba(241,236,224,.1)}
.corner{position:absolute;z-index:3;font-size:clamp(.69rem,.8vw,.81rem);letter-spacing:.06em;line-height:1.5}
.tl{top:calc(var(--pad) + 44px);left:var(--pad)}
.tr{top:calc(var(--pad) + 44px);right:var(--pad)}
section.black .corner{color:var(--muted-b)}
section.ivory .corner{color:var(--muted-i)}
.h-poster{margin:0;font-family:var(--sans);font-weight:700;line-height:.94;letter-spacing:-.05em}
.h-poster em{font-style:normal;color:var(--brass)}
[data-gate]{opacity:0;transform:translateY(18px);transition:opacity var(--reveal) cubic-bezier(.215,.61,.355,1),transform var(--reveal) cubic-bezier(.215,.61,.355,1)}
[data-gate="x"]{transform:translateX(-40px);transition-duration:var(--reveal),1.1s;transition-timing-function:cubic-bezier(.215,.61,.355,1),var(--phys)}
[data-gate].reached{opacity:1;transform:none}
.pc-tag{font-size:10px;letter-spacing:.14em;color:var(--muted-i);margin-bottom:10px}
section.black .pc-tag{color:var(--muted-b)}
.ulink{display:inline-flex;gap:8px;padding-bottom:4px;border-bottom:1px solid currentColor;text-decoration:none;transition:color .3s var(--ui)}
.ulink:hover{color:var(--brass)}
.ulink:focus-visible{outline:2px solid var(--brass);outline-offset:3px}

/* ---------- header (as on the Work page; ink over the ivory sections) ---------- */
.whead{position:fixed;top:0;left:0;right:0;z-index:60;display:flex;justify-content:space-between;align-items:center;padding:20px var(--pad);color:#fff;pointer-events:none;font-size:11.5px;letter-spacing:.12em;transition:color .35s ease,background-color .35s ease}
.whead.on-ivory{color:var(--ink);background:var(--ivory);box-shadow:0 1px 0 rgba(31,59,45,.14);pointer-events:auto}   /* the rows and the plates pass under it */
.whead a{pointer-events:auto;text-decoration:none;color:inherit;position:relative;padding-bottom:3px}
.whead a::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:currentColor;transform:scaleX(0);transform-origin:right;transition:transform .42s var(--ui)}
.whead a:hover::after{transform:scaleX(1);transform-origin:left}
.whead .mark{font-family:var(--sans);font-weight:700;font-size:22px;letter-spacing:-.04em}
.whead nav{display:flex;align-items:center;gap:28px}
.whead button{pointer-events:auto}

/* ---------- the rail: a brass line that fills as the reader moves through the chapters ---------- */
.rail{position:fixed;left:calc(var(--pad) * .45);top:22vh;bottom:22vh;z-index:40;width:2px;background:rgba(127,127,120,.25);pointer-events:none;opacity:0;transition:opacity .4s}
.rail.on{opacity:1}
.rail-fill{position:absolute;left:0;top:0;width:100%;height:100%;background:var(--brass);transform-origin:50% 0;transform:scaleY(var(--p,0));box-shadow:0 0 8px var(--brass-glow)}

/* ---------- the title ---------- */
.t-hero{min-height:100svh;display:flex;flex-direction:column;justify-content:center}
.t-hero-in{width:100%;max-width:1280px;margin:0 auto}
.t-kick{margin:0;font-size:12px;letter-spacing:.14em;color:var(--brass-hi)}
.t-title{margin:clamp(18px,3vh,30px) 0 0;max-width:22ch;font:700 clamp(36px,6vw,100px)/.97 var(--sans);letter-spacing:-.045em;text-wrap:balance}
.t-title .w{display:inline-block;opacity:0;transform:translateX(-.6em);transition:opacity .9s cubic-bezier(.215,.61,.355,1),transform 1.2s var(--phys);transition-delay:calc(var(--i) * 42ms + .15s)}
.t-title.reached .w{opacity:1;transform:none}
.t-down{position:absolute;z-index:2;left:50%;bottom:calc(var(--pad) + 6px);width:40px;height:76px;margin-left:-20px;display:flex;justify-content:center;color:var(--muted-b);transition:color .3s}
.t-down i{position:relative;display:block;width:1px;height:calc(100% - 4px);background:rgba(241,236,224,.22);overflow:hidden}
.t-down i::before{content:"";position:absolute;left:0;top:0;width:1px;height:40%;background:var(--brass-hi);animation:t-drip 2.6s var(--phys) infinite}
.t-down::after{content:"";position:absolute;left:50%;bottom:2px;width:7px;height:7px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:translateX(-50%) rotate(45deg)}
.t-down:hover,.t-down:focus-visible{color:var(--brass-hi)}
.t-down:focus-visible{outline:2px solid var(--brass);outline-offset:6px}
@keyframes t-drip{0%{transform:translateY(-100%)}70%,100%{transform:translateY(260%)}}

/* ---------- headings and the lines under them ---------- */
.t-head{position:relative;z-index:2;max-width:1280px;margin:0 auto}
.t-h{margin:0;max-width:24ch;font:700 clamp(30px,3.6vw,56px)/1.02 var(--sans);letter-spacing:-.04em;text-wrap:balance}
.t-lede{margin:18px 0 0;max-width:58ch;font:400 17px/1.55 var(--sans)}
section.black .t-lede{color:#d6d2c6}
section.ivory .t-lede{color:#3f3c37}
.t-note{margin:16px 0 0;max-width:64ch;font:400 12px/1.6 var(--mono);letter-spacing:.02em;color:var(--muted-b)}
section.ivory .t-note{color:var(--muted-i)}

/* ---------- the foot ---------- */
.t-foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;padding:22px var(--pad);font-size:11px;letter-spacing:.06em;color:var(--muted-b);background:var(--black)}

/* ---------- the PhD page (phd-thesis.html) shares this sheet: one black title screen ---------- */
.t-intro{min-height:100svh;display:flex;flex-direction:column;justify-content:center}
.t-intro>:not(.corner){width:100%;max-width:1280px;margin-left:auto;margin-right:auto}
.t-poster{font-size:clamp(64px,13vw,200px)}

/* ---------- smaller screens ---------- */
@media (max-width:699.98px){
  section{padding:calc(var(--pad) + 76px) var(--pad) calc(var(--pad) + 40px)}
  .whead nav{gap:14px;font-size:10px}
  .whead nav a:nth-child(n+2):not(:last-child){display:none}
  .rail{display:none}
  .t-lede{font-size:16px}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
  html{scroll-behavior:auto}
  [data-gate]{opacity:1!important;transform:none!important}
}
@media (scripting:none){[data-gate]{opacity:1;transform:none}.whead{position:absolute}}   /* no script: the header stays on the title screen */
@media print{[data-gate]{opacity:1;transform:none}.whead,.rail{display:none}}
html[data-motion="subtle"] .t-down i::before{animation:none;opacity:0}
html[data-motion="subtle"]{scroll-behavior:auto}
