/* ==========================================================================
   Stonex, Stone Atelier — brand tokens v1.0 (November 2026)
   Mirrors brand/tokens.json. Change both together.
   Fonts are loaded separately; see brand/README.md → "Fonts".
   ========================================================================== */

:root {
  /* ---------- Palette: the six brand colours ---------- */
  --sx-avorio: #F3EEE6;        /* ground */
  --sx-carta: #FBFAF7;         /* paper */
  --sx-pietra: #D9D2C7;        /* hairlines */
  --sx-nero: #17130F;          /* logo, text */
  --sx-oro: #B08D57;           /* foil, brass */
  --sx-tortora: #6B6257;       /* secondary text */

  /* ---------- Support tones: web only, never in the logo ---------- */
  --sx-pietra-chiara: #EBE6DC; /* warm stone band (ground of the gold logo on the sheet) */
  --sx-oro-scuro: #7D633B;     /* gold that passes 4.5:1 as text on every light ground */
  --sx-nero-80: #2E2822;       /* hover on Nero; raised surface on dark */
  --sx-terra: #9A3A26;         /* form errors only */

  /* ---------- Colour roles (light, the default) ---------- */
  --color-bg: var(--sx-avorio);
  --color-surface: var(--sx-carta);          /* cards, inputs, header on scroll */
  --color-band: var(--sx-pietra-chiara);     /* alternating section */
  --color-line: var(--sx-pietra);            /* 1px hairlines, dividers */
  --color-text: var(--sx-nero);
  --color-text-muted: var(--sx-tortora);     /* captions, meta, secondary copy */
  --color-accent: var(--sx-oro);             /* marks, rules, dots. Not text on light grounds */
  --color-accent-text: var(--sx-oro-scuro);  /* gold-coloured text, links on hover */
  --color-action: var(--sx-nero);            /* primary button fill */
  --color-action-hover: var(--sx-nero-80);
  --color-on-action: var(--sx-carta);
  --color-control-line: var(--sx-tortora);   /* input underline, checkbox border (3:1+) */
  --color-focus: var(--sx-oro-scuro);
  --color-error: var(--sx-terra);

  /* ---------- Typography ---------- */
  --font-display: "Bodoni Moda", "Noto Serif Display", "Noto Serif Armenian", Didot, Georgia, serif;
  --font-text: "Tenor Sans", "Noto Sans Armenian", "Helvetica Neue", Arial, sans-serif;
  --opsz-display: 24;          /* Bodoni Moda optical size: the logo's cut. Keeps hairlines visible on screen */
  --weight-display: 400;       /* headlines. The logo itself is 500 */
  --weight-text: 400;          /* Tenor Sans has one weight. Never bold, never faux italic */

  --text-display: clamp(3rem, 1.6rem + 5.6vw, 7rem);      /* 48 → 112 */
  --text-h1: clamp(2.5rem, 1.6rem + 3.6vw, 4.75rem);      /* 40 → 76  */
  --text-h2: clamp(2rem, 1.5rem + 2vw, 3.25rem);          /* 32 → 52  */
  --text-h3: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);         /* 24 → 32  */
  --text-h4: 1.25rem;                                     /* 20       */
  --text-lead: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem); /* 18 → 21 */
  --text-body: 1.0625rem;                                 /* 17       */
  --text-small: 0.875rem;                                 /* 14       */
  --text-label: 0.75rem;                                  /* 12, caps */
  --text-micro: 0.6875rem;                                /* 11, caps */

  --leading-display: 1.02;
  --leading-heading: 1.12;
  --leading-tight: 1.35;
  --leading-body: 1.7;

  --tracking-display: -0.01em;
  --tracking-label: 0.24em;    /* nav, buttons, eyebrows */
  --tracking-wide: 0.4em;      /* the logo's subline spacing; sparing, short words only */

  /* ---------- Space (4px base) ---------- */
  --space-1: 0.25rem;   /* 4   */
  --space-2: 0.5rem;    /* 8   */
  --space-3: 0.75rem;   /* 12  */
  --space-4: 1rem;      /* 16  */
  --space-5: 1.5rem;    /* 24  */
  --space-6: 2rem;      /* 32  */
  --space-7: 3rem;      /* 48  */
  --space-8: 4rem;      /* 64  */
  --space-9: 6rem;      /* 96  */
  --space-10: 8rem;     /* 128 */
  --space-11: 12rem;    /* 192 */

  /* ---------- Layout ---------- */
  --container: 90rem;                               /* 1440 */
  --margin: clamp(1.25rem, 5vw, 5.5rem);            /* 20 → 88 page margin */
  --gutter: clamp(1rem, 0.5rem + 1.5vw, 1.5rem);    /* 16 → 24 */
  --measure: 38rem;                                 /* ≈ 62 characters of body text */
  --section-y: clamp(6rem, 4rem + 8vw, 12rem);      /* 96 → 192 vertical rhythm */
  --header-h: 5rem;

  /* ---------- Lines, corners, depth ---------- */
  --line: 1px;
  --radius: 0;          /* cut stone has square edges */
  --shadow: none;       /* no drop shadows anywhere */

  /* ---------- Motion ---------- */
  --ease-settle: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-quick: 200ms;   /* hover, focus */
  --dur-base: 400ms;    /* menus, accordions */
  --dur-slow: 800ms;    /* image and section reveals */
}

/* ---------- Scripts: Cyrillic and Armenian headlines ---------- */
:lang(ru) {
  --font-display: "Noto Serif Display", "Bodoni Moda", Georgia, serif;
}
:lang(hy) {
  --font-display: "Noto Serif Armenian", "Bodoni Moda", Georgia, serif;
  --font-text: "Noto Sans Armenian", "Tenor Sans", Arial, sans-serif;
  --tracking-label: 0.12em;   /* Armenian caps need less spacing */
}

/* ---------- Dark ground (Nero sections, footer, packaging pages) ---------- */
[data-ground="nero"] {
  --color-bg: var(--sx-nero);
  --color-surface: var(--sx-nero-80);
  --color-band: var(--sx-nero-80);
  --color-line: var(--sx-tortora);
  --color-text: var(--sx-avorio);
  --color-text-muted: var(--sx-pietra);
  --color-accent: var(--sx-oro);
  --color-accent-text: var(--sx-oro);        /* 5.98:1 on Nero */
  --color-action: var(--sx-avorio);
  --color-action-hover: var(--sx-pietra);
  --color-on-action: var(--sx-nero);
  --color-control-line: var(--sx-pietra);
  --color-focus: var(--sx-oro);
  background: var(--color-bg);
  color: var(--color-text);
}

/* ---------- Base type helpers ---------- */
.sx-display, .sx-h1, .sx-h2, .sx-h3, .sx-h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-variation-settings: "opsz" var(--opsz-display);
  font-synthesis: none;
  text-wrap: balance;
}
.sx-display { font-size: var(--text-display); line-height: var(--leading-display); letter-spacing: var(--tracking-display); }
.sx-h1 { font-size: var(--text-h1); line-height: var(--leading-display); letter-spacing: var(--tracking-display); }
.sx-h2 { font-size: var(--text-h2); line-height: var(--leading-heading); }
.sx-h3 { font-size: var(--text-h3); line-height: var(--leading-heading); }
.sx-h4 { font-size: var(--text-h4); line-height: var(--leading-tight); font-weight: 500; }
.sx-lead { font-family: var(--font-text); font-size: var(--text-lead); line-height: 1.6; }
.sx-body { font-family: var(--font-text); font-size: var(--text-body); line-height: var(--leading-body); }
.sx-small { font-family: var(--font-text); font-size: var(--text-small); line-height: 1.55; color: var(--color-text-muted); }
.sx-label {
  font-family: var(--font-text);
  font-size: var(--text-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
