/* Atkinson Hyperlegible (SIL Open Font License, vendor/fonts/OFL.txt), Latin only, served from the site so the first paint waits on no other server */
@font-face{font-family:"Atkinson Hyperlegible";font-style:normal;font-weight:400;font-display:swap;src:url(/vendor/fonts/atkinson-400.woff2) format("woff2")}
@font-face{font-family:"Atkinson Hyperlegible";font-style:normal;font-weight:700;font-display:swap;src:url(/vendor/fonts/atkinson-700.woff2) format("woff2")}
@font-face{font-family:"Atkinson Hyperlegible";font-style:italic;font-weight:400;font-display:swap;src:url(/vendor/fonts/atkinson-400-italic.woff2) format("woff2")}
@font-face{font-family:"Atkinson Hyperlegible";font-style:italic;font-weight:700;font-display:swap;src:url(/vendor/fonts/atkinson-700-italic.woff2) format("woff2")}
:root{
  /* Quiet white page, always light, so the coloured model is the only loud thing. One readable family.
     Phone: title strip, model, parts strip, reading text; controls drawer and navigation fixed at the bottom. */
  --paper:#FFFFFF; --ink:#22262B; --soft:#667079; --rule:#E6E8EA; --fill:#F4F5F6; --spot:#2F6FB3; --warm:#9A5F1E;
  --body:"Atkinson Hyperlegible","Helvetica Neue",Arial,sans-serif;
  --top:48px; --bar:72px; --drawer:50px; --stage:44vh;
  --plate:rgba(255,255,255,.9); --edge:#CFD3D7;
  color-scheme:light;
}
:root[data-look="dark"]{
  --paper:#17191C; --ink:#ECEEF0; --soft:#9AA3AB; --rule:#2E3237; --fill:#1F2226; --spot:#7FB2E5; --warm:#E0A35E;
  --plate:rgba(32,35,39,.9); --edge:#3D4248;
  color-scheme:dark;
}
@supports (height:1svh){:root{--stage:44svh}}   /* the small viewport height: it stays put while Safari's toolbar shrinks and grows on scroll */

*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--paper);color:var(--ink);font-family:var(--body);font-size:17px;line-height:1.55;-webkit-text-size-adjust:100%}
a{color:inherit}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
:focus-visible{outline:2px solid var(--spot);outline-offset:2px}
svg{display:block}

/* site strip: which movement, the site name in the middle, the menu on the right */
.top{position:sticky;top:0;z-index:50;height:var(--top);display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;padding:0 6px;background:var(--paper);border-bottom:1px solid var(--rule)}
.brand{text-decoration:none;font-size:18px;letter-spacing:-.01em;min-height:44px;display:inline-flex;align-items:center}
.brand b{font-weight:700}
.brand span{color:var(--soft)}
.where{font-size:14px;color:var(--soft);font-variant-numeric:tabular-nums}
.tophome{width:44px;height:44px;display:grid;place-items:center;border-radius:10px;justify-self:start}
.tophome:hover{background:var(--fill)}
.top .right{display:flex;justify-content:flex-end;align-items:center}
.menu-btn{width:44px;height:44px;display:grid;place-items:center;border-radius:10px}
.menu-btn[aria-expanded="true"]{background:var(--fill)}
.site-menu{display:none;position:absolute;right:8px;top:calc(100% + 6px);min-width:190px;padding:6px;background:var(--paper);border:1px solid var(--rule);border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.12)}
.top.open .site-menu{display:grid}
.site-menu a,.site-menu .off{display:flex;align-items:center;min-height:46px;padding:0 14px;border-radius:8px;text-decoration:none;font-size:16px}
.site-menu a:hover{background:var(--fill)}
.site-menu .off{color:var(--soft);opacity:.6}
.theme-btn{width:44px;height:44px;display:grid;place-items:center;border-radius:10px}
.theme-btn:hover{background:var(--fill)}
@media (min-width:940px){
  :root{--top:60px}
  .top{padding:0 24px}
  .brand{font-size:24px}
  .menu-btn{display:none}
  .site-menu{display:flex;position:static;min-width:0;padding:0;border:0;box-shadow:none;gap:4px}
  .site-menu a,.site-menu .off{min-height:36px;padding:0 12px;font-size:15px}
  .theme-btn{width:40px;height:40px;margin-left:4px}
}

/* model, pinned while the text scrolls under it */
.stage{position:sticky;top:var(--top);z-index:20;height:var(--stage);min-height:300px;display:flex;flex-direction:column;background:var(--paper);border-bottom:1px solid var(--rule)}
.canvas{position:relative;flex:1;min-height:0}
#view{position:absolute;inset:0}
#view canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}
.hud{position:absolute;left:16px;top:12px;margin:0;display:grid;gap:1px;font-size:13px;line-height:1.35;pointer-events:none;font-variant-numeric:tabular-nums}
.hud div{display:flex;gap:8px}
.hud dt{color:var(--soft)}
.hud dd{margin:0;font-weight:700}
@media (max-width:939px){.hud{display:none}}   /* on a phone the model area is small, so the readouts are left out to keep it clear */
.camtools{position:absolute;right:12px;top:10px;display:flex;align-items:center;gap:6px}   /* the view buttons and Brown's drawing */
.views{display:flex;border-radius:999px;padding:3px;gap:2px;background:var(--plate);border:1px solid var(--rule)}
.eng-btn{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--plate);border:1px solid var(--rule);color:var(--ink)}
.eng-btn[aria-pressed="true"]{background:var(--ink);color:var(--paper);border-color:var(--ink)}
/* Brown's engraving shown where the model is, on its paper colour in both themes; the buttons stay on top */
.drawing{position:absolute;inset:0;box-sizing:border-box;padding:60px 16px 16px;background:#fbfaf6}
.drawing[hidden]{display:none}
.drawing img{display:block;width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}   /* fills the padded box and scales down to fit it at any size */
.show-drawing .hud{display:none}
@media (max-width:600px){.drawing{padding:16px 64px 16px 16px}}
.views button{font-size:13px;padding:5px 8px;border-radius:999px;min-height:32px;display:flex;align-items:center;justify-content:center;line-height:0}
.views button[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
@media (max-width:600px){.camtools{flex-direction:column;top:50%;transform:translateY(-50%);right:8px}.views{flex-direction:column}}

/* reading: number, name, short description, then the explanation */
.sheet{padding:22px 16px calc(var(--bar) + var(--drawer) + 36px);max-width:640px}
.sheet h1{margin:0 0 10px;font-size:26px;font-weight:700;line-height:1.18;letter-spacing:-.01em;text-wrap:balance}
.sheet h1 .n{display:block;margin-bottom:6px;font-size:14px;font-weight:700;letter-spacing:0;color:var(--soft)}
.sheet h1 .n small{font-size:inherit}
.lede{margin:0;font-size:17px;line-height:1.5;color:var(--soft);max-width:60ch}
.sheet h2{font-weight:700;font-size:18px;line-height:1.25;margin:26px 0 8px;padding-top:22px;border-top:1px solid var(--rule)}
.sheet p{margin:0 0 14px;max-width:62ch}
.sheet h2 + p{margin-top:0}
.sheet blockquote{margin:0 0 14px;padding-left:14px;border-left:3px solid var(--rule);color:var(--soft);max-width:60ch}
/* a translated quote: Brown's English folds out underneath */
.sheet .orig{margin:-6px 0 14px;max-width:60ch}
.sheet .report{margin:18px 0 6px;font-size:.92em;color:var(--soft)}   /* the link to report a problem, under the note */
.sheet .orig summary{cursor:pointer;color:var(--soft);font-size:.92em}
.sheet .orig blockquote{margin-top:8px}
.note{font-size:14px;color:var(--soft);line-height:1.5;margin-top:22px !important}

/* drawers: one row on top of the navigation bar, Parts and Controls; each opens upward over the text only */
.ctl{position:fixed;left:0;right:0;bottom:calc(var(--bar) + env(safe-area-inset-bottom,0px));z-index:35;background:var(--fill);border-top:1px solid var(--rule);display:grid;grid-auto-flow:column;grid-auto-columns:1fr;height:calc(var(--drawer) + 1px)}
.tab{display:flex;align-items:center;gap:10px;padding:0 12px 0 16px;text-align:left;min-width:0}
#tab-ctl{border-left:1px solid var(--rule)}
.tab .tx{flex:1;min-width:0;display:grid;line-height:1.2}
.tab .ttl{font-weight:700;font-size:16px}
.tab .sum{display:none;font-size:14px;color:var(--soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tab .chev{flex:none;color:var(--soft);transition:transform .2s}
.tab[aria-expanded="true"]{background:var(--paper)}
.tab[aria-expanded="true"] .chev{transform:rotate(180deg)}
.panel{display:none;align-content:start;gap:16px;padding:16px;background:var(--paper);overflow-y:auto;position:fixed;left:0;right:0;top:calc(var(--top) + max(var(--stage),300px));bottom:calc(var(--bar) + var(--drawer) + env(safe-area-inset-bottom,0px))}
.panel.open{display:grid}
.chips{display:flex;gap:8px;overflow-x:auto;margin:0 -16px;padding:0 16px 2px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.chips::-webkit-scrollbar{display:none}
.chips button{flex:none;white-space:nowrap;display:inline-flex;align-items:center;gap:8px;font-size:15px;padding:7px 14px 7px 11px;border-radius:999px;min-height:40px;border:1px solid var(--edge);background:var(--paper)}
.chips .dot{width:12px;height:12px;border-radius:50%;flex:none}
.chips button[aria-pressed="true"]{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.cap{margin:0;font-size:15px;line-height:1.45;color:var(--soft)}
.cap b{color:var(--ink)}
.panel .row{display:grid;gap:8px}
.panel label,.panel .lab{display:flex;justify-content:space-between;align-items:baseline;font-size:15px;font-weight:700}
.panel output{font-weight:400;color:var(--soft);font-variant-numeric:tabular-nums}
input[type=range]{width:100%;margin:0;height:28px;accent-color:var(--ink)}
.opts{display:flex;flex-wrap:wrap;gap:6px}
.opts button{font-size:15px;padding:8px 14px;border-radius:999px;border:1px solid var(--edge);background:var(--paper);min-height:40px}
.opts button[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--paper)}

/* navigation bar */
.bar{position:fixed;left:0;right:0;bottom:0;z-index:40;height:calc(var(--bar) + env(safe-area-inset-bottom,0px));padding:0 10px env(safe-area-inset-bottom,0px);display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;background:var(--paper);border-top:1px solid var(--rule)}
.bar .go{display:flex;align-items:center;gap:6px;min-height:56px;text-decoration:none;min-width:0}
.bar .go.next{justify-content:flex-end;text-align:right}
.bar .go svg{flex:none;color:var(--soft)}
.bar .go .t{display:grid;min-width:0;line-height:1.25}
.bar .go .t small{font-size:12px;color:var(--soft)}
.bar .go .t b{font-size:16px}
.bar .go .nm{display:none}
.bar .go[aria-disabled="true"]{opacity:.3;pointer-events:none}
#play{position:absolute;right:12px;bottom:12px;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:var(--plate);border:1px solid var(--rule);color:var(--ink)}
#reset{position:absolute;right:66px;bottom:12px;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:var(--plate);border:1px solid var(--rule);color:var(--ink)}
#reset:disabled{opacity:.35;cursor:default}
.homebtn{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;border:1px solid color-mix(in srgb,var(--warm) 35%,var(--paper));background:color-mix(in srgb,var(--warm) 8%,var(--paper));color:var(--warm)}
.homebtn:hover{background:color-mix(in srgb,var(--warm) 15%,var(--paper))}   /* same brass as Surprise me */

/* wide screens: the model fills the left with the navigation centred under it. The side column opens on a large
   number and the name, the text scrolls on its own, and Parts and Controls are sections docked under the text. */
@media (min-width:940px){
  :root{--side:clamp(440px,34vw,680px)}
  .sheet{padding:28px 32px calc(var(--bar) + 40px)}
  .mv{display:grid;grid-template-columns:minmax(0,1fr) var(--side);align-items:start}
  .stage{height:calc(100vh - var(--top) - var(--bar));border-bottom:0;border-right:1px solid var(--rule)}
  .hud{left:24px;top:18px;font-size:14px}
  .camtools{right:16px;top:14px}
  #play{right:16px;bottom:16px}
  #reset{right:70px;bottom:16px}

  .mv .sheet{position:sticky;top:var(--top);height:calc(100vh - var(--top));max-width:none;padding:0;display:flex;flex-direction:column}
  .read{flex:1;min-height:0;overflow-y:auto;padding:40px 44px 36px;scrollbar-width:thin;scrollbar-color:var(--edge) transparent}
  .read:focus-visible{outline-offset:-2px}
  .mv h1{margin-bottom:14px;font-size:32px;line-height:1.15}
  .mv h1 .n{margin-bottom:10px;font-size:44px;line-height:.9;letter-spacing:-.035em;color:var(--ink);font-variant-numeric:tabular-nums}
  .mv h1 .n small{margin-right:10px;font-size:20px;letter-spacing:0;color:var(--soft)}
  .mv .lede{font-size:19px;line-height:1.5}
  .mv .sheet h2{margin-top:30px}

  .ctl{position:static;flex:none;display:block;height:auto;max-height:60%;overflow-y:auto;background:var(--paper);box-shadow:0 -10px 18px -16px rgba(0,0,0,.35);scrollbar-width:thin;scrollbar-color:var(--edge) transparent}
  .tab{width:100%;height:50px;gap:12px;padding:0 38px 0 44px}
  .tab:hover{background:var(--fill)}
  .tab:focus-visible{outline-offset:-2px}
  #tab-ctl{border-left:0;border-top:1px solid var(--rule)}
  .tab .tx{display:flex;align-items:baseline;gap:14px}
  .tab .ttl{font-size:17px}
  .tab .sum{display:block;flex:1;min-width:0;text-align:right}
  .tab[aria-expanded="true"]{background:none}
  .tab[aria-expanded="true"]:hover{background:var(--fill)}
  .tab[aria-expanded="true"] .sum{visibility:hidden}
  .tab .chev{transform:rotate(180deg)}
  .tab[aria-expanded="true"] .chev{transform:none}
  .panel{position:static;overflow:visible;padding:4px 44px 22px}
  .chips{flex-wrap:wrap;overflow:visible;margin:0;padding:0;gap:6px}
  .panel .chips button{min-height:36px;padding:5px 12px 5px 10px;font-size:14px}
  .panel{gap:12px}
  #panel-ctl{gap:14px}

  .mv ~ .bar{right:var(--side);padding:0 24px;gap:22px;border-right:1px solid var(--rule)}
  .mv ~ .bar .go{gap:10px;padding:0 10px;border-radius:12px}
  .mv ~ .bar .go:hover{background:var(--fill)}
  .mv ~ .bar .go.prev{justify-self:end}
  .mv ~ .bar .go.next{justify-self:start}
  .mv ~ .bar .go .t b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media (min-width:940px) and (max-height:800px){
  .read{padding-top:28px}
  .mv h1{font-size:28px}
  .mv h1 .n{margin-bottom:8px;font-size:38px}
  .mv .lede{font-size:17px}
}
@media (min-width:1700px) and (min-height:801px){
  :root{--top:68px}
  .brand{font-size:28px}
  .read{padding:52px 56px 40px;font-size:18px}
  .mv h1{font-size:36px}
  .mv h1 .n{font-size:52px}
  .mv .lede{font-size:20px}
  .tab{padding:0 50px 0 56px}
  .panel{padding:4px 56px 24px}
}

/* contents page: search box, family buttons, one card per movement */
.home-wrap{max-width:1240px;margin:0 auto;padding:28px 16px 60px}
.home-wrap h1{font-weight:700;font-size:clamp(28px,7vw,44px);line-height:1.1;margin:0 0 12px;max-width:20ch;text-wrap:balance}
.home-wrap .lede{max-width:60ch;margin:0 0 24px;color:var(--soft)}
.home-wrap .lede a{font-weight:700;color:var(--ink)}
@media (min-width:940px){
  .home-wrap{padding-top:40px}
  .home-wrap h1{font-size:48px;max-width:none}
}

.find{display:flex;align-items:center;gap:12px;height:56px;padding:0 18px;margin:0 0 16px;font-size:18px;border:1px solid var(--edge);border-radius:12px;color:var(--soft)}
.findrow{display:flex;gap:10px;margin:0 0 16px}
.findrow .find{flex:1;min-width:0;margin:0}
.surprise{display:flex;align-items:center;gap:8px;height:56px;padding:0 18px;border:1px solid color-mix(in srgb,var(--warm) 35%,transparent);border-radius:12px;background:color-mix(in srgb,var(--warm) 8%,transparent);color:var(--warm);font-size:17px;white-space:nowrap}
.surprise:hover{background:color-mix(in srgb,var(--warm) 15%,transparent)}
@media (max-width:520px){.surprise .lbl{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}.surprise{width:56px;padding:0;justify-content:center}}
.find:focus-within{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.find input{flex:1;min-width:0;height:100%;border:0;outline:0;background:none;font:inherit;color:var(--ink);-webkit-appearance:none;appearance:none}
.fam button{padding:6px 13px;min-height:36px;font-size:14px}
@media (min-width:940px){.home-wrap .fam{flex-wrap:nowrap;overflow-x:auto;margin:0 -16px;padding:0 16px 2px}}
@media (min-width:700px){   /* headline, lede and filters centred over the full-width search */
  .home-wrap h1,.home-wrap .lede{text-align:center;margin-left:auto;margin-right:auto}
  .home-wrap .fam button:first-child{margin-left:auto}
  .home-wrap .fam button:last-child{margin-right:auto}
}
.count{margin:16px 0 10px;font-size:14px;color:var(--soft)}
.grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px 12px}
.grid li[hidden]{display:none}
.card{display:block;text-decoration:none;border-radius:12px}
.pic{position:relative;display:grid;place-items:center;aspect-ratio:4/3;border-radius:12px;background:var(--fill);overflow:hidden}
.pic img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;transition:opacity .2s}
.pic .eng{padding:10px;mix-blend-mode:multiply}
:root[data-look="dark"] .pic .eng{filter:invert(1);mix-blend-mode:screen}
.pic.has-model .eng{opacity:0}
.pic .no{position:absolute;right:8px;top:8px;z-index:1;padding:2px 8px;border-radius:999px;background:var(--paper);font-size:13px;font-weight:700;line-height:1.3;color:var(--soft);font-variant-numeric:tabular-nums;transition:opacity .2s}
.pic.bare .no{display:none}
.pic.bare::before{content:attr(data-n);font-size:34px;font-weight:700;color:var(--edge)}
.card.todo .pic img{opacity:.55}
.cap{display:block;padding:8px 2px 0;line-height:1.25}
.cap b{font-size:15px;font-weight:700}
@media (hover:hover){
  .card:hover .pic{box-shadow:inset 0 0 0 1px var(--edge)}
  .card:hover .pic.has-model.eng-ok .eng{opacity:1}
  .card:hover .pic.has-model.eng-ok .model{opacity:0}
  .card:hover .pic.has-model.eng-ok .no{opacity:0}   /* Brown's engraving carries its own number */
}
@media (min-width:700px){.grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:22px 18px}}

/* Brown's index */
.sheet.index{max-width:860px}
.index section{scroll-margin-top:calc(var(--top) + 8px)}
.index .jump{flex-wrap:wrap;overflow:visible;margin:0;padding:0}
.jump button{min-width:40px;justify-content:center;padding:7px 10px}
.ix{list-style:none;margin:0;padding:0}
.ix li{padding:4px 0;line-height:1.75}
.ix li.sub{padding-left:22px}
.ix .term{margin-right:6px}
.ix a{display:inline-block;margin-right:2px;padding:0 5px;border-radius:6px;font-weight:700;font-variant-numeric:tabular-nums;text-decoration:none;color:var(--spot)}
.ix a:hover{background:var(--fill)}
.ix a.todo{font-weight:400;color:var(--soft)}

/* Brown's engraving inside "In Brown's words"; paper-coloured backing so the black lines read in dark mode too */
.fig{margin:4px 0 16px}
.fig-open{display:block;width:100%;max-width:420px;padding:12px;border:1px solid var(--rule);border-radius:12px;background:#fbfaf6;cursor:zoom-in}
.fig-open:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.fig-open img{display:block;width:100%;height:auto;max-height:300px;object-fit:contain;mix-blend-mode:multiply}
.fig figcaption{margin-top:6px;font-size:13px;color:var(--soft)}
.fig-dlg{max-width:min(92vw,900px);max-height:92vh;padding:18px;border:0;border-radius:14px;background:#fbfaf6;color:#2A3540;cursor:zoom-out}
.fig-dlg::backdrop{background:rgba(20,24,28,.72)}
.fig-dlg img{display:block;max-width:100%;max-height:calc(92vh - 80px);margin:0 auto;object-fit:contain;mix-blend-mode:multiply}
.fig-dlg p{margin:10px 0 0;font-size:13px;text-align:center;color:#5b6570}

/* the page words scripts/pages.py writes for search engines; the engine replaces them */
.js .pre { display: none; }
