@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/fraunces-normal-300-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/figtree-normal-300-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-normal-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-normal-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tinkerfold: paper, ink and a few folds. */

@property --fold {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  color-scheme: light dark;

  --paper: #f3ede2;
  --paper-deep: #e8dfcf;
  --sheet: #fdfaf4;
  --ink: #1d1a16;
  --ink-soft: #4b443b;
  --ink-faint: #6f665a;
  --rule: rgb(29 26 22 / 0.13);
  --shadow: 32deg 30% 22%;

  --accent: #e0492b;
  --accent-ink: #b5341a;
  --flap-lit: #fdf8f0;
  --flap-shade: #e2d4bf;

  --lv: #6c58e4;
  --lv-deep: #4a39bd;
  --lv-paper: #e6e0fb;
  --lv-fold-lit: #d3caf7;
  --lv-fold-shade: #b8abef;

  --em: #c0600a;
  --em-deep: #8e4305;
  --em-paper: #f5e4c9;
  --em-fold-lit: #ebd1a2;
  --em-fold-shade: #dbb87e;
  --em-sentence: #f6dbab;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='.16' intercept='.9'/%3E%3CfeFuncG type='linear' slope='.16' intercept='.89'/%3E%3CfeFuncB type='linear' slope='.16' intercept='.875'/%3E%3CfeFuncA type='linear' slope='0' intercept='1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  --grain-blend: multiply;

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1140px;
  --ease-fold: cubic-bezier(.65, 0, .35, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1916;
    --paper-deep: #131210;
    --sheet: #282520;
    --ink: #f2ece2;
    --ink-soft: #cdc4b6;
    --ink-faint: #a2988a;
    --rule: rgb(242 236 226 / 0.14);
    --shadow: 30deg 45% 2%;

    --accent: #ee5a3a;
    --accent-ink: #ff8a6c;
    --flap-lit: #efe6d7;
    --flap-shade: #c3b39c;

    --lv: #9a8bff;
    --lv-deep: #5a48d6;
    --lv-paper: #25203e;
    --lv-fold-lit: #3d3569;
    --lv-fold-shade: #2e2852;

    --em: #ee9d4a;
    --em-deep: #a3530c;
    --em-paper: #2d2317;
    --em-fold-lit: #4d3a20;
    --em-fold-shade: #3a2c19;
    --em-sentence: #4f381a;

    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='.06' intercept='-.012'/%3E%3CfeFuncG type='linear' slope='.06' intercept='-.014'/%3E%3CfeFuncB type='linear' slope='.06' intercept='-.016'/%3E%3CfeFuncA type='linear' slope='0' intercept='1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
    --grain-blend: screen;
  }
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--grain), var(--paper);
  background-blend-mode: var(--grain-blend);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: inherit; text-wrap: balance; }
ul { margin: 0; padding: 0; list-style: none; }
b { font-weight: 650; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 2px; }

main { overflow-x: clip; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 3px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* The mark: a red sheet with one corner folded to the middle */

.mark__sheet { fill: var(--accent); }
.mark__shadow { fill: rgb(80 18 6 / .34); }
.mark__flap { fill: url(#mark-flap); }

/* Header */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: clamp(18px, 3vw, 30px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand__word {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 48, "SOFT" 100, "WONK" 0;
}

.nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 30px); }
.nav a {
  position: relative;
  padding-block: 6px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .98rem;
  text-decoration: none;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease-fold);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

/* Buttons. On hover a small corner folds down. */

.btn {
  --bg: var(--ink);
  --fg: var(--paper);
  --ear-c: color-mix(in oklab, var(--bg) 55%, white);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px 12px 18px;
  border: 0;
  border-radius: 2px;
  background: var(--bg);
  color: var(--fg);
  font: 600 1rem/1.1 var(--body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 hsl(var(--shadow) / .22), 0 8px 18px -10px hsl(var(--shadow) / .7);
  transition: box-shadow .2s ease;
}
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  background: linear-gradient(225deg, var(--behind, var(--paper)) 50%, var(--ear-c) 50%);
  transition: width .2s var(--ease-fold), height .2s var(--ease-fold);
}
.btn:hover { box-shadow: 0 1px 0 hsl(var(--shadow) / .22), 0 12px 24px -10px hsl(var(--shadow) / .75); }
.btn:hover::after, .btn:focus-visible::after { width: 14px; height: 14px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn small { font-size: .82rem; font-weight: 500; opacity: .72; }

.btn--ghost {
  --bg: transparent;
  --fg: var(--ink);
  --ear-c: var(--rule);
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px currentColor, 0 8px 18px -12px hsl(var(--shadow) / .6); }

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
  padding-block: clamp(24px, 6vw, 80px) clamp(64px, 10vw, 128px);
}

.tag {
  display: inline-flex;
  margin-bottom: 26px;
  filter: drop-shadow(0 1px 1px hsl(var(--shadow) / .18)) drop-shadow(0 4px 8px hsl(var(--shadow) / .1));
}
.tag span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 24px;
  background: var(--grain), var(--sheet);
  background-blend-mode: var(--grain-blend);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  color: var(--ink-soft);
  font: 500 .76rem/1.2 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.tag span::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper-deep);
  box-shadow: inset 0 1px 1.5px hsl(var(--shadow) / .5);
}

.hero h1 {
  margin-bottom: 24px;
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(2.7rem, 6.6vw, 5.4rem);
  line-height: .98;
  letter-spacing: -0.038em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.hero h1 em {
  padding-bottom: .1em;
  font-style: normal;
  color: var(--accent-ink);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 6.5 6 1.5l6 5 6-5 6 5' fill='none' stroke='%23e0492b' stroke-width='1.6'/%3E%3C/svg%3E") left bottom / .42em .14em repeat-x;
}

.hero__lede {
  max-width: 33ch;
  margin-bottom: 34px;
  color: var(--ink-soft);
  font-size: clamp(1.1rem, 1.7vw, 1.28rem);
  line-height: 1.55;
}

.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.hero__note { color: var(--ink-faint); font: 400 .8rem/1.4 var(--mono); letter-spacing: .02em; }

/* Hero art: three sheets of origami paper. assets/pals.js folds them into a fox, a
   penguin and a dog, drawn on canvases that sit here or, on wide screens, in the margin. */

.hero__art {
  position: relative;
  justify-self: center;
  width: min(100%, 500px);
  aspect-ratio: 1;
}

.stack { position: absolute; inset: 0; }

.psheet {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc(var(--y) * 100%);
  width: calc(var(--s) * 100%);
  aspect-ratio: 1;
  translate: -50% -50%;
  rotate: var(--r);
  background: var(--grain), var(--c);
  background-blend-mode: var(--grain-blend);
  box-shadow: 0 1px 1px hsl(var(--shadow) / .14), 0 10px 14px hsl(var(--shadow) / .24);
}
.psheet--em { --c: #e8b562; --x: .25; --y: .37; --s: .42; --r: -11deg; }
.psheet--lv { --c: #9d8ef2; --x: .76; --y: .33; --s: .4; --r: 8deg; }
.psheet--red { --c: var(--accent); --x: .54; --y: .6; --s: .46; --r: -3deg; }
.hero__art.has-pals .stack { visibility: hidden; }

.pals-home { position: absolute; inset: 0; pointer-events: none; }
.pals-side { position: fixed; inset: 0; z-index: 30; overflow: hidden; pointer-events: none; }
.pal { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.pal canvas { display: block; }

/* While a pal is away, its sheet's crease pattern stays behind in the hero. */
.pal-nest { position: absolute; left: 0; top: 0; overflow: visible; opacity: 0; transition: opacity .6s ease; }
.pal-nest path { fill: none; stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 4 5; }
.pal-nest.is-shown { opacity: .38; }

@media print {
  .pals-home, .pals-side { display: none; }
  .hero__art.has-pals .stack { visibility: visible; }
}

/* A flap rotates 180° about its crease. The face switches at 90°, when the flap is edge-on. */

/* -180° lifts each flap toward the viewer on its way over (positive goes behind the sheet). */
.flap {
  --to: -180deg;
  --fold: var(--to);
  background: var(--back);
  background-blend-mode: var(--grain-blend);
  transform: perspective(var(--persp, 1000px)) rotate3d(var(--ax), var(--ay), 0, var(--fold));
}

@keyframes fold-angle {
  from { --fold: 0deg; }
  to { --fold: var(--to); }
}
@keyframes fold-face {
  0%, 49.9% { background: var(--front); background-blend-mode: var(--grain-blend); }
  50%, 100% { background: var(--back); background-blend-mode: var(--grain-blend); }
}

/* Folded sheets: paper with one corner cut away, and a flap that folds over the cut */

.fsheet { position: relative; --ear: 44px; }

.fsheet__paper {
  position: relative;
  background: var(--grain), var(--fsheet-bg);
  background-blend-mode: var(--grain-blend);
  clip-path: polygon(0 0, calc(100% - var(--ear)) 0, 100% var(--ear), 100% 100%, 0 100%);
}

.fsheet__ear {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--ear);
  height: var(--ear);
  pointer-events: none;
  filter: drop-shadow(-1.5px 2px 2px hsl(var(--shadow) / .3));
}
.fsheet__ear .flap {
  --ax: 1; --ay: 1;
  --persp: 500px;
  --front: var(--grain), var(--fsheet-bg);
  --back: var(--grain), linear-gradient(225deg, var(--fold-lit) 0 24%, var(--fold-shade) 50%);
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  transform-origin: 50% 50%;
}

/* With scripts, flaps below the fold wait unfolded and fold once they scroll into view. */
.js .fsheet__ear:not(.is-in, .is-done) { filter: none; }
.js .fsheet__ear:not(.is-in, .is-done) .flap { --fold: 0deg; background: var(--front); }
.fsheet__ear.is-in .flap {
  animation:
    fold-angle .9s var(--ease-fold) .1s both,
    fold-face .9s linear .1s both;
}

/* Sections */

.section-head { max-width: 640px; margin-bottom: clamp(28px, 5vw, 56px); }

.label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--accent-ink);
  font: 500 .78rem/1.2 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.label::before { content: ""; width: 28px; height: 1.5px; background: currentColor; }

.section-head h2 {
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.032em;
  font-variation-settings: "opsz" 120, "SOFT" 100, "WONK" 1;
}

/* Apps */

.apps { padding-block: clamp(16px, 3vw, 40px) clamp(48px, 8vw, 100px); }

.app { margin-bottom: clamp(28px, 5vw, 52px); }

.app--lv {
  --app: var(--lv);
  --app-deep: var(--lv-deep);
  --app-ink: var(--lv-deep);
  --app-paper: var(--lv-paper);
}
.app--em,
.guide--em {
  --app: var(--em);
  --app-deep: var(--em-deep);
  --app-ink: var(--em-deep);
  --app-paper: var(--em-paper);
}
@media (prefers-color-scheme: dark) {
  .app--lv { --app-ink: #b9afff; }
  .app--em, .guide--em { --app-ink: #f3b46e; }
}

.app__sheet {
  --ear: clamp(40px, 5vw, 60px);
  --fsheet-bg: var(--app-paper);
  --behind: var(--app-paper);
  filter: drop-shadow(0 1px 1px hsl(var(--shadow) / .12)) drop-shadow(0 14px 24px hsl(var(--shadow) / .14));
}
.app--lv .app__sheet { --fold-lit: var(--lv-fold-lit); --fold-shade: var(--lv-fold-shade); }
.app--em .app__sheet { --fold-lit: var(--em-fold-lit); --fold-shade: var(--em-fold-shade); }

.app__paper {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(22px, 4.5vw, 56px);
}
.app--em .app__paper { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.app--em .app__art { order: 2; }

.app__tag {
  margin-bottom: 12px;
  color: var(--app-ink);
  font: 500 .76rem/1.3 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.app__name {
  margin-bottom: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 4.4vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
}
.app__lede {
  margin-bottom: 16px;
  font-family: var(--display);
  font-weight: 450;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.3;
  font-variation-settings: "opsz" 36, "SOFT" 100;
}
.app__text { max-width: 46ch; margin-bottom: 18px; color: var(--ink-soft); }

.app__facts { display: grid; gap: 8px; margin-bottom: 26px; }
.app__facts li { position: relative; padding-left: 24px; color: var(--ink-soft); font-size: 1rem; }
.app__facts li::before,
.guide__list li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: .48em;
  width: 11px;
  height: 11px;
  background: linear-gradient(135deg, var(--app) 50%, color-mix(in oklab, var(--app), white 45%) 50%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.app__get { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.btn--app { --bg: var(--app-deep); --fg: #fff; }

.app__meta {
  margin-bottom: 12px;
  color: var(--ink-faint);
  font: 400 .78rem/1.5 var(--mono);
}

.app__help summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--app-ink);
  font-size: .92rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.app__help summary::-webkit-details-marker { display: none; }
.app__help summary::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -2px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .2s ease;
}
.app__help[open] summary::before { transform: rotate(45deg); }
.app__help p { max-width: 54ch; margin-top: 10px; color: var(--ink-soft); font-size: .92rem; }

.app__guide { margin-top: 12px; }
.app__guide a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--app-ink);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
}
.app__guide a::after { content: "→"; transition: transform .2s var(--ease-fold); }
.app__guide a:hover { text-decoration: underline; text-underline-offset: 4px; }
.app__guide a:hover::after { transform: translateX(3px); }

.cmd {
  display: flex;
  max-width: 100%;
  margin-bottom: 14px;
  border-radius: 2px;
  background: color-mix(in oklab, var(--app-paper), var(--ink) 6%);
  box-shadow: inset 0 0 0 1px var(--rule);
  font: 400 .8rem/1.4 var(--mono);
}
.cmd code {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  font: inherit;
}
.cmd code::-webkit-scrollbar { display: none; }
.cmd code::before { content: "$ "; color: var(--ink-faint); }
.cmd__copy {
  display: grid;
  flex: none;
  min-width: 78px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  color: var(--app-ink);
  font: 600 .8rem/1 var(--body);
  cursor: pointer;
}
.cmd__copy span { grid-area: 1 / 1; place-self: center; transition: opacity .2s ease; }
.cmd__copy .done, .cmd__copy[data-state="done"] .idle { opacity: 0; }
.cmd__copy[data-state="done"] .done { opacity: 1; }

/* Lingveil art: a window whose English layer sits exactly over the Japanese page */

.lv {
  padding: 6px 4px 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.lv__window {
  overflow: hidden;
  border-radius: 9px 9px 4px 4px;
  background: var(--grain), var(--sheet);
  background-blend-mode: var(--grain-blend);
  box-shadow: 0 1px 1px hsl(var(--shadow) / .14), 0 20px 34px -18px hsl(var(--shadow) / .5);
  transform: rotate(-1.4deg);
}
.lv__bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.lv__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); }
.lv__body { position: relative; }

.lv__page { padding: 20px 24px 22px; }
.lv__page:lang(ja) { font-family: var(--jp); }
.lv__kicker {
  margin-bottom: 8px;
  color: var(--accent-ink);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.lv__title {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  font-weight: 700;
  line-height: 1.3;
}
.lv__p { margin-bottom: 8px; color: var(--ink-soft); font-size: .9rem; line-height: 1.6; }
.lv__p:last-child { margin-bottom: 0; }

.lv__veil {
  --ear: clamp(92px, 10vw, 124px);
  --fsheet-bg: var(--sheet);
  --fold-lit: color-mix(in oklab, var(--sheet), var(--lv) 12%);
  --fold-shade: color-mix(in oklab, var(--sheet), var(--lv) 26%);
  position: absolute;
  inset: 0;
  transition: opacity .28s ease;
}
.lv__veil .fsheet__paper {
  height: 100%;
  clip-path: polygon(var(--ear) 0, 100% 0, 100% 100%, 0 100%, 0 var(--ear));
}
.lv__veil .fsheet__ear { right: auto; left: 0; filter: drop-shadow(1.5px 2px 2px hsl(var(--shadow) / .3)); }
.lv__veil .fsheet__ear .flap {
  --ax: 1; --ay: -1;
  --back: var(--grain), linear-gradient(135deg, var(--fold-lit) 0 24%, var(--fold-shade) 50%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.lv.is-peek .lv__veil { opacity: 0; }

.lv__hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-left: 6px;
  color: var(--ink-soft);
  font-size: .86rem;
}
.lv__hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--rule), 0 2px 0 1px hsl(var(--shadow) / .16);
  color: var(--ink);
  font: 500 .95rem/1 var(--body);
}
.lv__hint .touch { display: none; }
@media (hover: none) {
  .lv__hint kbd, .lv__hint .mouse { display: none; }
  .lv__hint .touch { display: inline; }
}

/* Earmark art: a book page with a dog-ear, the sentence shaded and the word lit */

.em { padding: 8px 6px; }
.em__sheet {
  --ear: 38px;
  --fsheet-bg: var(--sheet);
  --fold-lit: var(--em-fold-lit);
  --fold-shade: var(--em-fold-shade);
  filter: drop-shadow(0 1px 1px hsl(var(--shadow) / .14)) drop-shadow(0 18px 24px hsl(var(--shadow) / .2));
  transform: rotate(1.3deg);
}
.em__page { padding: 24px 28px 18px; }
.em__running {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-right: 30px;
  color: var(--ink-faint);
  font: 400 .66rem/1.3 var(--mono);
  letter-spacing: .1em;
  white-space: nowrap;
  text-transform: uppercase;
}
.em__text {
  margin-bottom: 12px;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(.95rem, 1.5vw, 1.04rem);
  line-height: 1.75;
  font-variation-settings: "opsz" 14, "SOFT" 50;
}
.em__sentence {
  padding-block: 2px;
  border-radius: 3px;
  background: var(--em-sentence);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.em__sentence > span {
  border-radius: 2px;
  transition: background-color .12s ease, box-shadow .12s ease, color .12s ease;
}
.em__sentence > span.is-on {
  background: var(--em-deep);
  box-shadow: 0 0 0 2px var(--em-deep);
  color: #fff;
}
.em__fade {
  -webkit-mask-image: linear-gradient(#000 20%, transparent 92%);
  mask-image: linear-gradient(#000 20%, transparent 92%);
}
.em__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font: 400 .7rem/1 var(--mono);
}
.em__play { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); }
.em__play::before, .em__play::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 3px;
  height: 10px;
  border-radius: 1px;
  background: var(--sheet);
}
.em__play::before { left: 10px; }
.em__play::after { right: 10px; }
.em__track { flex: 1; height: 3px; overflow: hidden; border-radius: 2px; background: var(--rule); }
.em__track i { display: block; width: 22%; height: 100%; background: var(--em); }

/* The next one: a blank sheet with its crease pattern */

.next {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px clamp(22px, 4.5vw, 56px);
  border: 1.5px dashed var(--rule);
  color: var(--ink-soft);
}
.next__sheet { flex: none; width: 40px; height: 40px; transform: rotate(-4deg); }
.next__sheet rect { fill: var(--sheet); stroke: var(--rule); stroke-width: 1.5; }
.next__sheet path { fill: none; stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 2.5 2.5; opacity: .7; }
.next p { font-family: var(--display); font-size: 1.1rem; font-variation-settings: "opsz" 24, "SOFT" 100; }
.next__no {
  margin-right: 12px;
  color: var(--ink-faint);
  font: 500 .76rem/1.2 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Workshop */

.workshop { padding-block: clamp(32px, 6vw, 80px) clamp(72px, 10vw, 128px); }

.slips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 34px); }

.slip {
  --r: 0deg;
  position: relative;
  padding: 34px 26px 28px;
  background: var(--grain), var(--sheet);
  background-blend-mode: var(--grain-blend);
  box-shadow: 0 1px 1px hsl(var(--shadow) / .1), 0 12px 26px -16px hsl(var(--shadow) / .45);
  transform: rotate(var(--r));
}
.slip:nth-child(1) { --r: -1.3deg; --tape: var(--accent); }
.slip:nth-child(2) { --r: .9deg; --tape: var(--lv); margin-top: 18px; }
.slip:nth-child(3) { --r: -.6deg; --tape: var(--em); }
.slip::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 96px;
  height: 25px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 6px, rgb(255 255 255 / .2) 6px 12px),
    color-mix(in srgb, var(--tape) 45%, transparent);
  clip-path: polygon(0 0, 100% 0, 97% 25%, 100% 50%, 97% 75%, 100% 100%, 0 100%, 3% 75%, 0 50%, 3% 25%);
  transform: translateX(-50%) rotate(calc(var(--r) * -2.5));
}
.slip__no { color: var(--ink-faint); font: 500 .76rem/1 var(--mono); letter-spacing: .08em; }
.slip h3 {
  margin: 12px 0 8px;
  font-family: var(--display);
  font-weight: 580;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 36, "SOFT" 100;
}
.slip p { color: var(--ink-soft); font-size: 1rem; }
.slip a { color: var(--accent-ink); text-underline-offset: 3px; }

/* Footer, with a pinked top edge */

.foot {
  position: relative;
  padding-block: clamp(48px, 7vw, 80px) 34px;
  background: var(--grain), var(--paper-deep);
  background-blend-mode: var(--grain-blend);
}
.foot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
  background: var(--grain), var(--paper-deep);
  background-blend-mode: var(--grain-blend);
  -webkit-mask: conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 0 0 / 20px 100% repeat-x;
  mask: conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 0 0 / 20px 100% repeat-x;
}
.foot__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 28px 40px;
}
.foot__brand p { margin-top: 12px; color: var(--ink-soft); }
.foot__nav { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.foot__nav a { color: var(--ink-soft); font-weight: 500; text-decoration: none; }
.foot__nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.foot__fine {
  grid-column: 1 / -1;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font: 400 .78rem/1.4 var(--mono);
}

/* Not found */

.lost {
  display: grid;
  justify-items: start;
  gap: 22px;
  min-height: 60vh;
  align-content: center;
  padding-block: 40px 100px;
}
.lost .mark { width: 120px; height: 120px; transform: rotate(-6deg); filter: drop-shadow(0 16px 22px hsl(var(--shadow) / .25)); }
.lost h1 {
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.lost p { max-width: 40ch; color: var(--ink-soft); font-size: 1.15rem; }

/* Help pages: an app's guide on dog-eared sheets, with a contents list beside it */

.guide--em {
  --zigzag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 6.5 6 1.5l6 5 6-5 6 5' fill='none' stroke='%23c0600a' stroke-width='1.6'/%3E%3C/svg%3E");
  --sheet-fold-lit: var(--em-fold-lit);
  --sheet-fold-shade: var(--em-fold-shade);
}
@media (prefers-color-scheme: dark) {
  .guide--em {
    --zigzag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 6.5 6 1.5l6 5 6-5 6 5' fill='none' stroke='%23ee9d4a' stroke-width='1.6'/%3E%3C/svg%3E");
  }
}

.guide-head { padding-block: clamp(16px, 4vw, 56px) clamp(36px, 6vw, 72px); }
.guide-head .label { color: var(--app-ink); }
.guide-head h1 {
  max-width: 14ch;
  margin-bottom: 22px;
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.036em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.guide-head h1 em {
  padding-bottom: .1em;
  font-style: normal;
  color: var(--app-ink);
  background: var(--zigzag) left bottom / .42em .14em repeat-x;
}
.guide-head__lede {
  max-width: 44ch;
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: clamp(1.08rem, 1.6vw, 1.22rem);
  line-height: 1.55;
}
.guide-head__meta { color: var(--ink-faint); font: 400 .8rem/1.5 var(--mono); }
.guide-head__meta a { color: var(--app-ink); text-underline-offset: 3px; }

.guide {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 5vw, 64px);
  padding-bottom: clamp(64px, 10vw, 120px);
}

.guide__toc { position: sticky; top: 28px; }
.guide__toc-title {
  margin-bottom: 16px;
  color: var(--ink-faint);
  font: 500 .74rem/1.2 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.guide__toc ol { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.guide__toc a { text-decoration: none; }
.guide__toc a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--app); text-underline-offset: 4px; }
.guide__toc ol > li > a { display: flex; align-items: baseline; gap: 10px; color: var(--ink); font-weight: 600; }
.guide__toc ol > li > a span { color: var(--app-ink); font: 500 .74rem/1 var(--mono); letter-spacing: .08em; }
.guide__toc ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0 4px;
  padding-left: 14px;
  border-left: 1.5px solid var(--rule);
}
.guide__toc ul a { color: var(--ink-soft); font-size: .9rem; line-height: 1.35; }

.guide__sheets { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 5vw, 48px); }

.guide__sheet {
  --ear: clamp(40px, 5vw, 56px);
  --fsheet-bg: var(--sheet);
  --fold-lit: var(--sheet-fold-lit);
  --fold-shade: var(--sheet-fold-shade);
  filter: drop-shadow(0 1px 1px hsl(var(--shadow) / .12)) drop-shadow(0 14px 24px hsl(var(--shadow) / .14));
}
.guide__paper { padding: clamp(24px, 5vw, 56px); }

.guide__no {
  margin-bottom: 12px;
  color: var(--app-ink);
  font: 500 .76rem/1.3 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.guide__paper h2 {
  margin-bottom: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
}
.guide__lede {
  margin-bottom: 26px;
  font-family: var(--display);
  font-weight: 450;
  font-size: clamp(1.15rem, 1.9vw, 1.35rem);
  line-height: 1.3;
  font-variation-settings: "opsz" 36, "SOFT" 100;
}
.guide__paper h3 {
  margin: 40px 0 12px;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
  font-family: var(--display);
  font-weight: 580;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 36, "SOFT" 100;
}
.guide__paper > p:not(.guide__no, .guide__lede) { max-width: 66ch; margin-bottom: 14px; color: var(--ink-soft); }
.guide__paper > p:last-child { margin-bottom: 0; }
.guide__paper b { color: var(--ink); }
.guide__paper a { color: var(--app-ink); text-underline-offset: 3px; }

.guide__paper :is(p, li, dd) > code,
.defs--fields dt code {
  padding: .08em .34em;
  border-radius: 2px;
  background: color-mix(in oklab, var(--app-paper), var(--sheet) 35%);
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--ink);
  font: 400 .84em/1.4 var(--mono);
  overflow-wrap: anywhere;
}

.guide kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: .1em .42em;
  border-radius: 4px;
  background: color-mix(in oklab, var(--sheet), var(--app-paper) 55%);
  box-shadow: 0 0 0 1px var(--rule), 0 1.5px 0 1px hsl(var(--shadow) / .16);
  color: var(--ink);
  font: 500 .84rem/1.4 var(--body);
  text-align: center;
  white-space: nowrap;
}

.guide__list { display: grid; gap: 8px; max-width: 66ch; margin: 4px 0 18px; }
.guide__list li { position: relative; padding-left: 24px; color: var(--ink-soft); }

/* Two-column lists: keys and what they do, fields and what they mean */
.defs {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 28px;
  max-width: 760px;
  margin: 4px 0 18px;
}
.defs > div {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: baseline;
  padding-block: 10px;
  border-top: 1px solid var(--rule);
}
.defs > div:last-child { border-bottom: 1px solid var(--rule); }
.defs dt { color: var(--ink); white-space: nowrap; }
.defs dd { margin: 0; color: var(--ink-soft); }
.defs__or { margin-inline: 2px; color: var(--ink-faint); font-size: .86rem; }

.guide .cmd { margin: 4px 0 18px; }
.guide .cmd code { white-space: normal; overflow-wrap: anywhere; }

.code {
  max-width: 100%;
  margin: 18px 0 8px;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: 2px;
  background: color-mix(in oklab, var(--app-paper), var(--ink) 6%);
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--ink);
  font: 400 .8rem/1.65 var(--mono);
  tab-size: 2;
  scrollbar-width: thin;
}
.code code { font: inherit; }

.guide__thanks {
  padding-top: 8px;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 1.15rem;
  font-variation-settings: "opsz" 24, "SOFT" 100;
}
.guide__thanks a { color: var(--app-ink); text-underline-offset: 3px; }

/* Narrow screens */

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero__art { width: min(84vw, 400px); }
  .app__paper, .app--em .app__paper { grid-template-columns: minmax(0, 1fr); }
  .app--em .app__art { order: 0; }
  .slips { grid-template-columns: minmax(0, 1fr); max-width: 540px; }
  .slip:nth-child(2) { margin-top: 0; }
  .guide { grid-template-columns: minmax(0, 1fr); }
  .guide__toc { position: static; }
  .guide__toc ol { display: flex; flex-wrap: wrap; gap: 10px 26px; }
  .guide__toc ul { display: none; }
}

@media (max-width: 620px) {
  .defs { grid-template-columns: minmax(0, 1fr); }
  .defs > div { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .defs dt { white-space: normal; }
}

@media (max-width: 560px) {
  .foot__inner { grid-template-columns: 1fr; }
  .lv__page { padding: 16px 18px 18px; }
  .em__page { padding: 20px 20px 16px; }
  .next__no { display: block; margin: 0 0 4px; }
}

@media (max-width: 440px) {
  .nav__more { display: none; }
  .brand__word { font-size: 1.35rem; }
  .brand .mark { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flap, .js .fsheet__ear:not(.is-in, .is-done) .flap {
    animation: none !important;
    --fold: var(--to) !important;
    background: var(--back) !important;
  }
  .js .fsheet__ear:not(.is-in, .is-done) { filter: drop-shadow(-1.5px 2px 2px hsl(var(--shadow) / .3)); }
  .nav a::after, .btn::after { transition: none; }
}
