/* The look of the pages the API serves, in the site's identity: the privacy notice, the page for
   joining, a video's page, and the small error pages. Their words and their routes stay the API's;
   this file is only the look. Its address is stable (/styles/page.css): a template names it.

   Made for those pages' rules:
   - no script, and nothing here needs one;
   - nothing from another origin and no data: URL (the policy is style-src, font-src and img-src 'self');
   - no inline style: every state is a class;
   - the page reads right without this file: plain markup first (header, main, h1, h2, p, ul, footer),
     the classes on top. A body with class "page" and no other class already gets the type, the
     column and the colours;
   - a name can be long, right-to-left or an emoji: nothing depends on a name's width.

   Link, in this order:  /styles/fonts.css  /styles/tokens.css  /styles/page.css
   The colours and the face are the tokens' (tokens.css); each has its value here too, so the page
   keeps its look if that file is missing.

   The classes, all optional:
     body.page                      the shell
     header.page__bar > a.brand     the bar: the icon (img) and the name, linking to "/"
     main.page__main                the column; --centre sets a short page in the middle (join, errors)
     .label  .lead  .meta           a small line over a title (not shown as main's first line under the bar,
                                    where it would say the bar's name again); a first paragraph; a quiet line
     .button  --main  --block       a link or a button as a button, 48px high; the one main action; full width
     .stage                         the dark frame round a video
     .people > li > .state  --in    who is in, each with a state; --in marks a video that arrived
     .note                          a line on a surface (your video has arrived)
     .offer                         the premium offer, a card that ends in its one form button (the page's
                                    main action): an h2, p.offer__price (the amount, then a span with what
                                    it is for), ul.checks (any number of items), a payer's line if there is
                                    one (a p after the list, with or without .note), then the form. A card
                                    of one sentence and the form looks finished too
     p.own > a.button               "Make your own video", over the offer: as wide as the column at every
                                    width and as high as the main button, outlined, with an arrow
     footer.page__foot              the foot row: a link a page of the site's own (the notice, the imprint,
                                    the terms), then the domain as a span, at the row's end */

.page {
  --bg: var(--p-bg, #ffffff); --surface: var(--p-surface, #f4f4f4); --ink: var(--p-ink, #111111); --muted: var(--p-muted, #6b6b6b);
  --accent: var(--p-accent, #1a4be0); --accent-ink: var(--p-accent-ink, #ffffff);
  --dark: var(--p-inv-bg, #111111); --dark-ink: var(--p-inv-ink, #ffffff); --dark-muted: var(--p-inv-muted, #9a9a9a);
  --line: color-mix(in oklab, var(--ink) 11%, transparent); --line-strong: color-mix(in oklab, var(--ink) 20%, transparent);
  --face: var(--font-text, "Onest", system-ui, sans-serif); --display: var(--font-display, "Onest", system-ui, sans-serif);
  --side: 24px; --col: 40rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--p-bg, #ffffff); }
body.page {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; margin: 0;
  background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--face); overflow-wrap: break-word;
}

/* ---- the column: main, or the body's own children when a page has no main */
.page__main, body.page > :not(header, main, footer, script, style) {
  width: min(100% - 2 * var(--side), var(--col)); margin-inline: auto;
}
.page__main { flex: 1; padding-block: 48px 64px; }
.page__main--centre { display: flex; flex-direction: column; justify-content: center; --col: 28rem; }
body.page > :not(header, main, footer):first-child { margin-top: 48px; }
body.page > :not(header, main, footer):last-child { margin-bottom: 64px; }

/* ---- type */
.page h1, .page h2, .page h3 { margin: 0; font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; text-wrap: balance; }
.page h1 { font-size: clamp(32px, 6.2vw, 44px); line-height: 1.08; }
.page h2 { margin-top: 40px; font-size: 24px; line-height: 1.2; }
.page h3 { margin-top: 24px; font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 500; }
.page p, .page ul, .page ol { margin: 16px 0 0; }
.page h1 + p { margin-top: 20px; }
.page h2 + p, .page h3 + p { margin-top: 10px; }
.page .lead { font-size: 18px; line-height: 1.55; }
.page .label { margin: 0 0 6px; font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--muted); }
/* the bar already says the product's name: a label that opens the column under it would say it twice */
.page__bar + .page__main > .label:first-child { display: none; }
.page .meta { font-size: 14px; color: var(--muted); }
.page a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.page a:hover { text-decoration-color: currentColor; }
.page :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- the bar and the foot */
.page__bar { display: flex; align-items: center; min-height: 56px; padding-inline: var(--side); border-bottom: 1px solid var(--line); }
.page .brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 600 20px/1 var(--display); letter-spacing: -0.035em; text-decoration: none; }
.page .brand > img { width: 28px; height: 28px; border-radius: 50%; }
/* the foot: its links side by side from the row's start, the domain at its end; where the row is
   too narrow for all of them the domain takes the next line */
.page__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; min-height: 56px; padding: 8px var(--side); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.page__foot a { display: inline-flex; align-items: center; min-height: 48px; color: var(--ink); }
.page__foot > span { flex: 1 0 auto; text-align: end; }

/* ---- a button: a link to the chat, a download, the offer's one form button */
.page .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 8px; padding: 10px 24px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink);
  font: 500 16px/1.25 var(--face); text-align: center; text-decoration: none; cursor: pointer;
}
.page .button:hover { border-color: var(--ink); }
.page .button--main { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.page .button--main:hover { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 86%, var(--ink)); }
.page .button--block { display: flex; width: 100%; }
.page form { margin: 16px 0 0; }

/* ---- a video in its dark frame */
/* The frame's dark ground lies one pixel inside its edge, and the film has no ground of its own:
   a ground cut on the same round corner as the film shows as a thin dark line along the corners of
   a light picture. The ground is there for the bars beside a film of another shape. */
.page .stage { position: relative; display: grid; margin-top: 24px; overflow: hidden; border-radius: 16px; color: var(--dark-ink); }
.page .stage::before { content: ""; position: absolute; inset: 1px; border-radius: 15px; background: var(--dark); }
.page .stage > video { position: relative; }
.page .stage > video, .page video { display: block; width: 100%; height: auto; max-height: 80vh; }
.page :not(.stage) > video { margin-top: 24px; border-radius: 16px; }

/* ---- who is in */
.page .people { margin-top: 12px; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.page .people > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 56px; padding-block: 8px; border-top: 1px solid var(--line); font-weight: 500; }
.page .state { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; font-weight: 400; color: var(--muted); }
.page .state--in { color: var(--ink); }
/* the tick, drawn: two sides of a small box turned 45 degrees */
.page .state--in::before, .page .checks > li::before {
  content: ""; flex: none; width: 6px; height: 11px; margin: 0 3px 3px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---- a note and the offer */
.page .note { margin-top: 24px; padding: 16px; border-radius: 16px; background: var(--surface); }
/* The offer is a card that ends in its button: its name, its price with what the price is for, what
   it adds as a ticked list of any length, then the page's one main action across the card's foot.
   A payer's line (a payment under way, one that did not go through) stands above the button on the
   page's own ground, so it reads apart from the card's grey. */
.page .offer { margin-top: 32px; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.page .offer > :first-child { margin-top: 0; }
.page .offer > h2, .page .offer > h3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 500; }
.page .offer__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 4px; font: 400 28px/1.1 var(--display); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.page .offer__price > span { font: 400 14px/1.4 var(--face); letter-spacing: 0; color: var(--muted); }
.page .checks { padding: 0; list-style: none; }
/* an item is running text (a name inside it stands in a bdi), so the tick is set beside it, at the
   line's start, and the item is no flex row: a flex row would lay the name out as a column of its own */
.page .checks > li { position: relative; margin-top: 8px; padding-inline-start: 24px; }
.page .checks > li::before { position: absolute; inset-inline-start: 0; top: .28em; margin: 0 3px; }
.page .offer > .checks { margin-top: 16px; }
.page .offer > .note, .page .offer > .checks + p { margin-top: 20px; padding: 12px 16px; border-radius: 12px; background: var(--bg); }
.page .offer > form { margin-top: 20px; }
.page .offer .button { margin-top: 0; }

/* ---- "Make your own video": over the offer (the owner's order), under the film's download, as wide as
   the column at every width and as high as the main button, outlined as the download is, with the
   arrow of the homepage's buttons (drawn: two sides of a small box turned 45 degrees). It stands a
   section's distance under what is above it, and the offer follows it closely: the two are the
   page's actions, one after the other. */
.page .own { margin-top: 32px; }
.page .own + .offer { margin-top: 16px; }
.page .offer + .own { margin-top: 12px; }
.page .offer + p:not(.own) { margin-top: 24px; }
.page .own > .button { display: flex; width: 100%; margin-top: 0; }
.page .own > .button::after {
  content: ""; flex: none; width: 7px; height: 7px; margin-left: 12px;
  border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg);
}

@media (min-width: 640px) {
  .page { --side: 48px; }
  .page__main { padding-block: 72px 96px; }
  body.page > :not(header, main, footer):first-child { margin-top: 72px; }
  body.page > :not(header, main, footer):last-child { margin-bottom: 96px; }
}
@media print {
  .page__bar, .page__foot, .page .button { display: none; }
  body.page { display: block; min-height: 0; }
}
