/** biome-ignore-all lint/style/noDescendingSpecificity: <explanation> */

:root {
  --ink: #2b2118;
  --ink-soft: #5a4a3a;
  --paper: #f2ecde;      /* cream, multiplied over the paper texture */
  --paper-back: #e5dcc9;
  --peel-room: 110px; /* more than the hover peel */
  --metal-img: url("assets/images/metal.jpg");
  --paper-img: url("assets/textures/paper-tile.jpg");

  /* Wood planks: wood.svg baked to an image (the live SVG filters drew too slowly) */
  --wood-grain: url("assets/textures/wood.webp");

  --rule-ink: rgba(43, 33, 24, .35);
  --date-ink: #000;
  --outline: #000;                    /* logo outline */
  --pill-ink: #000;                   /* menu pill text and icon */
  --panel: rgba(120, 90, 50, .07);    /* soft box behind summaries on document pages */
  --paper-wash: color-mix(in srgb, var(--paper) 45%, transparent); /* softens the paper grain */
  --cut-below: 10px;                    /* darker header reaches this far below the cut line */
  --ios-engrave: 0 -1px 0 rgba(0, 0, 0, .3); /* iOS 6 engraved text, light: the back button and popup text */
  color-scheme: light;
}


* { box-sizing: border-box; }

/* Kill blue/grey flash on tap */
html {
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y; /* no pinch or double-tap zoom; scrolling still works */
  -webkit-user-select: none;  /* no text highlighting anywhere on the site */
  user-select: none;
}
a, button { -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: "EB Garamond", Georgia, serif;
}

/* ---------- Wooden desk + menu ---------- */
.desk {
  position: fixed;
  inset: 1px 0; /* black shows in the 1px strips above and below the paper */
  /* Only the top three plank rows; everything else stays black */
  background: var(--wood-grain) 0 0 / 2400px 420px repeat-x;
}

.desk::after { /* vignette */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .45));
}

/* ---------- Paw ---------- */
.paw {
  position: absolute;
  right: 0;
  top: calc(var(--band, 220px) - 200px + 14px); /* palm tucks under the torn paper, no wood below it */
  width: 200px;
  height: 200px;
  transform: scaleX(-1); /* drawn for the left corner, mirrored to come out of the right */
  z-index: 1;            /* on top of the wood, still under the paper */
  pointer-events: none;
  fill: rgba(0, 0, 0, .35);
}
.paw-palm,
.paw-toe { opacity: 0; transform-box: fill-box; }

.paw.in .paw-palm { animation: paw-slide .45s cubic-bezier(.2, .8, .3, 1) forwards; }
.paw.in .paw-toe {
  transform-origin: center;
  animation: paw-pop .3s cubic-bezier(.3, 1.6, .5, 1) forwards;
  animation-delay: calc(.35s + var(--i) * .09s);
}

@keyframes paw-slide {
  from { opacity: 0; transform: translate(-40%, 40%); }
  to   { opacity: 1; transform: none; }
}
@keyframes paw-pop {
  from { opacity: 0; scale: 0; }
  to   { opacity: 1; scale: 1; }
}

/* The menu fills the band where the header was ripped away */
.menu-list {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  right: 0;
  height: var(--band, 220px);
  display: flex;
  flex-direction: column; /* vertical list, left-aligned */
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0 52px 0 0; /* pills start at the left edge, right side clear of the close button */
}

/* After the rip, the pills slide in from the left one by one (script.js toggles .pills-in) */
.menu-list li { transform: translateX(-110%); }
.desk.pills-in .menu-list li {
  animation: pill-in .45s cubic-bezier(.2, .8, .3, 1) both;
  animation-delay: calc(var(--n) * .07s);
}
@keyframes pill-in {
  from { transform: translateX(-110%); }
  to   { transform: none; }
}

.menu-list li:nth-child(1) { --n: 0; --pill: 220, 38, 38; --len: 13.5em; --tex: url("assets/textures/fire.svg"); --tex-size: auto 100%; --tex-pos: left center; --tex-repeat: repeat-x; }  /* red */
.menu-list li:nth-child(2) { --n: 1; --pill: 22, 163, 74; --len: 12em; --tex: url("assets/textures/leaves.svg"); --tex-size: auto 100%; --tex-pos: left center; --tex-repeat: repeat-x; }    /* green */
.menu-list li:nth-child(3) { --n: 2; --pill: 37, 99, 235; --len: 10.5em; --tex: url("assets/textures/clouds.svg"); --tex-size: auto 100%; --tex-pos: left center; --tex-repeat: repeat-x; }  /* blue */

/* Each link is a frosted glass pill */
.menu-list a {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* text sits at the right end of the pill */
  min-width: var(--len);
  --pad-l: clamp(14px, 3vw, 32px);
  padding: .55em 1em .55em var(--pad-l); /* same pill height as when they had icons */
  border: 1px solid rgba(var(--pill), .9);
  border-left: 0;
  border-radius: 0 999px 999px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(3px) saturate(1.4);
  backdrop-filter: blur(3px) saturate(1.4);
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: min(clamp(1rem, 2.6vw, 1.4rem), calc(var(--band, 220px) / 9.5)); /* three pills fit the band */
  line-height: 1.15;
  letter-spacing: .015em;
  color: var(--pill-ink);
  text-decoration: none;
  transition: filter .15s ease;
}

/* Layer 1: the blurred texture. A flex item that ends in a round cut 1em before the label,
   so the label sits in plain glass: ( about ). Cut radius = half the pill's height */
.menu-list a::before {
  content: "";
  flex: 1;
  align-self: stretch;
  margin: calc(-.55em - 4px) -.125em calc(-.55em - 4px) calc(-1 * var(--pad-l) - 4px); /* 4px past the edges */
  -webkit-mask: radial-gradient(circle at 100% 50%, transparent calc(1.125em + 1px), #000 calc(1.125em + 2px));
  mask: radial-gradient(circle at 100% 50%, transparent calc(1.125em + 1px), #000 calc(1.125em + 2px));
  background-image: var(--tex, none);
  background-position: var(--tex-pos, center);
  background-size: var(--tex-size, auto);
  background-repeat: var(--tex-repeat, repeat);
  filter: blur(1.3px);
  pointer-events: none;
}

/* Layer 2: colour tint, glossy highlight on the top half, and inset bevel highlights */
.menu-list a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: rgba(var(--pill), .3);
  background-image:
    linear-gradient(180deg,
      rgba(255, 255, 255, .38) 0%,
      rgba(255, 255, 255, .12) 48%,
      rgba(255, 255, 255, 0) 52%,
      rgba(255, 255, 255, .07) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -2px 4px rgba(0, 0, 0, .14);
  pointer-events: none;
}

/* Layer 3: label text sits on top of all glass layers, sharp and crisp */
.menu-list a span {
  position: relative;
  z-index: 1;
}
/* The cut's edge: a half circle in the border colour. It runs into the pill's border at the
   bottom and stops under the shine line at the top */
.menu-list a span::before {
  content: "";
  position: absolute;
  left: calc(-1em - 1px);
  top: calc(50% - 1.125em - 1px);
  width: calc(2.25em + 2px);
  height: calc(2.25em + 2px);
  border: 1px solid rgba(var(--pill), .9);
  border-radius: 50%;
  clip-path: inset(2px 50% 0 0); /* spares the border and the shine line */
  pointer-events: none;
}

/* Hover: script.js makes the glow breathe and the pill shimmy left (pillHover); with reduced
   motion it's just a steady glow */
@media (prefers-reduced-motion: reduce) {
  .menu-list a:hover { filter: brightness(1.1); }
}

.menu-list a:focus,
.menu-list a:focus-visible {
  outline: none;
}

body.is-open .paper { overflow: hidden; } /* keep the band lined up while open */

/* ---------- Paper page ---------- */
.paper-shadow {
  position: fixed;
  inset: 1px 0; /* not screen-sized, or phones treat the paper as the page and leave a toolbar-tall band */
  filter: drop-shadow(-3px 3px 6px rgba(0, 0, 0, .45));
  pointer-events: none;
}

.paper {
  position: absolute;
  will-change: transform;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: auto;
  padding: 0 16px; /* the space at the bottom is the painting (.scene) */
  --scene-h: clamp(220px, 16.7vw, 420px);
  background:
    linear-gradient(var(--paper-wash), var(--paper-wash)),
    var(--paper-img) 0 0 / 420px auto repeat,
    var(--paper);
  background-blend-mode: normal, multiply;
  scrollbar-width: none; /* still scrolls, just no visible scrollbar */
  overscroll-behavior: none; /* no grey overscroll glow at the ends on Chrome for Android */
  scroll-timeline: --page block; /* drives the collapsing header */
}
.paper::-webkit-scrollbar { display: none; }

.masthead, .view {
  max-width: 720px;
  margin: 0 auto;
}

/* Header */
.masthead {
  position: sticky;
  top: 0;
  z-index: 3;
  max-width: none;
  width: 100vw;
  margin: 0 0 0 calc(50% - 50vw);
  padding: var(--peel-room) 16px 0; /* keeps the full header below the torn corner */
  text-align: center;
}

.masthead.collapsing {
  height: var(--head-min);
  margin-bottom: calc(var(--head-full) - var(--head-min) + 36px); /* content starts where it always did */
}

/* Collapsing header: transforms and opacity driven by the paper's scroll (no script in the loop).
  script.js measures --head-range and the title/date targets. Firefox gets --head-s / --p from script.js. */

/* A window onto the header's paper: the window slides up while the paper inside slides down,
   so the texture stays lined up with the page */
.head-bg { display: none; }
.masthead.collapsing .head-bg {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--head-full) + var(--cut-below)); /* down to the bottom of the scissors */
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
  transform: translateY(calc(-1 * var(--head-s, 0px)));
}
.head-paper,
.head-shade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--head-full) + var(--cut-below));
  will-change: transform;
  transform: translateY(var(--head-s, 0px));
}
.head-paper {
  background:
    linear-gradient(var(--paper-wash), var(--paper-wash)),
    var(--paper-img) 0 0 / 420px auto repeat,
    var(--paper);
  background-blend-mode: normal, multiply;
}
.head-shade { /* the darker shade fades in as it collapses, ending on the list bands' tint */
  background: var(--panel);
  opacity: var(--p, 0);
}

/* While the menu is open the tear runs along the cut line */
body.is-open .masthead.collapsing .head-bg { height: var(--head-full); }

body.is-open .rule { opacity: 0; }

.masthead.collapsing .rule {
  position: absolute;
  left: 0;
  top: calc(var(--head-full) - 1px);
  margin: 0;
  width: 100%;
  z-index: 1;
  will-change: transform;
  transform: translateY(calc(-1 * var(--head-s, 0px))); /* moves up with the content */
}
/* The cut line fades out as it collapses (.rule's own opacity is the menu's fade) */
.masthead.collapsing .rule::after,
.masthead.collapsing .rule .scissors { opacity: calc(1 - var(--p, 0)); }

/* Title and date glide to the upper left and shrink */
.masthead.collapsing .title-link,
.masthead.collapsing .tagline {
  transform:
    translate(calc(var(--to-x) * var(--p, 0)), calc(var(--to-y) * var(--p, 0)))
    scale(calc(1 + (var(--to-s) - 1) * var(--p, 0)));
}

@supports (animation-timeline: scroll()) {
  .masthead.collapsing .head-bg,
  .masthead.collapsing .rule { animation: head-up linear both; }
  .masthead.collapsing .head-paper { animation: head-down linear both; }
  .masthead.collapsing .head-shade { animation: head-down linear both, fade-in linear both; }
  .masthead.collapsing .rule::after,
  .masthead.collapsing .rule .scissors { animation: fade-out linear both; }
  .masthead.collapsing .title-link,
  .masthead.collapsing .tagline { animation: head-move linear both; }

  /* After the shorthands, which reset these */
  .masthead.collapsing .head-bg,
  .masthead.collapsing .rule,
  .masthead.collapsing .head-paper,
  .masthead.collapsing .head-shade,
  .masthead.collapsing .rule::after,
  .masthead.collapsing .rule .scissors,
  .masthead.collapsing .title-link,
  .masthead.collapsing .tagline {
    animation-timeline: --page;
    animation-range: 0px var(--head-range);
  }
}

@keyframes head-up   { to { transform: translateY(calc(-1 * var(--head-range))); } }
@keyframes head-down { to { transform: translateY(var(--head-range)); } }
@keyframes fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out  { from { opacity: 1; } to { opacity: 0; } }
@keyframes head-move {
  from { transform: none; }
  to   { transform: translate(var(--to-x), var(--to-y)) scale(var(--to-s)); }
}

/* Title and date: measured by script, moved by the collapse above */
.title-link,
.tagline {
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  transform-origin: 0 0;
  will-change: transform;
}

.title-link {
  color: inherit;
  text-decoration: none;
  filter: url(#set-in); /* pressed in; on the link so the h1's stencil cuts get the shadow too */
}

h1 {
  margin: 0;
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 5rem);
  letter-spacing: -.01em;
  line-height: 1.05;
  background: var(--metal-img) center / cover no-repeat, #a9adb1;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #a9adb1; /* stencil cuts: a mask set by script.js */
}

.tagline {
  margin: .5em auto 0;
  font-family: Roboto, sans-serif;
  font-weight: 700;
  color: var(--date-ink);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .9rem;
}

/* The slogan between the title and the date */
.slogan {
  width: fit-content;
  margin: .35em auto 0;
  font-family: Roboto, sans-serif;
  font-size: 1rem;
  letter-spacing: .02em;
  color: var(--ink-soft);
}
.peace { /* the "o": sized and weighted like a lowercase o */
  width: .6em;
  height: .6em;
  margin: 0 .03em;
  vertical-align: -.02em;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.1;
  stroke-linecap: round;
}
/* It isn't part of the compact header: it fades out over the first third of the collapse */
.masthead.collapsing .slogan { opacity: calc(1 - 3 * var(--p, 0)); }
@supports (animation-timeline: scroll()) {
  .masthead.collapsing .slogan {
    animation: fade-out linear both;
    animation-timeline: --page;
    animation-range: 0px calc(var(--head-range) / 3);
  }
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.rule {
  position: relative;
  margin: 28px 0 36px calc(50% - 50vw); /* break out of the centred column to span the page */
  width: 100vw;
  height: 1px;
}
.rule::after {
  content: "";
  position: absolute;
  top: -1px;
  right: 16px;
  width: var(--cut-w, calc(100% - 60px));
  height: 2px;
  background: radial-gradient(circle at 1px 1px, var(--ink-soft) .9px, transparent 1.1px) 0 0 / 6px 2px repeat-x;
}
.rule .scissors {
  position: absolute;
  left: 16px;
  top: -10px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.view { font-size: 1.25rem; line-height: 1.6; }
.view h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: 2rem;
  margin: 0 0 .5em;
}
.lede { font-size: 1.5rem; }

/* Home page lines with a small line icon in front */
.icon-line {
  display: flex;
  align-items: flex-start;
  gap: .55em;
}
.line-icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  margin-top: .22em; /* level with the first line of text */
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.line-icon .fill { fill: currentColor; stroke: none; } /* the wand's ball */

.view .lede-heading {
  margin: 0 0 .5em;
  font: inherit;
  font-size: 1.5rem;
}

.lede-heading + .divider { margin-top: 0; }

/* A short note under a section heading */
.section-note {
  margin: -.65em 0 .7em; /* tucked close under its heading */
  font-size: 1rem;
  color: var(--ink-soft);
}
.section-note + .divider { margin-top: 0; } /* list starts right under the heading */
.ruled-list + .lede-heading { margin-top: 1.6em; }

/* ---------- Watercolour at the bottom of the paper ---------- */
.page-body {
  min-height: calc(100% - var(--body-top, 0px) - var(--scene-h));
  padding-bottom: 24px;
}

/* Pinned to the bottom of the paper at any scroll position */
.scene {
  position: sticky;
  bottom: 0;
  z-index: -1; /* under the text, still over the paper it multiplies with */
  display: block;
  margin-left: calc(50% - 50vw);
  width: 100vw;
  height: var(--scene-h);
  overflow: hidden;
  mix-blend-mode: multiply; /* painted on the paper */
  pointer-events: none;
  user-select: none;
  --u: max(calc(100vw / 2400), calc(var(--scene-h) / 400));
}
.scene-base {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Moving parts */
.scene-part {
  position: absolute;
  left: calc(50% + (var(--x) - 1200) * var(--u));
  bottom: calc((400 - var(--y2)) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  will-change: transform;
}

/* Sun rays: a faint still copy, and one on top that jitters like a cartoon */
.scene-rays { --x: 900; --y2: 200; --w: 200; --h: 200; opacity: .35; }
.scene-boil { opacity: 1; animation: boil .9s steps(1) infinite; } /* gentle: faster looked like a sunstorm */
@keyframes boil {
  0%   { transform: none; }
  25%  { transform: translate(.4px, -.4px) rotate(.5deg); }
  50%  { transform: translate(-.4px, .2px) rotate(-.35deg); }
  75%  { transform: translate(.2px, .4px) rotate(.25deg); }
}

/* Tire swing: hangs from the branch at (1300, 174) and sways in the wind */
.scene-swing {
  --x: 1276; --y2: 256; --w: 50; --h: 86;
  transform-origin: 48% 4.65%;
  animation: sway 4.5s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-5deg); }
  30%      { transform: rotate(7deg); }
  55%      { transform: rotate(-2deg); }
  80%      { transform: rotate(5deg); }
}

/* ---------- Document pages ---------- */
.doc {
  font-size: 1.12rem;
  line-height: 1.65;
}

.doc p { margin: 0 0 1em; }

.doc a { color: inherit; text-underline-offset: .15em; }

.doc-head {
  position: relative;
  margin-bottom: 1.4em;
  padding-left: 104px; /* keep the text clear of the back button */
  text-align: right;
}

.doc .doc-head {
  position: sticky;
  top: 14px;
  z-index: 2;
  /* how far the title and date slide left, to clear the torn corner on narrow screens */
  --shift: max(0px, 72px - max(16px, (100vw - 720px) / 2));
}
.doc-head::before { /* its paper strip, full width, with the header's shade; fades in as it takes over */
  content: "";
  position: absolute;
  top: -14px;
  bottom: -10px;
  left: calc(50% - 50vw);
  width: 100vw;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(var(--panel), var(--panel)),
    linear-gradient(var(--paper-wash), var(--paper-wash)),
    var(--paper-img) 0 0 / 420px auto repeat,
    var(--paper);
  background-blend-mode: normal, normal, multiply;
  opacity: var(--q, 0);
  will-change: opacity;
}
.doc-head .doc-title,
.doc-head .doc-meta { transform-origin: 100% 0; will-change: transform; }
.doc-head .doc-title {
  transform: translateX(calc(-1 * var(--shift) * var(--q, 0))) scale(calc(1 - .15 * var(--q, 0)));
}
.doc-head .doc-meta { /* follows the title, which gets 15% shorter */
  transform: translate(calc(-1 * var(--shift) * var(--q, 0)), calc(-.15 * 2.4rem * var(--q, 0)));
}

@supports (animation-timeline: scroll()) {
  .paper.doc-header .masthead { animation: push-up linear both; }
  .paper.doc-header .doc-head::before { animation: fade-in linear both; }
  .paper.doc-header .doc-head .doc-title { animation: doc-title-in linear both; }
  .paper.doc-header .doc-head .doc-meta { animation: doc-meta-in linear both; }

  .paper.doc-header .masthead,
  .paper.doc-header .doc-head::before,
  .paper.doc-header .doc-head .doc-title,
  .paper.doc-header .doc-head .doc-meta {
    animation-timeline: --page;
    animation-range: var(--push-start) var(--push-end);
  }
}

@keyframes push-up      { to { transform: translateY(calc(-1 * (var(--head-min) + var(--cut-below)))); } }
@keyframes doc-title-in { to { transform: translateX(calc(-1 * var(--shift))) scale(.85); } }
@keyframes doc-meta-in  { to { transform: translate(calc(-1 * var(--shift)), calc(-.15 * 2.4rem)); } }

.view .doc-title { margin: 0; line-height: 1.6; }
.doc-head .doc-meta { margin: .25em 0 0; }
.doc-meta strong { margin-left: .4em; }

/* Back button sits a little above the gap between the title and the date */
.doc .doc-head .ios-back { top: calc(1.5rem * 1.6 - .4rem); }

/* iOS 6-style back button */
.doc .ios-back {
  position: absolute;
  left: 0;
  top: 50%;
  width: 90px;  /* the SVG is drawn at 82×30 and scales evenly */
  height: 33px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 9px; /* centre the label in the body, not over the point */
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  text-shadow: var(--ios-engrave);
  text-decoration: none;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .35));
}
.ios-back svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ios-back span { position: relative; }
.ios-back-shape { transition: filter .15s ease; }
.ios-back:hover .ios-back-shape { filter: brightness(1.1); }

.doc-meta {
  font-family: Roboto, sans-serif;
  font-size: .8rem;
  letter-spacing: .1em; /* the same as the header date and the section labels */
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Section labels */
.doc h3 {
  margin: 2.2em 0 .9em;
  padding-bottom: .45em;
  border-bottom: 1px solid var(--rule-ink);
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* List sections */
.doc-band {
  margin: 1.6em 0 1.6em calc(50% - 50vw);
  width: 100vw;
  padding: .2em max(16px, calc((100vw - 720px) / 2)) 1em;
  border-top: 1px solid var(--rule-ink);
  border-bottom: 1px solid var(--rule-ink);
  border-radius: 0;
  background: var(--panel);
}
.doc-band h3 { margin-top: 1em; border-bottom: 0; padding-bottom: 0; }
.doc-band + h3 { margin-top: 1.4em; }

.tick-list,
.cross-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tick-list li,
.cross-list li {
  position: relative;
  padding-left: 1.6em;
  margin: .5em 0;
}
.tick-list li::before,
.cross-list li::before {
  position: absolute;
  left: 0;
}

.tick-list li::before {
  content: "";
  top: .3em;
  left: .25em;
  width: .32em;
  height: .62em;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(40deg);
}
/* On app pages the description's ticks are short bold dashes instead of checkmarks */
[data-view="app"] .tick-list li::before {
  top: calc(.8em - 1.25px);
  left: .15em;
  width: .7em;
  height: 2.5px;
  border: 0;
  border-radius: 1px;
  background: currentColor;
  transform: none;
}

/* The cross: two 2.5px lines like the tick, centred on the tick's middle */
.cross-list li::before,
.cross-list li::after {
  content: "";
  position: absolute;
  top: calc(.8em - 1.25px);
  left: .05em;
  width: .72em;
  height: 2.5px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}
.cross-list li::after { transform: rotate(-45deg); }

.num-list {
  list-style: none;
  counter-reset: num;
  margin: .5em 0 .5em;
  padding: 0;
}
.num-list li {
  position: relative;
  counter-increment: num;
  padding-left: 1.6em; /* text sits close to its circle */
  margin: .55em 0;
}
.num-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .4em;
  top: round(.4em, 1px); /* whole pixels, so the circle isn't drawn slightly oval */
  width: 18px;           /* a whole number too (an em size rounded unevenly) */
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
}
/* Tally lines instead of numbers, in the paper colour. All are shadows of one hidden box, and
   script.js snaps their width and spacing to device pixels, so every line is the same thickness */
.num-list li::after {
  --tw: var(--tally-w, 2px);
  --ts: var(--tally-step, 4px);
  content: "";
  position: absolute;
  left: calc((18px - ((var(--n, 1) - 1) * var(--ts) + var(--tw))) / 2 - var(--ts));
  top: calc(.4em + 6px);
  top: calc(round(.4em, 1px) + 6px); /* level with the circle, which is rounded the same way */
  width: var(--tw);
  height: 6px;
  box-shadow: var(--tally, var(--ts) 0 var(--paper));
}
.num-list li:nth-child(2)::after { --n: 2; --tally: var(--ts) 0 var(--paper), calc(2 * var(--ts)) 0 var(--paper); }
.num-list li:nth-child(3)::after { --n: 3; --tally: var(--ts) 0 var(--paper), calc(2 * var(--ts)) 0 var(--paper), calc(3 * var(--ts)) 0 var(--paper); }
.num-list li:nth-child(4)::after { --n: 4; --tally: var(--ts) 0 var(--paper), calc(2 * var(--ts)) 0 var(--paper), calc(3 * var(--ts)) 0 var(--paper), calc(4 * var(--ts)) 0 var(--paper); }
.num-list li:nth-child(5)::after { --n: 5; --tally: var(--ts) 0 var(--paper), calc(2 * var(--ts)) 0 var(--paper), calc(3 * var(--ts)) 0 var(--paper), calc(4 * var(--ts)) 0 var(--paper), calc(5 * var(--ts)) 0 var(--paper); }

.perm-list { margin: 0; }
.perm-list > div {
  padding: .9em 0;
  border-bottom: 1px solid var(--rule-ink);
}
.perm-list > div:first-child { padding-top: 0; }
.perm-list > div:last-child { border-bottom: 0; } /* no stray line after the last entry */

.perm-list > div.doc-band {
  margin: 0 0 0 calc(50% - 50vw);
  padding: .9em max(16px, calc((100vw - 720px) / 2));
  border-top: 1px solid var(--rule-ink);
  border-bottom: 1px solid var(--rule-ink);
}
.perm-list > div:has(+ .doc-band) { border-bottom: 0; }
.perm-list dd > p { margin: 0 0 .5em; }
.perm-list dd > :last-child { margin-bottom: 0; }
.perm-list dt {
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .3em;
}
.perm-list dd { margin: 0; }

/* Policy icons (:name: in a .lpol file): a line icon in the text colour, sized to the text */
.lpol-icon {
  width: 1.15em;
  height: 1.15em;
  margin-right: .35em;
  vertical-align: -.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lpol-icon .fill { fill: currentColor; stroke: none; }

.perm-note { /* a luggage tag: rounded on the right, pointed on the left with a punched hole */
  --h: 1.4em;  /* tag height */
  --tag-ink: color-mix(in srgb, var(--ink) 35%, var(--paper));
  --tag-fill: color-mix(in srgb, var(--tag-ink) 30%, transparent); /* the inside: the outline colour, see-through */
  position: relative;
  z-index: 0; /* its shape (z-index -1) stays behind the text but in front of the page */
  display: inline-block;
  box-sizing: border-box;
  height: var(--h);
  margin-left: calc(.5em + var(--h) / 2); /* room for the point */
  padding: 0 .55em .12em .5em;            /* text sits a touch higher in the tag */
  font-family: Roboto, sans-serif; /* same tag wherever it's used */
  font-weight: 700;
  font-size: .75rem;
  line-height: calc(var(--h) - .12em);
  letter-spacing: .02em; /* lowercase, as written */
  vertical-align: .17em; /* one height everywhere it's used */
  color: var(--ink-soft);
}
/* The tag's shape: one SVG path drawn by script.js (drawTags) at its real pixel size, hole included */
.perm-note .tag-shape {
  position: absolute;
  z-index: -1;
  top: 0;
  left: calc(var(--h) / -2);
  overflow: visible;
  pointer-events: none;
}
.perm-note .tag-shape path {
  fill: var(--tag-fill);
  fill-rule: evenodd;
  stroke: var(--tag-ink);
  stroke-linejoin: round;
}


/* ---------- Contact page ---------- */
.contact { text-align: center; }
.contact .divider { margin-top: 42px; }

.contact-logo {
  --logo: 116px; /* the square image inside the 2px outline */
  display: block;
  width: calc(var(--logo) + 4px);
  height: calc(var(--logo) + 4px);
  flex: none;
  border: 2px solid var(--outline);
  border-top-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: -14px;
  text-align: left;
}
.contact-who p { margin: 0; }
.contact-name {
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
}
.contact-who .contact-role {
  margin-top: .15em;
  font-weight: 700;
  font-family: Roboto, sans-serif;
  font-size: .8rem; /* same size and spacing as the app's developer under its name */
  color: var(--ink-soft);
}

.divider {
  margin: 28px 0 0 calc(50% - 50vw);
  width: 100vw;
  height: 0;
  border: 0;
  border-top: 1px solid var(--rule-ink);
}

.ruled-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}

/* Each row sits on its own paper strip above the painting, so it stays readable */
.ruled-list li { position: relative; z-index: 0; }
.ruled-list li::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  z-index: -1;
  background:
    linear-gradient(var(--paper-wash), var(--paper-wash)),
    var(--paper-img) 0 0 / 420px auto repeat,
    var(--paper);
  background-blend-mode: normal, multiply;
  box-shadow: inset 0 0 0 100vmax transparent; /* the hover tint */
  transition: box-shadow .15s ease;
}
/* Hovering a row tints it with the list bands' shade, .15s like the other buttons' brighten */
@media (hover: hover) {
  .ruled-list > li:has(> a:hover, > [data-soon]:hover)::before { box-shadow: inset 0 0 0 100vmax var(--panel); }
}
.ruled-list li::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  border-top: 1px solid var(--rule-ink);
}

.ruled-list > li > a,
.ruled-list > li > span { /* the row itself, not spans inside it (like a pill) */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6em 0;
  color: inherit;
  text-decoration: none;
}

.ruled-list > li > a::after,
.ruled-list > li > span::after {
  content: "";
  flex: none;
  width: .5em;
  height: .5em;
  margin-right: .3em;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

/* ---------- Folded back corner ---------- */
.flap-shadow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  filter: drop-shadow(-4px 5px 7px rgba(0, 0, 0, .35));
}

.flap {
  will-change: transform;
  position: absolute;
  inset: 0;
  background:
    var(--shade, none),
    linear-gradient(rgba(120, 110, 95, .12), rgba(120, 110, 95, .12)),
    var(--paper-img) 0 0 / 420px auto repeat,
    var(--paper-back);
  background-blend-mode: normal, normal, multiply;
}

/* ---------- Menu button ---------- */
.menu-btn {
  position: fixed;
  top: 6px;
  right: 6px;
  z-index: 10;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  /* The pencils' shadow, on the button so it doesn't turn with them */
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5));
}

.menu-btn:focus-visible { outline: 2px solid #ffd68a; outline-offset: 2px; }

.icon {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
  transition: opacity .35s ease, transform .35s ease;
}

.icon i {
  position: absolute;
  left: 8px;
  height: var(--bar-h, 3px); /* script.js snaps the lines to device pixels */
}

/* Menu icon: mini pencils (graphite, wood, body, ferrule, eraser), drawn point-left */
.icon i {
  width: 22px;
  border-radius: 0 1.5px 1.5px 0;
  background:
    linear-gradient(rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .18)),
    linear-gradient(90deg,
      #3a3a3a 0 2px,
      #e7c99c 2px 5.5px,
      #f2c230 5.5px 16px,
      #b8bcc0 16px 18.5px,
      #e98c95 18.5px);
  clip-path: polygon(0 50%, 5.5px 0, 100% 0, 100% 100%, 5.5px 100%);
}

/* Three pencils, points right, a little right of centre (the erasers look heavier) */
.icon-bars i { left: 9px; transform: scaleX(-1); }
.icon-bars i:nth-child(1) { top: var(--bar-1, 10.5px); }
.icon-bars i:nth-child(2) { top: var(--bar-2, 16.5px); left: 5px; transform: none; } /* points the other way */
.icon-bars i:nth-child(3) { top: var(--bar-3, 22.5px); }

/* Open: the same pencils turn to stand upright, points up (a vertical menu icon) */
.icon-bars { transform: rotate(0deg); } /* not `none`: keeps the layer */
body.is-open .icon-bars { transform: rotate(-90deg); }

/* ---------- Bodega ---------- */
/* A platform group's label: its logo and name, as typed, above the group's divider */
.doc h3.platform {
  display: flex;
  align-items: center;
  gap: .45em;
  margin: 30px 0 0;
  padding: 0;
  border: 0;
  text-transform: none;
}
.platform + .divider { margin-top: 10px; }
.platform-logo { flex: none; width: 1.35em; height: 1.35em; fill: currentColor; }
.platform-logo.android { width: 1.55em; height: 1.55em; margin: -.1em -.05em; } /* short and wide, so drawn bigger */
.platform-logo .line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

/* App rows: icon, then name / developer / version, and the FREE button on the right */
.app-list > li { display: flex; align-items: center; gap: 12px; }
.app-list > li > a.app-row {
  flex: 1;
  justify-content: flex-start;
  gap: 12px;
  padding: .7em 0;
}
.app-list > li > a.app-row::after { display: none; } /* no arrow: the button sits there */

.app-icon {
  flex: none;
  width: 57px;
  height: 57px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.app-text { display: flex; flex-direction: column; line-height: 1.25; }
.app-name { font-weight: 700; }
.app-list .app-name { font-size: 1.05rem; } /* a little under the list rows' 1.15rem */
.app-sub {
  font-family: Roboto, sans-serif;
  font-weight: 400;
  font-size: .8rem;
  color: var(--ink-soft);
}

/* iOS 6 App Store "FREE" button with its "+" badge. Downloads the APK */
.free-btn {
  position: relative;
  flex: none;
  padding: 5px 12px 5px 16px;
  border: 1px solid #b4b4b4;
  border-radius: 6px; /* same as the menu button and the popup's OK */
  background: linear-gradient(#fdfdfd, #ececec 50%, #e2e2e2 50%, #ebebeb) padding-box;
  /* padding-box: no light fringe outside the rounded corners */
  box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(0, 0, 0, .12);
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: .02em;
  color: #6c6c6c;
  text-shadow: 0 1px 0 #fff;
  text-decoration: none;
  transition: filter .15s ease;
}
.free-btn::before { /* the "+" badge: two white bars, so the plus sits dead centre in its square */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 4px 0 2px 0;
  background:
    linear-gradient(#fff, #fff) center / 7px 1.5px no-repeat,
    linear-gradient(#fff, #fff) center / 1.5px 7px no-repeat,
    #c4c4c4;
}
/* VIEW on the Bodega list: the same button without the badge or the row styles */
.app-list > li > a.view-btn {
  display: inline-block;
  padding: 5px 12px;
}
.app-list > li > a.view-btn::before,
.app-list > li > a.view-btn::after { display: none; }
.free-btn:hover,
.free-btn:active { filter: brightness(1.1); } /* the same brighten as the back button */

/* An app's page: icon, version and the button, above the description */
.app-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.2em;
}
/* FREE with the file type (APK, DMG...) under it; an app with several downloads stacks them */
.app-hero .gets {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-left: auto;
}
.app-hero .get {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.file-type {
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: .65rem;
  letter-spacing: .1em;
  color: var(--ink-soft);
}

/* Screenshots: a row of phone-shaped frames (empty until the app has screenshots) */
.shots {
  display: flex;
  gap: 10px;
  overflow: auto hidden; /* sideways only (the 1.1x zoom pokes past the top and bottom) */
  margin-bottom: .4em;
  scrollbar-width: none;
  clip-path: inset(0 round 16px); /* round ends, like the pictures */
}
.shot {
  flex: none;
  width: calc((100% - 30px) / 4); /* four share the width when there's room (a laptop shows them all) */
  min-width: 120px;               /* narrower screens: they keep this size and scroll sideways */
  max-width: 180px;
  aspect-ratio: 9 / 19.5;
  border-radius: 16px;
  object-fit: cover;
}
/* Desktop apps: two window-shaped shots share the width */
.shots.wide .shot { width: calc((100% - 10px) / 2); min-width: 240px; max-width: none; aspect-ratio: 16 / 10; }
/* Screenshots keep their own shape; empty frames match their height */
img.shot,
.shots.wide img.shot { height: auto; aspect-ratio: auto; align-self: flex-start; }
.shots:has(img) span.shot,
.shots.wide:has(img) span.shot { aspect-ratio: auto; }
img.shot {
  cursor: zoom-in;
  filter: blur(1.2px);                    /* slightly soft while small; the zoomed copy is sharp */
  transform: scale(1.1);                  /* the picture zoomed in a little inside its box... */
  clip-path: inset(4.545% round 14.55px); /* ...cut back to the box (1 / 1.1), corners 16px once scaled */
}

/* A zoomed screenshot (script.js zoomShot): the copy zooms from its box over a dim backdrop */
.shot-zoom {
  position: fixed;
  inset: 0;
  z-index: 100;
  cursor: zoom-out;
}
.shot-zoom-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  opacity: 0; /* starts clear and fades in (without this its first frame flashed dark) */
}
.shot-zoom-box {
  position: absolute;
  overflow: hidden; /* its corner radius is set by script.js: 6% of its width */
  transform-origin: 0 0;
  will-change: transform;
}
.shot-zoom-box img {
  display: block;
  width: 100%;
  height: 100%;
  will-change: transform;
}
/* Empty frames: an SVG dashed outline, so the dashes stay even round the corners */
span.shot { position: relative; }
.shot-frame {
  position: absolute;
  top: .75px;
  left: .75px;
  width: calc(100% - 1.5px);
  height: calc(100% - 1.5px);
  overflow: visible;
}
.shot-frame rect {
  fill: none;
  stroke: var(--rule-ink);
  stroke-width: 1.5;
  stroke-dasharray: 6 5; /* with pathLength 770: exactly 70 dashes */
}

/* ---------- Popups (iOS 6 alert style) ---------- */
/* Built by showAlert() in script.js. The backdrop catches clicks; the rest of the page is inert */
.alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .5);
  opacity: 0; /* faded in and out by script */
  /* No long-press selection or callout (it swallowed the press on Android) */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.alert {
  position: relative;
  width: min(320px, 100%);
  padding: 24px 12px 20px;
  border: 2px solid transparent; /* room for the rim, drawn by ::before */
  border-radius: 13px;
  background:
    /* the curved gloss across the top: a wide, flat arc that stays high */
    radial-gradient(190% 64px at 50% -28px, rgba(255, 255, 255, .36), rgba(255, 255, 255, .1) 97%, transparent 100%) padding-box,
    /* under the rim too, or the inner curves show a seam */
    linear-gradient(rgba(4, 22, 82, .68), rgba(4, 22, 82, .68)) border-box;
  will-change: transform; /* its own layer throughout, or the text hops after the bounce */
  -webkit-backdrop-filter: blur(3px) saturate(1.4); /* the same frosted glass as the menu pills */
  backdrop-filter: blur(3px) saturate(1.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .6); /* no inner highlight: it doubled up with the rim */
  color: #fff;
  text-align: center;
  font-family: Roboto, sans-serif;
  opacity: 0; /* zoomed in by script */
}
/* The rim: white at the top, grey down the sides. A masked ring, so the navy stays see-through */
.alert::before {
  content: "";
  position: absolute;
  inset: -2px;
  padding: 1.5px 2px; /* thinner where it's bright white */
  border-radius: inherit;
  background: linear-gradient(#fff, #f4f5f7 7%, #b4b8bf 26%, #a3a7af 80%, #c9ccd2);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.alert-title {
  margin: 4px 0 14px;
  text-align: left;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
  text-shadow: var(--ios-engrave);
}
.alert-message {
  margin: -6px 0 18px;
  text-align: right;
  font-size: 16.5px;
  line-height: 1.3;
  text-shadow: var(--ios-engrave);
}

/* Popup buttons: glossy translucent grey, split shine, dark rim */
.alert-btn {
  display: block;
  width: 100%;
  height: 41px;
  border: 1px solid rgba(0, 0, 0, .55);
  border-radius: 6px;
  background: linear-gradient(
    rgba(255, 255, 255, .42),
    rgba(255, 255, 255, .22) 50%,
    rgba(255, 255, 255, .1) 50%,
    rgba(255, 255, 255, .17));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 0 rgba(255, 255, 255, .18);
  color: #fff;
  font: 700 18px Roboto, sans-serif;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .6);
  cursor: pointer;
  background-color: transparent;
  transition: background-color .15s ease;
}
/* Hover and press: a white tint (brightness does nothing on a near-white button) */
.alert-btn:hover,
.alert-btn:active,
.alert-btn.is-pressed { background-color: rgba(255, 255, 255, .14); } /* .is-pressed: the 0.1s after a click */
.alert-btn:focus,
.alert-btn:focus-visible { outline: none; } /* it gets focus when the popup opens; no ring */

[data-soon] { cursor: pointer; } /* "coming soon" things open the popup */

/* Keyboard focus (Tab only): one ink outline. The menu button, pills and popup OK keep their own */
a:focus-visible,
[data-soon]:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 2px; border-radius: 4px; }
.free-btn:focus-visible { border-radius: 6px; }
.ios-back:focus-visible { outline: none; }
.ios-back:focus-visible .ios-back-shape { filter: brightness(1.1); stroke: var(--ink); stroke-width: 2; }
/* Screenshots are clipped, so they brighten and sharpen instead */
img.shot:focus-visible { outline: none; filter: brightness(1.12); }

@media (prefers-reduced-motion: reduce) {
  .icon, .menu-list a { transition: none; }
  .paw.in .paw-palm, .paw.in .paw-toe,
  .desk.pills-in .menu-list li { animation-duration: 1ms; animation-delay: 0s; }
  .scene-boil, .scene-swing { animation: none; }
}
