/* tokens.css: every colour, size, radius, shadow, duration and layer. Use var(--ds-*), never a hex in a component.
   Direction "Gallery white" (2 Dec 2026): the interface is the wall and the mount; the photographs are the colour.
   - Colour-true neutrals (R = G = B), so photos look exactly as the photographer graded them. No tinted greys.
   - Ink is the one action colour: the primary button, the selected item, focus. On guest pages the studio's own
     colour (AccentPalette) takes over the primary button; with no colour set it stays ink.
   - Two schemes, one system. Light, and dark ("Gallery night": the same wall with the lights down, not an inversion):
     every page follows the OS setting (prefers-color-scheme). A signed-in studio can force one with
     <html data-appearance="light|dark"> (Appearance in the account menu; a cookie). Guest pages follow the OS only.
     In dark, elevation is lighter surfaces (canvas → card → raised), hairlines stay visible, and the ink action
     turns light with dark words on it.
   - Type: Newsreader (serif; titles, names, prices, display) + Schibsted Grotesk (sans; everything you read or
     operate). Both SIL OFL, self-hosted, subset (public/fonts, licences beside them).
   How to use all of this: docs/DESIGN_SYSTEM.md. The brand name comes from BRAND_NAME through `brand`.
   ORDER MATTERS: :root light, then the dark block (media + forced), then .ds-guest (+ dark), .ds-dark, .ds-light. */

/* Fonts (DESIGN_SYSTEM §10): each face is two files. The Latin core (letters, figures, punctuation, ₹, § © · ×) is
   what nearly every page needs; the -ext file (accented letters: é, ñ, ł …, and the rare Latin-1 signs: £ ° ½ « » …)
   loads only when a page has one (unicode-range). The ".3" in the name is the version: a remade font gets a new
   number, because /fonts is cached for a year (".3", marketing-speed 3 Dec: the rare signs moved to -ext, 10 KB
   less on every first visit). The serif has the two weights the tokens use, 330 (display) and 400 (title). Keep the
   ranges in step with the files. */
@font-face{font-family:"Schibsted Grotesk";src:url("/fonts/schibsted-grotesk.3.woff2") format("woff2");font-weight:400 700;font-style:normal;font-display:swap;
  unicode-range:U+0020-007E,U+00A0,U+00A7,U+00A9,U+00AD,U+00AE,U+00B7,U+00D7,U+00F7,U+2000-206F,U+20AC,U+20B9,U+2122,U+2190-2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Schibsted Grotesk";src:url("/fonts/schibsted-grotesk-ext.3.woff2") format("woff2");font-weight:400 700;font-style:normal;font-display:swap;
  unicode-range:U+00A1-00A6,U+00A8,U+00AA-00AC,U+00AF-00B6,U+00B8-00BF,U+00C0-00D6,U+00D8-00F6,U+00F8-017F,U+0192,U+02BB-02BC,U+02C6,U+02DA,U+02DC}
@font-face{font-family:"Newsreader";src:url("/fonts/newsreader.3.woff2") format("woff2");font-weight:330 400;font-style:normal;font-display:swap;
  unicode-range:U+0020-007E,U+00A0,U+00A7,U+00A9,U+00AD,U+00AE,U+00B7,U+00D7,U+00F7,U+2000-206F,U+20AC,U+20B9,U+2122,U+2190-2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Newsreader";src:url("/fonts/newsreader-ext.3.woff2") format("woff2");font-weight:330 400;font-style:normal;font-display:swap;
  unicode-range:U+00A1-00A6,U+00A8,U+00AA-00AC,U+00AF-00B6,U+00B8-00BF,U+00C0-00D6,U+00D8-00F6,U+00F8-017F,U+0192,U+02BB-02BC,U+02C6,U+02DA,U+02DC}
@font-face{font-family:"Newsreader";src:url("/fonts/newsreader-italic.3.woff2") format("woff2");font-weight:330 400;font-style:italic;font-display:swap;
  unicode-range:U+0020-007E,U+00A0,U+00A7,U+00A9,U+00AD,U+00AE,U+00B7,U+00D7,U+00F7,U+2000-206F,U+20AC,U+20B9,U+2122,U+2190-2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Newsreader";src:url("/fonts/newsreader-italic-ext.3.woff2") format("woff2");font-weight:330 400;font-style:italic;font-display:swap;
  unicode-range:U+00A1-00A6,U+00A8,U+00AA-00AC,U+00AF-00B6,U+00B8-00BF,U+00C0-00D6,U+00D8-00F6,U+00F8-017F,U+0192,U+02BB-02BC,U+02C6,U+02DA,U+02DC}

:root{
  color-scheme:light dark;

  /* Core palette: neutral, R = G = B. Fixed values: use them only when you mean that exact colour in both schemes
     (white words on a photo, the black viewer). For grounds, text and actions use the roles below. */
  --ds-white:#FFFFFF;
  --ds-paper:#F4F4F4;        /* the light scheme's app ground and bands */
  --ds-mist:#ECECEC;         /* the light scheme's sunken wells */
  --ds-ink:#1C1C1C;          /* the light scheme's text and action colour (17:1 on white) */
  --ds-ink-hover:#3A3A3A;
  --ds-graphite:#626262;     /* the light scheme's secondary text: 6.1:1 on white, 5.6:1 on paper */
  --ds-rule:#E2E2E2;         /* the light scheme's hairlines */
  --ds-rule-strong:#8A8A8A;  /* the light scheme's control borders: 3.4:1 on white */
  --ds-wa:#0F8443;           /* WhatsApp actions only; white text 4.8:1 */
  --ds-photo-light:#FFFFFF; --ds-photo-dark:#111111; --ds-viewer:#000000;

  /* Legacy names (night and lamplight, before 2 Dec 2026). Kept so older page CSS still renders; don't use them in
     new CSS. night = the dark scope's ground; lamp = a light glint on dark; petrol = ink; glows = none. */
  --ds-night:#161616; --ds-night-2:#222222; --ds-night-3:#2E2E2E;
  --ds-on-night:#F2F2F2; --ds-on-night-muted:#A8A8A8;
  --ds-petrol:#1C1C1C; --ds-petrol-light:#F2F2F2;
  --ds-lamp:#FFFFFF; --ds-lamp-strong:#FFFFFF; --ds-lamp-soft:#FBF1DE; --ds-on-lamp:#1C1C1C;
  --ds-glow-lamp:transparent; --ds-glow-petrol:transparent;

  /* Roles: light. Every one of these has a dark value in the block below. */
  --ds-bg:var(--ds-paper);           /* the app's ground (studio, admin) */
  --ds-canvas:var(--ds-white);       /* the open ground of marketing, guest and message pages */
  --ds-band:var(--ds-paper);         /* a tinted band on the canvas (marketing's price, the empty mount) */
  --ds-surface:var(--ds-white);      /* cards, fields */
  --ds-raised:var(--ds-white);       /* menus, dialogs, popovers: things that float */
  --ds-chosen:var(--ds-white);       /* the chosen tile of a segmented control */
  --ds-sunken:var(--ds-mist);        /* wells, chips, tracks, a photo's place before it loads */
  --ds-text:var(--ds-ink);
  --ds-text-muted:var(--ds-graphite);
  --ds-line:var(--ds-rule);
  --ds-line-strong:var(--ds-rule-strong);
  --ds-inverse:var(--ds-ink); --ds-on-inverse:#FFFFFF;   /* small solid marks: tooltips, counters, the current step */
  --ds-knob:#FFFFFF;                 /* a switch's knob when off */
  --ds-link:var(--ds-ink);
  --ds-focus:var(--ds-ink);
  --ds-selected:var(--ds-ink);
  --ds-accent:var(--ds-ink);
  --ds-on-accent:#FFFFFF;
  --ds-accent-layer:rgb(255 255 255 / .14);   /* hover on the primary fill: a layer of its own text colour */
  --ds-hover:rgb(28 28 28 / .05);
  --ds-press:rgb(28 28 28 / .09);
  --ds-scrim:rgb(0 0 0 / .5);
  --ds-ok:#1D6B3B; --ds-ok-bg:#E9F4ED;
  --ds-warn:#8A5200; --ds-warn-bg:#FBF1DE;
  --ds-bad:#B3261E; --ds-bad-bg:#FCEBEA;
  --ds-info:#1F4F8F; --ds-info-bg:#EAF0F8;
  --ds-danger:#B3261E; --ds-on-danger:#FFFFFF;
  /* Depth: surfaces are flat (a hairline). Shadows only lift things that float above the page. */
  --ds-shadow-1:0 1px 2px rgb(0 0 0 / .06),0 6px 16px -4px rgb(0 0 0 / .12);       /* menus, toasts, sticky bars */
  --ds-shadow-2:0 2px 6px rgb(0 0 0 / .06),0 24px 56px -16px rgb(0 0 0 / .28);      /* dialogs, sheets */
  --ds-shadow:0 1px 2px rgb(0 0 0 / .05),0 32px 64px -32px rgb(0 0 0 / .32);        /* marketing: a print lifted off the wall */
  --ds-bar:rgb(255 255 255 / .9);    /* a translucent sticky bar over the page (with a blur) */

  /* Type */
  --ds-font:"Schibsted Grotesk",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans",sans-serif;
  --ds-serif:"Newsreader",Georgia,"Times New Roman",serif;
  --ds-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
  --ds-normal:100%; --ds-wide:100%; --ds-wider:100%;   /* legacy widths: the new faces have no width axis */
  --ds-w-regular:400; --ds-w-medium:500; --ds-w-strong:600;   /* sans */
  --ds-w-display:330; --ds-w-title:400;                       /* serif: display (marketing, covers), titles (app) */
  --ds-fs-xs:.875rem;     /* 14: chips, fine print */
  --ds-fs-hint:.9375rem;  /* 15: hints, meta */
  --ds-fs-sm:1rem;        /* 16 */
  --ds-fs-ui:1rem;        /* 16: app and guest body, inputs, buttons */
  --ds-fs-base:1.125rem;  /* 18: reading (marketing, help, legal) */
  --ds-fs-md:1.25rem;     /* 20: h2 in the app (sans) */
  --ds-fs-lg:1.5rem;      /* 24: dialog titles, h2 in prose (serif) */
  --ds-fs-xl:clamp(1.875rem,1.5rem + 1.2vw,2.5rem);    /* 30→40: app page titles (serif) */
  --ds-fs-2xl:clamp(2.25rem,1.55rem + 2.6vw,3.5rem);   /* 36→56: marketing section titles (serif) */
  --ds-fs-3xl:clamp(2.75rem,1.6rem + 4.4vw,5rem);      /* 44→80: marketing page titles (serif) */
  --ds-fs-display:clamp(3rem,1.5rem + 5.4vw,6rem);     /* 48→96: the homepage headline */
  --ds-fs-cover:clamp(2.75rem,1.2rem + 7.5vw,6.5rem);  /* 44→104: the couple's names on a gallery cover */
  --ds-lh-body:1.6; --ds-lh-ui:1.45; --ds-lh-head:1.15; --ds-lh-tight:1.04;
  --ds-track-display:-.025em; --ds-track-title:-.015em;

  /* Space and layout */
  --ds-s1:4px;--ds-s2:8px;--ds-s3:12px;--ds-s4:16px;--ds-s5:24px;--ds-s6:32px;--ds-s7:48px;--ds-s8:64px;--ds-s9:96px;--ds-s10:128px;
  --ds-pad:clamp(16px,4vw,48px);
  --ds-max:1280px; --ds-max-app:1120px; --ds-max-form:36rem; --ds-max-prose:42rem;

  /* Radius by role: a photo is a print (2), chip 4, control 6, card and dialog 10, phone sheet 16. Pills only for
     switches, counters and avatars. */
  --ds-r-photo:2px; --ds-r-sm:4px; --ds-r-ctl:6px; --ds-r-md:10px; --ds-r-lg:16px; --ds-r-pill:999px;

  /* Motion */
  --ds-ease:cubic-bezier(.2,.7,.2,1); --ds-ease-in:cubic-bezier(.4,0,1,1);
  --ds-dur-1:120ms; --ds-dur:180ms; --ds-dur-2:280ms;

  /* Layers */
  --ds-z-sticky:10; --ds-z-float:20; --ds-z-pop:30; --ds-z-toast:40; --ds-z-modal:50; --ds-z-skip:60;
}

/* Dark roles ("Gallery night"). Written twice, KEEP THE TWO COPIES IN STEP: once for the OS setting (unless a studio
   forced light), once for a studio that forced dark. Elevation: canvas #111 → surface #1A1A1A → raised #232323.
   Text 15.9:1 on the canvas; muted 7.4:1 on the canvas, 6.7:1 on a card; control borders 3.2:1 on a card. */
@media (prefers-color-scheme:dark){
  :root:not([data-appearance=light]){
    color-scheme:dark;
    --ds-bg:#111111; --ds-canvas:#111111; --ds-band:#171717; --ds-surface:#1A1A1A; --ds-raised:#232323; --ds-chosen:#383838;
    --ds-sunken:#262626; --ds-text:#EDEDED; --ds-text-muted:#A6A6A6; --ds-line:#2E2E2E; --ds-line-strong:#6E6E6E;
    --ds-inverse:#EDEDED; --ds-on-inverse:#111111; --ds-knob:#D4D4D4;
    --ds-link:#EDEDED; --ds-focus:#EDEDED; --ds-selected:#EDEDED;
    --ds-accent:#EDEDED; --ds-on-accent:#111111; --ds-accent-layer:rgb(0 0 0 / .12);
    --ds-hover:rgb(255 255 255 / .06); --ds-press:rgb(255 255 255 / .1); --ds-scrim:rgb(0 0 0 / .66);
    --ds-ok:#7DD3A0; --ds-ok-bg:#10291B; --ds-warn:#F2C066; --ds-warn-bg:#2D2209;
    --ds-bad:#FF8F85; --ds-bad-bg:#36140F; --ds-info:#93B8F5; --ds-info-bg:#13233A;
    --ds-danger:#D13434; --ds-on-danger:#FFFFFF;
    --ds-shadow-1:0 0 0 1px rgb(255 255 255 / .06),0 8px 24px -6px rgb(0 0 0 / .7);
    --ds-shadow-2:0 0 0 1px rgb(255 255 255 / .08),0 28px 64px -16px rgb(0 0 0 / .8);
    --ds-shadow:0 0 0 1px rgb(255 255 255 / .05),0 40px 80px -40px rgb(0 0 0 / .9);
    --ds-bar:rgb(17 17 17 / .86);
  }
}
:root[data-appearance=dark]{
  color-scheme:dark;
  --ds-bg:#111111; --ds-canvas:#111111; --ds-band:#171717; --ds-surface:#1A1A1A; --ds-raised:#232323; --ds-chosen:#383838;
  --ds-sunken:#262626; --ds-text:#EDEDED; --ds-text-muted:#A6A6A6; --ds-line:#2E2E2E; --ds-line-strong:#6E6E6E;
  --ds-inverse:#EDEDED; --ds-on-inverse:#111111; --ds-knob:#D4D4D4;
  --ds-link:#EDEDED; --ds-focus:#EDEDED; --ds-selected:#EDEDED;
  --ds-accent:#EDEDED; --ds-on-accent:#111111; --ds-accent-layer:rgb(0 0 0 / .12);
  --ds-hover:rgb(255 255 255 / .06); --ds-press:rgb(255 255 255 / .1); --ds-scrim:rgb(0 0 0 / .66);
  --ds-ok:#7DD3A0; --ds-ok-bg:#10291B; --ds-warn:#F2C066; --ds-warn-bg:#2D2209;
  --ds-bad:#FF8F85; --ds-bad-bg:#36140F; --ds-info:#93B8F5; --ds-info-bg:#13233A;
  --ds-danger:#D13434; --ds-on-danger:#FFFFFF;
  --ds-shadow-1:0 0 0 1px rgb(255 255 255 / .06),0 8px 24px -6px rgb(0 0 0 / .7);
  --ds-shadow-2:0 0 0 1px rgb(255 255 255 / .08),0 28px 64px -16px rgb(0 0 0 / .8);
  --ds-shadow:0 0 0 1px rgb(255 255 255 / .05),0 40px 80px -40px rgb(0 0 0 / .9);
  --ds-bar:rgb(17 17 17 / .86);
}
:root[data-appearance=light]{color-scheme:light}

/* Guest pages: the canvas ground; the studio's colour (AccentPalette, on <html style>) drives the main action, links,
   rings and selection. With no colour it is ink (light) or its light inverse (dark). They follow the OS only. */
.ds-guest{
  --ds-bg:var(--ds-white); --ds-canvas:var(--ds-white); --ds-surface:var(--ds-white); --ds-sunken:var(--ds-paper);
  --ds-text:var(--ds-ink); --ds-text-muted:var(--ds-graphite); --ds-line:var(--ds-rule); --ds-line-strong:var(--ds-rule-strong);
  --ds-link:var(--accent-ink,#1C1C1C); --ds-focus:var(--accent-ink,#1C1C1C); --ds-selected:var(--accent-ink,#1C1C1C);
  --ds-accent:var(--accent,#1C1C1C); --ds-on-accent:var(--on-accent,#FFFFFF);
  --ds-accent-layer:color-mix(in srgb,var(--on-accent,#FFFFFF) 14%,transparent);
  --ds-hover:rgb(28 28 28 / .05); --ds-press:rgb(28 28 28 / .09);
}
@media (prefers-color-scheme:dark){
  :root.ds-guest{
    color-scheme:dark;
    --ds-bg:#111111; --ds-canvas:#111111; --ds-band:#171717; --ds-surface:#1A1A1A; --ds-raised:#232323; --ds-chosen:#383838;
    --ds-sunken:#1F1F1F; --ds-text:#EDEDED; --ds-text-muted:#A6A6A6; --ds-line:#2C2C2C; --ds-line-strong:#6E6E6E;
    --ds-link:var(--accent-ink-dark,#EDEDED); --ds-focus:var(--accent-ink-dark,#EDEDED); --ds-selected:var(--accent-ink-dark,#EDEDED);
    --ds-accent:var(--accent-dark,#EDEDED); --ds-on-accent:var(--on-accent-dark,#111111);
    --ds-accent-layer:color-mix(in srgb,var(--on-accent-dark,#111111) 14%,transparent);
    --ds-hover:rgb(255 255 255 / .06); --ds-press:rgb(255 255 255 / .1);
  }
}

/* Dark scope: the photo viewer, toasts, the drop overlay, a dark photo band. Neutral, never tinted, in both schemes.
   .ds-night is its old name. */
.ds-dark,.ds-night{
  color-scheme:dark;
  --ds-bg:#161616; --ds-canvas:#161616; --ds-band:#1C1C1C; --ds-surface:#222222; --ds-raised:#2A2A2A; --ds-chosen:#3A3A3A; --ds-sunken:#0E0E0E;
  --ds-text:#F2F2F2; --ds-text-muted:#A8A8A8; --ds-line:#333333; --ds-line-strong:#6E6E6E;
  --ds-inverse:#F2F2F2; --ds-on-inverse:#161616; --ds-knob:#D4D4D4;
  --ds-link:#FFFFFF; --ds-focus:#FFFFFF; --ds-selected:#FFFFFF;
  --ds-accent:#FFFFFF; --ds-on-accent:#161616; --ds-accent-layer:rgb(0 0 0 / .08);
  --ds-hover:rgb(255 255 255 / .08); --ds-press:rgb(255 255 255 / .14);
  --ds-ok:#8FD6A8; --ds-ok-bg:#12301E; --ds-warn:#F2C27A; --ds-warn-bg:#35270D;
  --ds-bad:#FF9C92; --ds-bad-bg:#3D1613; --ds-info:#9CC1F0; --ds-info-bg:#142538;
  background:var(--ds-bg); color:var(--ds-text);
}

/* Light scope: light roles on one element whatever the scheme (invoice, print, a printable card). */
.ds-light{
  color-scheme:light;
  --ds-bg:#FFFFFF; --ds-canvas:#FFFFFF; --ds-band:var(--ds-paper); --ds-surface:#FFFFFF; --ds-raised:#FFFFFF; --ds-chosen:#FFFFFF; --ds-sunken:var(--ds-mist);
  --ds-text:var(--ds-ink); --ds-text-muted:var(--ds-graphite); --ds-line:var(--ds-rule); --ds-line-strong:var(--ds-rule-strong);
  --ds-inverse:var(--ds-ink); --ds-on-inverse:#FFFFFF; --ds-knob:#FFFFFF;
  --ds-link:var(--ds-ink); --ds-focus:var(--ds-ink); --ds-selected:var(--ds-ink);
  --ds-accent:var(--ds-ink); --ds-on-accent:#FFFFFF; --ds-accent-layer:rgb(255 255 255 / .14);
  --ds-hover:rgb(28 28 28 / .05); --ds-press:rgb(28 28 28 / .09);
  --ds-ok:#1D6B3B; --ds-ok-bg:#E9F4ED; --ds-warn:#8A5200; --ds-warn-bg:#FBF1DE;
  --ds-bad:#B3261E; --ds-bad-bg:#FCEBEA; --ds-info:#1F4F8F; --ds-info-bg:#EAF0F8;
  --ds-shadow-1:0 1px 2px rgb(0 0 0 / .06),0 6px 16px -4px rgb(0 0 0 / .12);
  --ds-shadow-2:0 2px 6px rgb(0 0 0 / .06),0 24px 56px -16px rgb(0 0 0 / .28);
  --ds-shadow:0 1px 2px rgb(0 0 0 / .05),0 32px 64px -32px rgb(0 0 0 / .32);
}
