/* Photo site design tokens. Campaign e367f5a4.
   Every color pair is checked by tools/check_tokens.py. Ratios are in tools/check_tokens_output.txt. */

@font-face {
  font-family: "Figtree";
  src: url("/static/figtree-latin-wght.woff2") format("woff2");
  font-weight: 300 900;
  font-display: optional;
}

:root {
  /* Type */
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-caption: .8125rem/1.125rem var(--font);
  --text-small: .875rem/1.25rem var(--font);
  --text-body: 1rem/1.5rem var(--font);
  --text-h3: 1.25rem/1.75rem var(--font);
  --text-h1: 1.9375rem/2.375rem var(--font);
  --weight-light: 300;
  --weight-medium: 500;
  --weight-bold: 650;
  --measure: 65ch;
  /* Wider than a reading measure, narrower than the page. The photo page's
     facts sit in two columns pinned to the left and right of this, so it has
     to be wide enough that "Taken" and "Exposure" are visibly the two EDGES
     of a block and not two words next to each other — and narrow enough that
     they still read as belonging to the photograph above. */
  --measure-wide: 90ch;
  /* Wide tracking on small, light type is what makes a masthead read as a
     photographer's rather than an application's. Figtree is a variable font
     down to 300, so this needs no second file. */
  --track-wide: .22em;
  --track-caption: .08em;

  /* Spacing, 4 px base */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Layout */
  /* Airier than the original mock, to match the reference Nicholas gave
     (psweddingstudio.com): real gaps between photographs and a bounded
     measure, rather than an edge-to-edge contact sheet. */
  /* MEASURED against the reference Nicholas gave (psweddingstudio.com): its
     photographs sit about 2.5rem apart with roughly a 4rem page margin, and
     that space is most of what makes the page feel like a gallery wall rather
     than a contact sheet. The earlier 1.5rem/2rem was still too tight. */
  --gallery-gap: 2.5rem;
  /* THE TILE HEIGHT GRID. A landscape tile is --slot-h of the column's width
     tall; a portrait is exactly two of those plus one gap, so every tile
     boundary in every column falls on a multiple of (slot + gap) and columns
     align without coordinating. 0.6667 is 3:2, the ratio Nicholas's X-T5
     shoots. The gap is a FRACTION of the column width, not a length, because
     the grid only holds at every screen size if it scales with the column. */
  --slot-h: .6667;
  /* The text around a photograph, as FIXED lengths, because text does not
     scale with the column. A slot is
         title block + photo + caption block + gap
     and a portrait spans exactly two slots, so its photo must be
         2*photo + caption block + gap + title block
     Each block's height is its line box plus its own margin, and both are
     reserved on EVERY tile whether or not it has a title -- an untitled
     photograph that skipped the title line would be one line shorter than
     its neighbours and the grid would break on exactly the tiles that have
     no caption to explain it. */
  --tile-line: 1.125rem;
  --title-block: 1.625rem;   /* line + --space-2 below */
  --cap-block: 1.875rem;     /* --space-3 above + line */
  --slot-gap: 1.5rem;
  --page-max: 1600px;
  --page-pad: 4rem;
  /* KEPT deliberately, with no consumer today: both are owed to the
     full-screen viewer that is still to be built, and re-deriving a scrim
     alpha from scratch is how a contrast floor gets eyeballed instead of
     measured. tools/check_tokens.py has them on an explicit allowlist with
     this reason, so the unused-token check stays honest. */
  --panel-width: 320px;
  --target: 44px;

  /* Radius. Photos stay square-cornered. */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-full: 999px;

  /* The scrim behind a corner caption laid over a photograph. 0.88 alpha
     because this is the ONE contrast case no tool can check -- text over a
     photograph whose colours nobody controls -- and the mitigation has to be
     design, not a test. The research floor was >= 0.85. */
  --photo-scrim: rgb(0 0 0 / .88);
  /* The text ON that scrim, and it is NOT --text.
     SEEN ON THE LIVE PAGE: the first version used --text, which follows the
     theme, while the scrim is always black. In light mode that put #171717 on
     near-black and the title was unreadable. A fixed background needs a fixed
     foreground; this pair is 15.9:1 and does not move with the theme. */
  --on-scrim: #F2F2F2;

  /* Motion */
  --motion-base: 200ms;
  --ease: cubic-bezier(.2, 0, 0, 1);

  /* Focus ring on photos: white and black pair */
  --focus-photo-inner: #FFFFFF;
  --focus-photo-outer: #000000;
}

:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1B1B1B;
  --raised: #262626;
  --border: #6A6A6A;
  --border-control: #767676;
  --text-muted: #A8A8A8;
  --text: #E8E8E8;
  --accent-text: #F58025;
  --accent-fill: #F58025;
  --on-accent: #121212;
  --focus: #F58025;
  --scrim: rgb(0 0 0 / .35);
  /* Dark uses lighter surfaces for height, not shadows. */
  --shadow-2: none;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --raised: #F2F2F2;
  --border: #8E8E8E;
  --border-control: #8A8A8A;
  --text-muted: #5E5E5E;
  --text: #171717;
  --accent-text: #B35308;
  --accent-fill: #F58025;
  --on-accent: #171717;
  --focus: #B35308;
  --scrim: rgb(0 0 0 / .35);
  --shadow-2: 0 4px 12px rgb(0 0 0 / .12);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --raised: #F2F2F2;
    --border: #8E8E8E;
    --border-control: #8A8A8A;
    --text-muted: #5E5E5E;
    --text: #171717;
    --accent-text: #B35308;
    --accent-fill: #F58025;
    --on-accent: #171717;
    --focus: #B35308;
    --shadow-2: 0 4px 12px rgb(0 0 0 / .12);
  }
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.photo-link:focus-visible {
  outline: 2px solid var(--focus-photo-inner);
  outline-offset: 0;
  box-shadow: 0 0 0 4px var(--focus-photo-outer);
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion-fast: 0ms; --motion-base: 0ms; }
  html { scroll-behavior: auto; }
}
