/* SideDock website. Flat colours only, the Mac's own type, hairlines, and the product
   doing the talking.

   The palette is the demo Mac's wallpaper (Martin Martz, Unsplash): deep indigo for the
   page, purple for the Notch chapter, orange for the last call, blue for the demo
   screens. One look in light and dark mode alike: the wallpaper is dark. The identity is
   the app's own: the black notch (the navigation hangs from the top like one) and Pip. */

:root {
  --indigo: #1d153e;
  --purple: #5c348d;
  --orange: #b04630;
  --blue: #1f5fa8;
  --bg: var(--indigo);
  --surface: #281e52;
  --surface-2: #31265f;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #f6f1ff;
  --text-2: #d3cae9;
  --text-3: #bdb1da;
  --accent: #e89954;
  --ink: #f6f1ff;
  --on-ink: #1d153e;
  --shadow: rgba(5, 3, 18, 0.45);
  /* A few chosen sections take another colour of the wallpaper's (see .tone-band). */
  --band: var(--purple);
  --page: var(--indigo);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", sans-serif;
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", sans-serif;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--on-ink); }

/* ---------- Type ---------- */

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; color: var(--text); text-wrap: balance; }
p { text-wrap: pretty; }
h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -0.03em; }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
p { margin: 0; }
/* The line above a heading: a word or two in the accent, sentence case, nothing else. */
.kicker { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--accent); }
.lede { font-size: 19px; line-height: 1.5; color: var(--text-2); max-width: 600px; }
.fine { font-size: 14px; color: var(--text-3); }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 99px;
  border: 0;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.button:hover { opacity: 0.88; }
.button:active { transform: scale(0.97); }
.button svg { width: 16px; height: 16px; }
.button.quiet { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.button.quiet:hover { opacity: 1; background: var(--line); }

/* ---------- The notch navigation (black in both modes) ---------- */

.notchnav {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 100;
  transform: translateX(-50%);
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 10px 0 16px;
  color: #f3f1ec;
}
.notchnav svg.shape { position: absolute; left: 0; top: 0; height: 100%; overflow: visible; z-index: -1; pointer-events: none; }
.notchnav svg.shape path { fill: #000; }
.notchnav .inner { position: relative; display: flex; align-items: center; height: 100%; overflow: hidden; width: 100%; }
.notchnav .brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 650; font-size: 15px; margin-right: 12px; white-space: nowrap; }
.notchnav .brand .pip { width: 24px; height: 27px; flex: none; }
.notchnav .links { display: flex; align-items: center; gap: 2px; white-space: nowrap; transition: opacity 0.2s 0.18s; }
.notchnav .links a { padding: 6px 11px; border-radius: 99px; font-size: 14px; color: rgba(255, 255, 255, 0.64); transition: color 0.2s, background 0.2s; }
.notchnav .links a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.notchnav .button { height: 32px; padding: 0 14px; font-size: 13.5px; margin-left: 8px; white-space: nowrap; transition: opacity 0.2s 0.18s; background: #f5f1e9; color: #000; }
.notchnav .brand .name { transition: opacity 0.2s 0.18s; }
.notchnav.folded .links, .notchnav.folded .button, .notchnav.folded .brand .name { opacity: 0; pointer-events: none; transition: opacity 0.1s; }
.notchnav .now { position: absolute; right: 16px; top: 0; height: 100%; display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.7); opacity: 0; pointer-events: none; transition: opacity 0.1s; }
.notchnav.folded .now { opacity: 1; transition: opacity 0.2s 0.24s; }
.notchnav .now svg { width: 17px; height: 17px; transform: rotate(-90deg); }
.notchnav .now circle { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 2.4; }
.notchnav .now circle.fill { stroke: #d3cbbb; stroke-linecap: round; }

/* ---------- Layout ---------- */

.section { position: relative; padding: 160px 24px 0; }
.wrap { max-width: 1160px; margin: 0 auto; }
.head { display: grid; gap: 14px; max-width: 680px; margin-bottom: 56px; }
.head.center { margin-left: auto; margin-right: auto; text-align: center; justify-items: center; }
.split { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: center; }

/* ---------- Band sections ----------
   Most of the page sits on indigo. The Notch chapter is purple and the last call to
   download, running into the footer, is orange. Their edges aren't straight lines: a wave
   in and out, an arc to finish. */

/* A band: purple (the Notch chapter), or orange for the last call (.tone-orange). */
.tone-band {
  --bg: var(--band);
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.14);
  --line-2: rgba(255, 255, 255, 0.24);
  --text: #ffffff;
  --text-2: #ece3fa;
  --text-3: #ddd0f2;
  --accent: #f6b27c;
  --ink: #ffffff;
  --on-ink: var(--band);
  --shadow: rgba(10, 4, 24, 0.35);
  color-scheme: dark;
  /* A screen never takes the colour around it: inside a band, every demo screen (the live
     stage, the tiles' pictures, a card's stage) is the page's indigo. */
  --wall: var(--indigo);
  --on-wall: #ffffff;
  --on-wall-2: rgba(255, 255, 255, 0.75);
  --menu-bg: rgba(0, 0, 0, 0.18);
  --mark: rgba(255, 255, 255, 0.34);
  --mark-on: rgba(255, 255, 255, 0.9);
  background: var(--band);
  color: var(--text);
  padding-bottom: 150px;
}
.tone-orange { --band: var(--orange); --accent: #1d153e; --text-2: #fff1e6; --text-3: #ffe3d0; }
.tone-band + .section { padding-top: 190px; }
/* Room above a band for its shaped edge. */
.section:has(+ .tone-band) { padding-bottom: 150px; }
/* The shaped edges: band-coloured shapes outside the section's box, cut by a mask. */
.tone-band::before, .tone-band::after {
  content: ''; position: absolute; left: 0; right: 0; background: var(--band); pointer-events: none;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
.tone-band::before { bottom: calc(100% - 1px); height: 90px; }
.tone-band::after { top: calc(100% - 1px); height: 64px; }
.tone-band.in-wave::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'><path d='M0 90V56C180 18 360 6 560 30S940 86 1140 62 1360 16 1440 22V90Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'><path d='M0 90V56C180 18 360 6 560 30S940 86 1140 62 1360 16 1440 22V90Z'/></svg>");
}
.tone-band.in-dome::before {
  height: 120px;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'><path d='M0 120C260 120 420 0 720 0S1180 120 1440 120Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'><path d='M0 120C260 120 420 0 720 0S1180 120 1440 120Z'/></svg>");
}
.tone-band.in-arc::before {
  height: 110px;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 110' preserveAspectRatio='none'><path d='M0 110Q720 -100 1440 110Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 110' preserveAspectRatio='none'><path d='M0 110Q720 -100 1440 110Z'/></svg>");
}
/* Out like the notch: a tab hanging from the middle with the notch's inward corners.
   It keeps its shape at any width. */
.tone-band.out-notch::after {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 64'><path d='M0 0H360C340 0 332 8 332 24V30C332 50 318 64 298 64H62C42 64 28 50 28 30V24C28 8 20 0 0 0Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 64'><path d='M0 0H360C340 0 332 8 332 24V30C332 50 318 64 298 64H62C42 64 28 50 28 30V24C28 8 20 0 0 0Z'/></svg>");
  -webkit-mask-size: 360px 64px; mask-size: 360px 64px; -webkit-mask-position: center top; mask-position: center top;
}
.tone-band.out-wave::after {
  height: 80px;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path d='M0 0H1440V24C1240 70 1060 78 860 52S420 6 240 30 60 66 0 58Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path d='M0 0H1440V24C1240 70 1060 78 860 52S420 6 240 30 60 66 0 58Z'/></svg>");
}
.tone-band.out-none::after { display: none; }
footer.tone-band { padding: 34px 24px 54px; }
footer.tone-band::before, footer.tone-band::after { display: none; }
@media (max-width: 900px) {
  .tone-band { padding-bottom: 104px; }
  .tone-band + .section { padding-top: 140px; }
  .section:has(+ .tone-band) { padding-bottom: 100px; }
  .tone-band::before { height: 48px; }
  .tone-band.in-dome::before, .tone-band.in-arc::before { height: 64px; }
  .tone-band.out-notch::after { -webkit-mask-size: 240px 44px; mask-size: 240px 44px; height: 44px; }
}

/* ---------- Hero ---------- */

.hero { position: relative; padding: 104px 24px 0; }
/* (Above the big Pip leaning in from the right.) */
.hero .intro, .hero .demo-shell { position: relative; z-index: 1; }
/* A chapter's first section: its name, then what it does. */
.chapter-open .head { margin-bottom: 40px; }
.hero .intro { display: grid; justify-items: center; text-align: center; gap: 16px; }
.hero .lede { max-width: 640px; }
.hero .cta, .final .cta { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.demo-shell { position: relative; margin: 40px auto 0; max-width: 1240px; }
.stage { position: relative; perspective: 2000px; }
.controls { display: grid; justify-items: center; gap: 14px; margin-top: 26px; }
.featuredock {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  width: fit-content;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.featuredock button {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.featuredock button:hover, .featuredock button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.featuredock button svg { width: 20px; height: 20px; }
.featuredock button::after {
  content: attr(data-tip);
  position: absolute;
  /* Under the buttons: above them they would sit on the Mac's frame. */
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s var(--ease);
}
.featuredock button:not([data-tip])::after { display: none; }
.featuredock button:hover::after { opacity: 1; transform: translateX(-50%); }
.featuredock .sep { width: 1px; margin: 8px 4px; background: var(--line-2); }
.featuredock button.wide { width: auto; display: flex; gap: 7px; padding: 0 14px 0 12px; font-size: 14px; font-weight: 600; color: var(--text); }
.featuredock button.wide svg { width: 17px; height: 17px; }

/* A phone: whole-size buttons in two even rows of four (never a row that breaks wherever
   the width runs out), no separators, and no Full screen (the page already is the screen). */
@media (max-width: 560px) {
  .controls .featuredock { display: grid; grid-template-columns: repeat(4, 52px); gap: 4px; padding: 6px; justify-content: center; }
  .controls .featuredock button { width: 52px; height: 48px; }
  .controls .featuredock .sep, .controls .featuredock button.wide { display: none; }
}

/* Full screen: the demo's screen alone, edge to edge, like a video played full screen: no
   frame, heading, film bar or buttons. The browser's own full screen holds #demo; where it
   can't, #demo is a layer over the whole window. Black shows only where the display's shape
   differs from the screen's. */
.demo-shell.full #demo, #demo:fullscreen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; width: 100%; height: 100%; margin: 0; padding: 0; background: #000; perspective: none; scale: none; }
.demo-shell.full .mac, #demo:fullscreen .mac { padding: 0; border-radius: 0; box-shadow: none; background: #000; transform: none; transition: none; }
.demo-shell.full .mac .viewport, #demo:fullscreen .mac .viewport { border-radius: 0; }
#demo::backdrop { background: #000; }
.full-note { position: absolute; top: 18px; left: 50%; translate: -50% 0; z-index: 5; margin: 0; padding: 8px 14px; border-radius: 99px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 13px; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
.full-note.on { opacity: 1; }
.demo-shell:not(.full) .full-note { display: none; }

/* ---------- Overview: the map and the pillars ---------- */


/* ---------- Chapters (a story's steps; each fills as it plays) ---------- */

.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.chapters li { position: relative; padding: 12px 16px 13px; border-radius: 14px; cursor: pointer; color: var(--text-3); transition: color 0.3s, background 0.3s; }
.chapters li b { display: block; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.chapters li span { display: block; font-size: 14.5px; line-height: 1.45; max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.5s var(--ease), opacity 0.35s, margin 0.5s var(--ease); }
.chapters li:hover { color: var(--text-2); }
.chapters li.on { color: var(--text); background: var(--surface); }
.chapters li.on span { max-height: 90px; opacity: 1; color: var(--text-2); margin-top: 4px; }
.chapters li i { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; opacity: 0; transition: opacity 0.3s; }
.chapters li.on i { opacity: 1; }
.chapters li i::before { content: ""; position: absolute; inset: 0; background: var(--text-2); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- Bento ---------- */

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.tile-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line-2); pointer-events: none; z-index: 3; }
.tile-card p { color: var(--text-2); font-size: 15.5px; }
.tile-card.wide { grid-column: span 6; }
.tile-card.half { grid-column: span 3; }
.tile-card.third { grid-column: span 2; }
.tile-card.horizontal { display: grid; grid-template-columns: 340px 1fr; gap: 0; padding: 0; min-height: 300px; }
.tile-card.horizontal .copy { padding: 28px; display: grid; gap: 10px; align-content: center; }
.tile-card .art { margin-top: auto; }

/* ---------- FAQ ---------- */

.faq { max-width: 780px; margin: 0 auto; }
.faq details { border-top: 1px solid var(--line-2); padding: 22px 2px; }
.faq details:last-child { border-bottom: 1px solid var(--line-2); }
.faq summary { cursor: pointer; list-style: none; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-2); margin-top: 10px; font-size: 16px; }

/* ---------- Final and footer ---------- */

.final { text-align: center; padding-bottom: 150px; }
.final .wrap { display: grid; justify-items: center; gap: 16px; }
.final .icon { width: 112px; height: 112px; margin-bottom: 12px; }
footer { border-top: 1px solid var(--line-2); padding: 34px 24px 54px; color: var(--text-3); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer a:hover { color: var(--text); }

/* ---------- Arriving: things rise into place as they come into view ---------- */

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--delay, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* Screenshots of a state (?still=1): no transitions. */
.still *, .still *::before, .still *::after { transition: none !important; }

@media (max-width: 1000px) {
  }
@media (max-width: 900px) {
  body { font-size: 16px; }
  .notchnav .links { display: none; }
  .section { padding: 110px 20px 0; }
  .hero { padding: 110px 16px 0; }
  .demo-shell { margin-top: 44px; }
  .split { grid-template-columns: 1fr; gap: 24px; }
  .featuredock { gap: 2px; padding: 4px; flex-wrap: wrap; justify-content: center; }
  .featuredock button { width: 36px; height: 36px; }
  .featuredock button svg { width: 18px; height: 18px; }
  .featuredock button::after { display: none; }
  .bento { grid-template-columns: 1fr; }
  .tile-card.wide, .tile-card.half, .tile-card.third { grid-column: auto; }
  .tile-card.horizontal { grid-template-columns: 1fr; }
  .lede { font-size: 17px; }
  .final { padding-bottom: 96px; }
}
@media (max-width: 560px) {
  }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
.tone-band .cards-stage { box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 60px var(--shadow); }

/* ---------- SideDock's voice in type ----------
   Headings, kickers and big numbers in Fredoka: round, like Pip and the wordmark. Reading
   copy stays in SF. The app's own UI, drawn inside the demos, keeps the Mac's font. */
:root { --heading: "Fredoka", ui-rounded, var(--display); }
/* A hand, for the notes in the margin. */
:root { --hand: "Caveat", "Bradley Hand", "Marker Felt", cursive; }
.hero h1,
main .section h2:not(.cards-stage *, .stage *, .story-screen *, .crop-art *),
.theater .headline h3, .coding-copy h3, .tile-card > h3, .card-notes .note h3,
.kicker, .plan h3, .plan-price strong, .final h2,
.page-hero h1, .page-body h2, .release aside h2, .value h2, .cta-card h2, .only b, .b-macs .big {
  font-family: var(--heading);
  font-weight: 600;
}
.hero h1 { letter-spacing: -0.025em; line-height: 1.06; }
/* "useful", underlined by three soft strokes in three colours, one under the other like a
   ribbon. Solid colours, no gradient. */
.hero h1 .squiggle { position: relative; display: inline-block; }
.squiggle svg { position: absolute; left: -3%; bottom: -0.2em; width: 106%; height: 0.36em; overflow: visible; pointer-events: none; }
.squiggle path { fill: none; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.squiggle path:nth-child(1) { stroke: #ffa94d; }
.squiggle path:nth-child(2) { stroke: #ff6fae; }
.squiggle path:nth-child(3) { stroke: #5fd3ff; stroke-width: 2.8; }
/* Not there until it's drawn (js/motion.js adds .drawn as the heading comes in), so it never
   shows first and then vanishes to be drawn again. Without motion it's simply there. */
.squiggle path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.squiggle.drawn path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .squiggle path { stroke-dashoffset: 0; } }
main .section h2:not(.cards-stage *, .stage *, .story-screen *, .crop-art *), .final h2, .page-body h2 { letter-spacing: -0.02em; }
.theater .headline h3, .coding-copy h3 { letter-spacing: -0.025em; }
.page-hero h1 { letter-spacing: -0.03em; }
.kicker { letter-spacing: 0.01em; font-size: 18px; }
.plan-price strong { letter-spacing: -0.03em; }

/* ---------- App icons that swell like the Dock (js/dockrow.js) ----------
   Each icon grows up from its foot; while the pointer moves they follow it closely, and they
   settle back a little slower when it leaves. The name sits above, in the Dock's own label. */
.dock-row { position: relative; width: fit-content; }
.dock-row > img { transform-origin: 50% 100%; transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1); }
.dock-row.live > img { transition-duration: 0.09s; }
.dock-row > :not(img):not(.dock-name) { transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1); }
.dock-name { position: absolute; left: 0; top: 0; padding: 5px 11px 6px; border-radius: 9px; background: rgba(22, 16, 44, 0.94); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); color: #fff; font: 600 13px/1.2 var(--ui); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.14s ease; z-index: 3; }
.dock-name.on { opacity: 1; }

/* ---------- A pen's marks ----------
   On the words that matter, here and there (js/doodles.js): one mark in a bright, solid ink,
   drawn as a hand would when it comes into view, sometimes sillier (a word that floats, a
   stamp, Pip peeking, confetti), and now and then a note in the margin. --d0 is when the pen
   starts: in a heading that rises word by word, once its word is up. */
.hl { position: relative; display: inline-block; font-style: inherit; isolation: isolate; --pen: #ffd43b; --d0: 0.1s; }
.words-in .hl { --d0: calc(var(--i, 0) * 65ms + 0.9s); }
/* The widget wall's stamp comes down once its number has counted up. */
#widgets-title .hl { --d0: 1.5s; }
.hl-art { position: absolute; z-index: -1; overflow: visible; pointer-events: none; }
.hl-art path { fill: none; stroke: var(--pen); stroke-width: max(2px, 0.068em); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.hl.drawn .hl-art path, .words-in.arrived .hl .hl-art path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.55s cubic-bezier(0.55, 0, 0.25, 1) calc(var(--d0) + var(--k) * 0.12s); }
/* Filled parts (a sticker, a dot, a shadow) come in by size, not by a pen. */
.hl-art path.fill { fill: var(--pen); stroke: none; stroke-dasharray: none; opacity: 0; scale: 0.4; transform-box: fill-box; transform-origin: 50% 50%; }
.hl.drawn .hl-art path.fill, .words-in.arrived .hl .hl-art path.fill { opacity: 1; scale: 1; transition: opacity 0.2s ease calc(var(--d0) + var(--k) * 0.12s), scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--d0) + var(--k) * 0.12s); }
/* Finer pens for the small marks; above the words for what lies on them. */
.hl:is([data-mark="burst"], [data-mark="steam"], [data-mark="sparkle"], [data-mark="hearts"], [data-mark="ribbon"], [data-mark="tally"], [data-mark="slip"]) .hl-art path { stroke-width: max(1.6px, 0.055em); }
.hl:is([data-mark="strike"], [data-mark="clip"], [data-mark="cursor"]) .hl-art { z-index: 1; }
/* Room so the pen doesn't run into the next word. */
.hl:is([data-mark="circle"], [data-mark="box"], [data-mark="sticker"], [data-mark="stamp"]) { margin: 0 0.2em; }
.hl[data-mark="bubble"] { margin: 0 0.24em; }
.hl:is([data-mark="check"], [data-mark="cursor"], [data-mark="swoosh"]) { margin-right: 0.5em; }
.hl[data-mark="hearts"] { margin-right: max(0.6em, 14px); }
.hl:is([data-mark="home"], [data-mark="lock"]) { margin-right: max(0.8em, 20px); }
.hl[data-mark="wink"] { margin-right: max(1em, 22px); }
.hl:is([data-mark="infinity"], [data-mark="target"]) { margin-right: max(1.2em, 26px); }
/* A marker, and colouring in: the words go ink-dark as the pen passes. */
.hl[data-mark="swash"] .hl-art path { stroke-width: 0.72em; }
.hl[data-mark="scribble"] .hl-art path { stroke-width: 0.34em; }
.hl:is([data-mark="swash"], [data-mark="scribble"], [data-mark="sticker"]) { transition: color 0.2s ease; }
.hl:is([data-mark="swash"], [data-mark="scribble"]).drawn, .words-in.arrived .hl:is([data-mark="swash"], [data-mark="scribble"]) { color: #21163a; transition-delay: calc(var(--d0) + 0.25s); }
/* A sticker: slapped on, a little askew. */
.hl[data-mark="sticker"].drawn, .words-in.arrived .hl[data-mark="sticker"] { color: #21163a; rotate: -2.5deg; transition: color 0.15s ease var(--d0), rotate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) var(--d0); }
/* A stamp: the words in its ink, capitals, brought down hard, a little crooked. */
.hl[data-mark="stamp"] { color: var(--pen); text-transform: uppercase; letter-spacing: 0.03em; rotate: -3deg; }
.hl[data-mark="stamp"] .hl-art path { stroke-dasharray: none; stroke-width: max(2.4px, 0.075em); }
.hl[data-mark="stamp"] .hl-art path.thin { stroke-width: max(1.4px, 0.04em); }
.hl[data-mark="stamp"] .hl-art { opacity: 0; }
.hl[data-mark="stamp"].drawn .hl-art, .words-in.arrived .hl[data-mark="stamp"] .hl-art { animation: hl-stamp 0.42s cubic-bezier(0.5, 0, 0.75, 0) var(--d0) both; }
.hl[data-mark="stamp"].drawn, .words-in.arrived .hl[data-mark="stamp"] { animation: hl-thud 0.3s ease-out calc(var(--d0) + 0.4s); }
@keyframes hl-stamp { from { opacity: 0; scale: 1.7; } 70% { opacity: 1; } to { opacity: 1; scale: 1; } }
@keyframes hl-thud { 30% { translate: 0 0.04em; } 60% { translate: 0 -0.02em; } }
/* "hover": it floats, and its shadow stays on the ground, smaller when it's higher. */
.hl[data-mark="hover"].drawn, .words-in.arrived .hl[data-mark="hover"] { animation: hl-float 2.8s ease-in-out calc(var(--d0) + 0.4s) infinite; }
.hl[data-mark="hover"].drawn .hl-art, .words-in.arrived .hl[data-mark="hover"] .hl-art { animation: hl-ground 2.8s ease-in-out calc(var(--d0) + 0.4s) infinite; }
.hl[data-mark="hover"] .hl-art path.shadow { fill: var(--pen); }
.hl[data-mark="hover"].drawn .hl-art path.shadow, .words-in.arrived .hl[data-mark="hover"] .hl-art path.shadow { opacity: 0.45; }
@keyframes hl-float { 50% { translate: 0 -0.14em; } }
@keyframes hl-ground { 50% { translate: 0 0.14em; scale: 0.82 1; } }
/* Pip, peeking over the letters: up from behind them, then blinking now and then. */
.hl-art .peek { transform-box: fill-box; transform-origin: 50% 100%; scale: 1 0; }
.hl-art .peek path { stroke: none; stroke-dasharray: none; }
.hl-art .peek .head { fill: #f6f1ff; }
.hl-art .peek .eye { fill: #1d153e; transform-box: fill-box; transform-origin: 50% 50%; }
.hl.drawn .hl-art .peek, .words-in.arrived .hl .hl-art .peek { scale: 1; transition: scale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--d0) + 0.2s); }
.hl.drawn .hl-art .peek .eye, .words-in.arrived .hl .hl-art .peek .eye { animation: hl-blink 5.2s ease-in-out calc(var(--d0) + 1.4s) infinite; }
@keyframes hl-blink { 0%, 90%, 100% { scale: 1 1; } 93% { scale: 1 0.1; } 96% { scale: 1 1; } }
/* Confetti: out from the middle of the words, spinning, then still. */
.hl[data-mark="confetti"] .hl-art path { stroke-dasharray: none; stroke-width: max(2px, 0.06em); opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.hl[data-mark="confetti"].drawn .hl-art path, .words-in.arrived .hl[data-mark="confetti"] .hl-art path { opacity: 1; scale: 1; animation: hl-confetti 0.9s cubic-bezier(0.15, 0.9, 0.3, 1.1) calc(var(--d0) + var(--k) * 18ms) both; transition: none; }
@keyframes hl-confetti { from { opacity: 0; translate: var(--dx) var(--dy); rotate: var(--r); scale: 0.2; } 20% { opacity: 1; } }
/* A word slipping off its line, hanging on by a corner. */
.hl[data-mark="slip"].drawn, .words-in.arrived .hl[data-mark="slip"] { transform-origin: 0 90%; animation: hl-slip 1.3s cubic-bezier(0.3, 1.5, 0.5, 1) calc(var(--d0) + 0.3s) both; }
@keyframes hl-slip { from { rotate: 0deg; } 55% { rotate: 14deg; } 78% { rotate: 9deg; } to { rotate: 11deg; } }
/* Someone typing: the dots bob one after another. */
.hl[data-mark="typing"].drawn .hl-art path.dot, .words-in.arrived .hl[data-mark="typing"] .hl-art path.dot { animation: hl-typing 1.3s ease-in-out calc(var(--d0) + 0.8s + var(--k) * 0.16s) infinite; }
@keyframes hl-typing { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 0 -0.09em; } }
/* The padlock's shackle snaps down once it's drawn. */
.hl-art path.shackle { translate: 0 -0.1em; }
.hl.drawn .hl-art path.shackle, .words-in.arrived .hl .hl-art path.shackle { translate: 0 0; transition: stroke-dashoffset 0.55s cubic-bezier(0.55, 0, 0.25, 1) var(--d0), translate 0.18s cubic-bezier(0.6, 0, 0.9, 0.5) calc(var(--d0) + 1s); }
/* The pointer: black with a white edge, as on a Mac; it comes in, then clicks. */
.hl-art path.cursor { fill: #0d0b14; stroke: #fff; stroke-width: max(1.4px, 0.035em); stroke-dasharray: none; transform-origin: 0 0; scale: 1; translate: 0.6em 0.5em; }
.hl.drawn .hl-art path.cursor, .words-in.arrived .hl .hl-art path.cursor { translate: 0 0; animation: hl-click 0.24s ease-in-out calc(var(--d0) + 0.75s); transition: opacity 0.2s ease var(--d0), translate 0.6s cubic-bezier(0.22, 1, 0.36, 1) var(--d0); }
@keyframes hl-click { 50% { scale: 0.86; } }
/* Shaken now and then, as if it can't wait. */
.hl[data-move="wiggle"].drawn, .words-in.arrived .hl[data-move="wiggle"] { animation: hl-wiggle 4s ease-in-out calc(var(--d0) + 1.2s) infinite; }
@keyframes hl-wiggle { 0%, 84%, 100% { rotate: 0deg; } 87% { rotate: -4deg; } 90% { rotate: 4deg; } 93% { rotate: -3deg; } 96% { rotate: 2deg; } }
/* Room beside the icons that come after words. */
.hl[data-mark="blind"] { margin-right: max(1.1em, 26px); }
.hl:is([data-mark="key"], [data-mark="cookie"], [data-mark="bandaid"]) { margin-right: max(1.25em, 30px); }
.hl[data-mark="snail"] { margin-right: max(1.4em, 34px); }
.hl[data-mark="pencil"] { margin-right: 0.3em; }
/* The snail, in no hurry at all. */
.hl[data-mark="snail"].drawn .hl-art, .words-in.arrived .hl[data-mark="snail"] .hl-art { animation: hl-crawl 7s ease-in-out calc(var(--d0) + 1s) infinite; }
@keyframes hl-crawl { 50% { translate: 0.2em 0; } }
/* The pencil (wood, lead, a yellow body, a band, a pink rubber) writes the line it sits on. */
.hl-art .pencil { translate: calc(var(--travel) * -1) 0; opacity: 0; }
.hl-art .pencil path { stroke: #1d153e; stroke-width: 0.8px; stroke-dasharray: none; stroke-dashoffset: 0; }
.hl-art .pencil .body { fill: #ffd43b; }
.hl-art .pencil .band { fill: #c7a6ff; }
.hl-art .pencil .rubber { fill: #ff7ab6; }
.hl-art .pencil .wood { fill: #f3c99a; }
.hl-art .pencil .lead { fill: #1d153e; }
.hl.drawn .hl-art .pencil, .words-in.arrived .hl .hl-art .pencil { translate: 0 0; opacity: 1; transition: translate 0.55s cubic-bezier(0.55, 0, 0.25, 1) var(--d0), opacity 0.12s ease var(--d0); }
/* The note in the margin: a few words in a hand, its arrow drawn back to the words. */
.hl-note { position: absolute; z-index: 2; display: flex; gap: 1px; white-space: nowrap; font: 700 max(20px, 0.5em) / 1 var(--hand); letter-spacing: 0; text-transform: none; color: var(--pen); pointer-events: none; opacity: 0; scale: 0.5; }
.hl-note b { font-weight: inherit; }
.hl-note svg { flex: none; width: 1.5em; height: 1.16em; overflow: visible; }
.hl-note path { fill: none; stroke: var(--pen); stroke-width: 2.2px; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.hl.drawn .hl-note, .words-in.arrived .hl .hl-note { opacity: 1; scale: 1; transition: opacity 0.2s ease calc(var(--d0) + 0.5s), scale 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--d0) + 0.5s); }
.hl.drawn .hl-note path, .words-in.arrived .hl .hl-note path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.35s ease-out calc(var(--d0) + 0.7s + var(--k, 0) * 0.3s); }
.hl-note path:last-child { --k: 1; }
.hl-note.at-tr { left: calc(100% - 0.05em); bottom: 70%; align-items: flex-end; transform-origin: 0 100%; rotate: -5deg; }
.hl-note.at-tl { right: calc(100% - 0.05em); bottom: 70%; align-items: flex-end; flex-direction: row-reverse; transform-origin: 100% 100%; rotate: 5deg; }
.hl-note.at-br { left: calc(100% - 0.05em); top: 72%; align-items: flex-start; transform-origin: 0 0; rotate: 4deg; }
.hl-note.at-bl { right: calc(100% - 0.05em); top: 72%; align-items: flex-start; flex-direction: row-reverse; transform-origin: 100% 0; rotate: -4deg; }
.hl-note.at-r { left: calc(100% + 0.15em); top: 50%; translate: 0 -50%; align-items: center; transform-origin: 0 50%; rotate: -4deg; }
/* Round a loop, a box, a bubble or a stamp, the note keeps clear of the pen's line. */
.hl:is([data-mark="circle"], [data-mark="box"], [data-mark="bubble"], [data-mark="stamp"], [data-mark="sticker"]) > .hl-note.at-tr { left: calc(100% + 0.3em); bottom: 98%; }
.hl:is([data-mark="circle"], [data-mark="box"], [data-mark="bubble"], [data-mark="stamp"], [data-mark="sticker"]) > .hl-note.at-tl { right: calc(100% + 0.3em); bottom: 98%; }
.hl-note.at-tl svg { scale: -1 1; }
.hl-note.at-br svg { scale: 1 -1; }
.hl-note.at-bl svg { scale: -1 -1; }
.hl-note.tucked { display: none; }
/* On a phone a centred heading has its label right above it: no note there. */
@media (max-width: 700px) { :is(.center, .final) .hl-note { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hl-art path, .hl-note path { stroke-dashoffset: 0; transition: none !important; }
  .hl-art path.fill, .hl-art path.cursor, .hl-art .peek, .hl-note { opacity: 1; scale: 1; translate: 0 0; transition: none !important; }
  .hl, .hl-art, .hl-art path, .hl-art .peek .eye { animation: none !important; }
  .hl[data-mark="stamp"] .hl-art { opacity: 1; }
  .hl[data-mark="hover"] .hl-art path.shadow { opacity: 0.45; }
  .hl-art .pencil { translate: 0 0; opacity: 1; transition: none !important; }
}

/* ---------- Between pages ----------
   Following a link to another page of the site, the old page lifts away and the new one
   settles in (cross-document view transitions: Chrome, Edge, Safari 18.2 and later;
   elsewhere a page simply loads). The top bar is one piece across pages: it stays put, and
   between the home page's notch bar and the other pages' bar it reshapes. */
@view-transition { navigation: auto; }
.notchnav, .subnav { view-transition-name: topbar; }
::view-transition-old(root) { animation: vt-out 0.26s cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both; }
::view-transition-group(topbar) { animation-duration: 0.5s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-16px) scale(0.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(26px) scale(0.985); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
