/* HALFLIGHT tokens: the single source of truth. Re-skin here first. */

@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-italic-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* primitives: candlelight paper, umber ink, dusty juniper accent.
     Some steps are intentionally unused on the demo pages; they are part
     of the scale so re-skins have room to move. */
  --candle: #f3e8da;
  --candle-2: #ecdfcc;
  --candle-3: #e2d2bc;
  --umber: #3e2f23;
  --umber-2: #34271d;
  --umber-3: #2b2018;
  --white: #fdf9f2;
  --juniper: #4a5d53;       /* deep: AA on candlelight at label sizes (5.8:1) */
  --juniper-bright: #86a495; /* bright: AA on umber at label sizes (4.7:1) */
  --juniper-raw: #7e9c8d;    /* large marks on dark grounds only */

  /* semantic (candlelight theme is the default) */
  --bg: var(--candle);
  --bg-2: var(--candle-2);
  --fg: var(--umber);
  --muted: #5d4e40;
  --line: rgba(62, 47, 35, 0.18);
  --line-strong: rgba(62, 47, 35, 0.55);
  --accent: var(--juniper);
  --accent-raw: var(--juniper);
  --focus: #274a3a;

  /* the press (button) reads its own ground, so components never touch primitives */
  --press-bg: var(--umber);
  --press-fg: var(--candle);
  --press-hover-bg: var(--juniper);
  --press-hover-fg: var(--candle);

  /* type */
  --font-display: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Onest", "Helvetica Neue", Arial, sans-serif;
  --t-display: clamp(2.5rem, 8.5vw, 7.5rem);
  --t-h1: clamp(2.4rem, 6vw, 5.25rem);
  --t-h2: clamp(1.9rem, 4vw, 3.4rem);
  --t-h3: clamp(1.3rem, 2.2vw, 1.85rem);
  --t-lead: clamp(1.15rem, 1.7vw, 1.45rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-inscription: 0.72rem;
  --lh-tight: 0.98;
  --lh-heading: 1.08;
  --lh-body: 1.6;
  --track-inscription: 0.18em;

  /* space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 9rem;
  --section-pad: clamp(5rem, 12vh, 9rem);
  --gutter: clamp(1rem, 2.5vw, 1.5rem);
  --edge: clamp(1.25rem, 4vw, 4rem);
  --measure: 40rem;
  --max-w: 84rem;
  --seam-w: clamp(9rem, 16vw, 15rem); /* width of the center seam column */
  --ribbon-h: 4.25rem;                /* the fixed top ribbon reserves its own band */

  /* shape + depth */
  --r-1: 3px;
  --r-2: 8px;
  --r-pill: 999px;
  --shadow-plate: 0 1px 2px rgba(43, 32, 24, 0.1), 0 14px 34px rgba(43, 32, 24, 0.12);

  /* motion */
  --dur-1: 150ms;
  --dur-2: 320ms;
  --dur-3: 700ms;
  --dur-4: 1100ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.83, 0, 0.17, 1);
  --drift-max: 30px; /* counterpoint drift amplitude, consumed by main.js */

  /* layers */
  --z-ribbon: 40;
  --z-veil: 50;
  --z-skip: 60;
}

/* umber theme: any element with data-theme="umber" flips the semantic set */
[data-theme="umber"] {
  --bg: var(--umber);
  --bg-2: var(--umber-2);
  --fg: var(--candle);
  --muted: #b3a290;
  --line: rgba(243, 232, 218, 0.2);
  --line-strong: rgba(243, 232, 218, 0.6);
  --accent: var(--juniper-bright);
  --accent-raw: var(--juniper-raw);
  --focus: #cfe6da;
  --press-bg: var(--candle);
  --press-fg: var(--umber);
  --press-hover-bg: var(--juniper-bright);
  --press-hover-fg: var(--umber-3);
}

/* candlelight theme, named: flips a nested wrapper back to the default ground */
[data-theme="candle"] {
  --bg: var(--candle);
  --bg-2: var(--candle-2);
  --fg: var(--umber);
  --muted: #5d4e40;
  --line: rgba(62, 47, 35, 0.18);
  --line-strong: rgba(62, 47, 35, 0.55);
  --accent: var(--juniper);
  --accent-raw: var(--juniper);
  --focus: #274a3a;
  --press-bg: var(--umber);
  --press-fg: var(--candle);
  --press-hover-bg: var(--juniper);
  --press-hover-fg: var(--candle);
}
