/* ============================================================
   Stella Apps — brand system (tokens + base + components)
   Lifted from Dave's two locked artifacts, 30 Jul 2026:
     "Stella Apps — Brand template"  (the one-sheet)
     "Stella Apps — small software for people who make things"
   Every value here is the brand template's, verbatim, with ONE
   documented addition: two darker TEXT-ONLY tokens, because the
   originals fail measured WCAG AA when used as text on cream —
   gold-deep #B8860B is 2.82:1, bronze #A5713A is 3.62:1
   (measured 31 Jul 2026; AA needs 4.5:1 for normal text).
   Fills, rules and every other value are untouched.
   Page-layout CSS lives inline in each page; this file is only
   the reusable system.
   ============================================================ */

@font-face { font-family: 'Karla'; font-style: normal; font-weight: 400;
  font-display: swap; src: url(assets/fonts/karla-400.woff2) format('woff2'); }
/* Karla 600/700 render synthetically from the 400 file — the locked
   artifacts shipped the same file for all three weights. Swap in real
   instances here if the faux bold ever grates. */
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 400;
  font-display: swap; src: url(assets/fonts/zilla-slab-400.woff2) format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 600;
  font-display: swap; src: url(assets/fonts/zilla-slab-600.woff2) format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 700;
  font-display: swap; src: url(assets/fonts/zilla-slab-700.woff2) format('woff2'); }

:root {
  /* The brand commits to a single warm, light world — cream ground,
     cocoa ink. There is no dark theme; say so to the browser so form
     controls and scrollbars don't render dark against it. */
  color-scheme: light;

  /* --- Colour: core -------------------------------------- */
  --color-cocoa: #2b221b;         /* ink, headings, footer      */
  --color-cocoa-hover: #43362b;   /* primary button hover       */
  --color-gold: #e2b01f;          /* ring gold — fills only     */
  --color-gold-hover: #c99a15;    /* gold button hover          */
  --color-gold-deep: #b8860b;     /* gold in FILLS and on cocoa — not text on cream */
  --color-cream: #f4eee3;         /* page ground                */
  --color-paper: #f9f5ec;         /* cards, panels              */
  --color-white: #ffffff;         /* inputs, photo cards        */

  /* --- Colour: supporting -------------------------------- */
  --color-cream-deep: #ede5d6;    /* surround behind the sheet  */
  --color-panel: #efe7d8;         /* note panels, card captions */
  --color-tint: #ebdcc2;          /* soft tags, selection       */
  --color-bronze: #a5713a;        /* bronze in FILLS — not text on cream */
  --color-bronze-dark: #7a5320;   /* link + ghost hover         */
  --color-sand: #d8c9b2;          /* rules, dividers, borders   */
  --color-sand-light: #e4d7c2;    /* light rules, card borders  */
  --color-link-underline: #dcc49e;

  /* --- Colour: measured text-safe steps (added 31 Jul 2026) --
     Same hue families, deepened until they pass AA on cream:   */
  --color-gold-text: #8a5a00;     /* 5.13:1 on cream — kickers, gold-as-text */
  --color-bronze-text: #8f5b21;   /* 4.93:1 on cream — eyebrows, links       */

  /* --- Colour: from the artwork -------------------------- */
  --color-lilac: #a3949c;         /* her coat — illustration only */
  --color-navy: #243341;          /* contour — sparingly          */

  /* --- Colour: text -------------------------------------- */
  --color-text: #5b5044;          /* body copy                  */
  --color-muted: #6b6055;         /* muted labels, captions     */
  --color-on-dark: #f4eee3;       /* type on cocoa              */
  --color-on-dark-muted: #b6a896; /* secondary type on cocoa    */

  /* --- Type faces ---------------------------------------- */
  --font-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-body: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* --- Type scale ---------------------------------------- */
  --text-h1: 62px;      /* 56–68px depending on page           */
  --text-h2: 34px;
  --text-h3: 24px;
  --text-display: 46px; /* specimen / oversized headline       */
  --text-hero: 50px;
  --text-lead: 17px;
  --text-body: 15px;
  --text-body-sm: 14px;
  --text-note: 12.5px;
  --text-label: 12px;
  --text-eyebrow: 11px;

  --leading-tight: 1.02;   /* display headings                 */
  --leading-heading: 1.15; /* section headings                 */
  --leading-body: 1.55;
  --leading-note: 1.5;
  --leading-panel: 1.6;

  --tracking-heading: -0.02em;
  --tracking-h2: -0.015em;
  --tracking-label: 0.12em;
  --tracking-eyebrow: 0.14em;
  --tracking-kicker: 0.2em;

  /* --- Spacing ------------------------------------------- */
  --space-3xs: 4px;
  --space-2xs: 8px;
  --space-xs: 12px;
  --space-sm: 16px;
  --space-md: 20px;
  --space-lg: 28px;
  --space-xl: 44px;
  --space-2xl: 56px;

  /* --- Radii — soft, never square ------------------------ */
  --radius-chip: 3px;
  --radius-tag: 5px;
  --radius-nav: 7px;
  --radius-btn: 8px;
  --radius-card: 10px;

  /* --- Rules — 2px sand, never a drop shadow ------------- */
  --rule-width: 2px;
  --rule: var(--rule-width) solid var(--color-sand);
  --rule-light: var(--rule-width) solid var(--color-sand-light);

  /* --- Layout -------------------------------------------- */
  --content-width: 1200px;
  --sheet-width: 1240px;
  --sheet-pad: 56px;
  --focus-ring: 2px solid var(--color-gold-text); /* was gold-deep: 2.82:1 missed the 3:1 non-text bar */
}

@media (max-width: 1000px) {
  :root {
    --sheet-pad: 36px;
    --text-h1: 50px;
    --text-h2: 30px;
    --text-display: 38px;
    --text-hero: 40px;
  }
}

@media (max-width: 700px) {
  :root {
    --sheet-pad: 24px;
    --text-h1: 38px;
    --text-h2: 26px;
    --text-display: 30px;
    --text-hero: 32px;
    --text-lead: 16px;
  }
}

/* ============================================================
   Base — element defaults + shared type utilities
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-cream-deep);
  color: var(--color-cocoa);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--color-cocoa);
  text-wrap: balance;
}

h1 {
  font-weight: 700;
  font-size: var(--text-h1);
  line-height: 0.98;
  letter-spacing: var(--tracking-heading);
}

h2 {
  font-weight: 700;
  font-size: var(--text-h2);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-h2);
}

h3 {
  font-weight: 600;
  font-size: var(--text-h3);
  line-height: var(--leading-heading);
}

p { margin: 0; color: var(--color-text); text-wrap: pretty; }

strong { font-weight: 700; color: var(--color-cocoa); }

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--color-bronze-text); /* was bronze: 3.62:1 on cream fails AA */
  text-decoration: none;
  border-bottom: var(--rule-width) solid var(--color-link-underline);
}

a:hover {
  color: var(--color-bronze-dark);
  border-bottom-color: var(--color-gold-deep);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

::selection { background: var(--color-tint); }

/* Available to screen readers only. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Type utilities ------------------------------------- */

/* Gold caps kicker that opens a hero or a specimen block. */
.kicker {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--color-gold-text); /* was gold-deep: 2.82:1 on cream fails AA */
}

/* Small bronze caps label — names a block of specimens. */
.eyebrow {
  font-size: var(--text-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-bronze-text); /* was bronze — same AA reason as links */
}

.eyebrow--lg {
  font-size: var(--text-label);
  letter-spacing: 0.16em;
}

/* Muted caps label — used inside interface copy. */
.label-caps {
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-muted);
}

.lead {
  font-size: var(--text-lead);
  line-height: var(--leading-body);
  color: var(--color-text);
}

.body-sm {
  font-size: var(--text-body-sm);
  line-height: var(--leading-body);
  color: var(--color-text);
}

/* Footnote under a specimen. --ruled adds the hairline above it. */
.note {
  font-size: var(--text-note);
  line-height: var(--leading-note);
  color: var(--color-muted);
}

.note--ruled {
  padding-top: var(--space-3xs);
  border-top: var(--rule-light);
}

/* The wordmark, set in type rather than drawn. */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-heading);
  color: var(--color-cocoa);
}

.wordmark em {
  font-style: normal;
  color: var(--color-gold-text); /* gold-deep on cocoa is fine; on cream it isn't */
}

/* ============================================================
   Interface elements — reusable pieces the pages build from
   ============================================================ */

/* --- Buttons -------------------------------------------- */
/* One primary per view. Cocoa leads, gold supports, ghost defers.
   (The company site itself uses none — informational, no CTAs —
   but the system keeps them for product surfaces and the sheet.) */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  border: var(--rule-width) solid transparent;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease,
    color 120ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

.btn--primary { background: var(--color-cocoa); color: var(--color-on-dark); }
.btn--primary:hover { background: var(--color-cocoa-hover); color: var(--color-on-dark); }

.btn--gold { background: var(--color-gold); color: var(--color-cocoa); }
.btn--gold:hover { background: var(--color-gold-hover); color: var(--color-cocoa); }

.btn--ghost { background: transparent; border-color: var(--color-sand); color: var(--color-cocoa); }
.btn--ghost:hover { border-color: var(--color-gold-deep); color: var(--color-bronze-dark); }

.btn--sm { padding: 10px 20px; font-size: var(--text-body-sm); }
.btn--nav { padding: 7px 16px; border-radius: var(--radius-nav); font-size: var(--text-body-sm); }

/* --- Tags & badges -------------------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: var(--rule-width) solid transparent;
  border-radius: var(--radius-tag);
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.tag--soft { background: var(--color-tint); color: var(--color-bronze-dark); }
.tag--dark { background: var(--color-cocoa); color: var(--color-gold); }
.tag--outline { border-color: var(--color-sand); color: var(--color-text); }

/* --- Inputs --------------------------------------------- */

.input {
  min-width: 0;
  padding: 12px 16px;
  border: var(--rule-width) solid var(--color-sand);
  border-radius: var(--radius-btn);
  background: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  line-height: 1.2;
  color: var(--color-cocoa);
}

.input::placeholder { color: var(--color-muted); opacity: 1; }

.field { display: flex; gap: 10px; }
.field .input { flex: 1; }

/* --- Surfaces ------------------------------------------- */

/* Paper card with a sand border — the workhorse container. */
.card {
  display: flex;
  flex-direction: column;
  background: var(--color-paper);
  border: var(--rule-light);
}

.card--padded { padding: var(--space-lg) var(--space-lg) 24px; gap: 14px; }

/* White card, soft corners — content, products, photography. */
.card--white {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: var(--space-md) 22px;
  gap: var(--space-2xs);
}

/* Caption strip along the bottom of a specimen card. */
.card__caption {
  padding: 14px var(--space-md);
  border-top: var(--rule-light);
  background: var(--color-panel);
  font-size: var(--text-note);
  line-height: var(--leading-note);
  color: var(--color-text);
}

/* Tinted note panel — rules, caveats, things to remember. */
.panel {
  padding: var(--space-md) 24px;
  background: var(--color-panel);
  border: var(--rule-light);
  font-size: 13.5px;
  line-height: var(--leading-panel);
  color: var(--color-text);
}

.panel--split { display: flex; flex-wrap: wrap; gap: 32px; }
.panel--split > * { flex: 1; min-width: 300px; }

/* --- Grids ---------------------------------------------- */

.grid { display: grid; gap: var(--space-md); }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-xs); }

@media (max-width: 1000px) {
  .grid--3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .panel--split > * { min-width: 0; }
}

@media (max-width: 760px) and (min-width: 481px) {
  .grid--4 { grid-template-columns: 1fr 1fr; }
}
