/* ==========================================================================
   Arca — design tokens  ·  demo: Fondazione Arca
   Gallery white + ink. One accent at a time, which changes with the current
   exhibition ([data-exhibit] on <html>). Variable Fraunces (opsz/SOFT/WONK/wght
   axes are animatable) + Geist Mono for gallery labels and data. Max 2 families.
   Contrast: the accent is a SURFACE (--on-accent text on top) or a large graphic
   element; it is never used as small text on paper.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic-latin-ext.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-ext.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ---- Colour: palette ------------------------------------------------ */
  --c-paper: #f4f4f1;      /* gallery white: base surface */
  --c-paper-deep: #e8e8e4; /* plaster: alternate sections */
  --c-bone: #ffffff;       /* cards / fields on paper */
  --c-ink: #0e0e0e;        /* ink: text and dark sections */
  --c-ink-soft: #1a1a1a;   /* cards on dark */
  --c-stone: #5a5a55;      /* secondary text on paper (AA: 5.4:1 on paper) */
  --c-dust: #9c9c95;       /* secondary text on dark (AA on ink) */
  --c-danger: #b3261e;
  --c-ok: #2f7a4f;

  /* Exhibition accents. Each has its own AA-contrast "on" text colour. */
  --x-oxblood: #7a1f2b;  --x-oxblood-on: #ffffff;
  --x-forest: #1f4a3a; --x-forest-on: #ffffff;
  --x-bronze: #86652a;    --x-bronze-on: #ffffff;
  --x-plum: #4a2a52;   --x-plum-on: #ffffff;

  /* ---- Colour: semantic (overridden by [data-theme]) ------------------ */
  --bg: var(--c-paper);
  --bg-raised: var(--c-bone);
  --bg-sunk: var(--c-paper-deep);
  --fg: var(--c-ink);
  --fg-muted: var(--c-stone);
  --line: rgba(14, 14, 14, 0.16);
  --line-strong: rgba(14, 14, 14, 0.9);
  --field-line: rgba(14, 14, 14, 0.38);
  --accent: var(--x-oxblood);
  --on-accent: var(--x-oxblood-on);

  /* ---- Typography ------------------------------------------------------ */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* variable axes: display type is "carved" (max opsz, WONK on) */
  --fv-display: "opsz" 144, "SOFT" 0, "WONK" 1;
  --fv-body: "opsz" 14, "SOFT" 0, "WONK" 0;
  --fw-display: 380;
  --fw-body: 380;

  /* fluid scale (320 → 1440) */
  --fs-mega: clamp(4.25rem, 1.2rem + 15.5vw, 17rem);     /* wordmark, hero */
  --fs-display-xl: clamp(3.5rem, 1.1rem + 10.6vw, 12rem);
  --fs-display-l: clamp(3rem, 1.1rem + 7.4vw, 8.5rem);
  --fs-h1: clamp(2.75rem, 1.2rem + 5.6vw, 6.25rem);
  --fs-h2: clamp(2rem, 1.2rem + 3.3vw, 4.25rem);
  --fs-h3: clamp(1.5rem, 1.1rem + 1.6vw, 2.375rem);
  --fs-h4: clamp(1.25rem, 1.05rem + 0.7vw, 1.625rem);
  --fs-lead: clamp(1.1875rem, 1.05rem + 0.55vw, 1.5rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-label: 0.72rem;
  --lh-display: 0.88;
  --lh-heading: 1.02;
  --lh-body: 1.6;
  --ls-display: -0.035em;
  --ls-label: 0.07em;

  /* ---- Spacing (base 4) -------------------------------------------------- */
  --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: 8rem;   --s-11: 11rem;
  --section-y: clamp(5rem, 3rem + 8vw, 10rem);

  /* ---- Layout ---------------------------------------------------------- */
  --container: 1440px;
  --gutter: clamp(1.25rem, 0.5rem + 2.6vw, 2.5rem);
  --col-gap: clamp(1rem, 0.6rem + 1.2vw, 1.75rem);
  --nav-h: 76px;

  /* ---- Shape: the arch is the signature ---------------------------------------- */
  --r-arch: 999px 999px 0 0;     /* round arch */
  --r-arch-soft: 50% 50% 0 0 / 38% 38% 0 0;
  --r-sm: 4px;
  --r-md: 10px;
  --r-pill: 999px;

  /* ---- Motion ------------------------------------------------------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);       /* expo-ish: soft landing */
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --dur-1: 0.18s; --dur-2: 0.35s; --dur-3: 0.7s; --dur-4: 1.2s;

  /* ---- Shadows: "hung" (far, diffuse) → "placed" (close, crisp) ----- */
  --lift: 0; /* 0 = placed · 1 = lifted; animated by GSAP */
  --shadow-art: 0 calc(6px + 38px * var(--lift)) calc(14px + 56px * var(--lift)) calc(-4px - 6px * var(--lift)) rgba(14, 14, 14, calc(0.3 - 0.1 * var(--lift)));

  /* ---- Z-index --------------------------------------------------------- */
  --z-nav: 50; --z-menu: 60; --z-cursor: 90; --z-curtain: 100;
}

/* ---- Section themes ---------------------------------------------------- */
[data-theme="dark"] {
  --bg: var(--c-ink);
  --bg-raised: var(--c-ink-soft);
  --bg-sunk: #070707;
  --fg: var(--c-paper);
  --fg-muted: var(--c-dust);
  --line: rgba(244, 244, 241, 0.18);
  --line-strong: rgba(244, 244, 241, 0.9);
  --field-line: rgba(244, 244, 241, 0.4);
  /* deep pigments disappear on black: dark sections use gallery white as their accent */
  --accent: var(--c-paper);
  --on-accent: var(--c-ink);
}
[data-theme="stone"] {
  --bg: var(--c-paper-deep);
  --bg-raised: var(--c-paper);
  --bg-sunk: #d9d9d4;
}
[data-theme="accent"] {
  --bg: var(--accent);
  --bg-raised: color-mix(in srgb, var(--accent) 88%, #000);
  --fg: var(--on-accent);
  --fg-muted: color-mix(in srgb, var(--on-accent) 72%, var(--accent));
  --line: color-mix(in srgb, var(--on-accent) 28%, transparent);
  --line-strong: var(--on-accent);
  --field-line: color-mix(in srgb, var(--on-accent) 55%, transparent);
}

/* ---- Current exhibition → accent of the whole site -------------------------- */
[data-exhibit="oxblood"]  { --accent: var(--x-oxblood);  --on-accent: var(--x-oxblood-on); }
[data-exhibit="forest"] { --accent: var(--x-forest); --on-accent: var(--x-forest-on); }
[data-exhibit="bronze"]    { --accent: var(--x-bronze);    --on-accent: var(--x-bronze-on); }
[data-exhibit="plum"]   { --accent: var(--x-plum);   --on-accent: var(--x-plum-on); }
