/* Design tokens — the website's copy of the studio's visual identity.

   Where these come from (update here when the design system changes):
   - The Studio identity (owner-approved 2026-10-15): the Graphic Design
     System's default skin "studio" (design/skins/studio/skin.typ) and the
     identity kit it is built on (Marketing\Visual Identity\…\Winner\).
     Brief: the design system's WEBSITE-HANDOFF.md.
   - Wordmark: the kit's artwork, inline SVG (src/components/Wordmark.astro);
     never typed in a font.
   - Typefaces: JSS Jost (the wordmark's own letters) for labels and small
     values: Regular 400 in tracked capitals (0.32em), Book 350 for values;
     Source Serif 4 for all reading text, its weight fixed and its optical
     size automatic (see scripts/fonts.py). Roman at 350, the owner's choice
     on screen (2026-10-16; print uses 400); italic at 400.
   - Colour: black and white, one grey, no accent colour, no dark mode.
     --ink is a hair softer than the print black on purpose (pure black on a
     bright screen is harsh at reading sizes); --paper is the screen-only warm
     off-white (print is white).
   - Sizes: scaled up from the print sizes for screen reading.
   - The wordmark leads the opening line, as in print and on the link-preview
     card: at every screen width the line's capitals are about 0.7 the height
     of the wordmark's (2026-10-20; before, 1.3, and the two competed). Change
     --width-wordmark and --size-positioning together to keep this.

   All text colours pass WCAG AA contrast on --paper (checked at build). */

:root {
  /* Colour */
  --paper: #FAF9F6;
  --ink: #111111;          /* wordmark, text, hairlines, links, focus outline */
  --ink-2: #5E5E5E;        /* secondary text: labels, footer, region line */
  --rule-faint: #D9D9D6;   /* never text; used for the text-selection highlight */

  /* Typefaces */
  --font-text: "Source Serif 4", Georgia, serif;
  --font-label: "JSS Jost", "Futura", "Segoe UI", system-ui, sans-serif;
  --weight-text: 350;      /* the weight fixed in the Source Serif roman file */

  /* Tracking (letter-spacing) */
  --tracking-label: 0.32em;
  --tracking-value: 0.04em;

  /* Sizes: phone → large desktop */
  --size-text: clamp(1.125rem, 1.06rem + 0.3vw, 1.3125rem);        /* 18 → 21px */
  --size-positioning: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);       /* 24 → 34px */
  --size-punch: clamp(1.375rem, 1.15rem + 1vw, 1.875rem);          /* 22 → 30px */
  --size-value: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);            /* 16 → 18px */
  --size-label: 0.75rem;                                           /* 12px */
  --width-wordmark: clamp(15rem, 10.5rem + 13vw, 22.5rem);         /* 240 → 360px */

  /* Layout */
  --measure: 31em;                       /* comfortable line length for the text */
  --gutter: clamp(1.25rem, 5vw, 4rem);   /* side margins */
}
/* Web copies of the Studio's typefaces (open licences; see fonts-source/).
   Made by scripts/fonts.py. Source Serif 4 keeps only its optical-size axis:
   its weight is fixed in the file (the number in the file name). */
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/SourceSerif4-Roman-350.woff2") format("woff2");
  font-weight: 350;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/SourceSerif4-Italic-400.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
/* One CSS family for JSS Jost: Book is 350, Regular 400. */
@font-face {
  font-family: "JSS Jost";
  src: url("/fonts/JSSJost-Book.woff2") format("woff2");
  font-weight: 350;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JSS Jost";
  src: url("/fonts/JSSJost-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Shared styles for every page. */

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: only light;
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  font-family: var(--font-text);
  font-weight: var(--weight-text);
  font-size: var(--size-text);
  line-height: 1.55;
  text-align: center;
  font-optical-sizing: auto;   /* Source Serif: text design for small type, display design for large */
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p, h1, h2 { margin: 0; font-weight: inherit; font-size: inherit; }

/* Links: ink, never blue, with a thin underline that darkens on hover. */
a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 0.3s ease;
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 0.3em; }
::selection { background: var(--rule-faint); color: var(--ink); }

/* The wordmark: the identity kit's artwork, inline (src/components/Wordmark.astro).
   Its frame is cropped to the ink, so it centres exactly on the page axis. */
.wordmark {
  display: block;
  width: var(--width-wordmark);
}
.wordmark svg { display: block; width: 100%; height: auto; }
a.wordmark { color: var(--ink); text-decoration: none; }

/* Tracked capitals labels (e.g. "Enquiries", footer). The indent balances
   the tracking after the last letter, so each label sits truly centred. */
.label {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: var(--size-label);
  letter-spacing: var(--tracking-label);
  text-indent: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.4;
  font-variant-numeric: lining-nums;
}

/* Small values (e.g. the email address): JSS Jost Book, normal case. */
.value {
  font-family: var(--font-label);
  font-weight: 350;
  font-size: var(--size-value);
  letter-spacing: var(--tracking-value);
  font-variant-numeric: lining-nums;
}

/* Display-line typesetting (src/components/DisplayLine.astro): a phrase
   between commas stays on one line when it fits, so lines break at commas
   first; a hyphenated word is never split. */
.phrase { display: inline-block; }
.whole { white-space: nowrap; }

.hairline {
  border: 0;
  border-top: 1px solid var(--ink);
  width: 3.5rem;
  margin: 0 auto;
}

.site-footer {
  padding: 2.5rem var(--gutter) 2rem;
}
.site-footer p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em 0.9em;
}
.site-footer p > * { white-space: nowrap; }
.site-footer a { color: var(--ink-2); }
/* Too narrow for one line (phones; the line is longest with a range of
   years, "© 2026–2027"): one item per line, without the dot. On the
   narrowest phones the years and the name may also part, never the name. */
@media (max-width: 30rem) {
  .site-footer p { flex-direction: column; align-items: center; }
  .site-footer p > [aria-hidden] { display: none; }
  .site-footer p > * { white-space: normal; }
  .site-footer p > * > * { white-space: nowrap; }
}

/* Quiet arrival: each line resolves into focus, once, as it is reached:
   from a soft blur and transparent to sharp. Nothing loops or moves around.
   Visitors whose device asks for reduced motion see no animation at all.
   Browsers without scroll-linked animation (e.g. Firefox today) simply show
   the lower sections; the opening still resolves on arrival.
   Longhand properties on purpose: the "animation" shorthand would reset
   animation-timeline and break the scroll-linked version. */
/* Starts at 1% opacity, not 0: invisible to the eye, but Chrome never counts
   an element that starts fully transparent as the page's main content, and
   the positioning line is the only text on the first screen (the wordmark is
   artwork). Without it, speed tests find no "largest contentful paint" and
   give no Performance score (owner's choice, 2026-10-16). */
@keyframes resolve {
  from { opacity: 0.01; filter: blur(8px); }
  to   { opacity: 1; filter: blur(0); }
}
/* Lower sections: a pure focus-pull at full colour, so the text keeps its
   full contrast at every moment (automated accessibility tests measure the
   page before it is scrolled). */
@keyframes focus {
  from { filter: blur(7px); }
  to   { filter: blur(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .arrive {
    animation-name: resolve;
    animation-duration: 2.4s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
  }
  /* The studio name is there from the first moment, blurred, and sharpens in
     place, so the page never looks blank while it loads. */
  .wordmark.arrive { animation-name: focus; }
  .arrive-later { animation-delay: 1s; }

  @supports (animation-timeline: view()) {
    .reveal {
      animation-name: focus;
      animation-timing-function: ease-out;
      animation-fill-mode: both;
      animation-duration: auto;
      animation-timeline: view();
      animation-range: entry 5% entry 100%;   /* sharp by the time it is fully on screen */
    }
  }
}

/* Simple text pages (privacy, not found). */
.page {
  flex: 1;
  width: 100%;
  padding: clamp(2.5rem, 8vh, 4.5rem) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.page h1 {
  margin-top: clamp(4rem, 18vh, 9rem);
  font-size: var(--size-positioning);
  line-height: 1.18;
}
.page .hairline { margin-block: 2.5rem; }
.page .body { max-width: var(--measure); text-wrap: balance; }
.page .body p + p { margin-top: 1em; }
