/* Design tokens: Bonaventura Auctions, "Public Record" direction.
   Single source of truth for color, type, space, shape, texture and motion.
   Edit here first. Names from the v0.2 draft (--paper, --gold, --ease…) are
   kept as aliases so the pages built before Phase 3 keep working. */
:root {
  /* ---------- Palette (six colours, nothing else on the page) ---------- */
  --newsprint: #F2EDE2;  /* page ground, scrim, card and calendar surface */
  --ink:       #141210;  /* headings, body, primary button, "today", footer, bars */
  --lead:      #5B564D;  /* secondary text: eyebrows, captions, legend, past days */
  --rule:      #CFC7B5;  /* hairlines, grid lines, chip borders. Decorative only, never text */
  --red:       #A9231B;  /* Notary Red: stamps, H1 underline, focus ring, ::selection, link hover, errors */
  --brass:     #B48A2C;  /* second accent, dark surfaces only: "today" border and count, footer rules */

  /* Derived tints, all built from the six above */
  --ink-2: #2A2622;                              /* ink hover */
  --ink-3: #3A352F;                              /* ink active / dark surface 2 */
  --newsprint-2: #E9E3D5;                        /* secondary surface: table zebra, disabled fields */
  --rule-soft: rgba(20, 18, 16, 0.08);           /* hairline on newsprint when 1px Rule is too strong */
  --line-on-ink: rgba(242, 237, 226, 0.18);      /* hairline on ink */
  --on-ink:   var(--newsprint);                  /* text on ink (16.01:1) */
  --on-ink-2: #C9C3B6;                           /* secondary text on ink (10.5:1) */
  --on-ink-3: #9A948A;                           /* tertiary text on ink (6.1:1) */
  --red-soft: rgba(169, 35, 27, 0.10);           /* error field tint */
  --brass-soft: rgba(180, 138, 44, 0.18);        /* brass tint on ink */

  /* Sale status. Each pair also differs in lightness, never hue alone.
     Confirmed and update stay neutral; only adjourned (warn) and cancelled (red) carry colour. */
  --ok-bg:   #E6EBDF; --ok-fg:   #2E5A3B; --ok-bd:   #9FB59C;
  --warn-bg: #F3E4C4; --warn-fg: #6E4A05; --warn-bd: #D7B46A;
  --bad-bg:  #F1DCD8; --bad-fg:  var(--red); --bad-bd: #D49A93;
  --info-bg: #E2E4E6; --info-fg: #3A4A66; --info-bd: #A6AEBB;

  /* Draft aliases (Phase 3 removes these as each section is restyled) */
  --paper: var(--newsprint);
  --paper-2: var(--newsprint-2);
  --white: var(--newsprint);
  --gold: var(--brass);
  --gold-deep: var(--red);         /* brass fails on paper (2.72:1); the draft used --gold-deep for text and hover, which is now red */
  --gold-soft: var(--brass-soft);
  --gold-on-ink: var(--brass);
  --text: var(--ink);
  --text-2: var(--lead);
  --text-3: var(--lead);
  --line: var(--rule);
  --line-strong: var(--ink);
  --grid-line: var(--rule-soft);
  --grid-line-on-ink: var(--line-on-ink);

  /* ---------- Type ---------- */
  --font-display: 'BA Serif Display', 'BA Serif', 'BA Serif Fallback', Georgia, 'Times New Roman', serif;
  --font-body:    'BA Serif', 'BA Serif Fallback', Georgia, 'Times New Roman', serif;
  --font-label:   'BA Grotesk', 'BA Grotesk Fallback', Arial, Helvetica, sans-serif;
  --font-mono:    'BA Mono', 'BA Mono Fallback', 'Courier New', ui-monospace, monospace;

  /* Scale. Display is 9.4x body at the top of the clamp. */
  --fs-hero:  clamp(2.5rem, 6.5vw, 6rem);                /* 40px phone, 94px at 1440, 96px max; 5.6x body */
  --fs-h2:    clamp(1.875rem, 1rem + 2.6vw, 3.25rem);    /* 30px to 52px */
  --fs-h3:    clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);  /* 20px to 28px */
  --fs-xl:    clamp(2.5rem, 1.5rem + 4vw, 5rem);         /* big figures: counts, results */
  --fs-lead:  clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);  /* 17px to 20px */
  --fs-body:  clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);   /* 16px phone, 17px desktop */
  --fs-sm:    0.9375rem;   /* 15px */
  --fs-xs:    0.8125rem;   /* 13px: the smalltype floor for running text */
  --fs-label: 0.75rem;     /* 12px caps labels */
  --fs-tag:   0.6875rem;   /* 11px caps tags, never running text */

  --lh-display: 0.92;
  --lh-tight:   0.95;
  --lh-heading: 1.08;
  --lh-lead:    1.4;
  --lh-body:    1.5;
  --lh-small:   1.35;

  --track-display: -0.02em;
  --track-caps:    0.08em;
  --track-wide:    0.14em;
  --track-tag:     0.1em;

  --fw-display: 500;
  --fw-body: 400;
  --fw-bold: 600;

  /* ---------- Space (8px baseline) ---------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --section-y: clamp(56px, 4vw + 40px, 112px);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --col-gap: 24px;
  --measure: 64ch;
  --measure-lead: 56ch;

  /* ---------- Shape ---------- */
  --r-0: 0;
  --r-chip: 2px;          /* chips, tags and the focus ring only */
  --r-sm: 0; --r-md: 0; --r-lg: 0; --r-xl: 0;   /* draft aliases: no radius anywhere else */
  --r-pill: var(--r-chip);
  --shadow-card: none;
  --shadow-lift: none;
  --hairline: 1px;
  --rule-heavy: 3px;      /* the lower rule of the Oxford pair */

  /* Deliberate imperfection, held in tokens so it is consistent */
  --tilt-stamp: -3deg;
  --tilt-clip: -1.2deg;
  --offset-figure: -0.4em;
  --bleed: calc(50% - 50vw);

  /* ---------- Texture ---------- */
  --grain: url('/assets/grain.png');           /* 64x64 indexed PNG, under 1KB, tiled over the page ground */
  --halftone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='1.1' fill='%23141210' fill-opacity='.18'/%3E%3C/svg%3E");

  /* ---------- Motion ---------- */
  --dur-fast: 160ms;
  --dur-base: 420ms;
  --dur-slow: 900ms;
  --ease-ink:   cubic-bezier(0.16, 1, 0.3, 1);      /* decelerating: reveals, magnetic CTA, hovers */
  --ease-stamp: cubic-bezier(0.34, 1.56, 0.64, 1);  /* overshoot: the stamp only */
  --ease-rule:  cubic-bezier(0.65, 0, 0.35, 1);     /* symmetric: scaleX draws, clip-path */
  --stagger-line: 45ms;
  --stagger-word: 18ms;
  --stagger-max: 8;
  --ease: var(--ease-ink);                           /* draft alias */

  /* ---------- Layout ---------- */
  --tap: 44px;
  --header-h: 64px;
  --z-header: 50;
  --z-bar: 40;
  --z-nav: 55;
  --z-dialog: 100;
  --z-skip: 110;
}

@media (max-width: 1079px) {
  :root { --header-h: 56px; }
}
