/* Fonts: Barlow Semi Condensed, SIL Open Font License (see fonts/README.txt),
   copied into the site so no request leaves the page for them. */
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/barlow-semi-condensed-400-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/barlow-semi-condensed-400-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: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/barlow-semi-condensed-500-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/barlow-semi-condensed-500-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: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/barlow-semi-condensed-600-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/barlow-semi-condensed-600-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;
}
/* Windows and film.
   Chosen 2026-10-20 from the directions tried in experiments/ (C4). Four
   choices, each with a job:
   1. The page is one window in two halves, titled Clip and Exposure: each
      picture with its controls under it. The titles name the two pictures,
      which nothing on the page did before. Flat: one-pixel lines, a wider pale
      one between the halves, no bevels, no shadows. (Four separate windows
      until 2026-12-03.)
   2. Inside the windows is the darkroom. The clip is a strip of negative,
      sprocket holes along the top and bottom; the exposure is a print, with
      the white border an enlarger's easel leaves. What goes in, what comes
      out, readable at a glance.
   3. A light-gray desk behind the windows, untinted (middle gray until
      2026-12-04). It's the pasteboard
      color photo editors use, because a neutral gray doesn't push a
      picture's colors warmer or cooler. The pictures themselves sit on
      black film and white paper, not on the gray.
   4. Red means one thing: the shutter is open (a darkroom's safelight).
      And Save PNG is the default button, with the heavy ring
      that meant "Return does this": the one thing to do in each place.
   The type is Barlow Semi Condensed, a DIN-like face self-hosted in fonts/,
   so a lot of controls fit in a small space and read quickly. */

:root {
  color-scheme: light dark; /* native sliders, scrollbars and file pickers match the chrome */

  --bg: #cfcfcf;      /* the desk behind the windows: light gray, untinted (was #6b6b6b middle gray until 2026-12-04) */
  --on-bg: #000;      /* the heading's text on the desk (13.6:1) */
  --chrome: #dddddd;  /* a window: close to the desk, so its black outline is what sets it apart */
  --panel: #000;      /* an empty picture; looks.js paints it into the exposure canvas too */
  --raised: #f4f4f4;  /* a control under the pointer */
  --well: #fff;       /* sunken things: the timeline's groove */
  --edge: #000;       /* window and button outlines */
  --rule: #c4c4c4;    /* the line down the middle: a shade darker than --chrome */
  --soft: #808080;    /* a ring under the pointer (2.9:1 on --chrome) */
  --swell: #b4b4b4;   /* the movement curve: a shade darker than what it sits on */
  --stripe: #6e6e6e;  /* the lines in a title bar */
  --ink: #000;        /* text, and a chosen option's fill (15:1 on --chrome) */
  --on-ink: #fff;     /* text on --ink */
  --muted: #3d3d3d;   /* secondary text: 8:1 on --chrome, 10.9:1 on --well */

  --film: #050505;    /* film base, untinted */
  --hole: #2e2e2e;    /* a sprocket hole */
  --paper: #f4f4f4;   /* the print's border */
  --holes: linear-gradient(90deg, var(--hole) 0 8px, transparent 8px);
  --film-edge: 18px;  /* the width of the film's border, and of the print's */
  --title-h: 24px;    /* a window's title bar */
  --page-end: 56px;   /* the room under the windows at the bottom of the page */
  /* Spacing, two numbers (2026-12-03). --space: from the top of the page to
     the header, and from the window's outline or dividing lines to what's in it,
     so every left edge inside a window is on one line. --row: between one row
     of controls and the next. A phone has a smaller --space. */
  --space: 12px;
  --row: 8px;
  --head-h: 40px;     /* the heading's row */
  --divide: 4px;       /* the line between the left half and the right */

  --red: #d92d24;     /* the shutter, while it's open (white on it: 4.8:1) */
  --on-red: #fff;
  --focus: #0b4fd6;   /* 5:1 on --chrome, 6.8:1 on --well */

  --radius: 4px;
  --radius-sm: 3px;   /* small marks: the timeline's tabs, the overview's window, the corner labels */
  --radius-lg: 12px;  /* the frame that says "Drop the video" */
  --chrome-in: #ececec; /* the left half, what goes in, a shade lighter than --chrome (wide screens) */
  --raised-in: #f7f7f7; /* --raised on it: still lighter */
  --overlay: rgb(221 221 221 / 0.94); /* --chrome, nearly solid: over the page while a file is dragged in */
  --on-black: #bbb;   /* words on the black of an empty picture (10.9:1) */
  --font: 'Barlow Semi Condensed', system-ui, -apple-system, sans-serif;
}

/* Dark: the same page for a dark system setting (added 2026-11-23). The desk
   and the windows go dark, outlines and text go light, and a chosen option is
   a light fill with dark text. The film and the print stay as they are: black
   film, white paper, so a picture is judged against the same thing either way.
   Contrasts: --muted on --chrome 8.9:1, --ink on --chrome 12.9:1, --focus on
   --chrome 6.6:1, --edge on --chrome 4.4:1. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --chrome-in: #353535;
    --raised-in: #424242;
    --on-bg: #f2f2f2;
    --chrome: #2b2b2b;
    --raised: #3a3a3a;
    --well: #101010;
    --edge: #8c8c8c;
    --rule: #1c1c1c;
    --soft: #777;
    --swell: #444;
    --stripe: #6a6a6a;
    --ink: #f2f2f2;
    --on-ink: #000;
    --muted: #c6c6c6;
    --focus: #7fb0ff;
    --overlay: rgb(43 43 43 / 0.94); /* --chrome, nearly solid */
  }
}

body {
  margin: 0;
  /* 18px at the browser's usual size, and larger when the browser is set
     to larger text (rem follows that setting; px didn't). */
  font: 1.125rem/1.4 var(--font);
  color: var(--ink);
  background: var(--bg);
}

/* The phone layout (2026-12-04, third review): 860px wide or less, or a
   touch screen 520px tall or less (an iPhone Pro Max or Plus on its side is
   up to 956 wide, past 860, and scrolled through the desktop page). The
   desktop rules take exactly the rest: 860.02 rather than 861, so a window
   at 860.5 (browser zoom) isn't in neither. core.js has the same test
   (PHONE_LAYOUT) for the scripts. */
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  :root { --space: 8px; --row: 12px; }
}

button, input, select { font-family: inherit; }

header.site,
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* The header: a small heading straight on the desk, no box (2026-12-03; it
   was a bar in the windows' style). The name, then "by Sami Smith"
   (the name linking to samismith.com) right after it, sharing a baseline; the name starts on the
   same line as what's inside the windows below. Text on the desk is --on-bg:
   black or the blue focus ring on that gray would be hard to see. Its height
   is part of --pic-h. */
header.site { padding-top: var(--space); }
header.site .heading {
  box-sizing: border-box;
  display: flex;
  align-items: baseline;
  gap: var(--space); /* the byline comes right after the name */
  height: var(--head-h);
  padding: 0 calc(var(--space) + 1px); /* 1px: the windows' outline */
  color: var(--on-bg);
}
header.site h1 { margin: 0; font-size: clamp(1.5rem, 7.5vw, 2rem); /* smaller on a narrow phone, so the link keeps its room */ font-weight: 600; line-height: var(--head-h); white-space: nowrap; }
header.site .byline { margin: 0; font-size: 1rem; white-space: nowrap; }
/* The padding makes the link easier to hit without moving anything (an inline
   element's top and bottom padding takes no room in the layout). */
header.site a { padding: 6px 0; color: inherit; text-underline-offset: 2px; }
header.site a:focus-visible { outline: 3px solid var(--on-bg); outline-offset: 2px; }
header.site h1 a { text-decoration: none; } /* the name, back to the start: looks like the heading, underlined on hover */
header.site h1 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
@media (pointer: coarse) {
  header.site a { padding: 13px 0; } /* 44px for a finger */
}

main {
  padding-top: var(--space);
  padding-bottom: var(--page-end);
  /* A white tab at the very end of the timeline sticks out half its width;
     on a phone that made the page scroll sideways. It stays visible: the
     page padding is wider than the overhang. */
  overflow-x: clip;
}
/* Everything is as wide as the two pictures: as wide as the page, but each
   picture is only as tall as the window leaves once everything else is in
   it, so the whole page fits the window with no scrolling (2026-11-30;
   before, each picture was up to 52% of the window and the page scrolled).
   The two columns have different budgets (2026-12-03), and the smaller
   picture wins:
   - the clip's column is the picture plus 484px and --head-h of everything else: the
     heading, gaps, the window's title and film border, and its controls
     (measured with a how-to line under them, removed 2026-12-04);
   - the exposure's column is 404px and --head-h of everything else with its tallest
     settings (Drift, or Multi exposure), plus the picture, plus the looks'
     thumbnails, which are about a third as tall as the picture (three to a
     row), hence the 0.75: picture + a third of it = what's left.
   Measured in Chrome: no scroll at 1512×860, 1280×800 or 1366×768. With the
   clip's column showing everything at once (zoomed in, a two-line credit, the
   status and notes) the smaller two may scroll a little. If the hidden
   Slices look comes back, re-measure. A short window still gets a picture
   --pic-min tall, and then the page may scroll. (240px until 2026-12-04, when
   a 1280×720 window scrolled 23px with Blend at its bottom edge: 200px fits it.) A column is at least 444px
   wide when there's room (the 900px), so the controls have room; a squarer
   or tall clip then sits in the middle of its half, no taller than --pic-h
   (see .source and #exposure under the desktop rules). 60px is --space on both
   sides of a half plus the film's border; then the window's outline (2px) and
   the line down the middle. timeline.js sets --ratio. */
:root {
  --pic-min: 200px;
  --pic-h: max(var(--pic-min), min(100vh - 484px - var(--head-h) - var(--touch-extra), (100vh - 404px - var(--head-h)) * 0.75 - var(--touch-extra)));
  --touch-extra: 0px; /* the 44px controls on a touch screen (see the pointer: coarse block at the end) */
}
main > *,
header.site > * {
  max-width: min(100%, max(900px, calc(2 * (var(--pic-h) * var(--ratio, 1.7778) + 60px) + var(--divide) + 2px)));
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  header.site, main { padding-left: 16px; padding-right: 16px; }
  main > *, header.site > * { max-width: none; }
}

h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 8px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- Buttons ----
   Four kinds, so the weight of a button says what it is:
   default = the one thing to do in its place (Save PNG): the heavy
             ring outside it
   filled  = the shutter, the one big thing in the clip's column
   outline = everything else (.view-toggle, .small)
   chosen  = an option that's selected (segments, below) */

.view-toggle,
.small,
#save {
  font: inherit;
  font-weight: 500;
  min-height: 40px;
  padding: 4px 16px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--chrome);
  color: var(--ink);
  cursor: pointer;
}
.view-toggle { flex: none; }
/* The timeline's + and −, under its right end (beside the overview when
   that shows). At either end of the zoom a button is aria-disabled (it
   stays focusable), dimmed like a disabled one. */
.zoom { display: flex; gap: 6px; margin-left: auto; }
.zoom[hidden] { display: none; } /* a short clip has none (viewAroundMarks) */
.zoom .small { font-size: 1.2rem; line-height: 1; }
.small[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.small[aria-disabled="true"]:hover { background: var(--chrome); border-color: var(--edge); }
body.live .zoom { display: none; } /* the camera has no timeline */
.small { min-width: 40px; padding: 4px 12px; font-size: 0.95rem; }
.view-toggle:hover,
.small:hover,
#save:hover { background: var(--raised); border-color: var(--ink); }
.small:disabled,
#save:disabled { opacity: 0.4; cursor: default; background: var(--chrome); border-color: var(--edge); }

/* The default button: the heavy ring and a thin line inside it, both within
   the button's own box, so it's the same height and sits on the same lines as
   every other button (until 2026-12-03 the ring was outside it). */
#save,
#trim-use {
  font-weight: 600;
  border-width: 2px;
  box-shadow: inset 0 0 0 2px var(--chrome), inset 0 0 0 3px var(--edge);
}
#save:disabled { box-shadow: none; }
/* Saving (looks.js, savePicture): the button stays awake, its words pulse slowly. */
.save-label { display: inline-block; }
#save.busy { cursor: progress; }
#save.busy .save-label { animation: save-pulse 0.9s ease-in-out infinite alternate; }
@keyframes save-pulse { to { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { #save.busy .save-label { animation: none; } }

.view-toggle:focus-visible,
.small:focus-visible,
#save:focus-visible,
#shutter:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (pointer: coarse) {
  .small { min-height: 44px; min-width: 44px; }
  .view-toggle, #save { min-height: 44px; }
}

/* ---- Choose a video (the picker) ----
   The page looks the same empty as loaded: two pictures with their controls
   under them. Before anything is chosen (body.empty) the controls are dimmed
   and switched off (`inert`), the right picture says what it's waiting for, and
   the picker is the empty state of the left picture: a panel over it (a phone:
   in the page's flow, since the picture there is too small to hold it). After,
   "Choose a video" brings it back as a layer over the whole clip column (a
   phone: over the whole window), so the <video> under it keeps drawing and a
   running exposure keeps going. */

.browse {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  background: var(--chrome);
}
.browse[hidden] { display: none; }
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  body.browsing:not(.empty) { overflow: hidden; } /* only the layer scrolls */
}
@media (min-width: 860.02px) and (min-height: 520.02px), (min-width: 860.02px) and (pointer: fine), (min-width: 860.02px) and (pointer: none) {
  /* Tighter, so the page fits the window (2026-11-30). */
  :root { --page-end: var(--space); }
  /* A window's first row starts --space from its outline, like its sides. */
  .col-controls > :first-child { margin-top: 0; }
  /* A column wider than its picture (a squarer or tall clip, or a short
     window): the film and the print keep the picture's shape, no taller
     than --pic-h, in the middle of the window. */
  .col-clip .source {
    max-width: calc(var(--pic-h) * var(--ratio, 1.7778)); /* the picture; the film's border is outside it (content-box) */
    margin-left: auto;
    margin-right: auto;
  }
  .col-exposure #exposure {
    width: min(calc(100% - 2 * var(--film-edge)), calc(var(--pic-h) * var(--ratio, 1.7778)));
    margin-left: auto;
    margin-right: auto;
  }
  .col-clip { position: relative; }
  /* Over a clip, it covers the left half; the window's lines already frame it. */
  .browse { position: absolute; z-index: 5; }
  body.browsing #open-browse { visibility: hidden; } /* it's already open */

  /* The empty state: in the left half, under its title, where the film will
     be. The picker is stacked with the picture in one grid cell (not laid over
     it), so it is as tall as the film it stands in for, or taller if it needs
     to be (a narrow window, a wrapped line). Then the row grows. The two
     columns share their rows (subgrid), so the line under the picture runs
     straight across both halves. */
  body.empty .stage { grid-template-rows: auto auto 1fr; }
  body.empty .col { display: grid; grid-template-columns: minmax(0, 1fr); grid-row: span 3; grid-template-rows: subgrid; }
  body.empty .col-clip > .pane { grid-area: 1 / 1; }
  body.empty .col-clip > .picture-actions { grid-area: 2 / 1; }
  body.empty .col-exposure > .picture-actions { align-self: end; }
  /* When the picker makes that row taller, the empty print stays in the middle
     of it, under its message. (In a row of the usual height this changes
     nothing: the two auto margins come to the paper's width.) */
  body.empty .col-exposure > .pane { display: flex; flex-direction: column; }
  body.empty .col-exposure #exposure { flex: none; margin-block: auto; }
  body.empty .browse {
    grid-area: 1 / 1 / 3 / 2; /* the picture's row and the buttons' */
    position: relative;
    margin: calc(var(--title-h) + 1px + var(--space)) var(--space) var(--space);
    border: 0;
    overflow: visible;
    display: flex;
  }
  body.empty .browse-inner { width: 100%; margin: auto 0; padding: var(--row) 0; }
  /* "Pick the part to use" is taller than the film's place (a 1024x768
     window scrolled 215px): it also takes the dimmed controls' room below,
     which has nothing to show yet. */
  body.empty.trimming .browse { grid-area: 1 / 1 / 4 / 2; }
  body.empty.trimming .col-clip > .col-controls { visibility: hidden; }
  /* The film under the picker: unseen, or a hairline of it shows round the
     edge. (opacity, since a hidden <video> can stop drawing.) */
  body.empty .col-clip .source { opacity: 0; }
}
/* The picker is already open, so there's nothing to choose from yet. Hidden,
   not removed: the row keeps its height, level with Save's. */
body.empty .col-clip > .picture-actions { visibility: hidden; }

/* The same --space in from the edge as every window; it also keeps the chosen
   tile's ring from being clipped by the scroll box. */
.browse-inner { padding: var(--space) var(--space) 40px; }
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  .browse-inner { padding: 16px 16px 48px; }
}

.browse-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.browse-bar h2 { font-size: 1.5rem; line-height: 1.1; margin: 0; }
body.empty .browse-bar { display: none; } /* nothing to go back to */

/* Which part of a long video to use (trim.js): while it's asking, the rest of
   the picker steps aside, so it's all there is to look at. */
body.trimming .browse-inner > :not(#trim) { display: none; }
/* The file's name is the panel's heading: plain, one line. */
.trim-name { margin: 0; overflow: hidden; font-size: 1rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.trim-video { display: block; width: 100%; max-height: 36vh; margin-top: var(--row); background: var(--panel); border: 1px solid var(--edge); }
.trim-video[hidden] { display: none; }
/* One bar: the strip of the video's pictures, the part outside the handles
   dimmed, a frame around the part chosen, and two handles. --f and --t are
   where the handles are, 0 to 1 (trim.js). A handle is --knob wide and its
   middle travels from --knob/2 to the bar's width minus that, like any
   slider's, so the frame and the dimming use the same sum. */
.trim-bar {
  --knob: 14px;
  --at-f: calc(var(--knob) / 2 + (100% - var(--knob)) * var(--f, 0));
  --at-t: calc(var(--knob) / 2 + (100% - var(--knob)) * var(--t, 1));
  position: relative;
  height: 52px;
  margin-top: var(--space);
}
.trim-strip {
  position: absolute;
  inset: 4px calc(var(--knob) / 2);
  width: calc(100% - var(--knob));
  height: calc(100% - 8px);
  border-radius: var(--radius-sm);
  background: #333;
}
.trim-chosen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* The dimming either side, then the frame around the part chosen. */
  background: linear-gradient(to right,
    transparent calc(var(--knob) / 2), rgb(0 0 0 / 0.62) calc(var(--knob) / 2),
    rgb(0 0 0 / 0.62) var(--at-f), transparent var(--at-f),
    transparent var(--at-t), rgb(0 0 0 / 0.62) var(--at-t),
    rgb(0 0 0 / 0.62) calc(100% - var(--knob) / 2), transparent calc(100% - var(--knob) / 2));
  background-clip: content-box;
  padding-block: 4px;
}
.trim-chosen::after {
  content: '';
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: var(--at-f);
  right: calc(100% - var(--at-t));
  border-block: 3px solid var(--ink);
}
.trim-bar input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  pointer-events: none; /* only the handles take the pointer */
}
.trim-bar input.on-top { z-index: 1; }
.trim-bar { cursor: grab; touch-action: none; } /* the part chosen slides as one piece (trim.js) */
.trim-bar.dragging { cursor: grabbing; }
.trim-bar input::-webkit-slider-runnable-track { height: 100%; background: none; }
.trim-bar input::-moz-range-track { background: none; }
.trim-bar input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--knob);
  height: 52px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--ink);
  pointer-events: auto;
  cursor: ew-resize;
}
.trim-bar input::-moz-range-thumb {
  width: var(--knob);
  height: 52px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--ink);
  pointer-events: auto;
  cursor: ew-resize;
}
.trim-bar input:focus-visible { outline: none; }
.trim-bar input:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--focus); outline-offset: 2px; }
.trim-bar input:focus-visible::-moz-range-thumb { outline: 3px solid var(--focus); outline-offset: 2px; }
/* The two times, under the bar. */
.trim-times { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; text-align: center; }
.trim-times output { padding: 0 4px; }
.trim .actions { margin-top: var(--space); }
@media (forced-colors: active) {
  .trim-chosen::after { border-color: Highlight; }
  .trim-bar input::-webkit-slider-thumb { background: ButtonText; }
  .trim-bar input::-moz-range-thumb { background: ButtonText; }
}

/* Before anything is chosen: the same layout, with nothing to use yet. The
   windows stay solid; what's in them is dimmed. */
body.empty .col-controls > * { opacity: 0.45; }
/* The clip's controls are a timeline with nothing on it, which looks broken,
   so they're hidden and the space is left blank. (Until 2026-12-04 a faint
   outline of a timeline stood there, two tabs on a groove, with "Your clip's
   timeline appears here" under it.) The exposure's controls stay, dimmed:
   they show what's coming. */
body.empty .col-clip > .col-controls { position: relative; min-height: 96px; }
body.empty .col-clip > .col-controls > * { visibility: hidden; }
body.empty .timeline > :not(.track),
body.empty .overview,
body.empty .zoom,
body.empty .hint { visibility: hidden; }
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  /* A phone: just the picker under the heading. */
  body.empty .browse { position: static; z-index: auto; overflow: visible; }
  body.empty .col-clip > .pane,
  body.empty .col-clip > .picture-actions,
  body.empty .col-clip > .col-controls,
  body.empty .col-exposure { display: none; }
}

/* What the empty exposure says. */
.pane { position: relative; }
.pane-empty {
  display: none;
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 24px;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
body.empty .pane-empty { display: grid; align-content: center; gap: 12px; }
.pane-empty p { margin: 0; }
.pane-empty svg { width: 64px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.6; }

#pick-status { margin: 0 0 var(--row); }
#pick-status:empty { margin: 0; } /* takes no room until a pick didn't work; kept rendered (not display: none), so a screen reader hears it when its text arrives */

/* Your own video (redone 2026-12-04, fewer words): the whole dashed box is
   the file button, an arrow up into a tray and a few words. The dashed line
   is the one the page draws while a file is dragged over it (body.dropping). */
.dropzone { margin: 0 0 var(--space); }
.drop-target {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: clamp(120px, 24vh, 200px);
  padding: var(--space);
  border: 2px dashed var(--edge);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
}
.drop-target:hover { background: var(--raised-in); border-style: solid; }
.drop-target:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop-target.chosen { border-style: solid; box-shadow: inset 0 0 0 1px var(--ink); }
.drop-icon {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (prefers-reduced-motion: no-preference) {
  .drop-target:hover .drop-icon path:first-child,
  body.dropping .drop-icon path:first-child { animation: drop-nudge 0.8s ease-in-out infinite alternate; }
}
@keyframes drop-nudge { to { transform: translateY(-4px); } }
.drop-title { font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
/* "Drop or choose" with a mouse; a touch screen has nothing to drag. */
.drop-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .drop-fine { display: none; }
  .drop-touch { display: inline; }
}
.drop-target .tile-note { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-target .tile-note:empty { display: none; }

/* Under it, the other places to start: Camera and three clips, each a small
   picture with its name under it. A clip's picture is the long exposure it
   makes. */
.sources {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.tile.source-tile { gap: 4px; align-items: stretch; } /* .tile, further down, would put it back to flex-start */
.source-pic {
  display: block;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--panel) center / cover no-repeat;
}
.source-tile:hover .source-pic { box-shadow: 0 0 0 1px var(--ink); }
.source-tile:focus-visible .source-pic { outline: 3px solid var(--focus); outline-offset: 2px; }
.source-tile[aria-pressed="true"] .source-pic { box-shadow: 0 0 0 2px var(--chrome-in), 0 0 0 4px var(--ink); }
.tile.source-tile .tile-title { margin: 0; font-size: 0.9rem; font-weight: 500; text-align: center; }
.source-tile[aria-pressed="true"] .tile-title { font-weight: 700; }
/* Camera isn't a clip, so it isn't a picture: it's a button, drawn like the
   file box above it (a light face, a solid outline, a line icon in the same
   strokes as the arrow). On while the camera is: filled black, like a chosen
   option. (Until 2026-12-04 it was a glowing dot on black, which read as a
   fourth clip.) */
.camera-tile .source-pic { display: grid; place-items: center; background: var(--raised-in); color: var(--ink); }
.camera-tile:hover .source-pic { background: var(--raised); }
.camera-tile[aria-pressed="true"] .source-pic { background: var(--ink); color: var(--on-ink); }
.camera-icon {
  width: 40%;
  max-width: 44px;
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
}

/* ---- Tiles ---- */

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
/* .tile sets display, which would otherwise beat the hidden attribute. */
.tile[hidden] { display: none; }

.tile:focus-visible { outline: none; } /* .source-pic draws its own ring */

.tile-title { margin-top: 6px; font-size: 1rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.tile-note { font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }

.credit { font-size: 0.95rem; overflow-wrap: anywhere; }
.credit a { color: inherit; text-underline-offset: 2px; }
.credit a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; } /* not the browser's thin default */

/* The file picker itself is invisible; the whole card is its label. */
#upload-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* While a file is dragged over the page. */
body.dropping::after {
  content: 'Drop to open';
  position: fixed;
  z-index: 20; /* above Choose a video too */
  inset: 12px;
  display: grid;
  place-items: center;
  border: 3px dashed var(--ink);
  border-radius: var(--radius-lg);
  background: var(--overlay);
  font-size: 1.5rem;
  font-weight: 600;
  pointer-events: none;
}

/* ---- The two pictures ----
   The clip and its exposure, side by side. Both keep the clip's shape;
   16:9 holds the space until it loads. The <video> lies under the frame
   canvas at full size: a video that is hidden or tiny can stop drawing. */
canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto 16 / 9;
  background: var(--panel);
}
/* Two columns: each a picture with its own controls under it. All of it is
   one window: an outline round the four parts, a line between a picture and
   its controls (see Windows, below). */
.stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  box-sizing: border-box; /* the outline is inside the width the header shares */
  border: 1px solid var(--edge);
  background: var(--chrome);
}
.col, .col-controls, .pane { min-width: 0; } /* a wide strip must not stretch the page */
/* Side by side (2026-12-03): the two halves are one height, and a wide line
   runs down the middle, so it's plain there is a left side and a right side.
   The line is the gap between the columns showing the window's background:
   a border on one column would make that column, and its picture, narrower
   than the other. */
@media (min-width: 860.02px) and (min-height: 520.02px), (min-width: 860.02px) and (pointer: fine), (min-width: 860.02px) and (pointer: none) {
  .stage { align-items: stretch; column-gap: var(--divide); background: var(--rule); }
  .col { display: flex; flex-direction: column; background: var(--chrome); }
  .col > .col-controls { flex: 1 0 auto; }
  /* The clip's credit at the bottom of its panel, under everything else
     (2026-12-04; it was right under Sharp). A flex column, so margin-top:
     auto can push it down; its rows don't collapse margins, and none touch. */
  .col-clip > .col-controls { display: flex; flex-direction: column; }
  .col-clip > .col-controls > #credit { order: 1; margin-top: auto; padding-top: var(--row); }
  /* The left half, what goes in, is a shade lighter than the right, what
     comes out (2026-12-04). Setting --chrome here (not just the background)
     keeps its buttons and hovers, which fill with --chrome, the same shade as
     the half they sit in. Wide screens only: on a phone the halves interleave. */
  .col-clip { --chrome: var(--chrome-in); --raised: var(--raised-in); } /* --raised: hover still lighter */
}
:where(.stage) h2 { margin-bottom: 6px; } /* :where: the picker's and trim's own headings win */
.source {
  position: relative;
}
.source video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.source #frame { position: relative; }
/* While the page can't read the film's pixels (Safari, streaming) the clip
   pane shows the <video> itself, cropped to the part being stacked.
   clips.js sets --crop-x/y/w/h as fractions of the video's picture. */
.source.native-video { overflow: hidden; }
.source.native-video #frame { visibility: hidden; }
.source.native-video video {
  inset: auto;
  width: calc(100% / var(--crop-w));
  height: calc(100% / var(--crop-h));
  left: calc(-100% * var(--crop-x) / var(--crop-w));
  top: calc(-100% * var(--crop-y) / var(--crop-h));
}

/* ---- Windows ----
   Each picture has its title in a bar along the top, and its controls under
   it, past a one-pixel line. */
.pane { padding: 0 var(--space) var(--space); }
/* "Choose a video" and Save PNG: between the picture and the line (2026-12-03;
   before, they were the first row under it). */
.stage .picture-actions { margin: 0; padding: 0 var(--space) var(--space); }
/* Save PNG (and Stop here, while it shows) centered under the output (2026-12-04). */
.col-exposure > .picture-actions { justify-content: center; }
/* Choose a video centered under the clip the same way. */
.col-clip > .picture-actions { display: flex; justify-content: center; }
.col-controls { padding: var(--space); border-top: 1px solid var(--edge); }

/* The headings were only for screen readers; here they're the titles. */
#clip-heading,
#exposure-heading {
  position: static;
  width: auto;
  height: var(--title-h);
  overflow: visible;
  clip-path: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 calc(-1 * var(--space)) var(--space);
  padding: 0 8px;
  border-bottom: 1px solid var(--edge);
  font-size: 0.95rem;
  line-height: 1;
  column-gap: 8px;
}
/* An old window's title bar (2026-12-04): fine horizontal lines run across the
   bar, broken in the middle where the title sits on a plain patch. The lines
   are the two pseudo-elements either side of the title's text, so the patch is
   always as wide as the title. */
#clip-heading::before,
#clip-heading::after,
#exposure-heading::before,
#exposure-heading::after {
  content: "";
  flex: 1;
  height: 11px; /* six 1px lines, 1px apart */
  background: repeating-linear-gradient(to bottom, var(--stripe) 0 1px, transparent 1px 2px);
}
/* What the empty exposure says, on the black of the empty picture (10.9:1). */
.pane-empty { top: calc(var(--title-h) + 1px + var(--space)); color: var(--on-black); }
/* Progress over the output picture (2026-12-04): a dark label along the
   picture's bottom, in the middle, with a bar that fills when the message
   says how far along it is. Under it the picture keeps building. The same
   words leave the status line under the clip while they show here. */
.busy-note {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(var(--space) + var(--film-edge) + 10px);
  transform: translateX(-50%);
  z-index: 3;
  max-width: calc(100% - 2 * var(--space) - 2 * var(--film-edge) - 20px);
  width: max-content;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.72);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}
.busy-note > span { display: block; padding: 6px 10px; }
.busy-note.measured::after { /* the bar */
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(var(--done, 0) * 100%);
  height: 3px;
  background: #fff;
}
body.busy .busy-note { display: block; }
body.busy .pane-empty { visibility: hidden; }
body.busy #status { display: none; }
/* Pause and play, in the clip's lower left corner (timeline.js): dark and
   round like the corner labels, over any picture. Above the video, and taking
   clicks even where the clip's window lets touches through (a phone). */
.clip-play {
  position: absolute;
  z-index: 3;
  left: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
}
.clip-play[hidden] { display: none; }
/* The icon is drawn, not a character (fonts drew the pause's two bars as
   one square): two bars while it plays, a triangle while it's paused. */
.clip-play span {
  display: block;
  width: 10px;
  height: 12px;
  margin: auto;
  background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%);
}
.clip-play[aria-pressed="true"] span {
  width: 11px;
  margin-left: calc(50% - 4px); /* a triangle looks centered a little right of center */
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.clip-play:hover { background: rgb(0 0 0 / 0.8); }
.clip-play:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: inset 0 0 0 2px #fff; }
@media (pointer: coarse) {
  .clip-play { width: 44px; height: 44px; left: 4px; bottom: 4px; } /* a finger's size */
}

/* The clip is a strip of negative. The film is painted under a transparent
   border, so the picture inside (and the <video>, which native-video crops
   and positions from the inside edge) is measured exactly as before. */
.col-clip .source {
  border: var(--film-edge) solid transparent;
  background:
    var(--holes) 6px 4px / 20px 9px repeat-x,
    var(--holes) 6px calc(100% - 4px) / 20px 9px repeat-x,
    var(--film);
  background-origin: border-box;
}

/* The exposure is a print. The paper is a shadow, not a border, so the
   canvas's box is still exactly the picture: a click on it places the Rings
   and Fan center. The top margin leaves the same --space under the title as
   the film has. */
#exposure {
  width: calc(100% - 2 * var(--film-edge));
  margin: calc(var(--film-edge) + var(--space)) var(--film-edge) var(--film-edge);
  box-shadow: 0 0 0 var(--film-edge) var(--paper);
}
/* On a narrow screen: the clip, then the clip's controls with the shutter right
   under it, then the exposure (still in view while the shutter is held), then
   its look and brightness. The clip's controls come apart (display: contents)
   so the shutter can come before the status and the how-to. The credit stays
   with the clip, as on a wide screen (2026-10-20; it was at the very end,
   where it moved whenever the look's settings changed height). */
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  .stage { grid-template-columns: 1fr; row-gap: 0; }
  .col { display: contents; }
  .col-clip > .pane { order: 1; }
  .col-clip > .col-controls { display: contents; }
  .col-clip > .col-controls > * { order: 6; } /* status and the how-to: just under the shutter */
  .col-clip > .picture-actions { order: 2; }
  .col-clip > .col-controls > .timeline { order: 3; }
  .col-clip > .col-controls > .timeline-foot { order: 4; }
  .col-clip > .col-controls > .actions { order: 5; }
  .col-exposure > .pane { order: 7; margin-top: var(--row); }
  .col-exposure > .picture-actions { order: 7; } /* after its picture: same number, later in the page */
  .col-exposure > .col-controls { order: 8; }

  /* A phone: one column, so no line down the middle. The pictures' titles
     become bars across the window, dividing it into Clip and Exposure. */
  .stage { padding: 0 var(--space) var(--space); }
  .col-controls,
  .pane { padding: 0; border: 0; }
  .stage .picture-actions { margin-top: var(--row); padding: 0; }
  #clip-heading,
  #exposure-heading { margin: 0 calc(-1 * var(--space)) var(--space); border-top: 1px solid var(--edge); }
  .col-clip > .pane { margin-top: -1px; } /* its top line is the window's own */

  /* Before a clip is chosen, the picker is all a phone shows, so it gets the
     title bar the Clip window would have had: "Choose a video". Its Back
     button has nothing to go back to. */
  body.empty .browse-bar {
    display: flex;
    justify-content: center;
    height: var(--title-h);
    margin: -1px calc(-1 * var(--space)) var(--space); /* its top line is the window's own */
    border-block: 1px solid var(--edge);
  }
  body.empty .browse-bar h2 { font-size: 0.95rem; }
  /* The same lines as the Clip and Exposure bars. */
  body.empty .browse-bar { align-items: center; column-gap: 8px; padding: 0 8px; }
  body.empty .browse-bar::before,
  body.empty .browse-bar::after {
    content: "";
    flex: 1;
    height: 11px;
    background: repeating-linear-gradient(to bottom, var(--stripe) 0 1px, transparent 1px 2px);
  }
  body.empty #close-browse { display: none; }
  body.empty .browse-inner { padding: 0 0 4px; }
}

/* A phone on its side (2026-12-01): the screen is about 375px tall, and a
   picture as wide as the page was taller than that, so the picture and its
   timeline were never in view together. Each picture is held to under half the
   window's height, centered, the way a wide screen holds a squarer clip. */
@media (max-width: 860px) and (max-height: 520px), (max-height: 520px) and (pointer: coarse) {
  :root { --head-h: 34px; } /* too little height here for more */
  header.site h1 { font-size: 1.2rem; }
}

/* ---- A phone: one frame, the video over its output (2026-12-04) ----
   The clip and its long exposure share one picture, pinned at the top of the
   screen, and the controls scroll under it. The output is underneath; the
   video is laid exactly over it and cut off at a line (--wipe, 0 to 1 across
   the picture: video to the left of it, output to the right). Drag sideways
   on the picture to move the line, press and hold to see the whole video,
   double-tap to go between the whole output and half and half (app.js,
   "one frame"). The line stays put while the timeline's tabs move. A vertical drag still scrolls (touch-action: pan-y).
   The two pictures must line up to the pixel, so here they lose their own
   frames (the film's edge, the print's border) and sit in one dark band.
   A pinned (sticky) grid item can only move within its own grid row, so the
   stage is a flex row that wraps here: each part is a whole line. app.js
   measures the frame (--clip-pane-h, --viewer-h). */
@property --wipe { syntax: '<number>'; inherits: true; initial-value: 0.5; }
.wipe { display: none; } /* the line: a phone only */
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  body:not(.empty) {
    --vpic-h: max(140px, 48svh - 40px); /* svh: with the browser's bars showing */
    /* The band's inside width: the window less the page's 16px sides and the
       window's 1px outline (and, on its side, the panel less its 12px sides).
       A length, not a %, so the picture, its label and the line agree. */
    --band-w: calc(100vw - var(--scrollbar, 0px) - 34px - 2 * var(--space)); /* --scrollbar: app.js */
    --pic-w: min(var(--band-w), calc(var(--vpic-h) * var(--ratio, 1.7778)));
    --band-pad: 8px;    /* the band's black above and below the picture */
    --label-inset: 6px; /* the corner labels, in from the picture's edge */
  }
  html:has(body:not(.empty)) { scroll-padding-top: calc(var(--viewer-h, 0px) + var(--row)); }
  body:not(.empty) .stage { display: flex; flex-wrap: wrap; align-items: flex-start; transition: --wipe 0.22s ease-out; }
  body.wiping .stage { transition: none; } /* under a finger: no lag */
  @media (prefers-reduced-motion: reduce) { body:not(.empty) .stage { transition: none; } }
  body:not(.empty) .col > *,
  body:not(.empty) .col-clip > .col-controls > * { flex: 1 1 100%; min-width: 0; box-sizing: border-box; } /* shrinks: the timeline has side margins */
  body:not(.empty) .col-clip > .col-controls > .visually-hidden { flex: none; }

  /* The band: the output's window, dark, across the whole window's width. */
  body:not(.empty) .col-clip > .pane,
  body:not(.empty) .col-exposure > .pane {
    position: sticky;
    top: 0;
    margin: 0 calc(-1 * var(--space));
    padding: var(--band-pad) var(--space);
  }
  body:not(.empty) .col-exposure > .pane {
    order: 1;
    z-index: 4; /* over the controls, under the picker (10) */
    margin-top: calc(-1 * var(--clip-pane-h, 0px)); /* under the video, in the same place */
    background: var(--film);
    touch-action: pan-y pinch-zoom; /* sideways is the wipe's; up and down still scrolls, two fingers still zoom */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none; /* a long press is ours, not the "save image" menu */
  }
  /* The video's window: see-through, over the output, and not where a finger
     lands (the band under it takes the gestures). */
  body:not(.empty) .col-clip > .pane { z-index: 5; pointer-events: none; }
  /* The titles are for screen readers again; the labels below say it. */
  body:not(.empty) #clip-heading,
  body:not(.empty) #exposure-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  /* The two pictures: the same width, in the middle, no frames of their own. */
  body:not(.empty) .col-clip .source {
    width: var(--pic-w);
    max-width: none; /* (the older on-its-side cap of 46vh) */
    margin: 0 auto;
    border: 0;
    background: var(--film);
    clip-path: inset(0 calc((1 - var(--wipe)) * 100%) 0 0); /* the video, as far as the line */
  }
  body:not(.empty) #exposure {
    width: var(--pic-w);
    margin: 0 auto;
    box-shadow: none;
  }
  /* What each side is, in a corner: the video's is cut off with it. */
  body:not(.empty) .col-clip .source::after,
  body:not(.empty) .col-exposure > .pane::after {
    position: absolute;
    top: var(--label-inset);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    background: rgb(0 0 0 / 0.6);
    color: #fff;
    font-size: 0.6875rem; /* 11px; rem, so it grows with a larger browser font */
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.04em;
    pointer-events: none;
  }
  body:not(.empty) .col-clip .source::after { content: 'Video'; left: var(--label-inset); }
  /* Output in the opposite corner, so the two never meet on a narrow (tall) clip. */
  body:not(.empty) .busy-note { /* in the video's window here (core.js) */
    z-index: 7; /* over the wipe's line */
    bottom: 40px; /* above the Output label */
    max-width: calc(var(--pic-w) - 24px);
  }
  body:not(.empty) .col-exposure > .pane::after {
    content: 'Output';
    top: auto;
    bottom: calc(var(--band-pad) + var(--label-inset));
    right: calc(50% - var(--pic-w) / 2 + var(--label-inset));
  }
  /* The line, and its handle: a slider for the keyboard and screen readers.
     It lives in the video's window (above the video; that window lets every
     other touch through to the band) and takes touches itself. */
  body:not(.empty) .wipe {
    display: block;
    pointer-events: auto;
    touch-action: pan-y pinch-zoom;
    position: absolute;
    z-index: 6;
    top: var(--band-pad);
    bottom: var(--band-pad);
    left: calc(50% - var(--pic-w) / 2 + var(--wipe) * var(--pic-w));
    width: 44px; /* a finger's width, centered on the line */
    margin-left: -22px;
    padding: 0;
    border: 0;
    background: none;
    cursor: ew-resize;
  }
  body:not(.empty) .wipe::before { /* the line */
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 21px;
    width: 2px;
    background: #fff;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.6); /* darker: it was faint over a white picture */
  }
  body:not(.empty) .wipe::after { /* the knob */
    content: '‹ ›';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.875rem; /* 30px, in rem with its glyph: a larger browser font grows both */
    height: 1.875rem;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.45);
    color: #111;
    font: 600 0.875rem/1.875rem var(--font);
    text-align: center;
    letter-spacing: 0.1em;
  }
  /* Blue with white inside it: the blue alone was 3:1 on the black band. */
  body:not(.empty) .wipe:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; box-shadow: inset 0 0 0 5px #fff; }
  body.peeking .wipe { opacity: 0; } /* holding to see the video: just the video */
  body.browsing .wipe { visibility: hidden; } /* under the picker: not one more stop for Tab */

  /* The controls under the frame: the clip's, then a line, then the output's. */
  body:not(.empty) .col-clip > .picture-actions { margin-top: var(--space); }
  /* Choose a video on the left edge, with the timeline and the labels. */
  body:not(.empty) .col-clip > .picture-actions { justify-content: flex-start; }
  body:not(.empty) .col-exposure > .picture-actions {
    margin-top: var(--space);
    padding-top: var(--space);
    border-top: 1px solid var(--edge);
  }
}
/* On its side: the frame is a dark panel down the left half of the screen,
   fixed (a pinned column was pushed up at the end of the page), the picture
   in its middle; the heading and the controls scroll on the right. */
@media (max-width: 860px) and (max-height: 520px), (max-height: 520px) and (pointer: coarse) {
  body:not(.empty) { --vpic-h: calc(100svh - 24px); --lane: 50vw; --band-w: calc(var(--lane) - 24px); }
  html:has(body:not(.empty)) { scroll-padding-top: 0; }
  body:not(.empty) header.site,
  body:not(.empty) main { padding-left: calc(var(--lane) + 16px); }
  body:not(.empty) .col-clip > .pane,
  body:not(.empty) .col-exposure > .pane {
    position: fixed;
    left: 0;
    width: var(--lane);
    margin: 0;
    box-sizing: border-box;
    padding: 8px 12px;
  }
  /* The band fills the panel; the video's window is centered on the same middle. */
  body:not(.empty) .col-exposure > .pane { top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; }
  body:not(.empty) .col-clip > .pane { top: 50%; transform: translateY(-50%); }
  body:not(.empty) .col-exposure > .pane::after { bottom: calc(50% - var(--pic-w) / var(--ratio, 1.7778) / 2 + 6px); }
}

/* A film has no shutter: its white tabs choose the frames and the exposure
   follows them. Only the camera has one. */
body:not(.live) .col-clip > .col-controls > .actions { display: none; }

/* ---- Live camera ----
   With the camera, there's no clip to mark: the
   timeline and its controls step aside. The camera's preview is mirrored,
   like a mirror, and so is its exposure (camera.js flips it), so the picture
   matches what you saw. */

.live-hint { display: none; }
body.live .live-hint { display: block; }
body.live #timeline,
body.live #overview,
body.live .frames-row { display: none; }
body.live.mirror #frame { transform: scaleX(-1); }

/* ---- Timeline ---- */

.timeline {
  position: relative;
  height: 64px;
  margin: var(--row) 8px 0; /* 8px: half a white tab, so a tab at either end lines up with the buttons */
  cursor: grab; /* the stretch moves as a whole, as well as by its tabs */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.track,
.span {
  position: absolute;
  top: 21px;
  height: 6px;
}

/* The track is a groove: white, outlined, the span sitting in it. */
.track { left: 0; right: 0; top: 19px; height: 8px; border: 1px solid var(--edge); background: var(--well); }
.span { background: var(--ink); }

/* Where the movement is (2026-10-19): a faint curve rising from the track's
   top edge, a light gray a shade darker than the window, so it reads as
   the track swelling where things happen rather than as a chart. The span
   and the tabs sit on top. timeline.js draws it (drawMotion) in `color`. */
.motion {
  position: absolute;
  left: 0;
  top: 5px;
  width: 100%;
  height: 14px; /* down to the track's top edge */
  pointer-events: none;
  color: var(--swell);
  background: transparent; /* not the black every canvas gets (see `canvas` below the picker) */
}

/* The two tabs are handles: a gray tab, outlined, with a grip line in it. */
.mark {
  position: absolute;
  top: 4px;
  box-sizing: border-box;
  width: 16px;
  height: 40px;
  margin-left: -8px;
  background: var(--chrome);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  cursor: ew-resize;
}
.mark::after {
  content: '';
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
}

.mark:focus-visible,
.span:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
/* The tab is 16px wide to look slim, but its grab area is 26px (a finger or a
   shaky pointer can find it; 24px is the least the WCAG 2.2 target-size rule
   asks for). The extra is invisible and part of the tab: a press on it is a
   press on the tab. */
.mark::before {
  content: '';
  position: absolute;
  inset: -4px -6px;
}
@media (pointer: coarse) {
  .mark::before { inset: -4px -14px; }
}

/* Time labels under the track. */
.ticks { position: absolute; left: 0; right: 0; top: 42px; height: 20px; pointer-events: none; }
.tick {
  position: absolute;
  top: 0;
  padding-left: 4px;
  border-left: 1px solid var(--edge);
  font-size: 0.85rem;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* How long the shutter is open, at the right end of the time labels (which
   stop short of it: see drawTicks in timeline.js). Tabular digits, so it holds
   still as a tab moves. */
.span-readout {
  position: absolute;
  right: 0;
  top: 42px;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

/* ---- Zoom ---- */

.transport { align-items: center; gap: 8px 16px; }

/* The row under the timeline: the overview (when zoomed in) and the + and −,
   small here (44px on a touch screen, from .small). Gone when both are. */
.timeline-foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.timeline-foot:not(:has(> :not([hidden]))) { display: none; }
body.live .timeline-foot { display: none; } /* the camera has no timeline */
.timeline-foot > .overview { flex: 1; min-width: 0; margin: 0 0 0 8px; }
.timeline-foot .small { min-width: 30px; min-height: 26px; padding: 0 8px; font-size: 1rem; }
@media (pointer: coarse) { .timeline-foot .small { min-width: 44px; min-height: 44px; } }

/* The whole clip in miniature. */
.overview {
  position: relative;
  height: 16px;
  margin: 4px 8px 0;
  box-sizing: border-box;
  border: 1px solid var(--edge);
  background: var(--well);
  cursor: pointer;
  touch-action: none;
}
.overview[hidden] { display: none; }
@media (pointer: coarse) { .overview { height: 28px; } } /* a finger's drag, not 16px */
/* The whole clip's movement, behind the span and the window. */
.ov-motion { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: var(--swell); background: transparent; }
.ov-span { position: absolute; top: 4px; bottom: 4px; background: var(--muted); }
.ov-window {
  position: absolute;
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  min-width: 6px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
}

.hint { margin: 4px 0 0; max-width: 62ch; font-size: 0.95rem; color: var(--muted); }
body.recorded .hint { display: none; } /* a how-to is for before the first time you use the shutter */
/* The long-span note belongs to a chosen clip, not the camera or an empty page. */
body.live #span-note, body.empty #span-note { display: none; }



/* ---- Exposure controls ----
   Each is a row: its name, then its choices as segments. The radio is
   still a real radio (it's what the keyboard and screen readers use); it's
   hidden and its label is drawn as the segment. The segments are one joined
   bar, equal widths, so a row reads as one choice; the chosen one is filled
   black. */

.looks {
  display: flex;
  align-items: center;
  min-inline-size: 0; /* a fieldset is as wide as its contents by default; let the bar shrink */
  margin: var(--space) 0 0;
  padding: 0;
  border: 0;
}

.looks label {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 auto; /* shared out by word length, so Diagonal gets more than Fan */
  min-width: 0;
  min-height: 40px;
  padding: 3px 4px;
  align-items: center;
  text-align: center;
  border: 1px solid var(--edge);
  line-height: 1.15;
  cursor: pointer;
}
.looks label + label { margin-left: -1px; } /* neighbors share one line */
.looks label:first-of-type { border-radius: var(--radius) 0 0 var(--radius); }
.looks label:last-of-type { border-radius: 0 var(--radius) var(--radius) 0; }
.looks label:hover,
.looks label:has(input:checked),
.looks label:has(input:focus-visible) { z-index: 1; } /* its outline on top of its neighbors' */
.looks label:hover { background: var(--raised); border-color: var(--ink); }
.looks label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.looks label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.looks input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }


@media (pointer: coarse) {
  .looks label { min-height: 44px; }
}
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  .looks label { font-size: 0.95rem; padding: 3px 2px; } /* Cut's five words fit at 390px */
}

/* ---- The looks, as thumbnails ----
   Each look is a small picture of this exposure in that look (looks.js draws
   them from a shrunk copy of the exposure), its name under it, the chosen
   one outlined. One row of equal columns, however many looks are shown, so
   the first starts and the last ends on the window's lines (2026-12-03;
   before, three looks sat in a grid of four, leaving the last column empty).
   The radio is still a real radio, hidden over its label. */
.thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--row);
  margin: var(--row) 0 0;
  padding: 0;
  border: 0;
}
.thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  cursor: pointer;
}
/* The ring is the canvas's own border, so a chosen thumbnail doesn't stick
   out past the line. The width fills the column, unless that would make it
   taller than the page's height allows (see --pic-h). */
.thumb canvas {
  box-sizing: border-box;
  width: min(100%, calc(var(--pic-h) * 0.36 * var(--ratio, 1.7778)));
  height: auto;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--panel);
  background-clip: content-box;
}
.thumb:hover canvas { border-color: var(--soft); }
.thumb:has(input:checked) canvas { border-color: var(--ink); }
.thumb:has(input:focus-visible) canvas { border-color: var(--focus); outline: 2px solid var(--focus); } /* 3px with the border, like the other rings */
.thumb[hidden], .slot-group[hidden] { display: none; } /* the looks put away (SHOWN_LOOKS in core.js) */
.thumb input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }
.thumb span { max-width: 100%; font-size: 0.95rem; line-height: 1.2; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb:has(input:checked) span { color: var(--ink); font-weight: 600; }

/* ---- This look's settings ----
   One slot under Brightness holds the chosen look's own controls (Camera for
   Silk, Sparkle, Ink and Comet; Exposures and Blend for Multi exposure;
   Slices, Cut and Edges for Slices; nothing for Poof and Heat), titled by
   the look. Every group sits in the same grid cell. The ones not in use are
   invisible and take no height (2026-10-20), so the window ends right after
   the chosen look's settings, with no empty gray under them. They still hang
   below it, invisible, on the desk: the page stays as tall as the tallest
   group needs, so it doesn't jump or pull the scroll when the look changes. */
.look-slot { margin-top: var(--row); }
.look-slot.empty { visibility: hidden; } /* nothing to set (updateSlot): no title over nothing */
/* The look's name over its own settings: a heading with a rule, so it reads as
   the title of what's under it and not as a stray word. */
.slot-title {
  margin: 0;
  padding-top: var(--row);
  border-top: 1px solid var(--edge);
  font-weight: 600;
  color: var(--ink);
}
.slot-groups { display: grid; }
.slot-group { grid-area: 1 / 1; min-width: 0; }
.slot-group.off { visibility: hidden; pointer-events: none; height: 0; } /* its contents overflow, unseen */
/* The page's length counts what overflows, but not the padding that would
   come after it: the window's bottom (--space padding, 1px outline) and the
   page's end. Without this the page grew shorter when a smaller group was
   chosen, and the browser pulled the scroll and the thumbnails up. */
.slot-group.off::after { content: ''; display: block; height: calc(var(--space) + 1px + var(--page-end)); }
.slot-none { margin: 16px 0 0; color: var(--muted); }

/* Brightness: label, slider, value in three columns. */
.sliders {
  display: grid;
  grid-template-columns: 6.5em minmax(64px, 1fr) 6em; /* one name width and one value width, so every track starts and ends on the same two lines, in both windows, and values end at the window's right-hand line */
  align-items: center;
  gap: 8px 12px;
  margin-top: var(--row);
}
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  .sliders { grid-template-columns: 6.5em minmax(64px, 1fr) auto; }
}
@media (max-width: 360px) {
  /* The smallest phones: a narrower label column and values that take only the room they need. */
  .sliders, .sliders[class] { grid-template-columns: 5.5em minmax(48px, 1fr) auto; gap: 8px; }
}
.sliders label, .sliders .row-name { font-weight: 600; }
/* Multi exposure's Blend, Camera, Slices' Cut and Edges: segments where a slider and
   its value would be. */
.sliders .blend-mode, .sliders .move-mode, .sliders .cut-mode, .sliders .edge-mode { grid-column: 2 / -1; margin: 0; }
.sliders .blend-mode label, .sliders .move-mode label, .sliders .cut-mode label, .sliders .edge-mode label { font-weight: inherit; min-height: 32px; }
@media (pointer: coarse) {
  .sliders .blend-mode label, .sliders .move-mode label, .sliders .cut-mode label, .sliders .edge-mode label { min-height: 44px; }
}
/* Center X and Y on one row, where a slider and its value would be: X, its
   slider, its value, then the same for Y. A phone stacks them, X over Y. */
.center-pair {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) 2.6em auto minmax(40px, 1fr) 2.6em;
  align-items: center;
  gap: 8px;
}
.sliders .center-pair output { min-width: 0; }
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  .center-pair { grid-template-columns: auto minmax(40px, 1fr) 2.6em; }
}
/* Slices in Rings or Fan: a click on the exposure puts the center. */
body.aiming #exposure { cursor: crosshair; }
.sliders output { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.sliders[hidden] { display: none; } /* (the grid above would otherwise win over `hidden`) */
.sliders.off { visibility: hidden; } /* out of use but still taking its room (the Slices count with Soft edges) */
.frames-row output { min-width: 5.5em; } /* "every frame", "every 12th": the value must not squeeze the slider */
.flash-row output, .slices-row output, #move-amount-row output { min-width: 4.5em; }
.sharp-row output { min-width: 3em; } /* "off" to "100%" */
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  /* A phone: every slider's value gets the same width, so every track starts
     and ends in the same place (Frames' was shorter than Brightness' and Sharp's). */
  .sliders output { min-width: 5.5em; }
}
@media (max-width: 360px) { .sliders output, .frames-row output, .flash-row output, .slices-row output, #move-amount-row output, .sharp-row output { min-width: 0; } }
/* A phone (2026-12-01): a slider gets the row's full width. Its name and value
   share a line above it, and the track runs the whole way under them. Side by
   side, the name and the value left the track about 85px at 375px and 70px at
   320px, too short to set a value with a thumb, and every row's track was a
   different length. The rows of segments (Camera, Cut, Edges, Poses) and the
   Center pair keep their layout; Cut takes the full width too, since its five
   words did not fit in the part left of the name (they ran together at 320px). */
@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  .sliders:has(> input[type="range"]) {
    grid-template-columns: 1fr auto;
    gap: 0 12px;
  }
  .sliders:has(> input[type="range"]) > label { grid-area: 1 / 1; }
  .sliders:has(> input[type="range"]) > output { grid-area: 1 / 2; min-width: 0; text-align: right; }
  .sliders:has(> input[type="range"]) > input[type="range"] { grid-area: 2 / 1 / 3 / -1; width: 100%; height: 36px; }
  /* Every row of segments goes under its name too, the way a slider does
     (2026-12-04: Camera's Twirl ran 9px past a 320px window). */
  .sliders .cut-mode, .sliders .move-mode, .sliders .blend-mode, .sliders .edge-mode { grid-column: 1 / -1; margin-top: 4px; }
  .looks label { min-width: 44px; } /* Fan was about 25px wide */
  /* An effect's name wraps onto a second line rather than being cut off
     ("Multi expos…" at 320px). */
  .thumb span { white-space: normal; text-align: center; text-wrap: balance; }
}
.sliders input[type="range"] { accent-color: var(--ink); height: 28px; margin: 0; }
/* The track, drawn here: the browser's own is a pale gray that nearly vanishes
   on the window (about 1.3:1). A white groove with an outline, like the
   timeline's, and a round knob in the ink color. */
.sliders input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; }
.sliders input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: var(--well); border: 1px solid var(--edge); border-radius: var(--radius); }
.sliders input[type="range"]::-moz-range-track { height: 6px; background: var(--well); border: 1px solid var(--edge); border-radius: var(--radius); }
.sliders input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--ink); border: 2px solid var(--chrome); box-shadow: 0 0 0 1px var(--ink); }
.sliders input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); border: 2px solid var(--chrome); box-shadow: 0 0 0 1px var(--ink); }
.sliders input[type="range"]::-moz-range-progress { height: 6px; background: var(--swell); border-radius: var(--radius); }
.sliders input[type="range"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; } /* the browser's own ring is orange */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--row);
  margin-top: var(--row);
}

/* ---- The shutter ----
   Black and filled while it waits, red while it's open. The width is fixed
   so the label changing (Hold to record / Recording… / Release to stop /
   Tap to stop / Cancel) never moves anything. */

#shutter {
  flex: 1 1 12em; /* the one big thing in its column */
  min-height: 52px;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 8px 28px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--on-ink);
  cursor: pointer;
  /* Held down to record: no long-press menu, no text selection, no panning. */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
#shutter:hover:not(:disabled) { background: var(--muted); border-color: var(--muted); } /* light: #3d3d3d, white on it 12:1; dark: #c6c6c6, black on it 12:1 */
#shutter.recording,
#shutter.recording:hover { background: var(--red); border-color: var(--red); color: var(--on-red); }
#shutter.recording::before {
  content: '';
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 0.5em;
  border-radius: 50%;
  background: currentColor;
}
#shutter:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 860px), (max-height: 520px) and (pointer: coarse) {
  #shutter { min-height: 56px; }
}

.readout {
  margin: 8px 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* The status starts a new row; the credit and the how-to are more lines of
   the same text. */
#status { margin-top: var(--row); }
#status:empty { margin: 0; }
#credit { margin-top: 4px; }

/* A finger's 44px (2026-12-04) for what was still smaller on a touch screen:
   the sliders (28px, 36px on a phone), the own-video card wider than a phone
   (40px), and the credit's link (18px: its line grows to hold it). */
@media (pointer: coarse) {
  /* Taller than the fit-the-window budget counted on: the picture gives up
     the difference (measured 22px at 1180×820, an iPad on its side). */
  :root { --touch-extra: 24px; }
  .sliders input[type="range"],
  .sliders:has(> input[type="range"]) > input[type="range"] { height: 44px; }
  .credit a { display: inline-block; max-width: 100%; padding-block: 13px; }
}

/* Windows High Contrast (forced colors, 2026-12-04). That mode paints every
   background in the system's own Canvas color and drops box shadows, so what
   says "chosen" by a fill or a shadow vanished: the chosen look and segment,
   the stretch on the timeline and the overview, the chosen clip. They take
   the system's Highlight instead, which the mode keeps. */
@media (forced-colors: active) {
  .looks label:has(input:checked) {
    forced-color-adjust: none;
    background: Highlight;
    border-color: Highlight;
    color: HighlightText;
  }
  .span, .ov-span { forced-color-adjust: none; background: Highlight; }
  .thumb canvas { border-color: Canvas; }
  .thumb:has(input:checked) canvas { border-color: Highlight; }
  .source-tile[aria-pressed="true"] .source-pic, #upload-tile.chosen { outline: 3px solid Highlight; outline-offset: 2px; }
  /* The phone's divider: its line and knob are a background and a shadow,
     which this mode drops. */
  body:not(.empty) .wipe::before { forced-color-adjust: none; background: CanvasText; box-shadow: none; }
  body:not(.empty) .wipe::after { forced-color-adjust: none; background: Canvas; color: CanvasText; outline: 2px solid CanvasText; box-shadow: none; }
  .clip-play { forced-color-adjust: none; background: Canvas; color: CanvasText; outline: 2px solid CanvasText; }
  /* The tabs' grip line and the progress bar are backgrounds, which this mode drops. */
  .mark::after, .busy-note.measured::after { forced-color-adjust: none; background: CanvasText; }
  .busy-note { forced-color-adjust: none; background: Canvas; color: CanvasText; outline: 1px solid CanvasText; }
}
