/* Theme: handmade - "Warm and hand-made"
 *
 * An arts organisation that also does consultancy, not the other way round.
 * Warm paper background instead of white, one strong pink and one deep green
 * (both taken from the old Squarespace stylesheet, darkened only as far as
 * WCAG AA required), photographs as plain rounded rectangles, and a drawn
 * brush mark under the headings. The first draft cut photographs into
 * irregular hand-cut shapes; Grace asked for "the normal square shapes
 * instead" (2026-09-21, C10), so the shape now comes only from
 * --radius-image. Poppins for headings, Atkinson Hyperlegible for
 * everything read at length.
 *
 * Every token in the contract (docs/plans/design-system-plan.md, 6.3) is
 * defined here as plain hex so `npm run contrast` can parse it. The rules at
 * the bottom are the few things a token cannot say.
 */

/* ---------- fonts ---------- */

/* Poppins and Atkinson Hyperlegible, both SIL Open Font License 1.1, latin
   subsets taken from the @fontsource packages and served from this repo. */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/css/fonts/poppins-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/css/fonts/poppins-latin-700.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/css/fonts/atkinson-hyperlegible-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/css/fonts/atkinson-hyperlegible-latin-700.woff2") format("woff2");
}

/* ---------- tokens ---------- */

:root {
  /* colour: surfaces and text
     Three warm papers rather than white and grey: the page is the lightest,
     one section tint goes clearly sandier and the other greener, so a long
     page alternates warm and cool instead of light and dark, and a short page
     still has a visible band. The Widgit symbols are black line art on
     transparency, so all three stay light. The border is dark enough that a
     1px divider actually exists on cream (1.86:1). */
  --color-bg: #fbf6ef;
  --color-surface: #f0e6d6;
  --color-surface-alt: #e4ead5;
  --color-text: #26201d;
  --color-muted: #5e514a;
  --color-border: #c9b49a;

  /* colour: brand
     Accent is the old site's pink #cb3c78 darkened to #b03166: the least
     change that clears 4.5:1 as link text on all three papers *and* on all
     three highlight tints (4.53 is the worst of the six). Focus is the old
     site's green #437546 unchanged: it only needs 3:1 and reaches 4.39:1 on
     the darkest paper. The highlights are tints of the same two colours plus
     a warm apricot, kept light because audience-picker sets --color-text on
     them. */
  --color-accent: #b03166;
  --color-on-accent: #ffffff;
  --color-accent-hover: #8f2753;
  --color-highlight-1: #d4e7c4;
  --color-highlight-2: #f9d6e4;
  --color-highlight-3: #fbdcc3;
  --color-focus: #437546;

  /* type
     Poppins for headings, because it is the one typographic thing her old
     site had. Atkinson Hyperlegible for body: drawn for low vision, and its
     odd, humane letterforms keep long text from looking corporate. Body is
     set a step up from the minimum with generous leading. */
  --font-heading: "Poppins", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI",
    sans-serif;
  --weight-heading: 600;
  --text-base: 1.125rem;
  --text-lead: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
  --text-h1: clamp(2.125rem, 1.5rem + 2.7vw, 3.375rem);
  --text-h2: clamp(1.625rem, 1.25rem + 1.6vw, 2.375rem);
  --text-h3: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --leading-body: 1.7;
  --leading-heading: 1.15;
  --measure: 62ch;

  /* shape and space
     Softly rounded, never boxed: pill controls, gently rounded photographs
     and tints, no shadows. --radius-image is every photograph's corner and
     the project card focus ring; there are no other image shapes. */
  --radius-image: 0.75rem;
  --radius-control: 2rem;
  --radius-card: 1rem;
  --border-width: 1px;
  --shadow-card: none;
  --space-section: clamp(3rem, 7vw, 5.5rem);
  --space-gap: 1.75rem;
  --container: 70rem;
}

/* ---------- theme rules ----------
 *
 * Convention: every selector in this block starts with `:root`. This file is
 * linked before /css/styles.css (plan 6.2), so without that prefix a theme
 * rule loses to the section or base rule it means to override.
 *
 * What no token can say: a drawn mark under the headings, a visible frame
 * for a project without an image, boundaries on the quiet buttons, and the
 * size of the wordmark.
 */

/* A project with no image yet is a blank frame, so make it a frame you can
   see: the placeholder tint is the one highlight that differs from all three
   papers. */
:root .project-cards-image {
  background: var(--color-highlight-2);
}

/* A drawn green stroke under the headings that open something - the page
   title, a section header, a call to action, a run of prose - and not under
   every h2 on the page, which turned a long page into a row of ticks. It is a
   block of its own beneath the text, so it never sits behind a word and
   cannot touch text contrast, and a heading wrapping to two or three lines
   just carries it further down. */
:root h1::after,
:root .section-header h2::after,
:root .cta-title::after,
:root .text-content > h2::after,
:root .contact-body > h2::after {
  content: "";
  display: block;
  width: 5.5rem;
  height: 0.625rem;
  margin-top: 0.5rem;
  background: url("/images/theme-handmade/underline.svg") 0 0 / 100% 100%
    no-repeat;
}

:root h1::after {
  width: 9rem;
  height: 0.875rem;
  margin-top: 0.625rem;
}

/* WCAG 1.4.11: the quiet buttons are bounded only by --color-border, which is
   a paper line, not an edge. Give them a real one - the plain button a warm
   brown (6.2:1 on the surface it sits on), the secondary button the accent
   (4.9:1) - with the matching hover and focus-visible states. The primary
   button keeps its own colour, hence the :not(). */
:root .btn:not(.btn-primary) {
  border-color: var(--color-muted);
}

:root .btn:not(.btn-primary):hover,
:root .btn:not(.btn-primary):focus-visible {
  border-color: var(--color-text);
}

:root .btn.btn-secondary {
  border-color: var(--color-accent);
}

:root .btn.btn-secondary:hover,
:root .btn.btn-secondary:focus-visible {
  border-color: var(--color-accent-hover);
}

/* Fallback for when site.logo is empty: the text wordmark is then all the logo
   there is, so let it carry a little weight. */
:root .logo {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  letter-spacing: -0.015em;
}
