/* Instrument Sans, served from this site (no request to another company, and it arrives with the page). */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: block; /* the font is preloaded and tiny: wait for it rather than flash a different one */
  src: url(fonts/instrument-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: block; /* the font is preloaded and tiny: wait for it rather than flash a different one */
  src: url(fonts/instrument-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* The glow behind the gallery takes the open wallpaper's color, and fades between them.
   It lives on the gallery alone (not inherited), so fading it never re-styles the rest of the page. */
@property --glow {
  syntax: "<color>";
  inherits: false;
  initial-value: #4f7bff;
}


:root {
  --bg: #0e1030;
  --fg: #ffffff;
  --ch: clamp(240px, calc(100svh - 250px), 1000px);
  --rw: 1320; /* screen width and height in pixels, set from the page's script */
  --rh: 2868;
  /* The wallpaper is never taller than the room the gallery really has (the script measures it into --ch-max). */
  --ch-eff: min(var(--ch), var(--ch-max, 9999px));
  --cw: min(calc(var(--ch-eff) * var(--rw) / var(--rh)), 78vw);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: #0b0d1c;
}
/* (In the gallery the page, including the strips Safari shows above and below it, takes the open wallpaper's colour: app.js sets it on html and body directly.) */

body {
  margin: 0;
  overflow-x: clip; /* nothing may push the page wider than the screen: that makes the phone zoom out */
  background-color: #0b0d1c; /* solid on purpose: Safari tints its bars from it */
  color: #fff;
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

/* ---------- opening: color field, clock, three lines ---------- */

/* The opening is ordinary page content. The colour field rides along behind the clock and the three lines (sticky, not
   pinned to the screen), then scrolls away with them, and the gallery takes over. */
.opening { position: relative; display: flow-root; } /* flow-root: the credits line's bottom margin stays inside, so no gap opens between the opening and the gallery */
.field-wrap {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100svh;
  height: 100lvh;
  margin-bottom: -100svh;
  margin-bottom: -100lvh;
  overflow: hidden;
}
.field {
  display: block;
  width: 100%;
  height: 100%;
  animation: field-in 2200ms ease both;
}
/* fine grain over the field, so the soft colour never bands */
.field-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  opacity: 0.16;
}

@keyframes field-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes clock-in {
  from { opacity: 0; filter: blur(16px); transform: translateY(1.5vh); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
}

.clock {
  animation: clock-in 2000ms var(--ease) 900ms both;
}
.clock-date {
  margin: 0;
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 500;
  opacity: 0.85;
}
.clock-time {
  margin: 0;
  --clock: min(40vw, 62svh);
  font-size: calc(var(--clock) * var(--fit, 1));
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
/* AM / PM sits small beside the numbers, like on a lock screen. */
.ampm {
  margin-left: 0.1em;
  font-size: 0.16em;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0.85;
}


.about {
  position: relative;
  z-index: 2;
  padding: 0 clamp(24px, 8vw, 120px);
  text-align: center;
}
.line {
  min-height: 55svh;
  display: grid;
  place-items: center;
  margin: 0 auto;
  max-width: 22ch;
  font-size: clamp(30px, 5vw, 60px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
  opacity: 0.15;
}

/* ---------- gallery ---------- */

/* The wrapper is the scrolling part: as tall as the biggest the screen gets, filled with the wallpaper's colour.
   The gallery itself is pinned to the top of the screen and is exactly as tall as what you can see
   (the script measures it), so the header can never end up over the tabs and no strip shows below it. */
.gallery-wrap {
  position: relative;
  z-index: 3;
  height: max(100lvh, var(--gh, 100lvh));
  background-color: var(--bg);
}
.gallery {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--gh, 100svh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto; /* the middle row never grows past the screen, so nothing is cut off */
  padding-top: 78px; /* clear of the fixed header (wordmark and Lock screen preview) */
  background-color: var(--bg);
  background-image: radial-gradient(70% 52% at 50% 50%, color-mix(in srgb, var(--glow) 30%, transparent), transparent 74%);
  color: var(--fg);
  /* (no colour fade here: the page's colours are moved by the script, frame by frame, with the swipe and with section changes) */
}
.tabs, .foot { position: relative; z-index: 1; }

/* Sections of the gallery (Essentials, Navy) */
.tabs {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 0 20px 20px; /* room below, so the tabs never touch the wallpapers */
}
.tabs button {
  font: inherit;
  font-size: 14px;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 300ms ease;
}
.tabs button:hover { opacity: 1; }
.tabs button[aria-pressed="true"] {
  opacity: 1;
  border-color: color-mix(in srgb, var(--fg) 7%, transparent);
}

/* ---------- top bar ---------- */

.bar {
  position: absolute; /* scrolls with the page, like apple.com's top bar; the gallery has its own copy */
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(20px, 4vw, 40px);
  color: #fff;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.gallery .bar { color: var(--fg); }
.gallery.chrome-off .toggle {
  opacity: 0;
  pointer-events: none;
  visibility: hidden; /* not just see-through: a hidden blur costs nothing while the colour field moves */
  transition: opacity 400ms ease, visibility 0s linear 400ms;
}

.mark {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: inherit;
  text-decoration: none;
}

.toggle {
  font: inherit;
  font-size: 14px;
  color: inherit;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--fg) 35%, transparent);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: opacity 400ms ease;
}
.toggle[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.stage {
  position: relative; /* so card positions are measured from the stage itself */
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding-inline: calc(50% - var(--cw) / 2);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.stage::-webkit-scrollbar { display: none; }

.card {
  position: relative;
  flex: none;
  width: var(--cw);
  aspect-ratio: var(--rw) / var(--rh);
  padding: 0;
  border: 0;
  border-radius: calc(var(--cw) * 0.14);
  font: inherit;
  overflow: hidden;
  background: transparent;
  scroll-snap-align: center;
  container-type: inline-size;
  cursor: pointer;
  /* --d is how many places away from the open wallpaper this one is: the farther, the smaller and fainter */
  --d: 1;
  opacity: max(0.14, calc(1 - var(--d) * 0.3));
  transform: scale(max(0.74, calc(1 - var(--d) * 0.07)));
  transition: transform 600ms var(--ease), opacity 600ms var(--ease);
}
.card[aria-current="true"] {
  opacity: 1;
  transform: scale(1);
  cursor: zoom-in;
}

/* Once the full-size picture is ready, the open wallpaper is a real image on top of the preview:
   that is what lets the phone offer "Save to Photos" when you press and hold it. */
.card .card-img {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card .card-img.on { display: block; }

/* Wallpapers drift in when a section opens */
@keyframes card-enter {
  from { opacity: 0; transform: translateY(18px) scale(0.9); }
}
.card.enter { animation: card-enter 800ms var(--ease) backwards; }

.card canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 260ms ease; /* a wallpaper fades in when it is ready */
}
.card canvas.ready { opacity: 1; }

/* lock screen preview */
.lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 7cqw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease;
}
body[data-lock="on"] .lock { opacity: 1; }

.island {
  width: 28cqw;
  height: 8cqw;
  border-radius: 8cqw;
  background: #000;
}
body[data-device="android"] .island {
  width: 5cqw;
  height: 5cqw;
  margin-top: 1cqw;
  border-radius: 50%;
}
.date {
  margin-top: 13cqw;
  font-size: 5.4cqw;
  font-weight: 500;
  opacity: 0.85;
}
.time {
  margin-top: 1cqw;
  font-size: 27cqw;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}
.lock[data-ink="light"] { color: #fff; }
.lock[data-ink="dark"] { color: #111; }

.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0 20px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
}

.name {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.download {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--bg);
  background: var(--fg);
  border: 0;
  border-radius: 999px;
  padding: 13px 28px;
  cursor: pointer;
  transition: opacity 200ms ease, color 70ms ease, background-color 70ms ease;
}
.download:hover { opacity: 0.85; }
.download:disabled { opacity: 0.6; cursor: progress; }

/* The size picker is hidden for now: phones and foldables are sized automatically, computers get iPhone size.
   The picker and its code are kept, so it can come back (for example as a small "other devices" link). */
.spec {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
}
.spec label { opacity: 0.55; }
.spec select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  max-width: 62vw;
  cursor: pointer;
  transition: border-color 70ms ease;
}
.spec select option { color: #15151a; background: #fff; }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}
.card:focus-visible { outline-offset: -4px; }

@media (max-width: 600px) {
  :root { --ch: clamp(240px, calc(100svh - 320px), 700px); }
  .bar { padding-block: 18px; }
  .clock-time { --clock: min(46vw, 62svh); }
}

/* ---------- full-screen viewer ---------- */

body.viewing { overflow: hidden; }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  opacity: 0;
  transition: opacity 600ms ease;
}
.viewer[hidden] { display: none; }
.viewer.open { opacity: 1; }

/* The picture keeps the exact shape of the chosen screen, as large as the window allows once its name has room underneath.
   Its corners are rounded like an iPhone's screen (the same share of its width as the cards in the gallery). The bottom margin
   lifts it by half the name's room, so the picture and its name are centred together. */
.viewer-frame {
  position: relative;
  width: var(--fw);
  aspect-ratio: var(--rw) / var(--rh);
  border-radius: calc(var(--fw) * 0.14);
  margin-bottom: var(--below);
  container-type: inline-size;
  /* No touch-action override and no drag blocking here: the phone's own press-and-hold menu must stay available. */
  overflow: hidden;
  transform: scale(0.94);
  /* The script starts it on top of the wallpaper you tapped, so it unfolds from there. */
  transition: transform 700ms var(--ease), border-radius 700ms var(--ease);
}
.viewer.open .viewer-frame { transform: none; }

/* Two pictures sit on top of each other: the next one fades in slowly over the one before. */
.vimg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 900ms ease, transform 1400ms var(--ease);
}
.vimg.shown { opacity: 1; transform: none; }
/* the lock screen clock always sits above the pictures */
.viewer-frame .lock { z-index: 5; }

.viewer-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--fg);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg) 35%, transparent);
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 300ms ease;
}

.viewer-lock {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  color: var(--fg);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  transition: opacity 300ms ease, background-color 300ms ease, color 300ms ease;
}
.viewer.chrome-hidden .viewer-lock { opacity: 0; pointer-events: none; }
/* On a computer the picture sits in the middle of the window: give it an edge so you can see its shape. */
@media (pointer: fine) {
  .viewer-frame { box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 16%, transparent); }
}

.viewer-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--ftop) + var(--fh) + 14px); /* right under the picture */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--fg);
  text-shadow: 0 1px 12px color-mix(in srgb, var(--bg) 80%, transparent);
  transition: opacity 300ms ease;
}
.viewer-name { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.025em; }
.viewer-hint { margin: 0; font-size: 13px; opacity: 0.75; max-width: calc(100vw - 32px); text-align: center; line-height: 1.35; text-wrap: balance; }
.viewer.chrome-hidden .viewer-bar,
.viewer.chrome-hidden .viewer-close { opacity: 0; pointer-events: none; }
@media (pointer: fine) { .viewer-hint { display: none; } }

/* Short screens (a phone held sideways): smaller phone, name and button on one row. */
@media (max-height: 520px) {
  :root { --ch: calc(100svh - 184px); }
  .tabs { gap: 14px; padding-bottom: 8px; }
  .tabs button { padding: 4px 14px; font-size: 13px; }
  .bar { padding-block: 14px; }
  .gallery { padding-top: 56px; }
  .foot {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    padding-bottom: 12px;
  }
  .name { font-size: 20px; }
  .download { padding: 10px 22px; }
  .clock-time { --clock: min(30vw, 52svh); }
  .line { min-height: 80svh; font-size: clamp(24px, 4vw, 40px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; }
  .stage { scroll-behavior: auto; }
}

/* ---------- Liquid Glass ----------
   Every button is translucent glass: it blurs and tints whatever is behind it, has a bright edge
   along the top where light catches it, and a soft shadow. It adapts to light and dark wallpapers. */

:root {
  --glass-tint: rgba(255, 255, 255, 0.04);
  --glass-tint-strong: rgba(255, 255, 255, 0.07);
  --glass-edge: rgba(255, 255, 255, 0.025);
  --glass-hi: rgba(255, 255, 255, 0.09);
  --glass-shine: rgba(255, 255, 255, 0.025);
  --glass-shadow: rgba(0, 0, 0, 0);
}
:root[data-tone="light"] {
  --glass-tint: rgba(255, 255, 255, 0.12);
  --glass-tint-strong: rgba(255, 255, 255, 0.2);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --glass-hi: rgba(255, 255, 255, 0.34);
  --glass-shine: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(30, 45, 80, 0);
}

.toggle:not(.viewer-lock),
.glass-group,
.download { position: relative; }
/* (the close and lock buttons in the full-screen view keep their own absolute position) */

.toggle,
.glass-group,
.download,
.viewer-close {
  isolation: isolate;
  color: var(--fg);
  background: linear-gradient(180deg, var(--glass-tint-strong), var(--glass-tint));
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  box-shadow:
    inset 0 0.5px 0 var(--glass-hi);
  transition: transform 250ms var(--ease), opacity 400ms ease; /* (no colour fades of its own: app.js moves its colours with the rest of the page) */
}
/* the shine: a soft highlight across the top left, as if a window were reflected in it */
.toggle::before,
.glass-group::before,
.download::before,
.viewer-close::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(130% 170% at 16% -25%, var(--glass-shine), transparent 56%);
}
.toggle:hover,
.download:hover,
.viewer-close:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.06));
}
:root[data-tone="light"] .toggle:hover,
:root[data-tone="light"] .download:hover,
:root[data-tone="light"] .viewer-close:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
}
.toggle:active,
.download:active,
.viewer-close:active { transform: scale(0.96); }

/* the Lock screen preview toggle: when on, the glass glows a little brighter instead of turning solid */
.toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.06));
  color: var(--fg);
  border-color: var(--glass-edge);
}
:root[data-tone="light"] .toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.24));
}

.toggle { padding: 9px 18px; }

.download {
  padding: 13px 32px;
  font-weight: 500;
}
.download:hover { opacity: 1; }
.download:disabled { opacity: 0.7; transform: none; }

.viewer-close,
.viewer-lock { background-color: transparent; }

/* the three sections sit in one glass capsule; the open one is a brighter glass pill inside it */
.glass-group {
  display: inline-flex;
  gap: 10px;
  padding: 5px;
  border-radius: 999px;
}
.tabs button {
  position: relative;
  color: var(--fg);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 20px;
  opacity: 0.72;
  transition: opacity 300ms ease;
}
.tabs button:hover { opacity: 1; }
.tabs button[aria-pressed="true"],
.tabs button.under-thumb { opacity: 1; }

/* The moving glass pill: it sits under the labels, follows a finger dragged along the bar,
   and settles on the nearest tab with a small overshoot. */
.glass-group { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.glass-thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  transform: translateX(var(--tx, 0px)) scale(var(--sc, 1));
  transition: transform 520ms cubic-bezier(0.3, 1.35, 0.4, 1), width 520ms cubic-bezier(0.3, 1.35, 0.4, 1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.06));
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 0.5px 0 var(--glass-hi);
}
.glass-thumb { background: linear-gradient(180deg, var(--thumb-a, rgba(255, 255, 255, 0.1)), var(--thumb-b, rgba(255, 255, 255, 0.06))); }
.glass-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(130% 170% at 16% -25%, var(--glass-shine), transparent 56%);
}
/* pressed: brighter and a little bigger, like a drop of glass under a finger */
.glass-thumb.dragging {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0.5px 0 var(--glass-hi);
}
:root[data-tone="light"] .glass-thumb.dragging { background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.3)); }
.tabs button { z-index: 1; }

/* where the screen cannot blur what is behind (older browsers), or the person asked for less transparency */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .toggle, .glass-group, .download, .viewer-close { background: rgba(40, 48, 80, 0.72); }
  :root[data-tone="light"] .toggle, :root[data-tone="light"] .glass-group, :root[data-tone="light"] .download, :root[data-tone="light"] .viewer-close { background: rgba(255, 255, 255, 0.85); }
}
@media (prefers-reduced-transparency: reduce) {
  .toggle, .glass-group, .download, .viewer-close {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(40, 48, 80, 0.85);
  }
  :root[data-tone="light"] .toggle, :root[data-tone="light"] .glass-group, :root[data-tone="light"] .download, :root[data-tone="light"] .viewer-close { background: rgba(255, 255, 255, 0.92); }
}

/* the glass buttons in the short, sideways phone layout stay compact */
@media (max-height: 520px) {
  .download { padding: 10px 24px; }
  .glass-group { gap: 6px; padding: 4px; }
  .tabs button { padding: 5px 14px; }
}


/* ---- "How to turn on Depth Effect": a quiet link under the Download button, and the card it opens ---- */
.howto {
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  opacity: 0.72;
  background: none;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 250ms ease;
}
.howto:hover { opacity: 1; }
.howto[hidden] { display: inline-block; visibility: hidden; } /* keeps its space, so the wallpapers never change size between sections */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 8, 16, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 300ms ease;
}
.sheet[hidden] { display: none; }
.sheet.open { opacity: 1; }
.sheet-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 30px 26px 26px;
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.09)), rgba(18, 22, 40, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(14px) scale(0.98);
  transition: transform 420ms cubic-bezier(0.3, 1.2, 0.4, 1);
}
.sheet.open .sheet-card { transform: none; }
.sheet h2 { margin: 0 36px 8px 0; font-size: 22px; font-weight: 500; letter-spacing: -0.025em; }
.sheet-lead { margin: 0 0 18px; font-size: 14px; line-height: 1.5; opacity: 0.78; }
.sheet-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.sheet-steps li { position: relative; padding-left: 38px; font-size: 15px; line-height: 1.45; counter-increment: step; }
.sheet-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.sheet-steps b { font-weight: 600; }
.sheet-note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 13px; line-height: 1.5; opacity: 0.7; }
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-card { transition: none; }
}


/* ---------- smooth and accessible ---------- */

/* No grey flash when tapping on iPhone; no double-tap delay on buttons. */
button, a, .card, .tabs, .glass-group { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }

/* Reading aids: a skip link for keyboard and screen reader users, and text only they hear. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(10, 12, 28, 0.92);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Buttons stay small to look at, but their touch area reaches 44 points, as Apple recommends. */
.toggle:not(.viewer-lock)::after,
.tabs button::after,
.howto::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}
.tabs button::after { inset: -7px 0; }
.howto { position: relative; }
.howto::after { inset: -10px -6px; }

/* Words stay easy to read on every wallpaper colour. */
.tabs button { opacity: 0.85; }
.tabs button:hover { opacity: 1; }
.howto { opacity: 0.9; }
.viewer-hint { opacity: 0.88; }

/* People who asked for less motion get a still page: no drifting, fading in or sliding. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
}

/* People who asked for more contrast get firmer glass and edges. */
@media (prefers-contrast: more) {
  :root {
    --glass-tint: rgba(10, 12, 28, 0.55);
    --glass-tint-strong: rgba(10, 12, 28, 0.7);
    --glass-edge: rgba(255, 255, 255, 0.7);
    --glass-hi: rgba(255, 255, 255, 0.7);
  }
  :root[data-tone="light"] {
    --glass-tint: rgba(255, 255, 255, 0.8);
    --glass-tint-strong: rgba(255, 255, 255, 0.92);
    --glass-edge: rgba(20, 22, 40, 0.7);
    --glass-hi: rgba(20, 22, 40, 0.5);
  }
  .tabs button, .howto, .viewer-hint { opacity: 1; }
}

/* Narrow screens: the gallery's one column may never be wider than the screen, and the tabs tighten up to fit. */
.gallery { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 360px) {
  .tabs { padding-inline: 12px; }
  .tabs button { padding-inline: 14px; }
  .glass-group { gap: 4px; }
}


/* Full screen from the Home Screen: the colour reaches behind the status bar and home bar, so the header and the gallery
   make room for the notch (these are zero in a normal Safari tab). */
.bar { padding-top: calc(24px + env(safe-area-inset-top)); }
.gallery { padding-top: calc(78px + env(safe-area-inset-top)); }
@media (max-width: 600px) {
  .bar { padding-top: calc(18px + env(safe-area-inset-top)); }
}
@media (max-height: 520px) {
  .bar { padding-top: calc(14px + env(safe-area-inset-top)); }
  .gallery { padding-top: calc(56px + env(safe-area-inset-top)); }
}

/* Two thin strips at the very top and bottom of the screen. They carry the colour Safari paints its status bar and
   toolbar with: in the opening, the colour field's own top and bottom colour (set live by the script); in the gallery
   the gallery itself does it, so they are removed (display: none, as opacity or pointer-events would still tint). */
.edge {
  position: fixed;
  left: 0;
  right: 0;
  height: 8px;
  z-index: 0;
  pointer-events: none;
  background-color: #0b0d1c;
}
.edge-top { top: 0; }
.edge-bottom { bottom: 0; }


/* ---------- from the opening into the selection ---------- */

/* The top edge of the gallery is feathered, not a hard line: the colour field melts into the wallpaper's colour as the
   gallery rises over it. (It sits above the gallery, so at rest it is off screen.) */
.opening .feather {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px; /* the last 12px lie under the gallery: two edges that meet on a part-pixel each leave that pixel row half empty, and the dark page
                    behind shows through as a hairline. Overlapping hides it. */
  height: 232px;
  z-index: 1; /* above the colour field, below the text (so the text and the credits link are never washed out) */
  pointer-events: none;
  /* its colour is the open wallpaper's colour, set by the script, frame by frame (a coloured box, faded in by this mask) */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.06) 44px, rgba(0, 0, 0, 0.22) 92.4px, rgba(0, 0, 0, 0.52) 140.8px, rgba(0, 0, 0, 0.82) 184.8px, #000 220px, #000 232px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.06) 44px, rgba(0, 0, 0, 0.22) 92.4px, rgba(0, 0, 0, 0.52) 140.8px, rgba(0, 0, 0, 0.82) 184.8px, #000 220px, #000 232px);
}

/* The selection arrives as you pull the gallery up: app.js places the tabs, the wallpapers, the name and the share button from the scroll
   position (see syncReveal), so there are no timers or transitions here. Until it has placed them they are simply hidden. */
.gallery.chrome-off .tabrow, .gallery.chrome-off .foot, .gallery.chrome-off .name, .gallery.pre .stage { opacity: 0; pointer-events: none; }


/* ---------- compact layout: tabs, a small name, the screen, a small Download, all close together ---------- */
/* Order, top to bottom: header, tabs, the wallpaper's name (small and quiet), the wallpaper, Download (small, centred),
   and on Depth the how-to link under it. Gaps are small and even, so the pieces read as one group. */
.gallery { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.tabs { padding-bottom: 7px; }
.name {
  margin: 0 0 4.2px; /* with the 2px the screen leaves around itself, the name sits the same distance from the tabs and from the screen */
  padding-inline: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  opacity: 0.78;
  position: relative;
  z-index: 1;
}
.foot {
  gap: 6px;
  padding: 6px 20px calc(14px + env(safe-area-inset-bottom));
}
.download { font-size: 13.5px; padding: 9px 24px; }
.download::after { content: ""; position: absolute; inset: -5px -8px; } /* the touch area stays comfortable */
.howto { font-size: 12px; }

@media (max-width: 600px) {
  :root { --ch: clamp(240px, calc(100svh - 230px), 820px); }
  .gallery { padding-top: calc(70px + env(safe-area-inset-top)); }
  .tabs { padding-bottom: 7px; }
}
@media (max-height: 520px) {
  .name { font-size: 12px; margin-bottom: 4px; }
  .foot { padding-block: 6px 8px; }
}


/* ---------- a little cheaper to draw ---------- */
.card.hot { will-change: transform, opacity; } /* the open wallpaper and the ones beside it are always ready to move */
.card { contain: layout paint; }


/* ---------- the padlock: lock the phone, and the clock wakes up ---------- */
/* One small round glass button with a padlock. Open padlock = plain picture. Tap it and it clicks shut, like locking an iPhone,
   and the lock screen (camera dot, date, clock) fades in over the picture. Tap again to open it. */
.lock-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.toggle:not(.viewer-lock).lock-btn::after { inset: -2px; border-radius: 50%; }
.padlock { display: block; overflow: visible; }
.padlock .shackle {
  transform-box: view-box;
  transform-origin: 8.5px 11px;
  transform: translate(-0.4px, -1.6px) rotate(-30deg); /* open: the right side lifted off its notch */
  transition: transform 460ms cubic-bezier(0.3, 1.6, 0.4, 1);
}
.padlock .pbody {
  transform-box: fill-box;
  transform-origin: center;
  fill: currentColor;
  fill-opacity: 0;
  transition: fill-opacity 300ms ease;
}
.padlock .keyhole { fill: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 250ms ease; }
.lock-btn[aria-pressed="true"] .shackle { transform: none; } /* shut */
.lock-btn[aria-pressed="true"] .pbody { fill-opacity: 0.9; }
.lock-btn[aria-pressed="true"] .keyhole { opacity: 1; }
.lock-btn.snap .pbody { animation: lock-snap 420ms cubic-bezier(0.3, 1.5, 0.4, 1); }
@keyframes lock-snap { 0% { transform: scale(1); } 35% { transform: scale(0.88); } 100% { transform: scale(1); } }
/* the pressed look from the old text button is not wanted on the round one */
.lock-btn[aria-pressed="true"] { background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07)); }

/* the lock screen wakes up in order: camera dot, date, clock (each fades in, rises and sharpens) */
.lock .island, .lock .date, .lock .time {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(7px);
  transition: opacity 260ms ease, transform 260ms ease, filter 260ms ease;
}
body[data-lock="on"] .lock .island, body[data-lock="on"] .lock .date, body[data-lock="on"] .lock .time {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 650ms var(--ease), transform 750ms var(--ease), filter 650ms var(--ease);
}
body[data-lock="on"] .lock .date { opacity: 0.85; transition-delay: 90ms; }
body[data-lock="on"] .lock .time { transition-delay: 180ms; }


/* ---------- tap the clock and it says the time ---------- */
.clock[role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 28px; outline-offset: 10px; }
body[data-lock="on"] .lock .time { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* while it is speaking, the clock breathes softly */
.clock.speaking .clock-time, .lock .time.speaking { animation: say-pulse 1.3s ease-in-out infinite; }
@keyframes say-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }

/* the save button is the iPhone share symbol */
.download { display: inline-grid; place-items: center; width: 44px; height: 36px; padding: 0; }
.download .ico { grid-area: 1 / 1; width: 20px; height: 20px; transition: opacity 0.25s ease, transform 0.25s ease; }
.download .check { opacity: 0; transform: scale(0.8); }
.download[data-state="done"] .share { opacity: 0; transform: scale(0.8); }
.download[data-state="done"] .check { opacity: 1; transform: none; }
.download[data-state="busy"] .share { animation: shareBusy 1.1s ease-in-out infinite; }
@keyframes shareBusy { 50% { opacity: 0.35; transform: translateY(-1px); } }
@media (prefers-reduced-motion: reduce) { .download[data-state="busy"] .share { animation: none; opacity: 0.5; } }


/* ---------- the name, the wallpaper and the share button stay together as one group ---------- */
/* The tabs stay at the top. The name, the wallpaper and the button sit right against each other and are centred in
   the room that is left, so the name always hugs the wallpaper, whatever the zoom or the screen shape. */
.gallery { grid-template-rows: auto minmax(0, 1fr) auto auto auto minmax(0, 1fr); }
.gallery .tabrow { grid-row: 1; }
.gallery .name { grid-row: 3; }
.gallery .stage { grid-row: 4; height: calc(var(--cw) * var(--rh) / var(--rw) + 6px); }
.gallery .foot { grid-row: 5; }

/* ---------- the padlock sits right next to the tabs, and moves with them whenever a new section is added ---------- */
.tabrow {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0 20px 7px;
}
.tabrow .tabs { padding: 0; }
.tabrow .lock-btn { flex: none; width: 49px; height: 49px; } /* as tall as the tabs, and round (set in pixels: Safari ignores aspect-ratio here) */


/* ---------- idea: swipe parallax ---------- */
/* While you swipe, each picture slides a little inside its own frame and grows a touch, so the row feels like it has depth.
   The middle one is always exactly still and exactly full size. */
.card canvas, .card .card-img {
  transform: translateX(calc(var(--px, 0) * -4%)) scale(calc(1 + var(--pa, 0) * 0.1));
  transform-origin: center;
}
@media (prefers-reduced-motion: reduce) { .card canvas, .card .card-img { transform: none; } }

/* ---------- idea: widgets preview ---------- */
/* A second button appears beside the padlock once the lock screen is on. It adds widgets under the clock, the torch and
   camera buttons and the home bar, so you can see if the picture still works with the real things on top. */
.widgets-btn {
  max-width: 0;
  margin-left: -8px; /* cancels the gap while it is hidden, so the row stays centred */
  padding: 0;
  border-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  transition: max-width 500ms var(--ease), margin 500ms var(--ease), opacity 350ms ease, visibility 0s linear 500ms;
}
body[data-lock="on"] .widgets-btn {
  max-width: 60px;
  margin-left: 0;
  border-width: 1px;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: max-width 500ms var(--ease), margin 500ms var(--ease), opacity 450ms ease 150ms, visibility 0s;
}

.widgets-btn[aria-pressed="true"] { background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07)); }

.lock .widgets, .lock .dock, .lock .home {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(6px);
  transition: opacity 260ms ease, transform 260ms ease, filter 260ms ease;
}
body[data-lock="on"][data-widgets="on"] .lock .widgets,
body[data-lock="on"][data-widgets="on"] .lock .dock,
body[data-lock="on"][data-widgets="on"] .lock .home {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 650ms var(--ease), transform 750ms var(--ease), filter 650ms var(--ease);
}
body[data-widgets="on"] .lock .widgets { transition-delay: 260ms; }
body[data-widgets="on"] .lock .dock { transition-delay: 340ms; }
body[data-widgets="on"] .lock .home { transition-delay: 420ms; }

.lock .widgets {
  display: flex;
  gap: 3cqw;
  margin-top: 5cqw;
}
.lock .widgets i {
  width: 17cqw;
  height: 17cqw;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, currentColor 15%, transparent);
  font-style: normal;
}
.lock .widgets i svg { position: absolute; width: 8cqw; height: 8cqw; top: 2.2cqw; }
.lock .widgets i b { position: absolute; bottom: 2.2cqw; font-size: 3.4cqw; font-weight: 600; letter-spacing: 0; }
.lock .widgets i span { position: absolute; top: 2.6cqw; font-size: 2.6cqw; font-weight: 600; letter-spacing: 0.04em; opacity: 0.7; }
.lock .widgets i:nth-child(1) svg { inset: 0; width: 100%; height: 100%; top: 0; transform: rotate(-90deg); }
.lock .widgets i:nth-child(1) b { bottom: auto; font-size: 4cqw; }
.lock .widgets i:nth-child(3) b { font-size: 8cqw; bottom: 2.4cqw; font-weight: 500; }
.lock .widgets .track { fill: none; stroke: color-mix(in srgb, currentColor 25%, transparent); stroke-width: 3; }
.lock .widgets .ring { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }

.lock .dock i {
  position: absolute;
  bottom: 9cqw;
  width: 15cqw;
  height: 15cqw;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, currentColor 15%, transparent);
}
.lock .dock i:first-child { left: 10cqw; }
.lock .dock i:last-child { right: 10cqw; }
.lock .dock svg { width: 7cqw; height: 7cqw; }
.lock .home {
  position: absolute;
  bottom: 2.6cqw;
  left: 50%;
  margin-left: -17cqw;
  width: 34cqw;
  height: 1.3cqw;
  border-radius: 1cqw;
  background: currentColor;
  opacity: 0;
}
body[data-lock="on"][data-widgets="on"] .lock .home { opacity: 0.85; }
.lock .dock { position: absolute; inset: 0; } /* a full-size box of its own, so the two round buttons stay at the bottom while it fades */


/* ---------- opening, take two: a softer serif clock, digits that arrive one by one, a breathing glow ---------- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
  src: url(fonts/geist-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.clock { position: relative; animation: clock-fade 1600ms ease 600ms both; }
@keyframes clock-fade { from { opacity: 0; } to { opacity: 1; } }

.clock-time {
  font-family: "Geist", "Instrument Sans", system-ui, sans-serif;
  font-weight: 300;
  --clock: min(46vw, 62svh);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: proportional-nums;
  margin-block: 0.02em 0;
}
.clock-time { white-space: nowrap; }
.clock-time .d, .clock-time .colon { display: inline-block; }
.clock-time .d { text-align: center; }
.clock-time .colon { margin-inline: -0.02em; transform: translateY(-0.05em); animation: colon-breathe 4s ease-in-out infinite; }
.clock-time .ampm { font-family: "Instrument Sans", sans-serif; font-size: 0.1em; }

/* each digit rises out of a soft blur, one after another */
.clock-time .rise { animation: digit-rise 1500ms var(--ease) backwards; }
@keyframes digit-rise {
  from { opacity: 0; transform: translateY(0.2em); filter: blur(0.07em); }
}
@keyframes colon-breathe { 50% { opacity: 0.35; } }

.clock-date { letter-spacing: 0.02em; margin-bottom: 0.6em; }

/* a very soft glow behind the clock that slowly breathes */
.clock::before {
  content: "";
  position: absolute;
  inset: -45% -35%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 55%, transparent 100%);
  animation: halo-breathe 9s ease-in-out infinite;
}
@keyframes halo-breathe { 0%, 100% { opacity: 0.55; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.04); } }

/* scrolling away: the clock drifts up, softens and fades (--hp goes from 0 to 1) */
.hero { --hp: 0; }
.clock-date, .clock-time {
  will-change: transform, opacity, filter; /* own layers while they drift, so scrolling does not repaint them */
  transform: translateY(calc(var(--hp) * -7vh));
  filter: blur(calc(var(--hp) * 8px));
  opacity: calc(var(--o, 1) * (1 - var(--hp) * 0.95));
}
.clock-date { --o: 0.85; }

/* the "Scroll" cue: plain small text at the bottom, fading in late */
.cue {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  margin: 0;
  font-size: 14px;
  opacity: 0;
  animation: cue-in 1200ms ease 3200ms forwards;
}
@keyframes cue-in { to { opacity: 0.6; } }
/* once you have started scrolling it has done its job, and goes (it comes back at the very top) */
.cue span { display: inline-block; transition: opacity 500ms ease; }
.cue.gone span { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .clock::before, .clock-time .colon { animation: none; }
  .clock-date, .clock-time { transform: none; filter: none; opacity: var(--o, 1); }
  .clock-time .rise { animation: none; }
}
@media (max-width: 600px) {
  .clock-time { --clock: min(54vw, 52svh); }
}

/* The clock's soft glow reaches past the screen edges; it is clipped here so it can never make the page wider than the screen
   (a wider page makes the iPhone zoom out and shows a dark strip on the right). */
.hero { overflow: clip; }
html { overflow-x: clip; }


/* the widgets button in the full-screen view: left of the padlock, only while the lock screen is on */
.viewer-widgets { right: 66px; margin-left: 0; }
/* the buttons in the full-screen view always sit above the picture (on a narrower phone the picture reaches behind them) */
.viewer-close, .viewer-lock, .viewer-bar { z-index: 6; }


/* ---------- full-screen view: the buttons stand in the margins beside the picture, never on top of it ---------- */
/* Left column: close, save. Right column: padlock, and below it the widgets button (once the padlock is shut).
   They sit right against the picture's edges; on a very narrow screen they use whatever margin there is. */
.viewer {
  --below: 66px;                                                 /* room under the picture for its name and the hint */
  --fh: min(calc((100vw - 96px) * var(--rh) / var(--rw)), calc(100svh - var(--below) - 28px)); /* the picture's height: room for a button column on each side, and for the name */
  --fw: calc(var(--fh) * var(--rw) / var(--rh));                 /* the picture's width */
  --ftop: calc(50% - (var(--fh) + var(--below)) / 2);            /* the picture's top edge (picture and name are centred together) */
  --side: max(4px, calc(50% - var(--fw) / 2 - 44px));          /* where the buttons start, measured from the screen edge */
  --top: var(--ftop);                                            /* the first row of buttons is level with the top of the picture */
  --step: 48px;                                                  /* one button plus a gap: the second row */
}
.viewer-close, .viewer-lock, .viewer-download { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.viewer-close { left: var(--side); top: var(--top); }
.viewer-download {
  position: absolute;
  left: var(--side);
  top: calc(var(--top) + var(--step));
  z-index: 6;
  display: grid;
  place-items: center;
}
.viewer-lock { right: var(--side); top: var(--top); }
.viewer-widgets {
  right: var(--side);
  top: calc(var(--top) + var(--step));
  max-width: none;
  margin: 0;
  overflow: visible;
  transform: translateY(-10px) scale(0.8);
  transition: transform 450ms var(--ease), opacity 350ms ease, visibility 0s linear 450ms;
}
body[data-lock="on"] .viewer-widgets {
  max-width: none;
  transform: none;
  transition: transform 450ms var(--ease), opacity 450ms ease 100ms, visibility 0s;
}
.viewer.chrome-hidden .viewer-download { opacity: 0; pointer-events: none; }

/* the "press and hold" line, when the Save button cannot open the share sheet: a clearer glass chip */
.viewer .viewer-hint.flash {
  opacity: 1 !important;
  padding: 9px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-shadow: none;
  max-width: calc(var(--fw) - 28px);
  text-align: center;
  line-height: 1.3;
}


/* the clock on the lock screen preview uses the same light Geist as the opening */
.time {
  font-family: "Geist", "Instrument Sans", system-ui, sans-serif;
  font-weight: 300;
  font-size: 29cqw;
  letter-spacing: -0.03em;
  font-variant-numeric: proportional-nums;
}

/* the name keeps the full brightness it has always had once the controls are in */
.gallery:not(.chrome-off) .name { opacity: 1; }


/* ---------- lock screen: the camera button clicks, the flashlight glows behind the screen ---------- */
body[data-lock="on"][data-widgets="on"] .lock .dock i {
  pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent;
  touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; /* a press here is only ever a press */
  transition: transform 260ms cubic-bezier(0.3, 1.4, 0.5, 1), background-color 200ms ease, color 200ms ease;
}
/* the ring around each circle counts as the button too, so a touch that only catches its edge still works */
body[data-lock="on"][data-widgets="on"] .lock .dock i::after { content: ""; position: absolute; inset: -6cqw; border-radius: 50%; }
/* under your finger it swells and brightens, the way an iPhone's does while you hold it */
body[data-lock="on"][data-widgets="on"] .lock .dock i.pressing { transform: scale(1.16); background: color-mix(in srgb, currentColor 30%, transparent); transition: transform 300ms cubic-bezier(0.2, 0.9, 0.3, 1), background-color 200ms ease, color 200ms ease; }

/* The flashlight: the phone's flash is in the top-left corner on the back, so the light spills out round that corner only
   (the rest of the light is behind the screen and cannot be seen). It sways a little, as if held in a hand. */
.torch-glow {
  position: absolute;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}
.torch-glow.on { opacity: 1; }
.torch-glow::before { /* the warm pool of light */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side, rgba(255, 248, 224, 0.98) 0%, rgba(255, 240, 196, 0.62) 24%, rgba(255, 232, 170, 0.24) 55%, rgba(255, 228, 160, 0) 100%);
  filter: blur(6px);
  animation: torch-sway 2.6s ease-in-out infinite alternate;
}
.torch-glow::after { /* rays of light fanning out up and to the left, away from the corner */
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg at 50% 50%,
    transparent 0deg, transparent 262deg,
    rgba(255, 250, 232, 0.5) 276deg, transparent 292deg,
    rgba(255, 250, 232, 0.4) 306deg, transparent 322deg,
    rgba(255, 250, 232, 0.5) 336deg, transparent 352deg, transparent 360deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 8%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 8%, transparent 100%);
  filter: blur(5px);
  animation: torch-rays 3.1s ease-in-out infinite alternate;
}
@keyframes torch-sway { from { transform: translate(-3%, -2%) scale(0.95); opacity: 0.9; } to { transform: translate(3%, 2.5%) scale(1.05); opacity: 1; } }
@keyframes torch-rays { from { transform: rotate(-5deg); opacity: 0.75; } to { transform: rotate(5deg); opacity: 1; } }
/* in the full-screen view the picture is centred, so its top-left corner is easy to find */
.viewer .viewer-glow {
  --s: calc(var(--fw) * 1.45);
  position: absolute;
  width: var(--s);
  height: var(--s);
  left: calc(50% - var(--fw) / 2 + var(--fw) * 0.06 - var(--s) / 2);
  top: calc(var(--ftop) + var(--fw) * 0.06 - var(--s) / 2);
}
.viewer-frame { z-index: 1; }
/* the button itself lights up white, like on an iPhone */
.lock.torch-on .dock i:first-child { background: #fff; color: #17181d; }
@media (prefers-reduced-motion: reduce) { .torch-glow::before, .torch-glow::after { animation: none; } }

/* the name and hint strip at the bottom of the full-screen view must not block taps on the lock screen's own buttons */
.viewer-bar { pointer-events: none; }


/* ---------- the printed photo: now and then it comes out of the top edge of the screen, flutters about and lands on the screen ---------- */
.lock .instant { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.instant .iphoto {
  position: absolute;
  left: 50%;
  top: 0;
  width: 52cqw;
  margin-left: -26cqw;
  padding: 3.4cqw 3.4cqw 12cqw;
  box-sizing: border-box;
  background: #fbf9f3;
  border-radius: 1cqw;
  box-shadow: 0 1cqw 2.6cqw rgba(0, 0, 0, 0.32);
  transform: translateY(-70cqw);
  opacity: 0;
}
/* 0 to 26%: it slides out of the top edge as it prints; then it swings left and right as it falls, settles over the clock and widgets,
   stays a while and fades. */
.instant.go .iphoto { animation: instant-fly 8.4s linear 0.75s both; }
@keyframes instant-fly {
  0%   { opacity: 1; transform: translate(0, -70cqw) rotate(0deg); box-shadow: 0 1cqw 2.6cqw rgba(0, 0, 0, 0.3); animation-timing-function: cubic-bezier(0.35, 0.05, 0.45, 1); }
  25%  { transform: translate(0, -9cqw) rotate(-2deg); animation-timing-function: ease-in-out; }
  33%  { transform: translate(-17cqw, 6cqw) rotate(-10deg); box-shadow: 0 5cqw 7cqw rgba(0, 0, 0, 0.3); animation-timing-function: ease-in-out; }
  43%  { transform: translate(15cqw, 19cqw) rotate(8deg); animation-timing-function: ease-in-out; }
  52%  { transform: translate(-7cqw, 33cqw) rotate(-5deg); animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }
  60%  { transform: translate(0, 38cqw) rotate(-2.5deg) scale(1.03); box-shadow: 0 2cqw 4cqw rgba(0, 0, 0, 0.32); animation-timing-function: ease-out; }
  64%  { transform: translate(0, 38cqw) rotate(-2.5deg) scale(1); box-shadow: 0 1cqw 2.2cqw rgba(0, 0, 0, 0.34); }
  90%  { opacity: 1; transform: translate(0, 38cqw) rotate(-2.5deg); }
  100% { opacity: 0; transform: translate(0, 41cqw) rotate(-2.5deg); }
}
.instant .iphoto img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #2b2b2e;
  filter: brightness(1.7) contrast(0.5) saturate(0) sepia(0.4);   /* a fresh print is pale and ghostly... */
}
.instant.go .iphoto img { animation: instant-develop 4.6s ease-out 3.2s both; }
@keyframes instant-develop { to { filter: none; } } /* ...and slowly develops */
@media (prefers-reduced-motion: reduce) {
  .instant.go .iphoto { animation: instant-fade 6s ease 0.2s both; transform: translate(0, 38cqw) rotate(-2.5deg); }
  .instant.go .iphoto img { animation: none; filter: none; }
  @keyframes instant-fade { 0% { opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } }
}


/* ---------- a phone held sideways: controls on the left, the wallpapers as tall as the screen on the right ---------- */
/* In landscape there is little height and plenty of width, so the tabs, buttons, name and share button stand in a column on the
   left (still horizontal, nothing is rotated) and the row of wallpapers takes the whole height on the right. */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --ch: calc(100svh - 28px); }
  .gallery {
    grid-template-columns: minmax(250px, 34%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .gallery .tabrow { grid-column: 1; grid-row: 2; flex-wrap: wrap; row-gap: 8px; padding: 0 14px 10px; }
  .gallery .name { grid-column: 1; grid-row: 3; margin: 6px 0 8px; font-size: 18px; letter-spacing: 0.02em; }
  .gallery .foot { grid-column: 1; grid-row: 4; padding: 0 14px 6px; }
  .gallery .stage { grid-column: 2; grid-row: 1 / -1; align-self: center; }
  /* the wordmark stays where it always is, top left, above the column */
  .gallery .bar { padding-top: calc(14px + env(safe-area-inset-top)); }
}
@media (orientation: landscape) and (max-height: 520px) {
  /* the wallpapers slide in softly under the column of controls instead of being cut off hard */
  .gallery .stage { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px); mask-image: linear-gradient(90deg, transparent 0, #000 28px); }
}


/* the padlock and the widgets button are one pair: in the row beside the tabs when upright, and together on their own line under the
   tabs when the phone is held sideways */
.tabbtns { display: contents; }
@media (orientation: landscape) and (max-height: 520px) {
  .tabbtns { display: flex; flex-basis: 100%; justify-content: center; align-items: center; gap: 8px; }
}


/* sideways, take two: the tabs and the padlock/widgets pair stand together in the left column; the name goes above the open wallpaper
   and the share button under it, like when the phone is upright */
@media (orientation: landscape) and (max-height: 520px) {
  .gallery { grid-template-rows: minmax(0, 1fr) auto auto auto minmax(0, 1fr); }
  .gallery .tabrow { grid-column: 1; grid-row: 1 / -1; align-self: center; padding-bottom: 0; }
  .gallery .name { grid-column: 2; grid-row: 2; margin: 0 0 4px; font-size: 14px; }
  .gallery .stage { grid-column: 2; grid-row: 3; align-self: center; }
  .gallery .foot { grid-column: 2; grid-row: 4; padding: 4px 0 2px; }
}


/* sideways, take three: the wallpapers get the whole left of the screen (as tall as it goes, with only the small share button
   under the open one); the controls (tabs, padlock and widgets, the name) stand in a column on the right */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --ch: calc(100svh - 56px); }
  .gallery {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 32%);
    grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1fr) auto;
    padding-top: calc(6px + env(safe-area-inset-top));
  }
  .gallery .stage { grid-column: 1; grid-row: 1 / 5; align-self: center; }
  .gallery .tabrow { grid-column: 2; grid-row: 2; align-self: auto; padding: 0 14px 8px; }
  .gallery .name { grid-column: 2; grid-row: 3; margin: 4px 0 0; font-size: 18px; letter-spacing: 0.02em; }
  .gallery .foot { grid-column: 1; grid-row: 5; padding: 2px 0 4px; }
  .gallery .stage { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
}
@media (orientation: landscape) and (max-height: 520px) {
  /* the wordmark moves to the top of the right-hand column, so it never sits on top of a wallpaper */
  .gallery .bar { left: auto; right: 0; width: max(240px, 32%); justify-content: center; padding-inline: 14px; }
}


/* ---------- the page runs all the way down, like apple.com in Safari ---------- */
/* The gallery is an ordinary full-height section (not pinned). Its picture, colour and glow reach the very bottom of the screen, so
   Safari's bottom bar floats over the page and you see the page through it, instead of a flat band. The controls stay in the area above
   the bar (that is the "small" screen height); the strip under the bar is the extra padding at the bottom. */
.gallery-wrap { height: auto; }
:root { --under: calc(max(100lvh, var(--gh, 100lvh)) - var(--gh, 100svh)); } /* how much taller the section is than what you can see right now (Safari's bar showing: the most; bar tucked away: nothing) */
.gallery-wrap { scroll-margin-top: calc(0px - var(--under)); } /* a link to the gallery lands on the controls, not on the empty strip above them */
.gallery {
  position: relative;
  top: auto;
  height: max(100lvh, var(--gh, 100lvh));
  /* The page ends with this section, so what you see at the very bottom is its LAST screen-height, whatever Safari's bar is doing.
     The controls live in that part: the extra strip is above them, not below. A transparent border keeps the colour and the glow
     running under it, and everything inside (wordmark, tabs, wallpapers) is measured from below it. */
  border-top: var(--under) solid transparent;
  padding-bottom: 0;
  background-repeat: no-repeat;
  background-image: radial-gradient(ellipse 70% calc(var(--gh, 100svh) * 0.52) at 50% calc(var(--gh, 100svh) * 0.5), color-mix(in srgb, var(--glow) 30%, transparent), transparent 74%);
}
@media (orientation: landscape) and (max-height: 520px) {
  .gallery { padding-bottom: env(safe-area-inset-bottom); }
}

/* Safari fills its bottom bar with a solid colour whenever a fixed strip touches the bottom edge. There is no bottom strip any more,
   so the bar floats over the page as clear glass and the page shows through it, like apple.com. (The top strip stays: the
   status bar area cannot show page content, so it is tinted with the colour of the page's top.) */
.edge-bottom { display: none; }

/* Safari 26 colours its toolbar from any fixed or sticky strip that reaches a screen edge, and the pinned colour field was one
   (so the bottom bar went solid). Here the field is an ordinary element that a scroll-linked animation carries down the page at
   exactly the scroll speed, so it looks pinned but Safari sees nothing pinned. Browsers without scroll-linked animations keep
   the sticky version above. hero.js measures --ride (how far it travels) and --ride-from (where the opening starts). */
@supports (animation-timeline: scroll()) {
  .field-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin-bottom: 0;
    height: calc(100lvh + 80px); /* runs on past Safari's "full height", under the bottom bar, so the bar shows the field and not a plain band */
    animation: field-ride linear both;
    animation-timeline: scroll(root block);
    animation-range: var(--ride-from, 0px) calc(var(--ride-from, 0px) + var(--ride, 0px));
    will-change: transform; /* its own layer: it only ever moves, it is never repainted */
  }
}
@keyframes field-ride { to { transform: translate3d(0, var(--ride, 0px), 0); } }

/* Safari paints its status strip from the page content just above the visible area, not from the gallery itself. At the bottom of the
   page that is the end of the opening: the colour field, the soft fade and the text, nearly the same light colours whatever wallpaper is
   open. They washed the strip out to a pale blue-grey that barely followed the page. Covering them is not enough (Safari reads the layers
   under a cover too), so while the gallery fills the screen the opening and the soft fade are simply not painted, and what lies above is
   only the page colour: the strip then follows it exactly (measured in the iOS Simulator: 11% -> 100%).
   The colour field itself is NOT hidden but parked far above the page: hiding it made Safari throw its drawing away, and it came back
   as one empty, flashing frame when you scrolled up. A parked layer keeps its drawing, so nothing flashes when it returns.
   Everything here only changes while the opening is off screen. It is a class on the opening itself (not on <body>), so crossing the join
   makes the browser re-check the opening's rules only, not every rule on the page. */
.opening.away { visibility: hidden; }
.opening.away .field-wrap { visibility: visible; top: -8000px; }
.opening.away .feather { display: none; }


/* ---------- polish: selection, touch areas, credits, no-script text ---------- */

/* A slow drag or a long press on the opening used to start iOS text selection (blue handles over the clock). Nothing on the page is meant
   to be selected, so it is off everywhere except where a form control needs it. The wallpapers keep the press-and-hold "Save to Photos"
   menu, which is a different thing (touch-callout) and is switched on again for them. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.card, .card canvas, .card .card-img, .viewer-frame, .vimg { -webkit-touch-callout: default; }
select, input, textarea { -webkit-user-select: auto; user-select: auto; }

/* the wordmark: same look, a comfortable 44px touch area (padding and an equal negative margin cancel out) */
.mark { display: inline-block; padding: 10px 14px; margin: -10px -14px; }

/* the credits link takes the page's text colour (it sits on the page colour at the very end of the opening), with a real underline */
.credits { margin: 0; text-align: center; }
.credits a { display: inline-block; padding: 14px 18px; font-size: 14px; color: var(--fg); opacity: 0.8; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* shown only when JavaScript is off */
.nojs { position: relative; z-index: 20; max-width: 560px; margin: 0 auto; padding: 96px 24px 24px; color: #fff; line-height: 1.5; }
.nojs p { margin: 0 0 14px; }

/* the colour field tints toward the open wallpaper's colour as the gallery rises over it (hero.js sets colour and strength from the scroll
   position), so the field, the status strip and the gallery arrive at the same colour together. It sits above the grain, so the grain's blending is untouched. */
.field-wrap .tint { position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; }

/* ---------- Scroll-linked motion, run by the browser itself (html.sd, set by boot.js) ----------
   The controls arriving, the colour tint, the intro lines lighting up, the clock drifting away and the opening hiding behind the gallery
   all follow the scroll position. A script can only place them a frame or more after Safari has scrolled (and later still when the phone
   is busy), so on a fast pull the buttons trailed behind and the opening came back late as a plain band. Here the browser places them
   itself, in the same step as its own scrolling. Each piece has its own stretch of the pull, worked out from where the gallery starts
   (--gtop, written by app.js only when it changes). Same numbers as the script it replaces (syncReveal, coverage, lightLines, driftClock).
   Without support, or with reduced motion, there is no "sd" class and the script does all of this as before. */
:root {
  --rv0: calc(var(--gtop, 100000px) + var(--under, 0px) - 95dvh); /* the pull starts when the controls are 95% of the way down the screen */
  --rvl: 60dvh;                                                  /* ... and is complete 60% of a screen later */
  --rv-ease: cubic-bezier(0.42, 0, 0.58, 1);                     /* soft at both ends */
}
.sd .gallery .tabrow {
  animation: rv-tabs var(--rv-ease) both; animation-timeline: scroll(root block);
  animation-range: var(--rv0) calc(var(--rv0) + 0.55 * var(--rvl));
}
.sd .gallery .stage {
  animation: rv-stage var(--rv-ease) both; animation-timeline: scroll(root block);
  animation-range: calc(var(--rv0) + 0.08 * var(--rvl)) calc(var(--rv0) + 0.78 * var(--rvl));
}
.sd .gallery .name {
  animation: rv-name var(--rv-ease) both; animation-timeline: scroll(root block);
  animation-range: calc(var(--rv0) + 0.28 * var(--rvl)) calc(var(--rv0) + 0.88 * var(--rvl));
}
.sd .gallery .foot {
  animation: rv-foot var(--rv-ease) both; animation-timeline: scroll(root block);
  animation-range: calc(var(--rv0) + 0.38 * var(--rvl)) calc(var(--rv0) + var(--rvl));
}
/* (hidden, not just see-through, until each starts to arrive: a hidden glass button costs nothing while the colour field moves) */
@keyframes rv-tabs  { from { opacity: 0; transform: translate3d(0, -14px, 0); visibility: hidden; pointer-events: none; } 50% { pointer-events: none; } 50.1% { pointer-events: auto; } to { opacity: 1; transform: none; visibility: visible; } }
@keyframes rv-stage { from { opacity: 0; transform: translate3d(0, 38px, 0) scale(0.94); visibility: hidden; pointer-events: none; } 50% { pointer-events: none; } 50.1% { pointer-events: auto; } to { opacity: 1; transform: none; visibility: visible; } }
@keyframes rv-name  { from { opacity: 0; transform: translate3d(0, -8px, 0); visibility: hidden; } to { opacity: 1; transform: none; visibility: visible; } }
@keyframes rv-foot  { from { opacity: 0; transform: translate3d(0, 18px, 0); visibility: hidden; pointer-events: none; } 50% { pointer-events: none; } 50.1% { pointer-events: auto; } to { opacity: 1; transform: none; visibility: visible; } }

/* the colour field takes on the open wallpaper's colour as the gallery rises over it (the colour itself comes from hero.js) */
.sd .field-wrap .tint {
  animation: rv-tint var(--rv-ease) both; animation-timeline: scroll(root block);
  animation-range: calc(var(--gtop, 100000px) - 100dvh) var(--gtop, 100000px);
}
@keyframes rv-tint { from { opacity: 0; } to { opacity: 1; } }

/* once the gallery fills the screen the opening is not painted (see ".opening.away" above): the same, now in step with the scroll */
@supports (animation-timeline: scroll()) {
  .sd .opening {
    animation: rv-away linear both; animation-timeline: scroll(root block);
    animation-range: calc(var(--gtop, 100000px) - 6px) calc(var(--gtop, 100000px) - 2px);
  }
  .sd .opening .field-wrap {
    visibility: visible; /* the colour field is never hidden, only parked far above the page (it keeps its drawing) */
    animation: field-ride linear both, rv-park step-end both;
    animation-timeline: scroll(root block), scroll(root block);
    animation-range: var(--ride-from, 0px) calc(var(--ride-from, 0px) + var(--ride, 0px)), calc(var(--gtop, 100000px) - 6px) calc(var(--gtop, 100000px) - 2px);
  }
}
@keyframes rv-away { from { visibility: visible; } to { visibility: hidden; } }
@keyframes rv-park { from { translate: 0 0; } to { translate: 0 -8000px; } } /* (a pure shift, never a change of layout: moving it with "top" made the browser re-place the page while scrolling) */

/* the three lines light up as they pass the middle of the screen (hero.js writes where each one's middle is: --mid) */
.sd .about .line {
  animation: rv-line linear both; animation-timeline: scroll(root block);
  animation-range: calc(var(--mid, -100000px) - 90dvh) calc(var(--mid, -100000px) - 10dvh);
}
@keyframes rv-line { 0% { opacity: 0.15; } 42.5% { opacity: 1; } 57.5% { opacity: 1; } 100% { opacity: 0.15; } }

/* scrolling away: the clock drifts up, softens and fades */
.sd .clock-date, .sd .clock-time {
  animation: rv-drift linear both; animation-timeline: scroll(root block);
  animation-range: 0px 70dvh;
}
@keyframes rv-drift { from { transform: none; filter: blur(0); opacity: var(--o, 1); } to { transform: translateY(-7vh); filter: blur(8px); opacity: calc(var(--o, 1) * 0.05); } }
