/* Homepage mosaic only; inner pages never load it. */
/* Category hues: one quiet colour per field, used only as a small marker. */
.hue{display:inline-block;width:8px;height:8px;border-radius:2px;flex:none;background:var(--soft)}
.hue[data-hue="Artificial Intelligence"]{background:oklch(.68 .07 305)}
/* Muted: low chroma, so the hues read as quiet labels rather than colour. */
.hue[data-hue="Physics"]{background:oklch(.66 .05 255)}.hue[data-hue="Chemistry"]{background:oklch(.66 .05 165)}.hue[data-hue="Medicine"]{background:oklch(.66 .05 22)}.hue[data-hue="Life sciences"]{background:oklch(.66 .05 125)}.hue[data-hue="Earth & space"]{background:oklch(.66 .05 290)}.hue[data-hue="Society"]{background:oklch(.66 .05 60)}.hue[data-hue="Mathematics"]{background:oklch(.66 .05 340)}.hue[data-hue="Computing"]{background:oklch(.66 .05 210)}.hue[data-hue="Engineering"]{background:oklch(.66 .05 95)}.hue[data-hue="Economics"]{background:oklch(.66 .05 140)}.hue[data-hue="Sports"]{background:oklch(.66 .05 0)}.hue[data-hue="Ecology"]{background:oklch(.66 .05 150)}.hue[data-hue="Humanities"]{background:oklch(.66 .05 40)}.hue[data-hue="Transportation"]{background:oklch(.66 .05 230)}
.mosaic{--gap:10px;padding:12px;display:grid;gap:var(--gap);grid-template-columns:repeat(auto-fill,minmax(150px,1fr));grid-auto-rows:minmax(112px,auto);grid-auto-flow:row dense;min-height:100vh}
.mosaic [data-span="2x2"]{grid-column:span 2;grid-row:span 2}.mosaic [data-span="2x1"]{grid-column:span 2}
.catalog-loading .mosaic,.js .mosaic[data-fit]{height:100vh;height:100dvh;min-height:0;overflow:hidden;grid-auto-flow:row}
.catalog-loading .mosaic:not([data-fit]){visibility:hidden}
body.tiles.fit{overflow:hidden}





.t-board{display:flex;flex-direction:column;gap:.35rem;container-type:inline-size}
@container (max-width:330px){.t-board tr>:nth-child(4){display:none}}
.t-board .tabs{display:flex;gap:.15rem;flex-wrap:wrap;margin:0;padding:0;border:0}
.t-board .tabs a{font-size:.68rem;padding:.16rem .46rem;border-radius:999px;color:var(--soft);text-decoration:none;border:1px solid transparent}
.t-board .tabs a[aria-current]{color:var(--ink);border-color:var(--line);background:var(--wash)}
.t-board #board-rows{flex:1;min-height:0;overflow:hidden;position:relative}
.t-board .table-wrap{overflow:hidden}.t-board .optional-col{display:none}
.t-board td,.t-board th{padding:.28rem .3rem;font-size:.74rem}.t-board thead th{padding-block:.25rem;font-size:.58rem}
.t-board .avatar{width:1.15rem;height:1.15rem;font-size:.58rem}



.t-action{display:flex;flex-direction:column;justify-content:space-between;padding:12px 14px}
.t-action b{font:500 1.1rem var(--mono);opacity:.55}
.t-action span{font-size:clamp(.82rem,calc(var(--cell-h,112px)*.12),1.15rem);font-weight:600;letter-spacing:-.015em;line-height:1.15}
.problem-tile{display:flex;flex-direction:column;gap:clamp(.15rem,calc(var(--cell-h,112px)*.03),.35rem);padding:clamp(8px,calc(var(--cell-h,112px)*.1),13px) 13px}
.problem-tile .meta{display:flex;align-items:center;gap:.4rem;font:.6rem var(--mono);color:var(--soft);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.problem-tile strong{font-size:clamp(.74rem,calc(var(--cell-h,112px)*.118),1.4rem);font-weight:600;line-height:1.14;letter-spacing:-.02em;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.problem-tile[data-grown] strong{font-size:clamp(.82rem,calc(var(--cell-h,112px)*.15),1.7rem);-webkit-line-clamp:2}
.problem-tile .foot{margin-top:auto;display:flex;align-items:center;gap:.4rem;font:.6rem var(--mono);color:var(--soft)}
.pager{display:flex;flex-direction:column;justify-content:space-between;padding:12px 14px}
.pager strong{font-size:1rem;letter-spacing:-.01em}.pager small{font:.64rem var(--mono);opacity:.7}
.mosaic[data-compact]>.t-action,[data-compact]>.t-connect,[data-compact] .cats,[data-compact] .viewfinder :is(br,span){display:none!important}
[data-compact] .t-brand{justify-content:center;gap:4px;padding:4px}
[data-compact] .viewfinder{font-size:clamp(1rem,5vw,1.5rem)}
.catalog-tools{display:flex;gap:4px}
.catalog-tools select{flex:1;min-width:0}
.catalog-tools :is(button,select){min-height:44px;padding:3px 6px;background:var(--card);border:1px solid var(--line);border-radius:6px}
.catalog-tools button{font-size:.75rem}
#catalog-board{width:min(36rem,calc(100% - 24px));color:var(--ink);background:var(--paper)}
#catalog-board::backdrop{background:#0007}
#catalog-board form{display:flex;justify-content:flex-end;margin-bottom:8px}
@media(max-width:520px){.mosaic{padding:8px;--gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:no-preference) and (hover:hover){
  html:not(.returning-home) .mosaic>.tile:not(.t-brand,.is-solved){animation:tile-in .18s var(--ease) backwards}
}
@keyframes tile-in{from{opacity:0;transform:translateY(4px)}}

.t-board tr.slot th,.t-board tr.slot td{color:var(--soft);font-weight:400;opacity:.7}
.t-board tr.slot th{font-style:italic}
.mosaic [data-span="3x2"]{grid-column:span 3;grid-row:span 2}

/* Headline tile: the logo frames the headline; the category filter is set as quiet text along its foot. */
.t-brand{display:flex;flex-direction:column;justify-content:space-between;gap:10px;background:none;color:var(--ink);border-color:transparent;padding:clamp(14px,calc(var(--cell-h,112px)*.16),24px) clamp(14px,calc(var(--cell-w,160px)*.11),24px)}
.t-brand .viewfinder{align-self:flex-start;font-size:clamp(1.6rem,min(calc(var(--tile-w,340px)*.105),calc(var(--tile-h,240px)*.2)),5rem)}
.cats{display:flex;flex-wrap:wrap;gap:.25rem .9rem;align-items:baseline;font-size:.74rem;line-height:1.35}
.cat{display:inline-flex;align-items:center;gap:.35rem;color:var(--soft);text-decoration:none;white-space:nowrap;
  transition:color .25s var(--ease)}
.cat sup{font:500 .56rem var(--mono);opacity:.6;margin-left:.15rem;top:-.4em}
.cat .hue{width:6px;height:6px;border-radius:50%}
.cat:hover{color:var(--ink);text-decoration:none}
.cat[aria-current]{background:var(--wash);box-shadow:0 0 0 3px var(--wash);border-radius:4px;color:var(--ink);font-weight:600}
/* Connect tile: styled like the other navigation tiles, holding a plain terminal. */
.t-connect{display:flex;flex-direction:column;gap:.5rem;padding:12px 14px}
.t-connect .term-head{display:flex;align-items:center;gap:.55rem}
.t-connect .term-icon{font:500 1.1rem var(--mono);opacity:.55;white-space:nowrap}
.t-connect .term-head h2{font-size:clamp(.82rem,calc(var(--cell-h,112px)*.12),1.15rem);font-weight:600;letter-spacing:-.015em}
.command.term{flex:1;display:flex;align-items:center;gap:.6rem;background:#141614;border:0;border-radius:10px;padding:.55rem .6rem .55rem .75rem;min-height:0}
.command.term code{flex:1;padding:0;font-size:clamp(.7rem,calc(var(--cell-h,112px)*.085),.9rem);line-height:1.4;white-space:normal;overflow:visible;overflow-wrap:anywhere;color:#e6e9e3;background:none}
.command.term .copy{flex:none;border:1px solid rgb(255 255 255/.18);border-radius:7px;background:none;color:#e6e9e3;
  font-family:inherit;font-size:.68rem;font-weight:600;line-height:1.2;padding:.32rem .6rem;min-width:0;cursor:pointer;transition:background .2s var(--ease)}
.command.term .copy:hover{background:rgb(255 255 255/.1)}
/* Solved problems: while a circle and a check draw themselves, the tile slowly turns black and its text greys. */
:root{--solved-bg:#0a0b0a;--solved-fg:#9ea39b;--solved-soft:#6a6f68}
@media(prefers-color-scheme:dark){:root{--solved-bg:#000;--solved-fg:#8f948d;--solved-soft:#5a5f58}}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.is-solved{
  --d:.5s;
  --darken-delay:calc(var(--d) + .7s);
  --darken-duration:5.2s;
  --darken-ease:cubic-bezier(.45,0,.25,1);
}
.check{position:absolute;right:12px;bottom:11px;width:clamp(26px,calc(var(--cell-h,112px)*.3),46px);height:auto;overflow:visible}
.check circle,.check path{fill:none;stroke:#3ecf7a;stroke-linecap:round;stroke-linejoin:round}
.check circle{stroke-width:2.4;stroke-dasharray:139;stroke-dashoffset:139;transform:rotate(-90deg);transform-origin:center}
.check path{stroke-width:3.4;stroke-dasharray:34;stroke-dashoffset:34}
@media(prefers-reduced-motion:no-preference){
  .mosaic>.tile.is-solved{animation:solve-dark var(--darken-duration) var(--darken-ease) var(--darken-delay) both}
  .is-solved strong{animation:solve-text var(--darken-duration) var(--darken-ease) var(--darken-delay) both}
  .is-solved .meta,.is-solved .foot{animation:solve-soft var(--darken-duration) var(--darken-ease) var(--darken-delay) both}
  .is-solved .check{animation:check-pop 1.8s cubic-bezier(.3,1.5,.5,1) calc(var(--d) + .2s) both}
  .is-solved .check circle{animation:draw 2.3s cubic-bezier(.65,0,.35,1) calc(var(--d) + .3s) forwards}
  .is-solved .check path{animation:draw .35s cubic-bezier(.4,0,.2,1) calc(var(--d) + 2.5s) forwards}
}
@media(prefers-reduced-motion:reduce){.is-solved{background:var(--solved-bg);border-color:var(--solved-bg)}.is-solved strong{color:var(--solved-fg)}.is-solved .meta,.is-solved .foot{color:var(--solved-soft)}.check circle,.check path{stroke-dashoffset:0}}
@keyframes solve-dark{to{background:var(--solved-bg);border-color:var(--solved-bg)}}
@keyframes solve-text{to{color:var(--solved-fg)}}
@keyframes solve-soft{to{color:var(--solved-soft)}}
@keyframes check-pop{from{opacity:0;transform:scale(.5) rotate(-12deg)}}
@keyframes draw{to{stroke-dashoffset:0}}
.mosaic [data-span="3x3"]{grid-column:span 3;grid-row:span 3}
.mosaic [data-span="3x1"]{grid-column:span 3}
