/* board.css — the index overlay and its board of tiles, on every page. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media (hover:none){a,button{touch-action:manipulation}}
@keyframes fadeUp{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:none}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.site-menu{--forest:#1f3b2d;--brass:#b48a3a;--brass-text:#8f6b22;--ink:#1a1d1b;--muted:#5c5f5a;--hair:rgba(31,59,45,.18);--cream:#cdbf9a;--serif:Figtree,sans-serif;--sans:Figtree,sans-serif;--mono:'JetBrains Mono',monospace;--ease:cubic-bezier(.2,.7,.2,1)}
[hidden].site-menu{display:none!important}
.site-menu{position:fixed;inset:0;z-index:100;background:var(--forest);color:#ffffff;overflow:auto;animation:fadeIn .35s ease both}
.menu-inner{max-width:1280px;margin:0 auto;padding:12px clamp(20px,4vw,48px) 64px}
.menu-head{display:flex;justify-content:space-between;align-items:center;height:48px}
.menu-kicker{font-family:var(--mono);font-size:12px;letter-spacing:.14em;color:var(--cream)}
.menu-close{appearance:none;background:none;border:1px solid rgba(255,255,255,.5);padding:10px 14px;font-family:var(--mono);font-size:12px;letter-spacing:.08em;color:#ffffff;cursor:pointer;transition:background .25s,color .25s}
.menu-close:hover{background:#ffffff;color:var(--forest)}
.menu-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:0 56px;margin-top:40px}
.menu-link{display:flex;align-items:baseline;gap:18px;padding:14px 0;border-bottom:1px solid rgba(255,255,255,.18);text-decoration:none;color:#ffffff;animation:fadeUp .6s cubic-bezier(.2,.7,.2,1) both;transition:color .25s}
.menu-link:hover{color:var(--cream)}
.menu-num{font-family:var(--mono);font-size:12px;color:var(--cream)}
.menu-label{font-family:var(--serif);font-weight:500;font-size:clamp(30px,4vw,46px);line-height:1}
.menu-kicker-pages{margin-top:36px}
.menu-grid-pages{margin-top:10px}
.menu-link-page .menu-label{font-size:clamp(26px,3.2vw,38px)}
.menu-sub{margin-left:auto;font-family:var(--mono);font-size:11px;color:var(--cream);text-align:right;max-width:46%;line-height:1.4}
.menu-profiles{display:flex;flex-wrap:wrap;gap:14px 26px;margin-top:48px;font-family:var(--mono);font-size:12px}
.menu-profile{color:#ffffff;text-decoration:none;border-bottom:1px solid var(--brass);padding-bottom:3px}
.menu-profile:hover{color:var(--cream)}
.menu-link-page{cursor:pointer}
.menu-link-page:hover .menu-label{text-decoration:underline;text-decoration-color:var(--brass);text-underline-offset:6px;text-decoration-thickness:1px}
html[data-moves] .site-menu{z-index:9000}

/* board.js — the index overlay as a wall of colour tiles. All of it hangs off [data-board], which menu.js sets, so the
 * overlay stays as it was if the script does not run. [data-live] adds the motion; calm visitors never get it. */

/* ---------- The board: a wall of six tiles and a quiet column ---------- */
html[data-moves] .site-menu[data-board]{--gap:6px;--pad:clamp(16px,1.9vw,30px);--panel:clamp(256px,21vw,340px);--label:clamp(44px,5.1vw,112px);--sub:48px;--snap:cubic-bezier(.16,1,.3,1);background:#fff;color:var(--forest);overflow:hidden auto;overscroll-behavior:contain;animation:none}
html[data-moves] [data-board] .menu-inner{position:relative;box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) var(--panel);grid-template-rows:auto auto minmax(0,1fr) auto;max-width:none;min-height:100%;margin:0;padding:0}
html[data-moves] [data-board] .board-off{display:none}
html[data-moves] [data-board] .board-sheet{grid-column:2;grid-row:1 / -1;background:#fff}
html[data-moves] [data-board] .menu-head{position:relative;z-index:1;grid-column:2;grid-row:1;box-sizing:border-box;height:auto;padding:14px var(--pad) 12px}
html[data-moves] [data-board] .menu-kicker{color:var(--brass-text)}
html[data-moves] [data-board] .board-kicker{position:relative;z-index:1;grid-column:2;grid-row:2;margin:0;padding:12px var(--pad) 8px;border-bottom:1px solid var(--forest);font-size:11px}
html[data-moves] [data-board] .menu-close{border-color:var(--forest);color:var(--forest)}
html[data-moves] [data-board] .menu-close:hover{background:var(--forest);color:#fff}
html[data-moves] [data-board] .menu-close:focus-visible,html[data-moves] [data-board] .board-list .menu-link:focus-visible,html[data-moves] [data-board] .menu-profile:focus-visible{outline:2px solid var(--brass);outline-offset:2px}

/* The quiet list: every section, one line each */
html[data-moves] [data-board] .board-list{position:relative;z-index:1;grid-column:2;grid-row:3;display:block;margin:0;padding:0 var(--pad)}
html[data-moves] [data-board] .board-list .menu-link{display:flex;align-items:center;gap:14px;height:clamp(30px,4.9vh,46px);padding:0;border-bottom:1px solid var(--hair);color:var(--forest);transition:color .25s}
html[data-moves] [data-board] .board-list .menu-num{flex:none;width:20px;font-size:10.5px;color:var(--brass-text)}
html[data-moves] [data-board] .board-list .menu-label{font-size:clamp(17px,1.4vw,21px);line-height:1;transition:transform .4s var(--ease)}
html[data-moves] [data-board] .board-list .menu-link:hover{color:var(--brass-text)}
html[data-moves] [data-board] .board-list .menu-link:hover .menu-label{transform:translateX(6px)}
html[data-moves] [data-board] .menu-profiles{position:relative;z-index:1;grid-column:2;grid-row:4;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;margin:0;padding:20px var(--pad) var(--pad);font-size:11.5px}
html[data-moves] [data-board] .menu-profile{justify-self:start;color:var(--forest)}
html[data-moves] [data-board] .menu-profile:hover{color:var(--brass-text)}

/* The wall. Rows are staggered between the columns so no seam runs the full width. */
html[data-moves] [data-board] .menu-grid-pages{grid-column:1;grid-row:1 / -1;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-template-rows:minmax(0,48fr) minmax(0,12fr) minmax(0,40fr);gap:var(--gap);box-sizing:border-box;min-height:max(100%,560px);margin:0;padding:var(--gap) 0 var(--gap) var(--gap)}
html[data-moves] [data-board] [data-tile="papers"]{grid-column:1 / 6;grid-row:1 / 3}
html[data-moves] [data-board] [data-tile="journal"]{grid-column:6 / 10;grid-row:1 / 3}
html[data-moves] [data-board] [data-tile="work"]{grid-column:10 / 13;grid-row:1 / 2}
html[data-moves] [data-board] [data-tile="overview"]{grid-column:1 / 5;grid-row:3 / 4}
html[data-moves] [data-board] [data-tile="courses"]{grid-column:5 / 10;grid-row:3 / 4}
html[data-moves] [data-board] [data-tile="news"]{grid-column:10 / 13;grid-row:2 / 4}

/* ---------- A tile ---------- */
html[data-moves] [data-board] [data-tone="forest"]{--t-bg:#1f3b2d;--t-wash:#cdbf9a;--t-ink:#cdbf9a;--t-accent:#b48a3a;--t-fill:#1f3b2d}
html[data-moves] [data-board] [data-tone="cream"]{--t-bg:#cdbf9a;--t-wash:#1f3b2d;--t-ink:#1f3b2d;--t-accent:#8f6b22;--t-fill:#cdbf9a}
html[data-moves] [data-board] [data-tone="brass"]{--t-bg:#b48a3a;--t-wash:#1f3b2d;--t-ink:#14271e;--t-accent:#f2ead6;--t-fill:#b48a3a}
html[data-moves] [data-board] [data-tone="forest"][data-hot]{--t-ink:#1f3b2d;--t-accent:#8f6b22;--t-fill:#cdbf9a}
html[data-moves] [data-board] [data-tone="cream"][data-hot]{--t-ink:#cdbf9a;--t-accent:#b48a3a;--t-fill:#1f3b2d}
html[data-moves] [data-board] [data-tone="brass"][data-hot]{--t-ink:#cdbf9a;--t-accent:#b48a3a;--t-fill:#1f3b2d}

html[data-moves] [data-board] .menu-link-page{position:relative;z-index:0;display:flex;flex-direction:column;align-items:flex-start;gap:0;box-sizing:border-box;min-width:0;padding:var(--pad);border:0;overflow:hidden;container-type:size;color:var(--t-ink);text-decoration:none;animation:none;transition:color .3s ease}
html[data-moves] [data-board] .menu-link-page:hover{color:var(--t-ink)}
html[data-moves] [data-board] .menu-link-page:focus-visible{outline:2px solid var(--t-ink);outline-offset:-8px}
html[data-moves] [data-board] .tile-plate,html[data-moves] [data-board] .tile-wash{position:absolute;inset:0;z-index:-1}
html[data-moves] [data-board] .tile-plate{background:var(--t-bg)}
html[data-moves] [data-board] .tile-wash{background:var(--t-wash);transform:scaleY(0);transform-origin:50% 100%}
html[data-moves] [data-board] .menu-link-page[data-hot] .tile-wash{transform:none}
html[data-moves] [data-board] .menu-link-page .menu-num{position:absolute;right:var(--pad);top:var(--pad);font-size:15px;line-height:1;color:inherit}
html[data-moves] [data-board] .menu-link-page .menu-label{display:block;max-width:calc(100% - 22px);margin:-.14em 0 0;padding-bottom:.14em;overflow:hidden;font-size:var(--label);line-height:1;letter-spacing:-.02em;text-decoration:none}
html[data-moves] [data-board] .tile-word{display:block}
html[data-moves] [data-board] .menu-link-page .menu-sub{margin:.35em 0 0;max-width:30ch;font-size:11.5px;line-height:1.45;color:inherit;text-align:left;text-wrap:balance}

/* The drawing sits in the corner opposite the label and never reaches it: its size gives way to the words above. */
html[data-moves] [data-board] .tile-draw{position:absolute;right:var(--pad);bottom:var(--pad);display:block;overflow:visible;width:min(60cqw,48cqh,calc(100cqh - var(--pad) * 2 - var(--label) - var(--sub)));aspect-ratio:1;transform-origin:100% 100%}
html[data-moves] [data-board] .tile-draw .ln{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
html[data-moves] [data-board] .tile-draw .fl{fill:var(--t-fill)}
html[data-moves] [data-board] .tile-draw .ac{stroke:var(--t-accent)}
html[data-moves] [data-board] .tile-draw .cut{stroke:var(--t-fill);stroke-width:7}
html[data-moves] [data-board] .tile-draw .dot{fill:var(--t-accent)}

/* ---------- Tablets: the column drops under the wall ---------- */
@media (max-width:999.98px){
  html[data-moves] [data-board] .menu-inner{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto auto auto}
  html[data-moves] [data-board] .board-sheet{grid-column:1;grid-row:1 / -1}
  html[data-moves] [data-board] .menu-head{position:sticky;top:0;z-index:2;grid-column:1;padding:8px var(--pad);background:#fff}
  html[data-moves] [data-board] .menu-grid-pages{grid-column:1;grid-row:2;height:clamp(460px,72vh,760px);height:clamp(460px,72dvh,760px);min-height:0;padding:0 var(--gap)}
  html[data-moves] [data-board] .board-kicker{grid-column:1;grid-row:3;margin-top:18px}
  html[data-moves] [data-board] .board-list{grid-column:1;grid-row:4;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:24px}
  html[data-moves] [data-board] .board-list .menu-link{height:44px}
  html[data-moves] [data-board] .menu-profiles{grid-column:1;grid-row:5;display:flex;flex-wrap:wrap;gap:12px 24px}
}

/* ---------- Phones: two columns; the board scrolls inside itself past the tiles ---------- */
@media (max-width:599.98px){
  html[data-moves] .site-menu[data-board]{--gap:4px;--pad:14px;--label:clamp(31px,9.4vw,40px);--sub:0px}
  html[data-moves] [data-board] .menu-grid-pages{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:clamp(132px,24vh,208px);grid-auto-rows:clamp(132px,24dvh,208px);height:auto;padding:0 var(--gap)}
  html[data-moves] [data-board] .menu-link-page[data-tile]{grid-column:auto;grid-row:auto}
  html[data-moves] [data-board] .board-list{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:18px}
  html[data-moves] [data-board] .menu-link-page .menu-num{font-size:13px}
  html[data-moves] [data-board] .tile-draw{width:min(58cqw,calc(100cqh - var(--pad) * 2 - var(--label) + 6px))}
  html[data-moves] [data-board] .tile-draw .ln{stroke-width:1.25}
  html[data-moves] [data-board] .tile-draw .cut{stroke-width:5}
}

/* ---------- Motion. The wall unfolds from the index button, top right; each tile grows out of a neighbour already there. ---------- */
@keyframes boardX{from{transform:scaleX(0)}}
@keyframes boardY{from{transform:scaleY(0)}}
@keyframes boardXOut{to{transform:scaleX(0)}}
@keyframes boardYOut{to{transform:scaleY(0)}}
@keyframes boardUp{from{transform:translateY(112%)}}
@keyframes boardIn{from{opacity:0;transform:translateY(10px)}}
@keyframes boardDraw{from{opacity:0;transform:scale(.86)}}
@keyframes boardOut{to{opacity:0}}
@keyframes boardBack{0%,99%{background-color:transparent}100%{background-color:#fff}}

html[data-moves] .site-menu[data-live]{animation:boardBack 1s linear both}
html[data-moves] [data-live] .menu-link-page{--k:boardX;--ko:boardXOut;--o:100% 50%}
html[data-moves] [data-live] [data-tile="work"]{--i:1}
html[data-moves] [data-live] [data-tile="journal"]{--i:2}
html[data-moves] [data-live] [data-tile="papers"]{--i:3}
html[data-moves] [data-live] [data-tile="news"]{--i:2.4;--k:boardY;--ko:boardYOut;--o:50% 0}
html[data-moves] [data-live] [data-tile="courses"]{--i:3.4;--k:boardY;--ko:boardYOut;--o:50% 0}
html[data-moves] [data-live] [data-tile="overview"]{--i:4.4;--k:boardY;--ko:boardYOut;--o:50% 0}
@media (max-width:599.98px){
  html[data-moves] [data-live] [data-tile="journal"]{--i:1}
  html[data-moves] [data-live] [data-tile="papers"]{--i:2}
  html[data-moves] [data-live] [data-tile="overview"]{--i:2.4;--k:boardY;--ko:boardYOut;--o:50% 0}
  html[data-moves] [data-live] [data-tile="work"]{--i:3;--k:boardY;--ko:boardYOut;--o:50% 0}
  html[data-moves] [data-live] [data-tile="news"]{--i:3.4}
  html[data-moves] [data-live] [data-tile="courses"]{--i:4}
}
html[data-moves] [data-live] .board-sheet{transform-origin:50% 0;animation:boardY .7s var(--snap) backwards}
html[data-moves] [data-live] .tile-plate{transform-origin:var(--o);animation:var(--k) .85s var(--snap) calc(var(--i) * 90ms) backwards}
html[data-moves] [data-live] .tile-wash{transition:transform .6s var(--snap)}
html[data-moves] [data-live] .tile-word{animation:boardUp .85s var(--snap) calc(var(--i) * 90ms + 170ms) backwards}
html[data-moves] [data-live] .menu-link-page .menu-sub,html[data-moves] [data-live] .menu-link-page .menu-num{animation:boardIn .6s ease calc(var(--i) * 90ms + 320ms) backwards}
html[data-moves] [data-live] .tile-draw{animation:boardDraw 1s var(--snap) calc(var(--i) * 90ms + 240ms) backwards}
html[data-moves] [data-live] .board-list .menu-link{animation:boardIn .5s ease backwards}
html[data-moves] [data-live] .menu-head,html[data-moves] [data-live] .board-kicker,html[data-moves] [data-live] .menu-profiles{animation:boardIn .5s ease 120ms backwards}

/* On hover or keyboard focus a tile turns over and its drawing runs ahead; the others go quiet. */
html[data-moves] [data-live] .menu-link-page .menu-label,html[data-moves] [data-live] .menu-link-page .menu-sub{transition:opacity .35s ease,transform .6s var(--snap)}
html[data-moves] [data-live] .menu-link-page .menu-num{transition:transform .6s var(--snap)}
html[data-moves] [data-live] .tile-draw{transition:opacity .35s ease,transform .8s var(--snap)}
html[data-moves] [data-live] .tile-draw .fl{transition:fill .3s ease}
html[data-moves] [data-live] .tile-draw .cut{transition:stroke .3s ease}
html[data-moves] [data-board] .menu-grid-pages[data-hot] .menu-link-page:not([data-hot]) .menu-label,html[data-moves] [data-board] .menu-grid-pages[data-hot] .menu-link-page:not([data-hot]) .menu-sub,html[data-moves] [data-board] .menu-grid-pages[data-hot] .menu-link-page:not([data-hot]) .tile-draw{opacity:.42}
html[data-moves] [data-live] .menu-link-page[data-hot] .tile-draw{transform:scale(1.08)}
html[data-moves] [data-live] .menu-link-page[data-hot] .menu-num{transform:translate(3px,-3px)}

/* Closing: the words go first, then the tiles fold back toward the button. site.js has already set hidden. */
html[data-moves] .site-menu[data-live][hidden][data-closing]{display:block!important;background:transparent;overflow:hidden;pointer-events:none;animation:none}
html[data-moves] [data-closing] .tile-plate{animation:var(--ko) .36s cubic-bezier(.7,0,.84,0) calc((5 - var(--i)) * 26ms) both}
html[data-moves] [data-closing] .board-sheet{animation:boardYOut .36s cubic-bezier(.7,0,.84,0) 150ms both}
html[data-moves] [data-closing] .tile-wash,html[data-moves] [data-closing] .tile-word,html[data-moves] [data-closing] .tile-draw,html[data-moves] [data-closing] .menu-link-page .menu-sub,html[data-moves] [data-closing] .menu-link-page .menu-num,html[data-moves] [data-closing] .board-list .menu-link,html[data-moves] [data-closing] .menu-head,html[data-moves] [data-closing] .board-kicker,html[data-moves] [data-closing] .menu-profiles{animation:boardOut .14s linear both}

/* ---------- Phones and tablets: full-size targets. Landscape phones: a wall of two rows, with room for the header ---------- */
@media (max-width:999.98px),(hover:none){
  html[data-moves] [data-board] .menu-close{min-height:40px}
  html[data-moves] [data-board] .menu-profiles{row-gap:22px}
  html[data-moves] [data-board] .menu-profile{position:relative}
  html[data-moves] [data-board] .menu-profile::after{content:"";position:absolute;left:-5px;right:-5px;top:50%;height:42px;margin-top:-21px}
}
@media (max-height:500px) and (max-width:999.98px){
  html[data-moves] .site-menu[data-board]{--gap:4px;--label:clamp(30px,10vh,40px);--sub:0px}
  html[data-moves] [data-board] .menu-grid-pages{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:clamp(116px,40vh,150px);height:auto}
  html[data-moves] [data-board] .menu-link-page[data-tile]{grid-column:auto;grid-row:auto}
  html[data-moves] [data-board] .menu-link-page .menu-sub{display:none}
  html[data-moves] [data-board] .tile-draw{width:min(50cqw,calc(100cqh - var(--pad) * 2 - var(--label) + 6px))}
}

/* One typeface: the labels in Figtree, as on the Work page. Figtree runs wider than the serif did, so the tile labels are smaller. */
.menu-label{font-weight:600;letter-spacing:-.02em}
html[data-moves] [data-board] .board-list .menu-label{font-weight:600;letter-spacing:-.01em}
html[data-moves] .site-menu[data-board]{--label:clamp(34px,3.7vw,80px)}
html[data-moves] [data-board] .menu-link-page .menu-label{font-weight:700;letter-spacing:-.035em;line-height:.98}
@media (max-width:599.98px){html[data-moves] .site-menu[data-board]{--label:clamp(23px,6.6vw,30px)}html[data-moves] [data-board] .menu-link-page .menu-sub{max-width:56%}html[data-moves] [data-board] .tile-draw{width:min(40cqw,calc(100cqh - var(--pad) * 2 - var(--label) + 6px))}}   /* the note keeps the left of the tile and the drawing the right, so they never meet */
