@font-face{
  font-family:'Geist Mono';
  src:url('fonts/GeistMono-VariableFont_wght.ttf') format('truetype-variations');
  font-weight:100 900;
  font-display:swap;
}

:root{
  --ground:#ffffff;
  --ink:#18171c;
  --dim:#a3a2a4;
  --fs:10px;
  --track:.15em;
  --ok:#1a9f47;              /* the only colour in here — the copied tick */
}
@media (prefers-color-scheme:dark){
  :root{ --ground:#101010; --ink:#f2f1f3; --dim:#77767b; --ok:#3fd93f; }
}
:root[data-theme="light"]{ --ground:#ffffff; --ink:#18171c; --dim:#a3a2a4; --ok:#1a9f47; }
:root[data-theme="dark"] { --ground:#101010; --ink:#f2f1f3; --dim:#77767b; --ok:#3fd93f; }

*{margin:0;padding:0;box-sizing:border-box}

html,body{
  height:100%;
  overflow:hidden;
  background:var(--ground);
  -webkit-font-smoothing:antialiased;
  text-rendering:geometricPrecision;
}

body{
  font-family:'Geist Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
  font-weight:500;
  font-size:var(--fs);
  letter-spacing:var(--track);
  line-height:1.25;
  text-transform:uppercase;
  color:var(--dim);
  overscroll-behavior:none;
  touch-action:none;
  cursor:grab;
  user-select:none;
  -webkit-user-select:none;
  -webkit-tap-highlight-color:transparent;
}
body.drag{cursor:grabbing}

#stage{position:fixed;inset:0;overflow:hidden}

/* one frame = the mask rect. everything hangs off its live dimensions. */
.fr{
  position:absolute;
  top:0;left:0;
  will-change:transform,width,height;
}

.mask{
  position:absolute;
  inset:0;
  overflow:hidden;
  background:var(--ground);
}

.ph{
  position:absolute;
  left:50%;top:50%;
  transform-origin:50% 50%;
  will-change:transform;
  pointer-events:none;
  display:block;
}

/* text components — anchored to the mask's live top and bottom edges */
.meta{
  position:absolute;
  left:100%;
  top:0;bottom:0;
  pointer-events:none;
  will-change:opacity;
}
.m-head{position:absolute;top:0;left:0}
.m-foot{position:absolute;bottom:0;left:0}
.code{display:block;color:var(--ink)}
.spec,.desc{display:block;color:var(--dim)}
.desc{text-wrap:pretty;overflow-wrap:break-word;hyphens:none}
.dim{display:block;color:var(--dim);font-variant-numeric:tabular-nums}

/* per-character reveal, gated by the aperture — no layout shift, the glyphs
   are always in the flow, they just aren't inked yet */
.ch{opacity:0}
.ch.on{opacity:1}

/* page furniture — same type system, sat on the page margin */
.mark{
  position:fixed;
  bottom:12px;
  font:inherit;
  letter-spacing:inherit;
  text-transform:inherit;
  color:var(--dim);
  background:none;
  border:0;
  padding:0;
  opacity:.55;
  text-decoration:none;
  cursor:pointer;
  z-index:5;
  transition:opacity .25s ease;
}
.mark:hover{opacity:1}
#by{left:14px}
#copy{right:14px;color:var(--ink)}
#copy.done{opacity:1}

/* ground toggle — a filled square on the top margin, nothing else */
#theme{
  position:fixed;
  top:14px;right:14px;
  width:15px;height:15px;
  padding:0;border:0;
  background:var(--ink);
  cursor:pointer;
  z-index:5;
  opacity:.9;
  transition:opacity .25s ease;
}
#theme:hover{opacity:1}

#close{
  top:12px;bottom:auto;right:12px;
  color:var(--ink);
  opacity:0;
  pointer-events:none;
  font-size:calc(var(--fs) * 1.3);
  letter-spacing:0;
  z-index:6;
}
#close.on{pointer-events:auto}

/* ---- copy sheet ------------------------------------------------------
   not a modal: the button opening into a panel in its own corner, on its own
   ground. Body copy drops the uppercase + wide tracking — a paragraph in strip
   type is unreadable, same reason the lab's notes do. */
#sheet{
  position:fixed;
  right:14px;
  bottom:calc(14px + 3em);
  z-index:7;
  width:min(320px, calc(100vw - 28px));
  background:var(--ground);
  padding:15px 16px 16px;
  color:var(--dim);
}
#sheet[hidden]{display:none}
.sh-h{color:var(--ink);margin-bottom:1.05em}
.sh-b{
  text-transform:none;
  letter-spacing:.045em;
  line-height:1.62;
  font-size:calc(var(--fs) + 1px);
}
.sh-b p{margin:0 0 .85em}
.sh-b p:last-child{margin-bottom:0}
.sh-b b{color:var(--ink);font-weight:500}
.sh-b .ok{color:var(--ok)}
.sh-b .cta{margin-top:1.15em;opacity:.72}
.sh-b a{color:var(--ink);text-decoration:none;border-bottom:1px solid currentColor;padding-bottom:1px}
.sh-b a:hover{opacity:.7}
.sh-a{margin-top:1.25em;display:flex;flex-direction:column;gap:.55em}
.sh-a button{
  font:inherit;letter-spacing:inherit;text-transform:uppercase;
  background:none;border:0;padding:0;
  color:var(--ink);
  text-align:left;
  cursor:pointer;
  opacity:.62;
  transition:opacity .2s ease;
}
.sh-a button:hover,.sh-a button:focus-visible{opacity:1;outline:none}
.sh-a button .ar{display:inline-block;width:1.5em}
#sheet-x{
  position:absolute;top:13px;right:14px;
  font:inherit;letter-spacing:0;
  background:none;border:0;padding:0;
  color:var(--ink);opacity:.45;cursor:pointer;
  font-size:calc(var(--fs) * 1.25);
}
#sheet-x:hover{opacity:1}
body.xp #theme{opacity:0;pointer-events:none}

@media (max-width:760px){
  :root{--fs:9px;--track:.12em}
  /* narrow: the two marks stack as one right-aligned block (Figma 390:239) */
  #copy{right:14px;bottom:calc(14px + 1.45em)}
  #by{left:auto;right:14px;bottom:14px;text-align:right}
}

@media (prefers-reduced-motion:reduce){
  .ph{transition:none}
}
