/* style.css
 *
 * Every page's one stylesheet, in app's palette: near black ground, icon's
 * amber, greys stepped from ground. Home page's pretend desktop as its first
 * screen, its facts, story and cards, then pages of text: download, updates,
 * terms, privacy.
 */

/* ------------------------------
 *         Typefaces:
 * ------------------------------ */

/* Chivo and Chivo Mono from this domain; SIL Open Font License 1.1 */
@font-face {
  font-family: "Chivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/chivo.woff2") format("woff2");
}
@font-face {
  font-family: "Chivo Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/chivo-mono.woff2") format("woff2");
}

/* ------------------------------
 *           Tokens:
 * ------------------------------ */

:root {
  /* Ground and surfaces */
  --ground: #0E1013;
  --panel: #1C1F24;
  --panel-raised: #262A30;
  --edge: #2C3138;

  /* Text */
  --bright: #ECEFF3;
  --text: #B4BCC6;
  --quiet: #7E8894;

  /* Icon's amber */
  --amber: #FFB842;
  --ink: #121417;

  /* Page's tempo, 112 a minute, as page.js's own kick */
  --beat-period: 0.5357s;

  /* Pinned top bar's height */
  --bar: 3.75rem;

  /* Gutter and measure */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 36rem;
}

/* ------------------------------
 *            Base:
 * ------------------------------ */

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

/* Page */
/* Whole page grows with screens wider than a laptop's: 16px to 1512 points
 * wide, 20px by 2560, every rem sized thing following, so a large monitor
 * sees the same page larger rather than a narrow column */
html { -webkit-text-size-adjust: 100%; font-size: clamp(100%, 0.6vw + 7px, 125%); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: Chivo, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Headings: plain, no labels above them */
h1, h2 {
  color: var(--bright);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.5rem); max-width: 14ch; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem); max-width: 24ch; }
p { margin: 0; }

/* Links */
a { color: var(--amber); text-underline-offset: 0.18em; }
a:hover { color: var(--bright); }

/* Focus ring */
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }

/* Media fill their box */
img, video { display: block; width: 100%; height: auto; }
figure { margin: 0; }
figcaption { color: var(--quiet); font-size: 0.9rem; margin-top: 0.75rem; max-width: var(--measure); }

/* Read by screen readers alone */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Skip link, off screen until focused */
.skip { position: absolute; left: -9999px; top: 0; z-index: 10; background: var(--amber); color: var(--ink); padding: 0.75rem 1rem; }
.skip:focus { left: 0; }

/* Width and gutters */
.wrap { width: 100%; max-width: max(72rem, 62vw); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------
 *          Top Bar:
 * ------------------------------ */

/* Pinned, one row, so Download is never further than the top of the screen */
.top { position: sticky; top: 0; z-index: 20; background: rgba(14, 16, 19, 0.94); border-bottom: 1px solid var(--edge); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--bar); }
html { scroll-padding-top: calc(var(--bar) + 1rem); }

/* Icon and name */
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--bright); text-decoration: none; font-weight: 700; }
.brand img { width: 2rem; height: 2rem; border-radius: 0.45rem; }

/* Links, Download set apart */
.top-links { display: flex; align-items: center; gap: clamp(0.9rem, 2.5vw, 1.75rem); font-size: 0.95rem; }
.top-links a { color: var(--text); text-decoration: none; }
.top-links a:hover, .top-links a[aria-current="page"] { color: var(--bright); }
.top-links a { padding: 0.45rem 0; }
.top-links .get { color: var(--ink); background: var(--amber); padding: 0.45rem 0.9rem; border-radius: 0.5rem; font-weight: 700; }
.top-links .get:hover { color: var(--ink); background: var(--bright); }

/* ------------------------------
 *          Desktop:
 * ------------------------------ */

.desk-section { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 7vw, 5rem); }
.desk-section .desk-layout { margin-top: 2rem; }

/* Desktop and Settings side by side, Settings under it on narrow screens */
.desk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17.5rem; gap: 1.25rem; align-items: start; }

/* Screen: night wallpaper painted, trace over it, icons over trace */
.desk {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid var(--edge);
  /* Pexels' wind-cut black sand, edges darkened so icons and trace read */
  background:
    radial-gradient(ellipse 120% 100% at 50% 45%, rgba(7, 10, 16, 0) 40%, rgba(7, 10, 16, 0.55) 100%),
    #0B0D11 url("/assets/media/desk-sand.webp") center / cover no-repeat;
}

/* Drop target lit while song dragged over */
.desk.is-dropping { outline: 2px dashed var(--amber); outline-offset: -8px; }

/* Bar across top of screen */
.desk-bar {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  height: 1.6rem; padding: 0 0.75rem;
  background: rgba(10, 12, 16, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
}
.desk-bar img { width: 0.95rem; height: 0.95rem; }

/* Trace fills screen under icons */
.desk-scope { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; }

/* Icons down right edge, as a desktop keeps them, low enough that trace runs under one */
.desk-icons {
  position: absolute; z-index: 2; top: 24%; right: 0.9rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  margin: 0; padding: 0; list-style: none;
}

/* One icon: picture over name */
.icon {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  width: 5.5rem; padding: 0.45rem 0.25rem;
  background: none; border: 0; border-radius: 0.5rem;
  color: #fff; font: inherit; font-size: 0.75rem; cursor: pointer;
}
.icon:hover, .icon[aria-pressed="true"], .icon.is-active { background: rgba(255, 255, 255, 0.14); }
.icon svg { width: 2.6rem; height: 2.6rem; }
.icon .sheet { fill: #E9EDF2; }
.icon .fold { fill: none; stroke: #B9C2CC; stroke-width: 1.5; }
.icon .note { fill: none; stroke: #4A5361; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.icon label .sheet, label.icon .sheet { fill: #6FAEE6; }
label.icon .fold { stroke: #4E8DC7; }
.icon-name { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); line-height: 1.25; text-align: center; white-space: nowrap; }

/* Dragged across the desktop: lifted, the trace still behind */
.desk-icons > li { touch-action: none; }
.desk-icons > li.is-dragging { z-index: 4; cursor: grabbing; }
.desk-icons > li.is-dragging .icon { background: rgba(255, 255, 255, 0.18); transform: scale(1.04); }

/* Picker hidden, label opening it, focus shown on label */
.icon input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.icon:focus-within { outline: 2px solid var(--amber); outline-offset: 2px; }

/* What to do, bottom left */
.desk-hint {
  position: absolute; z-index: 2; left: 0.9rem; bottom: 0.75rem; right: 7rem;
  color: rgba(255, 255, 255, 0.72); font-size: 0.8rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ------------------------------
 *           Tour:
 * ------------------------------ */

/* Pointer showing Settings in use, over everything, never catching clicks */
.desk-layout { position: relative; }
.tour-cursor {
  position: absolute; z-index: 5; left: 0; top: 0;
  pointer-events: none; opacity: 0;
  transition: transform 0.9s cubic-bezier(0.45, 0, 0.2, 1), opacity 0.4s ease;
}
.desk-layout.is-touring .tour-cursor { opacity: 1; }
.tour-cursor svg { width: 1.35rem; height: 1.35rem; fill: #fff; stroke: #111; stroke-width: 1.3; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); transition: transform 0.15s ease; transform-origin: 20% 10%; }
.tour-cursor.is-pressing svg { transform: scale(0.82); }
.tour-label {
  position: absolute; left: 1.4rem; top: 1.1rem; white-space: nowrap;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  background: var(--amber); color: var(--ink); font-size: 0.75rem; font-weight: 700;
  opacity: 0; transition: opacity 0.25s ease;
}
.tour-label.is-shown { opacity: 1; }

/* ------------------------------
 *          Settings:
 * ------------------------------ */

/* Window, as app's Settings looks */
.panel {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 0.75rem;
  padding: 0 1rem 1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  font-size: 0.85rem;
}

/* Title bar, three dots and name */
.panel-title { display: flex; align-items: center; gap: 0.4rem; height: 2.4rem; margin: 0 -1rem 0.75rem; padding: 0 0.85rem; border-bottom: 1px solid var(--edge); }
.panel-title i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #3A4048; }
.panel-title span { margin-left: 0.5rem; color: var(--quiet); font-size: 0.8rem; font-weight: 600; }

/* Row: label right aligned, control after */
.row { display: grid; grid-template-columns: 4rem minmax(0, 1fr); align-items: center; gap: 0.75rem; margin: 0 0 0.85rem; padding: 0; border: 0; min-width: 0; }
.row > label, .row > legend { color: var(--text); text-align: right; padding: 0; }
.row > legend { float: left; width: 4rem; margin-right: 0.75rem; }
fieldset.row { display: block; }
fieldset.row::after { content: ""; display: table; clear: both; }

/* Popup */
.row select {
  width: 100%; padding: 0.35rem 0.5rem;
  background: var(--panel-raised); color: var(--bright);
  border: 1px solid var(--edge); border-radius: 0.4rem; font: inherit;
}

/* Sliders in amber */
.row input[type="range"] { width: 100%; height: 1.6rem; accent-color: var(--amber); }

/* Colour wells */
.swatches { display: flex; flex-wrap: wrap; gap: 0.45rem; padding-top: 0.1rem; }
.swatches label { position: relative; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatch { display: block; width: 1.6rem; height: 1.6rem; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
.swatches input:checked + .swatch { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--bright); }
.swatches input:focus-visible + .swatch { outline: 2px solid var(--amber); outline-offset: 4px; }
.swatch-amber { background: rgb(255, 191, 89); }
.swatch-white { background: rgb(255, 255, 255); }
.swatch-ice { background: rgb(153, 209, 255); }
.swatch-cyan { background: rgb(89, 255, 242); }
.swatch-magenta { background: rgb(255, 115, 230); }
.swatch-green { background: rgb(128, 255, 153); }

/* Note under controls */
.panel-note { color: var(--quiet); font-size: 0.8rem; line-height: 1.5; border-top: 1px solid var(--edge); padding-top: 0.85rem; }

/* ------------------------------
 *       Mac Or Windows:
 * ------------------------------ */

/* Words and clips for system page speaks to; Mac unless root says Windows */
[data-only="windows"] { display: none; }
html[data-os="windows"] [data-only="windows"] { display: revert; }
html[data-os="windows"] video[data-only="windows"] { display: block; }
html[data-os="windows"] [data-only="mac"] { display: none; }

/* Switch above chapters, system shown lit */
.os-switch { display: inline-flex; padding: 0.2rem; border: 1px solid var(--edge); border-radius: 999px; background: var(--panel); }
.os-switch button { min-height: 2.5rem; padding: 0.3rem 1rem; border: 0; border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.os-switch button[aria-pressed="true"] { background: var(--amber); color: var(--ink); font-weight: 700; }

/* Download buttons: main one filled, its glow a layer pulsing on beat */
.get-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2rem; }
.get-button {
  display: inline-block; padding: 0.8rem 1.3rem; border-radius: 0.6rem;
  border: 1px solid var(--amber); color: var(--amber);
  font-weight: 700; text-decoration: none;
}
.get-button:hover { color: var(--ink); background: var(--amber); }
.get-main,
html:not([data-os="windows"]) .get-mac,
html[data-os="windows"] .get-windows {
  position: relative;
  color: var(--ink); background: var(--amber);
}
.get-main::after,
html:not([data-os="windows"]) .get-mac::after,
html[data-os="windows"] .get-windows::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 34px rgba(255, 184, 66, 0.5);
}
.get-main:hover,
html:not([data-os="windows"]) .get-mac:hover,
html[data-os="windows"] .get-windows:hover { background: var(--bright); border-color: var(--bright); }

/* Phone: no download filled, the link to send oneself offered instead */
[data-phone-only] { display: none; }
html[data-phone] [data-phone-only] { display: block; }
html[data-phone] .get-mac, html[data-phone] .get-windows { color: var(--amber); background: none; }
html[data-phone] .get-mac::after, html[data-phone] .get-windows::after { display: none; }
.send-on { margin-top: 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--edge); border-radius: 0.75rem; background: var(--panel); max-width: var(--measure); }
.send-on p { color: var(--bright); }
.send-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 0.85rem; }
button.get-button { font: inherit; font-weight: 700; cursor: pointer; background: none; }
.send-row .send-share:not([hidden]), .send-row .send-share[hidden] + .get-button { color: var(--ink); background: var(--amber); }
.page-head .send-row { justify-content: flex-start; }

/* Visitor's own system first */
html[data-os="windows"] .get-windows { order: -1; }

/* Short line under a section's heading */
.section-lede { margin-top: 0.9rem; max-width: var(--measure); }

/* ------------------------------
 *         Sections:
 * ------------------------------ */

/* Room between sections */
.reels, .closing, .why, .does { padding: clamp(3rem, 8vw, 6rem) 0; }

/* ------------------------------
 *           Stage:
 * ------------------------------ */

/* First screen: what it is and the download in one row, the demo under it */
.stage { padding: clamp(1.5rem, 3.5vh, 2.75rem) 0 clamp(2rem, 5vw, 3.5rem); }
.stage-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.25rem 2.5rem; }
.stage-words { flex: 1 1 30rem; }
.stage h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem); max-width: 18ch; }
.stage .lede { margin-top: 0.9rem; max-width: 40rem; }
.stage-get { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-start; }
.stage-get .get-row { justify-content: flex-start; margin-top: 0; }
.stage-get .small { margin-top: 0.7rem; color: var(--quiet); font-size: 0.85rem; }
.stage-get .send-on { margin: 0 0 1rem; }
.stage .desk-layout { margin-top: clamp(1.25rem, 3vh, 2rem); }

/* Desktop as tall as the first screen allows on a wide one, never cut */
@media (min-width: 901px) {
  .stage .desk { max-height: calc(100vh - var(--bar) - 15rem); margin-inline: auto; width: 100%; }
}

/* ------------------------------
 *           Facts:
 * ------------------------------ */

/* Four plain facts in a strip, in the mono face */
.facts { border-block: 1px solid var(--edge); background: var(--panel); }
.facts-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 2rem; margin: 0 auto; padding-block: 1.4rem; list-style: none; font-family: "Chivo Mono", ui-monospace, monospace; font-size: 0.85rem; color: var(--text); }
.facts-list b { display: block; color: var(--amber); font-weight: 400; font-size: 1.05rem; }

/* ------------------------------
 *            Why:
 * ------------------------------ */

/* Ian's note beside the two figures, drawn to scale */
.why { overflow: hidden; padding-bottom: clamp(1rem, 3vw, 2rem); }
.why-inner { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.weigh { --light: 4.5rem; display: grid; gap: 1.6rem; margin: 0; }
.weigh-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; gap: 0.35rem 1rem; }
.weigh-name { color: var(--text); font-size: 0.9rem; }
.weigh-figure { grid-column: 2; font-family: "Chivo Mono", ui-monospace, monospace; color: var(--bright); }
.weigh-bar { grid-column: 2; grid-row: 1; height: 1.1rem; border-radius: 0.25rem; transform-origin: left center; }

/* 3 GB beside 150 MB is twenty times: the long one runs off the screen */
.weigh-light { width: var(--light); background: var(--amber); box-shadow: 0 0 18px rgba(255, 184, 66, 0.45); }
.weigh-heavy { width: calc(var(--light) * 20.48); background: #4A505A; }
.weigh figcaption { margin: 0; color: var(--quiet); font-size: 0.85rem; }

/* Bars grow once in view, as page.js marks them */
.weigh.will-grow .weigh-bar { transform: scaleX(0); }
.weigh.will-grow.has-grown .weigh-bar { transform: none; transition: transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.weigh.will-grow.has-grown .weigh-light { transition-delay: 0.9s; transition-duration: 0.5s; }

/* ------------------------------
 *            Cards:
 * ------------------------------ */

/* Heading with the system switch, then three bands */
.does-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.band { margin-top: clamp(2rem, 4vw, 3rem); }
.band-title { display: flex; align-items: baseline; gap: 1rem; font-family: "Chivo Mono", ui-monospace, monospace; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.band-title a { letter-spacing: 0; text-transform: none; font-size: 0.85rem; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem); margin-top: 1rem; }
.card { display: flex; flex-direction: column; }
.card h3 { margin: 0.9rem 0 0; color: var(--bright); font-size: 1.15rem; font-weight: 800; }
.card p { margin: 0.35rem 0 0; font-size: 0.95rem; }

/* Clip over its still at the card's width, a play button over both until pressed */
.chapter-media video, .chapter-media img { border-radius: 0.75rem; border: 1px solid var(--edge); }
.chapter-media { display: grid; position: relative; }
.chapter-media > * { grid-area: 1 / 1; }
.chapter-media img, .chapter-media video { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.chapter-media video { opacity: 0; transition: opacity 0.3s ease; }
.chapter-media video.is-ready { opacity: 1; object-fit: contain; background: #000; }
.chapter-media .chapter-still[hidden] { display: none; }
.card-play {
  place-self: center; display: grid; place-items: center;
  width: 3.5rem; height: 3.5rem; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(14, 16, 19, 0.72); box-shadow: 0 0 0 1px rgba(255, 184, 66, 0.6), 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.card-play svg { width: 1.5rem; height: 1.5rem; margin-left: 0.2rem; fill: var(--amber); }
.card-play:hover { background: rgba(14, 16, 19, 0.9); transform: scale(1.06); }
.card-play:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.card-play[hidden] { display: none; }

/* 1.6's cards, words alone until their recordings are made */
.card-new { padding: 1.4rem 1.5rem; background: var(--panel); border: 1px solid var(--edge); border-radius: 0.9rem; }
.card-new h3 { margin-top: 0; }

/* ------------------------------
 *           Reels:
 * ------------------------------ */

/* Two rows drifting opposite ways, paused under pointer */
.reel { overflow: hidden; margin-top: 1.25rem; }
.reels .reel:first-of-type { margin-top: 2.25rem; }
.reel-track { display: flex; gap: 1.25rem; width: max-content; margin: 0; padding: 0; list-style: none; animation: reel 95s linear infinite; }
.reel-right .reel-track { animation-duration: 110s; animation-direction: reverse; }
.reel:hover .reel-track, .reel:focus-within .reel-track, .reels.is-paused .reel-track { animation-play-state: paused; }
.reel:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.reels-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.reel-pause { min-height: 2.5rem; padding: 0.3rem 1rem; border: 1px solid var(--edge); border-radius: 999px; background: var(--panel); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.reel-pause:hover { color: var(--bright); border-color: var(--quiet); }

/* Credit a picture's licence asks for, small over its corner */
.reel-credited { position: relative; }
.reel-credit { position: absolute; right: 0.5rem; bottom: 0.5rem; padding: 0.15rem 0.45rem; border-radius: 0.3rem; background: rgba(7, 10, 16, 0.85); color: var(--text); font-size: 0.7rem; white-space: nowrap; }
.reel-track img { height: clamp(9rem, 16vw, 13rem); width: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 0.6rem; border: 1px solid var(--edge); }
@keyframes reel { to { transform: translateX(calc(-50% - 0.625rem)); } }

/* ------------------------------
 *        Trace Rules:
 * ------------------------------ */

/* A trace drawn in on reaching it, its glow a blurred layer behind, dark until drawn */
.trace-rule { position: relative; }
.trace-rule::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5rem; pointer-events: none;
  background: url("/assets/trace-glow.svg") center / 100% 100% no-repeat;
  filter: blur(4px); opacity: 0;
}
.wrap.trace-rule::after { left: var(--gutter); right: var(--gutter); }
.trace-rule svg { position: relative; z-index: 1; display: block; width: 100%; height: 2.5rem; overflow: visible; }
.trace-rule path { fill: none; stroke: var(--amber); stroke-linecap: round; stroke-dasharray: 1600; stroke-dashoffset: 1600; transition: stroke-dashoffset 1.8s ease; }
.trace-rule .trace-line { stroke-width: 1.5; }
.trace-rule.is-drawn path { stroke-dashoffset: 0; }

/* ------------------------------
 *            Beat:
 * ------------------------------ */

/* Glows pulse on page's own kick by opacity alone, so compositor runs it */
@keyframes beat {
  0% { opacity: 1; }
  18% { opacity: 0.45; }
  40% { opacity: 0.22; }
  50% { opacity: 0.5; }
  62% { opacity: 0.22; }
  100% { opacity: 0.16; }
}
.get-main::after,
html:not([data-os="windows"]) .get-mac::after,
html[data-os="windows"] .get-windows::after { animation: beat var(--beat-period) ease-out infinite; will-change: opacity; }
/* Rule's glow lit on first kick after its line is drawn, one animation so compositor keeps it */
.trace-rule.is-drawn::after { animation: beat var(--beat-period) ease-out 1.8s infinite; will-change: opacity; }

/* Demo playing: page.js sets each glow's --glow to music's low end */
html.is-live .get-button::after,
html.is-live .trace-rule.is-drawn::after { animation: none; opacity: var(--glow, 0.4); }

/* Closing band: Ian's note beside what it costs, a rule between */
.closing-inner { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.closing-free { display: block; text-align: center; }
.closing-free .free { border: 0; padding: 0; max-width: 40rem; margin: 0 auto; }
.closing-free .free .get-button { margin-top: 0.5rem; }
.story p { margin-top: 1.1rem; }
.story .signature { font-family: "Chivo Mono", ui-monospace, monospace; color: var(--amber); }

/* Free, and last way to get it */
.free { border-left: 1px solid var(--edge); padding-left: clamp(2rem, 5vw, 4rem); }
.free p { margin: 1rem 0 2rem; }

/* ------------------------------
 *       Pages Of Text:
 * ------------------------------ */

/* Heading and its lede, then prose at a reading width */
.page { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 8vw, 6rem); }
.page-head { max-width: 46rem; }
.page-head p { margin-top: 1.1rem; font-size: 1.1em; }
.page-head .updated { color: var(--quiet); font-size: 0.9rem; }
.prose { max-width: 46rem; margin-top: clamp(2rem, 5vw, 3.5rem); }

/* Divider under heading and between parts of a page */
.page .trace-rule { margin: clamp(1.75rem, 4vw, 3rem) 0; }
.page .trace-rule + .prose, .page .trace-rule + .platforms, .page .trace-rule + .page-body, .page .trace-rule + .help { margin-top: 0; }

/* Long pages: list of sections pinned beside text, which takes rest of width */
.page-body { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.page-body .prose { margin-top: 0; max-width: 52rem; }
.toc { position: sticky; top: calc(var(--bar) + 2rem); font-size: 0.9rem; }
.toc-title { font-family: "Chivo Mono", ui-monospace, monospace; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.toc ol { list-style: none; padding: 0; margin-top: 1rem; border-left: 1px solid var(--edge); }
.toc li + li { margin-top: 0.15rem; }
.toc a { display: block; padding: 0.3rem 0 0.3rem 1rem; margin-left: -1px; border-left: 1px solid transparent; color: var(--quiet); text-decoration: none; }
.toc a:hover { color: var(--bright); border-left-color: var(--amber); }
.toc a[aria-current="page"] { color: var(--bright); }
.toc .date { display: block; font-size: 0.78rem; }
.prose h2[id] { scroll-margin-top: 6rem; }

/* Download's help: three parts side by side */
.help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: start; }
.help .prose { margin-top: 0; }
.help .prose h2 { margin-top: 0; font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem); }

/* Not found: centred, nothing beside it */
.page-centred .wrap { max-width: 46rem; text-align: center; }
.page-centred .page-head, .page-centred h1, .page-centred .prose h2 { margin-left: auto; margin-right: auto; }
.page-centred .button-row { justify-content: center; }
.page-centred .prose { margin-left: auto; margin-right: auto; }
.prose h2 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem); margin: 2.75rem 0 0.9rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { color: var(--bright); font-size: 1.1rem; margin: 1.75rem 0 0.6rem; }
.prose p + p, .prose ul + p, .prose ol + p, .prose p + ul, .prose p + ol { margin-top: 1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.5rem; }
.prose strong { color: var(--bright); font-weight: 700; }
code { font-family: "Chivo Mono", ui-monospace, monospace; font-size: 0.88em; color: var(--bright); background: var(--panel); border: 1px solid var(--edge); border-radius: 0.3rem; padding: 0.05rem 0.35rem; overflow-wrap: anywhere; }

/* Numbered steps: amber numbers in rings */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps li { position: relative; padding-left: 2.6rem; counter-increment: step; }
.steps li + li { margin-top: 1rem; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.05rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  border: 1px solid var(--amber); color: var(--amber);
  display: grid; place-items: center;
  font-family: "Chivo Mono", ui-monospace, monospace; font-size: 0.85rem;
}

/* Download: Mac and Windows side by side, visitor's own first */
.platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2rem); margin-top: clamp(2rem, 5vw, 3.5rem); }
.platform { background: var(--panel); border: 1px solid var(--edge); border-radius: 0.9rem; padding: clamp(1.25rem, 3vw, 2rem); }
html[data-os="windows"] #windows { order: -1; }
.platform h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.platform .needs { margin-top: 0.4rem; color: var(--quiet); }
.platform .fineprint { color: var(--quiet); font-size: 0.85rem; line-height: 1.55; }
.platform .fineprint code { background: none; border: 0; padding: 0; color: var(--quiet); font-size: 0.78rem; }
.platform .steps { margin-top: 1.75rem; }
@media (max-width: 900px) { .platforms, .help { grid-template-columns: minmax(0, 1fr); } }

/* Buttons pages of text share with home */
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }

/* ------------------------------
 *            Reviews:
 * ------------------------------ */

/* Download reviews, invitation remaining useful before quotes arrive */
.reviews { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.reviews-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.reviews-heading h2 { margin: 0; font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem); }
#reviews-empty { margin-top: 0.9rem; color: var(--quiet); }

/* Quotes share download cards' surface, long words wrapping within card */
.review-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.review-cards[hidden] { display: none; }
/* Fewer than three: two share the row, one reads at a measure's width */
.review-cards:has(> .review-card:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.review-cards:has(> .review-card:only-child) { grid-template-columns: minmax(0, 44rem); }
.review-card { margin: 0; padding: 1.5rem; background: var(--panel); border: 1px solid var(--edge); border-radius: 0.9rem; overflow-wrap: anywhere; }
.review-head { margin-bottom: 0.9rem; padding-bottom: 0.9rem; border-bottom: 3px solid var(--edge); }
.review-rating { display: block; color: var(--amber); letter-spacing: 0.15em; font-size: 1.05rem; }
.review-title { margin: 0.3rem 0 0; font-size: 1.1rem; line-height: 1.3; color: var(--bright); }
.review-card blockquote { margin: 0; color: var(--bright); white-space: pre-wrap; }
.review-card figcaption { margin-top: 1rem; font-size: 0.85rem; color: var(--quiet); }
@media (max-width: 900px) { .review-cards { grid-template-columns: minmax(0, 1fr); } }

/* Updates: one entry per version, date quiet beside heading */
.update h2[id] { scroll-margin-top: 6rem; }
.update h2 { margin: 0; }
.update .date { color: var(--quiet); font-size: 0.9rem; margin-top: 0.3rem; }
.update ul { margin-top: 1rem; }

/* Version's sentence, its groups named once */
.update .summary { display: block; margin-top: 0.9rem; color: var(--bright); font-size: 1.05rem; }
.update h3 { margin-top: 1.75rem; color: var(--amber); font-family: "Chivo Mono", ui-monospace, monospace; font-size: 0.8rem; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; }
.update h3 + ul { margin-top: 0.6rem; }

/* Older versions folded, opened by a press on their heading */
details.update > summary { display: block; cursor: pointer; list-style: none; }
details.update > summary::-webkit-details-marker { display: none; }
details.update > summary h2 { display: inline; }
details.update > summary h2::after { content: "+"; display: inline-block; margin-left: 0.6rem; color: var(--amber); font-weight: 400; transition: transform 0.2s ease; }
details.update[open] > summary h2::after { transform: rotate(45deg); }
details.update > summary .date { display: block; }
details.update > summary:hover h2 { color: var(--amber); }
details.update > summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 6px; border-radius: 0.3rem; }

/* ------------------------------
 *           Footer:
 * ------------------------------ */

footer { border-top: 1px solid var(--edge); padding: 2rem 0 3rem; font-size: 0.85rem; color: var(--quiet); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.footer-links a { display: inline-block; padding: 0.35rem 0; color: var(--quiet); text-decoration: none; }
.footer-links a[aria-current="page"] { color: var(--text); }
.footer-links a:hover { color: var(--bright); text-decoration: underline; }

/* ------------------------------
 *           Polish:
 * ------------------------------ */

/* Pages cross-fade into each other, the bar holding still and the main download travelling */
@view-transition { navigation: auto; }
.top { view-transition-name: top-bar; }
html:not([data-os="windows"]):not([data-phone]) .stage .get-mac,
html:not([data-os="windows"]):not([data-phone]) .platform .get-mac,
html[data-os="windows"]:not([data-phone]) .stage .get-windows,
html[data-os="windows"]:not([data-phone]) .platform .get-windows { view-transition-name: main-download; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.25s; }
::view-transition-group(main-download) { animation-duration: 0.4s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }

/* A section rises into place once, on arriving; page.js marks which, so without it all stand */
.will-rise { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.will-rise.has-risen { opacity: 1; transform: none; }

/* Buttons and cards lift under the pointer and press in */
.get-button, .reel-pause, .os-switch button, .top-links .get { transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
.get-button:active, .reel-pause:active, .os-switch button:active, .top-links .get:active { transform: translateY(1px) scale(0.98); }
.platform, .review-card { position: relative; isolation: isolate; transition: transform 0.2s ease, border-color 0.2s ease; }
@media (hover: hover) {
  .get-button:hover, .top-links .get:hover { transform: translateY(-1px); }
  .platform:hover, .review-card:hover { transform: translateY(-2px); border-color: #3A4049; }

  /* Soft light following the pointer across a card, its place set by page.js */
  .platform::before, .review-card::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
    background: radial-gradient(22rem circle at var(--light-x, 50%) var(--light-y, 0%), rgba(255, 184, 66, 0.07), transparent 70%);
    opacity: 0; transition: opacity 0.3s ease;
  }
  .platform:hover::before, .review-card:hover::before { opacity: 1; }
}

/* The list beside a long page lights the section being read */
.toc a.is-reading { color: var(--bright); border-left-color: var(--amber); }

/* A folded version opens smoothly where the browser can size to its content */
:root { interpolate-size: allow-keywords; }
details.update::details-content { block-size: 0; overflow: clip; transition: block-size 0.35s ease, content-visibility 0.35s allow-discrete; }
details.update[open]::details-content { block-size: auto; }

/* After a download is pressed, its steps light one after another */
.steps.is-lit li::before { animation: step-lit 0.5s ease both; }
.steps.is-lit li:nth-child(2)::before { animation-delay: 0.35s; }
.steps.is-lit li:nth-child(3)::before { animation-delay: 0.7s; }
.steps.is-lit li:nth-child(4)::before { animation-delay: 1.05s; }
@keyframes step-lit {
  from { background: transparent; color: var(--amber); }
  to { background: var(--amber); color: var(--ink); }
}

/* ------------------------------
 *       Reduced Motion:
 * ------------------------------ */

/* Rows still and scrollable by hand */
@media (prefers-reduced-motion: reduce) {
  .reel { overflow-x: auto; }
  .reel-track { animation: none; }
  .trace-rule path { transition: none; }

  /* No cross-fade, rise, lift or opening; steps lit together */
  @view-transition { navigation: none; }
  .will-rise { opacity: 1; transform: none; transition: none; }
  .platform, .review-card, .get-button, .top-links .get { transition: none; }
  .platform:hover, .review-card:hover, .get-button:hover, .top-links .get:hover { transform: none; }
  details.update::details-content { transition: none; }
  .steps.is-lit li::before { animation: none; background: var(--amber); color: var(--ink); }

  /* Nothing drifts, so nothing to pause */
  .reel-pause { display: none; }

  /* Glows held at their middle */
  .get-button::after, .trace-rule.is-drawn::after { animation: none; opacity: 0.4; }
}

/* ------------------------------
 *       Narrow Screens:
 * ------------------------------ */

/* Settings under desktop */
@media (max-width: 900px) {
  .desk-layout { grid-template-columns: minmax(0, 1fr); }
  .why-inner { grid-template-columns: minmax(0, 1fr); }
  .facts-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .closing-inner { grid-template-columns: minmax(0, 1fr); }
  .page-body { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .free { border-left: 0; padding-left: 0; border-top: 1px solid var(--edge); padding-top: 2.5rem; }
}

/* Phone: taller screen, smaller icons, one column */
@media (max-width: 640px) {
  .desk { aspect-ratio: 4 / 3.4; }
  .icon { width: 5rem; font-size: 0.7rem; }
  .icon svg { width: 2.1rem; height: 2.1rem; }
  .desk-hint { right: 5.5rem; font-size: 0.75rem; }
  .top-links { gap: 0.9rem; font-size: 0.88rem; }
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .reel-credit { font-size: 0.6rem; right: 0.35rem; bottom: 0.35rem; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .facts-list { grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
  .weigh-row { grid-template-columns: 5.5rem minmax(0, 1fr); }
}
