@font-face {
  font-family: "Notebook Hand";
  src: url("/assets/notebook-hand.woff2") format("woff2");
  font-weight: 400 650;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f2efe4;
  --ink: #272820;
  --soft: #57594e;
  --pencil: #97988b;
  --marker: #c6e4a8;
  --hand: "Notebook Hand", "Segoe Print", "Comic Sans MS", cursive;
  --ui: var(--hand);
  --edge: clamp(23px, 6vw, 82px);
  font-family: var(--hand);
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
html { --anchor-inset: 1.25rem; scroll-padding-block-start: var(--anchor-inset); }
body {
  margin: 0;
  font: 400 1.1rem/1.5 var(--hand);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,p,figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
::selection { color: var(--ink); background: var(--marker); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition { pointer-events: none; }
  ::view-transition-old(root), ::view-transition-new(root) {
    animation-duration: .54s;
    animation-timing-function: cubic-bezier(.35,0,.35,1);
  }
}

/* The pen marks a link. The highlighter sits behind a short phrase. */
.ink-word {
  position: relative;
  display: inline-block;
  line-height: 1.3;
}
.ink-word svg {
  position: absolute;
  left: 0;
  bottom: -.22em;
  width: 100%;
  height: .32em;
  overflow: visible;
  pointer-events: none;
  color: var(--soft);
}
.draw-ink {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.ink-mark {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: inherit;
  background: transparent;
  white-space: nowrap;
}
.marker-ink {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 29% -.12em 1%;
  background: var(--marker);
  clip-path: polygon(1% 11%, 18% 7%, 43% 10%, 72% 5%, 99% 0, 100% 82%, 85% 89%, 64% 86%, 39% 97%, 15% 92%, 0 100%);
}
@media (hover: hover) {
  a:hover .ink-word svg { color: var(--ink); }
}

/* Both layers fade together. Only the toy turns around its centre bearing. */
@media (prefers-reduced-motion: no-preference) {
  html.spin-started::before, html.spin-started::after {
    content: "";
    position: fixed;
    z-index: 100;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity .52s ease-in-out, visibility 0s linear .52s;
  }
  html.spin-started::before {
    inset: 0;
    background: var(--paper) url("/assets/fidget-trails.svg") center / clamp(142px,16.4vw,183px) auto no-repeat;
  }
  html.spin-started::after {
    inset: 0;
    margin: auto;
    width: clamp(104px, 12vw, 134px);
    height: clamp(104px, 12vw, 134px);
    background: url("/assets/fidget.svg?v=sticker") center / contain no-repeat;
    animation: turn-fidget 1.18s linear infinite;
  }
  html.spinning::before, html.spinning::after {
    visibility: visible;
    opacity: 1;
    transition: none;
  }
  @keyframes turn-fidget { to { transform: rotate(1turn); } }
}

.home-tab {
  display: grid; place-items: center; position: relative;
  align-self: start; width: 44px; height: 50px; justify-self: center;
}
.home-tab svg { position: absolute; bottom: 0; width: 32px; height: auto; pointer-events: none; }
@media (hover: hover) {
  .home-tab:hover svg { transform: translateY(5px); }
}
.home-tab:focus-visible svg, .home-tab:active svg { transform: translateY(5px); }
@media (prefers-reduced-motion: no-preference) {
  .home-tab svg { transition: transform .38s cubic-bezier(.23,.68,.3,1); }
}

.preload-percent {
  position: fixed;
  z-index: 101;
  pointer-events: none;
  top: calc(50% + clamp(84px, 10vw, 114px));
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  min-width: 3.6em;
  text-align: center;
  padding: 3px 9px 4px;
  border-radius: 47% 44% 48% 41% / 34% 47% 41% 52%;
  background: #dce4b9;
  color: var(--ink);
  font: 500 clamp(1.12rem, 2vw, 1.5rem)/1.15 var(--hand);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  visibility: hidden;
  transition: opacity .52s ease, visibility 0s linear .52s;
}
html.spinning .preload-percent {
  opacity: 1;
  visibility: visible;
  transition: none;
}
