/* Fonts: Inter (the app's) and Geist Mono, subset to Latin, SIL OFL 1.1 (fonts/OFL-*.txt). */
@font-face { font-family: Inter; src: url(fonts/inter-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/inter-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(fonts/geist-mono.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Palette: the app's tokens (src/ombra-ui/ui/theme.cpp), mono accent. */
:root, [data-theme=dark] {
  --panel: #050506; --card: #0e0e11; --raised: #18181d; --line: #232329; --line2: #393942;
  --text: #f2f4f8; --text2: #a0a6b5; --text3: #7d8492; --ok: #10b981; --rec: #ef4444;
  --accent: #e6e8ee; --on-accent: #0b0b0d; --scrim: 0.35; --drop: rgba(0, 0, 0, 0.55);
}
[data-theme=light] {
  --panel: #f3f3f6; --card: #fbfbfd; --raised: #ffffff; --line: #dcdce3; --line2: #c3c3cd;
  --text: #16171c; --text2: #4f5566; --text3: #666d7c; --ok: #0a8f63;
  --accent: #16171c; --on-accent: #fbfbfd; --scrim: 0.30; --drop: rgba(0, 0, 0, 0.32);
}
:root {
  --frame: var(--panel);
  --ft: 8px;   /* frame thickness (ui.screen_frame_thickness) */
  --fr: 12px;  /* frame inner radius (ui.screen_frame_radius) */
  --r: 12px;   /* panel radius = concave fillet radius (radius_panel) */
  --rc: 8px;   /* card radius */
  --sans: Inter, system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

body { font-family: var(--sans); color: var(--text); background: #000; -webkit-font-smoothing: antialiased; }

/* ---- The screen: a game under the overlay's scrim (black in both themes, as in the app). ---- */
/* Slices of game footage on a strip that tiles sideways (img/bg-*.jpg is one period, --p its width over
   its height). On a phone the two rows travel opposite ways. A transform on a layer the compositor
   already has: no repaint per frame. The slices' own gap colour shows between pieces. */
.screen { position: fixed; inset: 0; z-index: 0; background: #0a0a0c; overflow: hidden; --pw: calc(100vh * var(--p)); --p: 2; }
.screen::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / var(--scrim)); }
.screen .band { position: absolute; inset: 0; }
.screen .strip { position: absolute; top: 0; left: 0; height: 100%; width: calc(100% + var(--pw)); background: repeat-x 0 0 / var(--pw) 100%;
  animation: carousel var(--t) linear infinite; will-change: transform; }
.screen .strip.rev { animation-direction: reverse; }
@keyframes carousel { to { transform: translateX(calc(-1 * var(--pw))); } }
.screen .wide { background-image: url(img/bg-wide.jpg); --t: 42s; }
.screen .tall { display: none; }
.screen .tall .strip { background-image: url(img/bg-tall.jpg); }
@media (max-width: 900px) {
  .screen { --p: 0.599; }   /* 1402 / 2340 */
  .screen .one { display: none; }
  .screen .tall { display: block; }
  .screen .top { clip-path: inset(0 0 38% 0); }
  .screen .top .strip { --t: 24s; }
  .screen .bot { clip-path: inset(62% 0 0 0); }
  .screen .bot .strip { --t: 18s; }
}
html.bg-paused .screen, html.bg-paused .screen * { animation-play-state: paused; }

/* ---- The frame: everything outside a rounded rect inset by --ft (BuildScreenFramePath). ---- */
/* One shape: the rounded hole's shadow paints the whole frame. A border plus a corner shadow left a
   hairline seam between them at fractional zoom, where the backdrop showed as a square corner. */
.frame { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.frame::before { content: ""; position: absolute; inset: var(--ft) var(--ftr) var(--ft) var(--ft); border-radius: var(--fr); box-shadow: 0 0 0 100vmax var(--frame); }
/* The browser's own scrollbar, as the frame's right edge: --ft wide, the frame's colour, with the app's
   thumb (a 4 px pill, paint.h ScrollThumb) in the middle. Where it takes room (a mouse on Windows),
   --sbw is its width (script at the end) and the frame's right band shrinks by it, so all four sides
   stay --ft. Touch keeps the system's overlay bar. Firefox has no ::-webkit-scrollbar: a thin bar. */
:root { --ftr: max(0px, var(--ft) - var(--sbw, 0px)); }
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 8px; height: 8px; background: var(--frame); }
  ::-webkit-scrollbar-track { background: var(--frame); margin: calc(var(--ft) + var(--fr)) 0; }
  ::-webkit-scrollbar-thumb { min-height: 40px; border: 2px solid transparent; border-radius: 4px; background: var(--line2) padding-box; }
  ::-webkit-scrollbar-thumb:hover { border-width: 1px; background-color: var(--text3); }
  ::-webkit-scrollbar-thumb:active { border-width: 1px; background-color: var(--text2); }
  @supports not selector(::-webkit-scrollbar) { html { scrollbar-width: thin; scrollbar-color: var(--line2) var(--frame); } }
}

/* ---- Attached panels: concave fillets on the edge side, convex corners away from it
        (AttachedCornerShapes). Opaque, so frame and panel read as one surface. The offset
        box-shadow runs the panel under the frame band so no hairline shows at the join; each fillet
        is 1 px larger than --r and overlaps the frame and the panel it joins, so no seam opens
        between them at fractional zoom (its free corner, the circle's centre, stays put). ---- */
.att { position: relative; background: var(--panel); color: var(--text); filter: drop-shadow(0 18px 34px var(--drop)); }
.att::before, .att::after { content: ""; position: absolute; width: calc(var(--r) + 1px); height: calc(var(--r) + 1px); pointer-events: none; --g: transparent calc(var(--r) - 0.6px), var(--panel) calc(var(--r) + 0.4px); }
.att.t { border-radius: 0 0 var(--r) var(--r); box-shadow: 0 calc(-1 * var(--ft)) 0 var(--panel); }
.att.t::before { top: -1px; left: calc(-1 * var(--r)); background: radial-gradient(circle at 0 100%, var(--g)); }
.att.t::after  { top: -1px; right: calc(-1 * var(--r)); background: radial-gradient(circle at 100% 100%, var(--g)); }
.att.b { border-radius: var(--r) var(--r) 0 0; box-shadow: 0 var(--ft) 0 var(--panel); }
.att.b::before { bottom: -1px; left: calc(-1 * var(--r)); background: radial-gradient(circle at 0 0, var(--g)); }
.att.b::after  { bottom: -1px; right: calc(-1 * var(--r)); background: radial-gradient(circle at 100% 0, var(--g)); }
.att.l { border-radius: 0 var(--r) var(--r) 0; box-shadow: calc(-1 * var(--ft)) 0 0 var(--panel); }
.att.l::before { top: calc(-1 * var(--r)); left: -1px; background: radial-gradient(circle at 100% 0, var(--g)); }
.att.l::after  { bottom: calc(-1 * var(--r)); left: -1px; background: radial-gradient(circle at 100% 100%, var(--g)); }
.att.r { border-radius: var(--r) 0 0 var(--r); box-shadow: var(--ft) 0 0 var(--panel); }
.att.r::before { top: calc(-1 * var(--r)); right: -1px; background: radial-gradient(circle at 0 0, var(--g)); }
.att.r::after  { bottom: calc(-1 * var(--r)); right: -1px; background: radial-gradient(circle at 0 100%, var(--g)); }

/* ---- Shared bits ---- */
.ring { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; flex: none; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text3); }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px; border-radius: var(--rc); font-weight: 600; font-size: 15px; border: 1px solid transparent; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn small { font-weight: 400; opacity: 0.6; font-size: 13px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: var(--raised); border-color: var(--line2); color: var(--text); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.key { display: inline-grid; place-items: center; min-width: 40px; height: 30px; padding: 0 10px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line2); box-shadow: 0 2px 0 var(--line2); font-weight: 600; font-size: 14px; color: var(--text); }
button.key { cursor: pointer; transition: transform 0.08s, box-shadow 0.08s; }
button.key:active, .keys.down button.key { transform: translateY(2px); box-shadow: 0 0 0 var(--line2); }

/* ---- Brand (top left, on the scrim) and the pill (top right), as the overlay's header ---- */
.brand { position: fixed; z-index: 30; top: calc(var(--ft) + 22px); left: calc(var(--ft) + 26px); display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; font-size: 19px; letter-spacing: 0.04em; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4); }
.brand .ring { width: 26px; height: 26px; border-width: 3px; box-shadow: 0 0 10px rgba(255, 255, 255, 0.35), inset 0 0 6px rgba(255, 255, 255, 0.25); }
.pill { position: fixed; z-index: 30; top: calc(var(--ft) + 14px); right: calc(var(--ftr) + 22px); padding: 3px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
/* As the hero folds into the bar, the bar takes over the brand and the buttons: these fade as its
   content arrives (the same --p, written to them too). */
.brand, .pill { opacity: calc(1 - clamp(0, (var(--p) - 0.75) / 0.25, 1)); transition: --p 0.8s var(--ease); }
html.docked .brand, html.docked .pill { --p: 1; visibility: hidden; transition: --p 0.8s var(--ease), visibility 0s 0.8s; }
.tools { display: flex; gap: 2px; }
.tools > * { display: grid; place-items: center; width: 34px; height: 30px; border-radius: 7px; border: 0; background: none; color: var(--text2); }
.tools > *:hover { background: var(--raised); color: var(--text); }
.tools svg { width: 16px; height: 16px; }
.pill.tools > * { width: 38px; height: 34px; }
.pill.tools svg { width: 17px; height: 17px; }
.tools .theme svg { transition: transform 0.5s var(--ease); }
[data-theme=light] .tools .theme svg { transform: rotate(180deg); }

/* ---- Hero: attached to the top edge; scrolling folds it into a notch ---- */
/* One number drives the fold: --p, 0 open, 1 folded into the bar. A scroll threshold flips
   .docked and --p transitions over 0.8 s. Phases: the panel's free edge rises (--h) while the
   copy slides out under the frame and fades (--fo); then the panel narrows (--w) and the bar's
   content arrives (--m). --H1/--H2 (open and bar heights) are measured by the script. */
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
.hero { position: fixed; z-index: 30; top: var(--ft); left: calc(50% + (var(--ft) - var(--ftr)) / 2); translate: -50% 0;
  --hero-w: min(780px, calc(100vw - 2 * (var(--ft) + 158px)));   /* clears the logo and the tool pill */ --mini-w: 640px;
  --h: clamp(0, var(--p) / 0.8, 1); --fo: clamp(0, (var(--p) - 0.2) / 0.45, 1);
  --w: clamp(0, (var(--p) - 0.55) / 0.45, 1); --m: clamp(0, (var(--p) - 0.75) / 0.25, 1);
  width: calc(var(--hero-w) + (var(--mini-w) - var(--hero-w)) * var(--w));
  animation: drop 0.9s var(--ease) 0.15s both; }
@keyframes drop { from { transform: translateY(calc(-100% - var(--ft) - 40px)); } }
.hero { transition: --p 0.8s var(--ease); }
.hero.docked { --p: 1; }
.hero .rows { position: relative; overflow: hidden; border-radius: inherit;
  height: calc(var(--H1) - (var(--H1) - var(--H2)) * var(--h)); }
/* Copy and bar ride the panel's free edge (the bottom here), so the copy leaves under the frame. */
.hero .full { position: absolute; bottom: 0; left: 50%; width: var(--hero-w); translate: -50% 0; opacity: calc(1 - var(--fo)); }
.hero .mini { position: absolute; bottom: 0; left: 0; right: 0; opacity: var(--m); translate: 0 calc((1 - var(--m)) * 6px); }
.hero .full > div { padding: 26px 34px 30px; }
/* Before the script measures (or without it): the open hero at its natural height, no bar. */
.hero:not(.fold) .rows { height: auto; }
.hero:not(.fold) .full { position: static; translate: none; }
.hero:not(.fold) .mini { display: none; }
.hero .mini > div { display: flex; align-items: center; gap: 12px; padding: 9px 10px 11px 20px; }
.hero .mini .home { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.hero .mini .ring.sm { width: 18px; height: 18px; border-width: 2.5px; }
.hero .mini b { font-weight: 600; font-size: 15px; }
.hero .mini span { color: var(--text3); font-size: 14px; margin-right: auto; white-space: nowrap; }
.hero .mini .tools { margin-right: 4px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
h1 { margin: 16px 0 0; font-weight: 600; font-size: clamp(36px, min(4.4vw, 6.9vh), 64px); line-height: 1.02; letter-spacing: -0.035em; }
h1 span { color: var(--text3); }
.sub { margin: 16px 0 0; max-width: 560px; font-size: 17px; line-height: 1.5; color: var(--text2); }
.cta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 22px; padding: 12px 16px; border-radius: var(--rc); background: var(--card); border: 1px solid var(--line); }
.try .keys { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--text2); }
.try .keys .lbl { margin-right: 4px; }
.try .keys .rest { margin-left: 6px; }
.try .hint { margin-left: auto; font-size: 13px; color: var(--text3); white-space: nowrap; }

/* ---- Drawers: sections attached to the side edges; they slide out of the frame as they arrive.
        Scrolling is vertical, so a side-attached panel stays attached the whole way. ---- */
main { position: relative; z-index: 10; overflow-x: clip; padding-bottom: 22vh; }
.spacer { height: 100svh; }
.drawer { width: var(--w); margin-top: 24vh; transition: translate 0.8s var(--ease); }
.drawer.l { margin-left: var(--ft); }
.drawer.r { margin-left: auto; margin-right: var(--ftr); }
/* Parked outside the frame until the script reveals them; without the script they just show. */
.js .drawer.l:not(.in) { translate: calc(-100% - 3 * var(--r)) 0; }
.js .drawer.r:not(.in) { translate: calc(100% + 3 * var(--r)) 0; }
.spacer + .drawer { margin-top: 0; }
.drawer > .pad { padding: 40px 48px 44px; }
.drawer.l > .pad { padding-left: 56px; }
.drawer.r > .pad { padding-right: 56px; }
h2 { margin: 12px 0 0; font-weight: 600; font-size: clamp(28px, 2.9vw, 42px); line-height: 1.1; letter-spacing: -0.03em; max-width: 760px; }
h2 span { color: var(--text3); }

#buffer { --w: min(940px, 70vw); }
.strip-wrap { position: relative; margin-top: 30px; }
.strip { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; position: relative; }
.strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; filter: brightness(var(--b)) saturate(var(--s)); }
.strip::after { content: ""; position: absolute; inset: -6px; border: 2px solid var(--accent); border-radius: 9px; opacity: 0; }
.strip.flash::after { animation: bracket 1.4s var(--ease); }
@keyframes bracket { 0% { opacity: 0; transform: scale(1.02); } 15% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; } }
.now { position: absolute; right: -10px; top: -10px; bottom: -10px; width: 2px; border-radius: 2px; background: var(--rec); }
.now::before { content: "now"; position: absolute; top: -20px; left: 50%; translate: -50% 0; font-size: 11px; font-weight: 600; color: var(--rec); letter-spacing: 0.06em; text-transform: uppercase; }
.axis { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--text3); }
.press { display: flex; align-items: center; gap: 6px; margin-top: 26px; color: var(--text2); font-size: 15px; }
.press .rest { margin-left: 8px; }

.note { margin: 14px 0 0; font-size: 14px; color: var(--text3); }

/* Recording: the same frames, the red bar from 30 s back through now into slots not filmed yet. Ten
   slots of 10 s: now after slot 7, the start 3 slots back. */
#record { --w: min(940px, 70vw); --start: 40%; --now: 70%; }
.rec-wrap { position: relative; margin-top: 30px; padding-bottom: 32px; }
.rstrip { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.rstrip > * { width: 100%; aspect-ratio: 16 / 9; border-radius: 5px; }
.rstrip img { object-fit: cover; filter: brightness(var(--b)) saturate(var(--s)); }
.rstrip .fut { border: 1.5px dashed var(--line2); }
.rnow { right: auto; left: calc(var(--now) - 3.5px); bottom: 22px; }
.rbar { position: absolute; left: var(--start); right: 0; bottom: 0; height: 22px; display: flex; align-items: center; gap: 7px; padding-left: 9px;
  border-radius: 6px 0 0 6px; background: linear-gradient(90deg, var(--rec) 0 50%, transparent);   /* solid up to now: (70 - 40) / (100 - 40) */
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }
.rdot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.rpin { position: absolute; left: 58%; bottom: 5px; width: 9px; height: 9px; translate: -50% 0; rotate: 45deg; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px var(--rec); }
.raxis { position: relative; height: 16px; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--text3); white-space: nowrap; }
.raxis span { position: absolute; top: 0; }
.raxis .a1 { left: var(--start); }
.raxis .a2 { left: var(--now); translate: -50% 0; color: var(--rec); }
.raxis .a3 { right: 0; }
/* Where the strip is too narrow for the start label to run right from the start, it ends there. */
@media (min-width: 901px) and (max-width: 1180px) { .raxis .a1 { left: auto; right: calc(100% - var(--start)); } }
@media (min-width: 901px) and (max-width: 1000px) { .raxis .a3, .rbar span { display: none; } }
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.points > div { padding: 18px 20px 20px; border-radius: var(--rc); background: var(--card); border: 1px solid var(--line); }
.points b { display: block; font-weight: 600; font-size: 17px; }
.points span { display: block; margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--text2); }


#facts { --w: min(860px, 64vw); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.facts > div { padding: 20px 20px 22px; border-radius: var(--rc); background: var(--card); border: 1px solid var(--line); }
.facts b { display: block; font-weight: 600; font-size: 38px; letter-spacing: -0.03em; }
.facts span { display: block; margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--text2); }

#get { --w: min(1040px, 80vw); }
.get { display: grid; grid-template-columns: 1fr 1.05fr; gap: 44px; align-items: start; }
.get > * { min-width: 0; }
.get .btn { margin-top: 26px; }
.meta { margin-top: 14px; font-size: 13px; color: var(--text3); }
.smart { margin: 18px 0 0; max-width: 380px; font-size: 13px; line-height: 1.55; color: var(--text3); }
.smart b { color: var(--text2); font-weight: 600; }
.alts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.alt { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: var(--rc); background: var(--card); border: 1px solid var(--line); }
.alt div { min-width: 0; margin-right: auto; }
.alt .lbl { font-size: 12px; color: var(--text3); display: flex; gap: 8px; align-items: center; }
.alt code { display: block; margin-top: 5px; font-family: var(--mono); font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alt :is(button, a) { flex: none; height: 30px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line2); background: var(--raised); font-size: 12px; color: var(--text2); }
.alt :is(button, a) { min-width: 70px; display: grid; place-items: center; text-decoration: none; }
.tag { font-size: 10.5px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line2); color: var(--text2); }
[data-os=other] .only-win, html:not([data-os=other]) .only-other { display: none !important; }
.phone .anyway { display: block; margin-top: 12px; text-align: center; font-size: 13px; color: var(--text3); }
.phone p { margin: 14px 0 0; color: var(--text2); font-size: 15px; line-height: 1.5; }
.addr { margin-top: 12px; padding: 14px 16px; border-radius: var(--rc); background: var(--card); border: 1px solid var(--line); font-family: var(--mono); font-size: 16px; }
.phone .btn { width: 100%; justify-content: center; margin-top: 12px; }
.phone .btn[data-done]::after { content: " · link copied"; font-weight: 400; }

footer { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text3); }
footer a:hover { color: var(--text); }

/* ---- The save toast: attached to the bottom edge, like the toast the app shows after Alt+F10 ---- */
.toast { position: fixed; z-index: 35; bottom: var(--ft); left: calc(50% + (var(--ft) - var(--ftr)) / 2); width: 400px; margin-left: -200px; display: flex; align-items: center; gap: 16px; padding: 16px 20px 20px; transform: translateY(calc(100% + var(--ft) + 50px)); visibility: hidden; transition: transform 0.55s var(--ease), visibility 0s 0.55s; }
.toast.show { transform: none; visibility: visible; transition: transform 0.55s var(--ease); }
.toast .glow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--card); flex: none; }
.toast .glow i { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--text); box-shadow: 0 0 8px color-mix(in srgb, var(--text) 50%, transparent), inset 0 0 5px color-mix(in srgb, var(--text) 35%, transparent); }
.toast.rec .glow i { width: 16px; height: 16px; border: 0; background: var(--rec); box-shadow: 0 0 10px color-mix(in srgb, var(--rec) 60%, transparent); }
#record.live .rdot { animation: rblink 1.2s ease-in-out infinite; }
@keyframes rblink { 50% { opacity: 0.25; } }
.toast b { display: block; font-weight: 600; font-size: 16px; }
.toast span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--text2); }
.toast .drain { position: absolute; left: 20px; right: 20px; bottom: 9px; height: 3px; border-radius: 3px; background: var(--accent); transform-origin: left; }
.toast.show .drain { animation: drain 3.2s linear both; }
@keyframes drain { to { transform: scaleX(0); } }

/* Theme switch: the new theme opens out of the button as a circle (View Transitions). */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---- Keyboard focus: one ring, the text colour, on everything that takes focus ---- */
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.brand:focus-visible { outline-color: #fff; border-radius: 6px; }
.tools > :focus-visible, .key:focus-visible, .alt :is(button, a):focus-visible { outline-offset: 2px; }
#app .track:focus-visible { outline-offset: -4px; border-radius: var(--r); }

/* Reduced motion: no entrances or blinking. The backdrop starts paused (script) but plays when the
   visitor presses play, and the theme wipe, a reveal in place, always runs. */
@media (prefers-reduced-motion: reduce) {
  *:not(.strip), ::before, ::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
  #record.live .rdot { animation: none; }
}

/* ---- Phone: the hero becomes a sheet on the bottom edge, the toast drops from the top ---- */
@media (max-width: 900px) {
  :root { --ft: 6px; }
  .brand { top: calc(var(--ft) + 16px); left: calc(var(--ft) + 18px); font-size: 16px; }
  .brand .ring { width: 22px; height: 22px; }
  .pill { top: calc(var(--ft) + 11px); right: calc(var(--ftr) + 14px); }
  .pill.tools > * { width: 34px; height: 30px; }
  .pill.tools svg { width: 16px; height: 16px; }
  /* Full width, attached to the bottom and both sides: the frame thickens into the sheet, so the
     only fillets are where the sheet leaves the side edges. */
  .att.hero, .att.hero.docked { top: auto; bottom: var(--ft); left: var(--ft); right: var(--ftr); width: auto; translate: none; border-radius: 0;
    box-shadow: 0 var(--ft) 0 var(--panel), calc(-1 * var(--ft)) 0 0 var(--panel), var(--ft) 0 0 var(--panel); filter: drop-shadow(0 -10px 30px var(--drop)); }
  .att.hero::before { top: calc(-1 * var(--r)); left: -1px; background: radial-gradient(circle at 100% 0, var(--g)); }
  .att.hero::after { top: calc(-1 * var(--r)); right: -1px; background: radial-gradient(circle at 0 0, var(--g)); }
  @keyframes drop { from { transform: translateY(calc(100% + var(--ft) + 40px)); } }
  /* The free edge is the top here: copy and bar ride it down. */
  .hero .full { top: 0; bottom: auto; left: 0; width: 100%; translate: none; }
  .hero .mini { top: 0; bottom: auto; }
  .hero .full > div { width: auto; padding: 22px 22px 22px; }
  .hero .mini > div { padding: 10px 10px 10px 16px; }
  .hero .mini span { display: none; }
  .hero .mini .home { margin-right: auto; }
  h1 { font-size: 38px; margin-top: 12px; }
  .sub { font-size: 15.5px; margin-top: 12px; }
  .cta { margin-top: 18px; }
  .cta .btn { flex: 1; justify-content: center; }
  .try { margin-top: 14px; padding: 10px 12px; }
  .try .keys { font-size: 13.5px; flex-wrap: wrap; }
  .try .hint { display: none; }
  .key { min-width: 34px; height: 26px; font-size: 13px; padding: 0 8px; }
  main { padding-bottom: calc(12vh + 70px); }
  .drawer { --w: calc(100% - var(--ft) - 18px) !important; margin-top: 16vh; }
  .drawer > .pad, .drawer.l > .pad, .drawer.r > .pad { padding: 26px 22px 28px; }
  h2 { font-size: 27px; }
  .strip { grid-template-columns: repeat(5, 1fr); }
  .strip img:nth-child(odd) { display: none; }
  .press { flex-wrap: wrap; font-size: 14px; }
  .press .rest { margin-left: 2px; }
  .facts, .points { grid-template-columns: 1fr; gap: 8px; }
  .raxis { font-size: 10.5px; }
  .raxis .a1 { left: 0; }
  .raxis .a3, .rbar span { display: none; }
  .facts b { font-size: 32px; }
  .get { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .att.toast { bottom: auto; top: var(--ft); left: var(--ft); right: var(--ftr); width: auto; margin: 0; border-radius: 0;
    box-shadow: 0 calc(-1 * var(--ft)) 0 var(--panel), calc(-1 * var(--ft)) 0 0 var(--panel), var(--ft) 0 0 var(--panel); transform: translateY(calc(-100% - var(--ft) - 50px)); }
  .att.toast::before { bottom: calc(-1 * var(--r)); left: -1px; background: radial-gradient(circle at 100% 100%, var(--g)); }
  .att.toast::after { bottom: calc(-1 * var(--r)); right: -1px; background: radial-gradient(circle at 0 100%, var(--g)); }
  .att.toast.show { transform: none; }
}

/* ---- The app: its real panels on a horizontal scroller that snaps one screen at a time ---- */
[data-theme=dark] .shot.on-light, [data-theme=light] .shot.on-dark { display: none; }
#app { position: relative; margin-top: 24vh; --sw: min(1080px, calc(100vw - 2 * var(--ft) - 220px)); --sh: min(620px, 64svh); }
/* A real horizontal scroller: trackpad, Shift+wheel, touch and the arrows move it; the vertical wheel
   stays the page's. Padded on y so the shots' drop shadow isn't clipped by overflow. */
#app .track { display: flex; gap: 48px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 30px calc((100% - var(--sw)) / 2) 64px; }
#app .track::-webkit-scrollbar { display: none; }
#app .slide { flex: none; width: var(--sw); height: var(--sh); display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; scroll-snap-align: center; scroll-snap-stop: always;
  opacity: 0.35; scale: 0.94; transition: opacity 0.45s var(--ease), scale 0.6s var(--ease); cursor: pointer; }
#app .slide.on { opacity: 1; scale: 1; cursor: default; }
#app .slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; filter: drop-shadow(0 24px 48px rgb(0 0 0 / 0.5)); }
#app .cap { display: flex; gap: 18px; align-items: center; width: min(760px, calc(100% - 2 * var(--ft) - 32px)); margin: 0 auto; padding: 14px 14px 14px 24px;
  border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); filter: drop-shadow(0 18px 34px var(--drop)); }
#app .txt { flex: 1; min-width: 0; }
#app .g-title { margin: 0; font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
#app .g-cap { margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--text2); min-height: 3em; }
#app .nav { display: flex; align-items: center; gap: 10px; flex: none; }
#app .dots { display: flex; gap: 2px; }
#app .dots button { width: 15px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; transition: width 0.3s; }
#app .dots button::before { content: ""; width: 7px; height: 7px; border-radius: 4px; background: var(--line2); transition: background 0.3s, width 0.3s; }
#app .dots button.on { width: 28px; }
#app .dots button.on::before { width: 20px; background: var(--text); }
#app .arrow { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text);
  background: var(--raised); border: 1px solid var(--line2); transition: opacity 0.2s; }
#app .arrow svg { width: 16px; height: 16px; }
#app .arrow:disabled { opacity: 0.35; cursor: default; }
@media (max-width: 900px) {
  #app { --sw: calc(100vw - 2 * var(--ft) - 64px); --sh: min(420px, 52svh); }
  #app .track { gap: 14px; padding: 20px calc((100% - var(--sw)) / 2) 36px; }
  #app .cap { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 16px 12px; }
  #app .nav { justify-content: space-between; }
}
