/* Design tokens for the gallery.

   Two tiers:
   - Primitives: the raw palette, type sizes, spacing, radii, durations and curves. Named for
     what they are (sand-900, space-14), never used directly by components.
   - Semantics: what a value is for (color-ink, edge, motion-enter). Components use these.

   Two colour families: warm sand for the gallery's own surfaces (paper labels, chips, the
   loader), and neutral greys for the dark overlays (About, the design log). Glass buttons sit
   on the room, so their labels are near-white. */

:root {
  /* ---------- primitives: colour ---------- */
  --sand-25: #fdfcf9;
  --sand-50: #fbf9f5;
  --sand-100: #f6f2ea;
  --sand-150: #f4f1ec;
  --sand-200: #e9e6e0;
  --sand-300: #e3dccf;
  --sand-400: #cfc6b6;
  --sand-600: #6b6359;
  --sand-700: #5a5249;
  --sand-800: #2b2620;
  --sand-900: #1d1a16;
  --sand-900-rgb: 29 26 22;
  --sand-50-rgb: 251 249 245;
  --umber-600: #6b4a37;
  --shadow-brown-rgb: 29 22 14;

  --white: #fff;
  --white-rgb: 255 255 255;
  --grey-50: #f2f2f2;
  --grey-75: #ececec;
  --grey-100: #e4e4e4;
  --grey-200: #d6d6d6;
  --grey-300: #b5b5b5;
  --grey-500: #8a8a8a;
  --grey-550: #7d7d7d;
  --grey-600: #6f6f6f;
  --grey-850: #1e1e1e;
  --grey-900: #161616;
  --grey-950: #0a0a0a;
  --black: #000;
  --black-rgb: 0 0 0;

  /* ---------- primitives: type ---------- */
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-size-12: 12px;
  --font-size-13: 13px;
  --font-size-14: 14px;
  --font-size-15: 15px;
  --font-size-16: 16px;
  --font-size-17: 17px;
  --font-size-22: 22px;
  --font-size-34: 34px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---------- primitives: space and size (px) ---------- */
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-14: 14px;
  --space-16: 16px;
  --space-18: 18px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;

  /* ---------- primitives: radius ---------- */
  --radius-sm: 3px;    /* paper, thumbnails, small marks */
  --radius-md: 6px;    /* images */
  --radius-lg: 16px;   /* panels and bubbles */
  --radius-pill: 999px;
  --radius-round: 50%;

  /* ---------- primitives: motion ---------- */
  --duration-110: 110ms;
  --duration-200: 200ms;
  --duration-250: 250ms;
  --duration-300: 300ms;
  --duration-340: 340ms;
  --duration-400: 400ms;
  --duration-460: 460ms;
  --duration-1400: 1400ms;
  --curve-ease: ease;
  --curve-ease-in: ease-in;
  --curve-ease-out: ease-out;
  --curve-linear: linear;
  --curve-out-expo: cubic-bezier(0.22, 1, 0.36, 1);   /* fast start, long settle */
  --curve-in-quad: cubic-bezier(0.4, 0, 1, 1);        /* slow start, quick finish */
  --curve-lift: cubic-bezier(0.2, 0.75, 0.15, 1);     /* a card lifting off the wall */
  --curve-in-out: cubic-bezier(0.45, 0, 0.25, 1);     /* a card settling back onto it */

  /* =================== semantics =================== */

  /* colour: the gallery's own surfaces (warm) */
  --color-ink: var(--sand-900);
  --color-ink-soft: var(--sand-800);           /* body text on paper */
  --color-ink-muted: var(--sand-700);          /* captions, meta, a card's style line, icons */
  --color-paper: var(--sand-50);
  --color-paper-light: var(--sand-25);         /* the paper's grain gradient */
  --color-paper-shade: var(--sand-100);
  --color-paper-edge: var(--sand-300);         /* the board's thickness */
  --color-paper-edge-dark: var(--sand-400);
  --color-veil: var(--sand-200);               /* the page behind the room, the loader */
  --color-chip: rgb(var(--sand-50-rgb) / 0.9);
  --color-line: rgb(var(--sand-900-rgb) / 0.12);
  --color-line-faint: rgb(var(--sand-900-rgb) / 0.1);
  --color-hover-wash: rgb(var(--sand-900-rgb) / 0.07);
  --color-ring-track: rgb(var(--sand-900-rgb) / 0.22);
  --color-ring-track-hover: rgb(var(--sand-900-rgb) / 0.4);
  --color-loader-line: var(--umber-600);
  --color-accent: var(--sand-900);
  --color-scroll-thumb-on-paper: rgb(var(--sand-900-rgb) / 0.22);

  /* colour: labels on liquid glass */
  --color-on-glass: var(--sand-150);           /* every label on glass: buttons, the tour bar, now playing */
  --color-on-glass-hover: var(--white);
  --color-glass-wash: rgb(var(--white-rgb) / 0.12);
  --color-glass-fallback: rgb(var(--sand-900-rgb) / 0.55);
  --color-on-glass-muted: rgb(var(--white-rgb) / 0.92);  /* a bar's unselected labels (still 4.5:1 on smoked glass over white) */
  --color-glass-smoke-top: rgb(48 44 40 / 0.72);  /* smoked glass, for a bar of text over a dark overlay: lit at the top */
  --color-glass-smoke: rgb(18 16 14 / 0.72);

  /* colour: dark overlays */
  --color-scrim: rgb(8 7 6 / 0.8);             /* About */
  --color-scrim-photo: rgb(12 10 8 / 0.9);     /* a painting's original photo */
  --color-scrim-log: rgb(8 8 8 / 0.985);       /* the design log */
  --color-on-dark: var(--white);
  --color-on-dark-body: rgb(var(--white-rgb) / 0.88);
  --color-on-dark-wash: rgb(var(--white-rgb) / 0.1);
  --color-button-primary: var(--sand-50);
  --color-button-primary-hover: var(--sand-200);
  --color-button-primary-ink: var(--sand-900);

  /* colour: the design log (neutral greys) */
  --color-log-text: var(--grey-50);
  --color-log-prompt: var(--grey-75);
  --color-log-link: var(--grey-200);
  --color-log-hover: var(--grey-300);
  --color-log-secondary: var(--grey-500);
  --color-log-tertiary: var(--grey-550);
  --color-log-label: var(--grey-600);
  --color-log-surface: var(--grey-850);
  --color-log-media: var(--grey-900);
  --color-log-ink-inverse: var(--grey-950);
  --color-log-rim: rgb(var(--white-rgb) / 0.08);
  --color-log-rim-hover: rgb(var(--white-rgb) / 0.3);
  --color-log-scrollbar: rgb(var(--white-rgb) / 0.28);
  --color-log-skeleton: var(--grey-900);       /* an image still loading: its shape, in this */
  --color-log-skeleton-shine: rgb(var(--white-rgb) / 0.05);  /* the light passing over it */

  /* colour: tooltips (a light pill, as on resumetee.me) */
  --color-tooltip: var(--sand-150);
  --color-tooltip-ink: var(--sand-900);

  /* type */
  --type-body: var(--font-size-15)/1.4 var(--font-sans);
  --type-display: italic var(--weight-regular) var(--font-size-34)/1.15 var(--font-serif);
  --type-title: italic var(--font-size-22)/1.2 var(--font-serif);
  --type-title-small: italic var(--font-size-16)/1.2 var(--font-serif);
  --type-caption-serif: italic var(--font-size-16) var(--font-serif);
  --type-button: var(--weight-semibold) var(--font-size-15)/1.25 var(--font-sans);
  --type-bar: var(--weight-semibold) var(--font-size-13) var(--font-sans);

  /* layout */
  --edge: var(--space-24);                     /* bottom controls to the bottom edge */
  --inset: var(--space-14);                    /* corner controls and cards to the screen edge */
  --gap-controls: var(--space-10);
  --gap-actions: var(--space-16);
  --size-control: 44px;                        /* every glass button, and the close buttons */
  --size-bar-button: 36px;                     /* a button inside a bar: the tour bar's, the log filter's */

  /* depth */
  --z-controls: 2;
  --z-corner: 3;
  --z-lift: 4;
  --z-overlay: 5;
  --z-overlay-top: 6;
  --z-tooltip: 10;

  /* shadows */
  --shadow-chip: 0 0 0 1px var(--color-line), 0 8px 24px rgb(var(--sand-900-rgb) / 0.12);
  --shadow-paper:
    inset 0 0 0 0.5px var(--color-line-faint),
    inset 0 1px 0 rgb(var(--white-rgb) / 0.9),
    0 1px 0 var(--color-paper-edge), 0 2px 0 var(--color-paper-edge-dark),
    0 3px 6px rgb(var(--shadow-brown-rgb) / 0.16), 0 16px 34px -10px rgb(var(--shadow-brown-rgb) / 0.42);
  --shadow-raised: 0 6px 20px rgb(var(--black-rgb) / 0.35);
  --shadow-photo: 0 12px 40px rgb(var(--black-rgb) / 0.5);
  --shadow-frost: inset 0 0 0 1px rgb(var(--white-rgb) / 0.12), inset 0 1.5px 0.5px rgb(var(--white-rgb) / 0.3), inset 0 -6px 10px rgb(var(--black-rgb) / 0.25), 0 4px 14px rgb(var(--black-rgb) / 0.35);
  --shadow-thumb: 0 1px 4px rgb(var(--black-rgb) / 0.35);
  --shadow-icon: drop-shadow(0 1px 1.5px rgb(var(--black-rgb) / 0.35));
  --shadow-text-on-glass: 0 1px 2px rgb(var(--black-rgb) / 0.35);
  --shadow-log-card: 0 0 0 1px var(--color-log-rim), 0 16px 34px -14px rgb(var(--black-rgb) / 0.95);
  --shadow-log-card-hover: 0 0 0 1px var(--color-log-rim-hover), 0 26px 54px -16px rgb(var(--black-rgb) / 0.95);
  --shadow-log-card-selected: 0 0 0 1.5px rgb(242 242 242 / 0.7), 0 16px 34px -14px rgb(var(--black-rgb) / 0.95);
  --shadow-log-media: 0 20px 60px -20px rgb(var(--black-rgb) / 0.9);

  /* focus */
  --focus-ring: 2px solid var(--color-accent);
  --focus-ring-on-glass: 2px solid var(--color-on-glass);
  --focus-ring-hidden: none;                   /* a label card's close button: focused on opening, with no ring */

  /* motion: what each kind of movement uses */
  --motion-hover: var(--duration-200) var(--curve-ease);          /* colour and wash changes */
  --motion-fade: var(--duration-250) var(--curve-ease);           /* small things fading in */
  --motion-overlay: var(--duration-300) var(--curve-ease);        /* About and the log fading */
  --motion-move: var(--duration-400) var(--curve-out-expo);       /* things gliding into place */
  --motion-slide: var(--duration-460) var(--curve-out-expo);      /* the dock's buttons trading places */
  --motion-enter-duration: var(--duration-460);                   /* a card arriving */
  --motion-enter-curve: var(--curve-out-expo);
  --motion-exit-duration: var(--duration-250);                    /* a card leaving */
  --motion-exit-curve: var(--curve-in-quad);
  --motion-lift-duration: var(--duration-460);                    /* a wall label lifting into a card */
  --motion-lift-curve: var(--curve-lift);
  --motion-settle-duration: var(--duration-340);                  /* the card settling back onto the wall */
  --motion-settle-curve: var(--curve-in-out);
  --motion-words-in: var(--duration-200) var(--curve-ease-out);
  --motion-words-out: var(--duration-110) var(--curve-ease-in);
  --motion-skeleton: var(--duration-1400) var(--curve-ease) infinite;  /* a loading skeleton's shimmer, one pass */
  --motion-tip-delay: 150ms;                                      /* a tooltip waits this long before it appears */
  --motion-tip-in: 120ms var(--curve-out-expo);                   /* then pops in */
  --motion-tip-out: 80ms var(--curve-ease-in);                    /* and pops out */
}
