:root{
  --r3:28px;--bezel:1px;--ink:#000;
  --backdrop:#ece6d6;--bezel-c:#0e0e0f;--edge:#0e0e0f;
  --screen:#f6f5f2;--surface:#ecebe7;--text:#1d1c1a;--fade:#8f8c85;--muted:#625f59;--link:#1a5fcf;
  --t2:.8rem;--t3:.9rem;--t4:1rem;--t5:1.1rem;
}
@media (prefers-color-scheme:dark){
  :root{--edge:#4a4a4f;--backdrop:#0f1512;--screen:#18181a;--surface:#222225;--text:#efede8;--fade:#8c8a85;--muted:#9c9890;--link:#8ab4ff}
}
/* Background: still PNG layers (small stars). Nothing moves. */
body::before{content:'';position:fixed;inset:0;z-index:-1;background:url(../img/pattern-light.png) 0 0/1000px 1000px;pointer-events:none}
@media (prefers-color-scheme:dark){
  body::before{background-image:url(../img/pattern-dark.png)}
}
html{scrollbar-gutter:stable;-webkit-text-size-adjust:100%}
*{box-sizing:border-box}
body{margin:0;background:var(--backdrop);color:var(--text);font:400 var(--t4)/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;text-align:left;padding:24px 16px}
a{color:inherit}
a:focus-visible,button:focus-visible{outline:1px solid var(--muted);outline-offset:3px}

/* Page: text sits straight on the background, centred. Only app icons and the app card are boxes. */
.device{max-width:64rem;margin:0 auto}
.screen{display:flex;flex-direction:column;align-items:center;text-align:center}
.hero{width:100%;min-height:calc(100dvh - 120px);display:flex;flex-direction:column;justify-content:center;align-items:center;padding:48px 0}
.hero h1{font-size:clamp(3.4rem,18vw,13rem);line-height:.85;letter-spacing:-.05em;margin:0;font-weight:700;background:linear-gradient(180deg,var(--text) 15%,var(--fade) 100%);-webkit-background-clip:text;background-clip:text;color:transparent;display:flex;align-items:flex-start;gap:6px}
.hero h1 sup{font-size:var(--t3);font-weight:400;letter-spacing:0;margin-top:.5em}
.hero.small{min-height:40dvh}
.hero.small h1{font-size:clamp(2.6rem,10vw,6rem)}
.tag{margin:32px 0 0;max-width:22rem;font-size:clamp(1.2rem,3.4vw,1.7rem);line-height:1.25;font-weight:600}
.part{width:100%;padding:80px 0}
.part h2{margin:0 0 28px;font-size:var(--t3);font-weight:400;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.part p{margin:0;font-size:var(--t5)}
.grid{display:flex;flex-wrap:wrap;justify-content:center;gap:16px;max-width:60rem;margin:0 auto}
/* 404 page: the one title sits in the middle of the screen */
.lost .hero{min-height:calc(100dvh - 48px)}

/* Library tiles: small square app icons */
.tile{width:6.5rem}
.tile .face{width:100%;aspect-ratio:1;background:var(--surface);border:var(--bezel) solid var(--edge);border-radius:22px;display:flex;align-items:center;justify-content:center}
.tile .face svg,.sheet .logo svg{width:78%;aspect-ratio:1;fill:none;stroke:var(--muted);stroke-width:1;vector-effect:non-scaling-stroke;opacity:.55}
.tile .face svg *,.sheet .logo svg *{vector-effect:non-scaling-stroke}
.tile .face.brand,.sheet .logo.brand{background:var(--ink)}
.tile .face svg.brand,.sheet .logo.brand svg{width:100%;fill:#fff;stroke:none;opacity:1}
.tile .face svg.logo{width:42%;aspect-ratio:1200/1227;fill:var(--text);stroke:none;opacity:1}
.tile .face picture{display:contents}
.tile .face img.logo{display:block;width:42%;height:auto}
.defs{position:absolute;width:0;height:0;overflow:hidden}

/* App cards. A tile is a button. It opens a card in front of the page (see js/site.js for the flight of the logo). */
.tile button.face{padding:0;font:inherit;color:inherit;cursor:pointer;appearance:none}
.sheet{width:min(36rem,calc(100vw - 32px));min-height:min(30rem,calc(100dvh - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:0;overflow:auto;background:var(--screen);color:var(--text);border:var(--bezel) solid var(--edge);border-radius:var(--r3)}
.sheet.morph{overflow:hidden}
.sheet::backdrop{background:rgba(14,14,15,.5)}
.sheet[open]{display:flex;flex-direction:column}
.sheet .inner{flex:1;display:flex;flex-direction:column;padding:28px}
.sheet .head{display:flex;align-items:center;gap:16px;margin-bottom:20px}
.sheet .logo{width:80px;aspect-ratio:1;flex:none;display:flex;align-items:center;justify-content:center;background:var(--surface);border-radius:22px}
.sheet h3{flex:1;margin:0;padding-right:40px;font-size:1.4rem;font-weight:600}
.sheet .close{position:absolute;top:16px;right:16px;width:32px;height:32px;padding:0;border:0;border-radius:16px;background:var(--surface);color:var(--muted);display:flex;align-items:center;justify-content:center;cursor:pointer}
.sheet .close svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.sheet p{margin:0;font-size:var(--t5)}.sheet p.links{margin-top:auto}
.sheet a.link{color:var(--link)}
html.lock{overflow:hidden}
.ball{position:fixed;inset:auto;left:0;top:0;margin:0;padding:0;border:2px solid var(--text);width:14px;height:14px;border-radius:50%;background:var(--screen);overflow:visible}
.ball.mark{border:0;background:var(--text)}
@media (prefers-reduced-motion:no-preference){.sheet[open]::backdrop{animation:fade-in 200ms ease-out}}

footer{padding:32px 0 8px;color:var(--muted);font-size:var(--t2);text-align:center}footer p{margin:0}
footer a{color:inherit}

/* Tile hover (mouse only): a tile pops out a little */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .tile .face{transition:transform 220ms cubic-bezier(.2,.6,.2,1)}
  .tile .face:hover{transform:translateY(-2px) scale(1.02)}
}

@media (prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}
section[id]{scroll-margin:16px 0}

@media (max-width:640px){
  body{padding:16px}
  .tag{max-width:11rem}
  .part{padding:56px 0}
}

/* Page change: soft fade between pages (browsers without support just navigate) */
@view-transition{navigation:auto}
@media (prefers-reduced-motion:no-preference){
  ::view-transition-old(root){animation:fade-out 200ms ease-out both}
  ::view-transition-new(root){animation:fade-in 200ms ease-out both}
}
@keyframes fade-out{to{opacity:0}}
@keyframes fade-in{from{opacity:0}}

/* Side navigation: a slim dark box on the left edge. Only icons sit inside it, names sit outside.
   An invisible strip (::before) reaches where the icons appear, so moving toward them already opens it.
   On hover or focus the menu icon fades out, then the page icons fade in (one after the other, never together) and the box grows. */
.edge{position:fixed;left:0;top:calc(50% - 28px);z-index:5;width:40px;height:56px;color:#fff;transition:top 220ms cubic-bezier(.2,.6,.2,1),height 220ms cubic-bezier(.2,.6,.2,1)}
.edge:hover,.edge:focus-within{top:calc(50% - 82px);height:164px;outline:0}
.edge::before{content:'';position:absolute;left:0;top:-54px;bottom:-54px;width:40px}
.edge:hover::before,.edge:focus-within::before{top:0;bottom:0}
.edge .box{position:absolute;inset:0;background:var(--bezel-c);border-radius:0 22px 22px 0}
.edge .item{position:absolute;left:0;width:40px;height:40px;display:block;color:#fff;text-decoration:none;transition:opacity 110ms ease-out,visibility 110ms}
.edge .rest{top:8px;pointer-events:none;transition-delay:110ms}
.edge .one{top:14px}
.edge .two{top:62px}
.edge .three{top:110px}
.edge .go{opacity:0;visibility:hidden}
.edge:hover .go,.edge:focus-within .go{opacity:1;visibility:visible;transition-delay:110ms}
.edge:hover .rest,.edge:focus-within .rest{opacity:0;visibility:hidden;transition-delay:0s}
.edge .ico{position:absolute;left:4px;top:4px;width:32px;height:32px;border-radius:16px;display:flex;align-items:center;justify-content:center;transition:background-color 150ms ease-out}
.edge .lab{position:absolute;left:48px;top:7px;height:26px;display:flex;align-items:center;padding:0 10px;border-radius:13px;background:var(--screen);color:var(--text);font-size:var(--t2);white-space:nowrap}
.edge a:focus-visible .ico{outline:1px solid #fff}
@media (hover:hover){.edge a:hover .ico{background:rgba(255,255,255,.16)}}
.edge svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.edge svg.fil{position:absolute;left:0;width:18px;height:18px;fill:var(--bezel-c);stroke:none}
.edge svg.top{top:-18px;transform:scaleX(-1)}
.edge svg.bot{bottom:-18px;transform:scale(-1,-1)}
@media (prefers-reduced-motion:reduce){.edge,.edge .item,.edge .ico{transition:none}}
