/* brand-rubine.css: every brand decision for the research-lab template lives here.
   Identity 6 (Rubine). Sources: project/02-brand/identity-6-rubine/tokens.json, palette.json, contrast.md.
   Pages: rubine.html loads this file and assets/rubine/ (mark.svg, wordmark.svg, plate-*.webp).
   To re-skin: a new brand-<name>.css with the same properties, plus an assets/<name>/ folder.
   site.css reads only the custom properties below. */

@font-face {
  font-family: "pre spin Funnel";
  src: url("assets/fonts/text.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "pre spin Funnel";
  src: url("assets/fonts/display.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback so the swap does not move the page. */
@font-face {
  font-family: "pre spin Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
  size-adjust: 98%;
  ascent-override: 98%;
  descent-override: 26%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light dark;

  /* Brand colour: one blue scale; the gradient lands on 700, 600, 500. */
  --brand-100: #FEECED;
  --brand-200: #FCD2D5;
  --brand-300: #FBA7B1;
  --brand-400: #EF6A82;
  --brand-500: #E0245D;
  --brand-600: #CE0058;
  --brand-700: #B4004E;
  --brand-800: #8A053B;
  --brand-900: #540723;
  --brand: var(--brand-600);
  --brand-grad: linear-gradient(180deg, var(--brand-700) 0%, var(--brand-600) 50%, var(--brand-500) 100%);
  --on-brand: #FFFFFF;
  --on-brand-muted: #FFFFFF;          /* contrast.md: no tint passes body on the gradient, so all text is white */
  --button-ink: var(--brand-800);     /* text on the white button on the brand ground */
  /* Closing band: identity 5's generated frosted glass (id5-frosted-glass-6afa740a-t1), cropped 21:9 with the light
     in the lower right, graded with this identity's src/grade.py. White type: at least 4.69:1 anywhere on it. */
  --brand-plate: image-set(url("assets/rubine/band-1440.webp") 1x, url("assets/rubine/band-2880.webp") 2x);
  --brand-plate-sm: url("assets/rubine/band-2880.webp");
  --danger: #B93500;                   /* not used on this page; here so forms inherit it */

  /* Neutrals: warm stone, Paper to Ink. */
  --paper: #F4F2EE;
  --ink: #111111;
  --n-100: #EBE9E5;
  --n-200: #DBD9D5;
  --n-300: #BFBDB9;
  --n-400: #9A9894;
  --n-500: #797774;
  --n-600: #5C5B58;

  /* Roles the template uses (derived from the above; override per theme). */
  --surface: var(--paper);
  --text: var(--ink);
  --text-muted: var(--n-600);
  --rule: var(--n-200);
  --rule-strong: var(--ink);
  --accent: var(--brand-800);         /* palette.json light accent-text: links and marks on paper */
  --accent-hover: var(--brand-900);
  --accent-tint: var(--brand-300);
  --focus: var(--brand-600);
  --selection: var(--brand-200);
  --bit-one: var(--ink);
  --bit-zero: var(--n-200);
  --bit-diff-one: var(--brand-600);
  --bit-diff-zero: var(--brand-400);

  /* Logo colour. The SVG slots are single-colour; filters set ink or white. */
  --logo-ink: brightness(0) saturate(100%);
  --logo-on-brand: brightness(0) invert(1);
  --logo-on-dark: brightness(0) invert(1);

  /* Lockup geometry, in wordmark heights (concept.md: mark 1.5 x-height, gap 0.6 x-height). */
  --lockup-mark-h: 0.878;
  --lockup-mark-ratio: 1.129;
  --lockup-gap: 0.351;
  --lockup-mark-dy: 0.044;
  --wordmark-ratio: 4.045;

  /* Type */
  --font-display: "pre spin Funnel", "pre spin Fallback", system-ui, sans-serif;
  --font-text: "pre spin Funnel", "pre spin Fallback", system-ui, sans-serif;
  --weight-text: 400;
  --weight-display: 500;
  --tracking-display: -0.025em;
  --step--1: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-0: clamp(1.0625rem, 1.01rem + 0.25vw, 1.1875rem);
  --step-1: clamp(1.1875rem, 1.12rem + 0.32vw, 1.375rem);
  --step-2: clamp(1.4375rem, 1.3rem + 0.6vw, 1.8125rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.1vw, 2.5rem);
  --step-4: clamp(2.125rem, 1.7rem + 1.9vw, 3.375rem);
  --step-5: clamp(2.625rem, 1.9rem + 3.3vw, 5rem);
  --step-6: clamp(3.125rem, 2rem + 5vw, 6.5rem);

  /* Shape */
  --radius: 3px;
  --rule-w: 1px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #111111;
    --text: #F4F2EE;
    --text-muted: #BFBDB9;
    --rule: #292928;
    --rule-strong: #F4F2EE;
    --accent: var(--brand-300);
    --accent-hover: var(--brand-200);
    --accent-tint: var(--brand-700);
    --focus: var(--brand-400);
    --selection: var(--brand-800);
    --bit-one: #F4F2EE;
    --bit-zero: #292928;
    --bit-diff-one: var(--brand-400);
    --bit-diff-zero: var(--brand-600);
    --logo-ink: brightness(0) invert(1);
  }
}
:root[data-theme="dark"] {
  --surface: #111111;
  --text: #F4F2EE;
  --text-muted: #BFBDB9;
  --rule: #292928;
  --rule-strong: #F4F2EE;
  --accent: var(--brand-300);
  --accent-hover: var(--brand-200);
  --accent-tint: var(--brand-700);
  --focus: var(--brand-400);
  --selection: var(--brand-800);
  --bit-one: #F4F2EE;
  --bit-zero: #292928;
  --bit-diff-one: var(--brand-400);
  --bit-diff-zero: var(--brand-600);
  --logo-ink: brightness(0) invert(1);
}
