/* ==========================================================================
   Albumator design tokens
   Printed-matter craft meets precise software: warm paper, navy ink, rose
   accent. Light theme is the default; dark follows prefers-color-scheme and
   can be forced with <html data-theme="light|dark">.

   Public contract (used by every page and by the editor):
     colours   --bg --surface --surface-2 --surface-sunk --ink --muted --faint
               --line --line-strong --accent --accent-strong --accent-ink
               --accent-soft --navy --cream --ok --warn --danger --focus
     space     --space-1 .. --space-10   (4px base)
     radius    --radius-xs .. --radius-xl, --radius-pill
     shadow    --shadow-1 .. --shadow-4, --shadow-slot
     motion    --ease-out --ease-in-out --ease-spring --dur-1 .. --dur-4
     type      --font-ui --font-display --font-mono, --text-2xs .. --text-hero
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-italic-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("/fonts/caveat-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* brand constants (never change between themes) */
  --navy: #292a35;
  --cream: #fdfaec;
  --rose: #c4566c;

  /* surfaces: warm paper */
  --bg: #f3eddc;
  --bg-grain: rgba(41, 42, 53, 0.035);
  --surface: #fdfaec;
  --surface-2: #f8f3e2;
  --surface-sunk: #ece5d0;
  --surface-raised: #ffffff;

  /* ink */
  --ink: #292a35;
  --muted: #5f6070;       /* 5.6:1 on --surface */
  --faint: #8b8a92;       /* decorative / disabled only */
  --line: rgba(41, 42, 53, 0.12);
  --line-strong: rgba(41, 42, 53, 0.24);

  /* accent: rose. --accent is decorative; use --accent-strong for fills with
     white text and --accent-ink for text on paper (both >= 4.5:1). */
  --accent: #c4566c;
  --accent-strong: #b0405a;
  --accent-hover: #9c344d;
  --accent-ink: #a23850;
  --accent-soft: rgba(196, 86, 108, 0.12);
  --on-accent: #ffffff;

  /* signal */
  --ok: #2f7a5a;
  --ok-soft: rgba(47, 122, 90, 0.13);
  --warn: #9a6200;
  --warn-soft: rgba(201, 138, 20, 0.16);
  --danger: #b3261e;
  --danger-soft: rgba(179, 38, 30, 0.1);
  --focus: #3b6fd6;

  /* complementary art palette used by the generated "photos" */
  --sun: #f2c14e;
  --teal: #2a8c8a;
  --sage: #8fae7c;
  --sky: #9cc9d9;

  /* spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;
  --space-9: 72px;
  --space-10: 112px;

  /* radius: paper corners are small, UI is a little softer */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* shadows: layered, warm-tinted so paper feels lifted, not floating */
  --shadow-color: 41 30 20;
  --shadow-1: 0 1px 0 rgb(var(--shadow-color) / 0.06), 0 1px 2px rgb(var(--shadow-color) / 0.08);
  --shadow-2: 0 1px 1px rgb(var(--shadow-color) / 0.05), 0 4px 10px -2px rgb(var(--shadow-color) / 0.1), 0 10px 24px -8px rgb(var(--shadow-color) / 0.1);
  --shadow-3: 0 2px 2px rgb(var(--shadow-color) / 0.05), 0 12px 28px -6px rgb(var(--shadow-color) / 0.16), 0 28px 56px -16px rgb(var(--shadow-color) / 0.18);
  --shadow-4: 0 4px 6px rgb(var(--shadow-color) / 0.06), 0 24px 48px -8px rgb(var(--shadow-color) / 0.22), 0 56px 96px -24px rgb(var(--shadow-color) / 0.28);
  --shadow-slot: 0 1px 0 rgb(255 255 255 / 0.6) inset, 0 1px 2px rgb(var(--shadow-color) / 0.2);
  --shadow-focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus);

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-in: cubic-bezier(0.5, 0, 0.9, 0.4);
  /* spring-like overshoot; the linear() version is a real damped spring */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 360ms;
  --dur-4: 640ms;

  /* type */
  --font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-hand: "Caveat", "Bradley Hand", cursive;

  --text-2xs: 0.6875rem;  /* 11 */
  --text-xs: 0.75rem;     /* 12 */
  --text-sm: 0.8125rem;   /* 13 */
  --text-md: 0.9375rem;   /* 15 base UI */
  --text-lg: 1.0625rem;   /* 17 */
  --text-xl: 1.25rem;     /* 20 */
  --text-2xl: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --text-3xl: clamp(1.75rem, 1.4rem + 1.2vw, 2.375rem);
  --text-4xl: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  --text-hero: clamp(2.75rem, 1.4rem + 5.6vw, 6rem);
  --leading-tight: 1.05;
  --leading-snug: 1.25;
  --leading-body: 1.55;

  /* layers */
  --z-sticky: 20;
  --z-menu: 60;
  --z-dialog: 80;
  --z-toast: 100;

  --header-h: 60px;
  --content-w: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* ---------- dark: "ink-black paper" - navy-tinted, never pure black ------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14151b;
  --bg-grain: rgba(255, 250, 236, 0.03);
  --surface: #1c1d26;
  --surface-2: #232430;
  --surface-sunk: #101116;
  --surface-raised: #2a2b38;

  --ink: #f2ecda;
  --muted: #a7a6b3;        /* 7:1 on --surface */
  --faint: #6f6f7d;
  --line: rgba(253, 250, 236, 0.1);
  --line-strong: rgba(253, 250, 236, 0.22);

  --accent: #e07a90;
  --accent-strong: #d9647c;
  --accent-hover: #e8788e;
  --accent-ink: #f0a0b0;
  --accent-soft: rgba(224, 122, 144, 0.16);
  --on-accent: #1a0d11;

  --ok: #6fcf9f;
  --ok-soft: rgba(111, 207, 159, 0.14);
  --warn: #f0b84a;
  --warn-soft: rgba(240, 184, 74, 0.15);
  --danger: #ff8b82;
  --danger-soft: rgba(255, 139, 130, 0.14);
  --focus: #8db2ff;

  --shadow-color: 0 0 0;
  --shadow-1: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 1px 2px rgb(0 0 0 / 0.5);
  --shadow-2: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 6px 14px -4px rgb(0 0 0 / 0.55);
  --shadow-3: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 16px 32px -8px rgb(0 0 0 / 0.6), 0 30px 60px -20px rgb(0 0 0 / 0.5);
  --shadow-4: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 28px 56px -8px rgb(0 0 0 / 0.7), 0 60px 100px -30px rgb(0 0 0 / 0.6);
  --shadow-slot: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 1px 2px rgb(0 0 0 / 0.5);
  --shadow-focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14151b;
    --bg-grain: rgba(255, 250, 236, 0.03);
    --surface: #1c1d26;
    --surface-2: #232430;
    --surface-sunk: #101116;
    --surface-raised: #2a2b38;

    --ink: #f2ecda;
    --muted: #a7a6b3;
    --faint: #6f6f7d;
    --line: rgba(253, 250, 236, 0.1);
    --line-strong: rgba(253, 250, 236, 0.22);

    --accent: #e07a90;
    --accent-strong: #d9647c;
    --accent-hover: #e8788e;
    --accent-ink: #f0a0b0;
    --accent-soft: rgba(224, 122, 144, 0.16);
    --on-accent: #1a0d11;

    --ok: #6fcf9f;
    --ok-soft: rgba(111, 207, 159, 0.14);
    --warn: #f0b84a;
    --warn-soft: rgba(240, 184, 74, 0.15);
    --danger: #ff8b82;
    --danger-soft: rgba(255, 139, 130, 0.14);
    --focus: #8db2ff;

    --shadow-color: 0 0 0;
    --shadow-1: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 1px 2px rgb(0 0 0 / 0.5);
    --shadow-2: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 6px 14px -4px rgb(0 0 0 / 0.55);
    --shadow-3: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 16px 32px -8px rgb(0 0 0 / 0.6), 0 30px 60px -20px rgb(0 0 0 / 0.5);
    --shadow-4: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 28px 56px -8px rgb(0 0 0 / 0.7), 0 60px 100px -30px rgb(0 0 0 / 0.6);
    --shadow-slot: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 1px 2px rgb(0 0 0 / 0.5);
  }
}

/* A real damped spring where supported (Chromium/Safari/Firefox 112+). */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(
      0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.9%,
      1.077 23.6%, 1.1 27.5%, 1.092 31.2%, 1.062 35.4%, 1.011 43.4%, 0.994 49.8%,
      0.993 55%, 1 66%, 1.002 80%, 1
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-1: 1ms;
    --dur-2: 1ms;
    --dur-3: 1ms;
    --dur-4: 1ms;
  }
}

/* Latin-Extended subsets (Croatian: š č ć ž đ). Same families as above, only used for these code points. */
@font-face{font-family:"Fraunces";src:url("/fonts/fraunces-latin-ext-var.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Fraunces";src:url("/fonts/fraunces-italic-latin-ext-var.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Geist";src:url("/fonts/geist-latin-ext-var.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Geist Mono";src:url("/fonts/geist-mono-latin-ext-var.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Caveat";src:url("/fonts/caveat-latin-ext-var.woff2") format("woff2");font-weight:400 700;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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
