/* GRAFIT lecture family: typography, spacing and chrome follow VHS/p01.
   PGA alone uses the ochre course accent from tools/course-colors.cjs.
   Kept separate so the frozen v1 edition and original PDFs do not change. */
.presenting .slide[hidden]{display:none!important}
@media print{body.presenting .slide[hidden]{display:block!important}}
:root{--paper:#fcfbf8;--ink:#203039;--muted:#586973;--accent:#745c16;--line:#d9dfdf;--panel:#eef2f2;font-family:"Segoe UI",Arial,sans-serif}
html[data-theme=dark]{--paper:#151d23;--ink:#e5edf1;--muted:#afbec8;--accent:#dccb8a;--line:#384751;--panel:#223039}
body,body.presenting{font-family:"Segoe UI",Arial,sans-serif;font-size:16px;line-height:1.5}
body>header.toolbar{min-height:76px;padding:10px 4vw;gap:16px;position:sticky;top:0;z-index:20;font-size:14px}
.toolbar .brand{font-size:21px;font-weight:700;letter-spacing:.08em;text-decoration:none;white-space:nowrap}
.toolbar .lecture-label{font-size:13px;color:var(--muted)}
.toolbar nav{margin-left:auto;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.toolbar button,.toolbar .return-link{font:inherit;min-height:40px;border:1px solid var(--line);border-radius:5px;padding:9px 14px;background:transparent;text-decoration:none}
button:hover,.toolbar .return-link:hover{background:var(--panel)}
.toolbar details{position:relative}.toolbar summary{cursor:pointer;padding:9px 4px}.toolbar details>div{position:absolute;right:0;top:100%;min-width:230px;background:var(--paper);border:1px solid var(--line);padding:16px;box-shadow:0 8px 28px #0002}.toolbar details a{display:block;padding:8px 0}
main,body.presenting main{max-width:1600px;padding:0 5vw 90px}
h1{font-size:clamp(42px,5.4vw,78px);font-weight:600;line-height:1.12;letter-spacing:-.045em;max-width:1100px;margin:0 0 30px}
h2,.slide.brdf-topic>h2{font-size:clamp(30px,3.2vw,48px);font-weight:600;letter-spacing:-.035em;line-height:1.15;margin:0 0 30px;padding:0;background:none;color:var(--ink)}
h3{font-size:1em;font-weight:650;line-height:1.3;margin:0 0 10px}
.intro{padding:70px 0;font-size:clamp(20px,2vw,29px)}
.intro>p{max-width:1300px}.intro .notice{font-size:16px}
.slide,.presenting .slide{font-size:clamp(20px,2vw,29px);line-height:1.5;padding:70px 0;scroll-margin-top:110px;min-height:70vh}
.presenting .slide{padding:42px 0 38px;min-height:calc(100dvh - 160px)}
.slide>.content,.slide>.tutorial{max-width:1300px}
.content>div{min-width:0}.content.illustrated{gap:36px}
.eyebrow{font-size:15px;text-transform:uppercase;letter-spacing:.14em;margin:0 0 30px;color:var(--accent)}
li{margin-bottom:.55em}.slide li,.tutorial p{overflow-wrap:anywhere}figcaption,.comparison figcaption,.brdf-source-gallery figcaption{font-size:14px;line-height:1.5;color:var(--muted)}
.source{font-size:15px;color:var(--muted)}.source pre{color:var(--ink)}
.key-block{margin:20px 0;border-left-width:3px}.key-block>h3{font-size:1em;font-weight:650;padding:12px 22px}.key-block>p{font-size:1em;padding:16px 22px}
.brdf-equation{margin:20px 0;padding:16px 22px;border-left-width:3px}.brdf-equation>p{font:15px/1.5 "Segoe UI",Arial,sans-serif;color:var(--muted)}
.tex-equation{font-size:clamp(20px,2vw,29px);padding:18px 0;max-width:100%;overflow:auto;overflow-wrap:normal;overscroll-behavior-inline:contain}
.tex-equation .katex-display{margin:.35em 0;text-align:left}.tex-equation .katex-display>.katex{text-align:left;white-space:nowrap}
.brdf-equation .tex-equation{font-size:clamp(20px,2vw,29px);padding:6px 0;margin:0}
.tutorial,.lab{padding:24px 0;margin:30px 0}.presenting .tutorial{font-size:inherit}
table{font-size:.88em;line-height:1.4}th,td{padding:16px 18px}th{background:var(--panel)}td:first-child{font-weight:600}
body>footer{height:70px;padding:0 4vw;justify-content:space-between;gap:16px;font-size:13px;color:var(--muted);z-index:20}
.pager{display:flex;align-items:center;gap:14px}.pager button{font-size:22px;padding:3px 16px;min-height:40px}.pager output{min-width:68px;text-align:center;font-variant-numeric:tabular-nums}
.progress{position:fixed;bottom:0;left:0;height:3px;background:var(--accent);width:0;z-index:25;transition:width .15s}
@media(max-width:1100px),(max-height:760px){.slide,.presenting .slide{font-size:23px;padding:32px 0}h2,.slide.brdf-topic>h2{font-size:36px;margin-bottom:22px}.key-block>h3{padding:10px 18px}.key-block>p{padding:12px 18px}}
@media(max-width:760px){body>header.toolbar{gap:9px;padding:10px 16px;position:static}.toolbar .lecture-label{display:none}.toolbar nav{margin-left:0;width:100%;gap:6px}.toolbar button,.toolbar .return-link{padding:8px 10px}.toolbar .brand{margin-left:auto}.toolbar details{margin-left:auto}main,body.presenting main{padding-inline:22px}.slide,.presenting .slide{font-size:20px;padding:35px 0;min-height:0;scroll-margin-top:15px}h2,.slide.brdf-topic>h2{font-size:30px}.intro{padding:40px 0}.content.illustrated{grid-template-columns:1fr}.key-block>h3,.key-block>p{font-size:20px}.tex-equation,.brdf-equation .tex-equation{font-size:20px}.brdf-equation{padding:12px}.eyebrow{font-size:13px}body>footer{height:64px;padding:0 16px;flex-wrap:nowrap}.footer-hint,footer>a{display:none}.pager{margin:auto}.controls label{min-width:0}.brdf-visual svg text{font-family:"Segoe UI",Arial,sans-serif}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.progress{transition:none}}
/* Related formulae share a row; keep the original TeX size and reading order. */
.presenting:has(#whitted-recursion) .slide:is(#slide-20,#whitted-recursion){padding-block:24px;line-height:1.4}
.presenting:has(#whitted-recursion) .slide:is(#slide-20,#whitted-recursion)>.eyebrow{margin-bottom:12px}
.presenting:has(#whitted-recursion) .slide:is(#slide-20,#whitted-recursion)>h2{margin-bottom:18px}
.presenting:has(#whitted-recursion) .slide:is(#slide-20,#whitted-recursion) li{margin-bottom:.3em}
.presenting:has(#whitted-recursion) .slide:is(#slide-20,#whitted-recursion)>.key-block,.presenting:has(#whitted-recursion) .slide:is(#slide-20,#whitted-recursion)>.brdf-references{margin-block:12px}
@media(min-width:1101px){.presenting:has(#whitted-recursion) .slide:is(#slide-20,#whitted-recursion)>.key-block{display:flex;align-items:stretch}.presenting:has(#whitted-recursion) .slide:is(#slide-20,#whitted-recursion)>.key-block>h3{display:flex;align-items:center;flex:0 0 220px;padding-block:8px}.presenting:has(#whitted-recursion) .slide:is(#slide-20,#whitted-recursion)>.key-block>p{flex:1;min-width:0;padding-block:10px}}
.brdf-equations{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:18px;align-items:stretch;margin-block:18px}
.brdf-equations>.brdf-equation{min-width:0;margin:0;padding:12px 18px}
.brdf-equations .tex-equation{padding-block:0}
.brdf-equations .katex-display{margin-block:.15em}
.presenting .slide:has(.brdf-equations){padding-block:24px;line-height:1.4}
.presenting .slide:has(.brdf-equations)>.eyebrow{margin-bottom:12px}
.presenting .slide:has(.brdf-equations)>h2{margin-bottom:18px}
.presenting .slide:has(.brdf-equations) li{margin-bottom:.3em}
.presenting .slide:has(.brdf-equations)>.key-block{margin-block:12px}
.presenting .slide:has(.brdf-equations)>.key-block>h3{padding-block:8px}
.presenting .slide:has(.brdf-equations)>.key-block>p{padding-block:10px}
.presenting .slide:has(.brdf-equations)>.brdf-references{margin-block:12px}
@media(min-width:761px) and (max-height:820px){.presenting .slide:has(.brdf-equations){padding-block:16px}.presenting .slide:has(.brdf-equations)>.eyebrow{margin-bottom:8px}.presenting .slide:has(.brdf-equations)>h2{margin-bottom:12px}.presenting .brdf-equations{margin-block:12px}}
@media(min-width:1101px){.presenting .slide:has(.brdf-equations)>.key-block{display:flex;align-items:stretch}.presenting .slide:has(.brdf-equations)>.key-block>h3{display:flex;align-items:center;flex:0 0 220px}.presenting .slide:has(.brdf-equations)>.key-block>p{flex:1;min-width:0}}
@media(max-width:760px){.brdf-equations{grid-template-columns:1fr;gap:12px}.presenting .slide:has(.brdf-equations){padding-block:30px}}
@media print{@page{size:A4 landscape;margin:12mm}body,body.presenting{background:white;color:black;font-size:18px}body>header,body>footer,.progress{display:none!important}main,body.presenting main{padding:0;max-width:none}.slide,.presenting .slide{font-size:18px;min-height:0;padding:12px 0}.slide.brdf-topic>h2,h2{font-size:30px}h1{font-size:48px}.key-block>h3,.key-block>p{font-size:18px}.tex-equation,.brdf-equation .tex-equation{font-size:20px;overflow:visible}.slide.brdf-topic>h2{color:black}.intro{font-size:18px}.comparison img{max-height:90mm}.presenting .tutorial{font-size:18px}}
