/* Spice & parchment design tokens. Light ("Parchment") is the default; dark ("Cast iron") is [data-theme="dark"].
   Everything else in ui.css and views.css reads these variables, so a colour or type change happens here. */

:root {
    color-scheme: light;

    /* Surfaces and ink. Every colour used for text (ink, ink-muted, ink-faint, gold-deep, herb, paprika) keeps
       4.5:1 against --page, --card and --sunken in both themes (WCAG AA); paprika also clears it on paprika-soft. */
    --page: #fbf6ee;
    --card: #fffdf8;
    --sunken: #f3eadb;
    --border: #e6d9c5;
    --border-strong: #cdbca2;
    --ink: #2b1d14;
    --ink-muted: #6f5b4e;
    --ink-faint: #76685c;

    /* Brand */
    --paprika: #b9361b;
    --paprika-hover: #9e2d15;
    --paprika-soft: rgba(185, 54, 27, 0.12);
    --on-paprika: #fff;
    --gold: #d99a2b;
    --gold-deep: #865b11;
    --gold-soft: #f3dfae;
    --gold-glow: rgba(217, 154, 43, 0.35);
    --herb: #487035;
    --herb-soft: rgba(79, 122, 58, 0.14);
    --chili: #a32c2c;
    --chili-soft: rgba(163, 44, 44, 0.12);
    --toast-accent: var(--gold);

    /* Hero photo overlay (warm cocoa, never flat black). Strong enough that hero text keeps 4.5:1 over the
       brightest marble the text sits on, at any width. */
    --hero-overlay: linear-gradient(100deg, rgba(43, 29, 20, 0.86) 0%, rgba(43, 29, 20, 0.76) 55%, rgba(43, 29, 20, 0.52) 100%);
    /* Below 992px the text runs most of the width of the hero, so the light end of the gradient needs more cover. */
    --hero-overlay-narrow: linear-gradient(100deg, rgba(43, 29, 20, 0.86) 0%, rgba(43, 29, 20, 0.8) 55%, rgba(43, 29, 20, 0.66) 100%);
    --hero-ink: #fbf6ee;
    --hero-ink-muted: #ead9c0;
    --hero-gold: #e8b451;

    /* Type */
    --font-display: 'Fraunces Variable', Georgia, 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, 'Helvetica Neue', Arial, sans-serif;
    --text-xs: 0.8125rem;
    --text-sm: 0.875rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.75rem;
    --text-3xl: 2.25rem;
    --leading: 1.55;

    /* Shape and depth */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(43, 29, 20, 0.06), 0 1px 6px rgba(43, 29, 20, 0.05);
    --shadow: 0 2px 6px rgba(43, 29, 20, 0.08), 0 8px 24px rgba(43, 29, 20, 0.08);
    --shadow-lg: 0 12px 40px rgba(43, 29, 20, 0.18);
    --ring: 0 0 0 3px var(--gold-glow);

    /* Spacing and layout */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --wrap: 72rem;
    --wrap-narrow: 50rem;
    --header-h: 4rem;
    --tabbar-h: 3.75rem;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --quick: 160ms;
    --slow: 240ms;

    /* Parchment grain: an SVG noise tile drawn over the page at low opacity */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.15 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --grain-opacity: 0.07;
}

[data-theme="dark"] {
    color-scheme: dark;

    --page: #17120f;
    --card: #221a15;
    --sunken: #2c221c;
    --border: #3a2e26;
    --border-strong: #55453a;
    --ink: #f3eadb;
    --ink-muted: #b8a48f;
    --ink-faint: #97887d;

    --paprika: #ef6f43;
    --paprika-hover: #f5865f;
    --paprika-soft: rgba(226, 90, 43, 0.18);
    --on-paprika: #1b110c;
    --gold: #e8b451;
    --gold-deep: #f0c66f;
    --gold-soft: rgba(232, 180, 81, 0.18);
    --gold-glow: rgba(232, 180, 81, 0.4);
    --herb: #8cc47a;
    --herb-soft: rgba(140, 196, 122, 0.16);
    --chili: #ef7b7b;
    --chili-soft: rgba(239, 123, 123, 0.16);
    /* Toasts are light on dark pages, so their action takes the light theme's deep paprika. */
    --toast-accent: #9e2d15;

    --hero-overlay: linear-gradient(100deg, rgba(23, 18, 15, 0.9) 0%, rgba(23, 18, 15, 0.74) 55%, rgba(23, 18, 15, 0.5) 100%);
    --hero-overlay-narrow: linear-gradient(100deg, rgba(23, 18, 15, 0.9) 0%, rgba(23, 18, 15, 0.8) 55%, rgba(23, 18, 15, 0.62) 100%);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 6px rgba(0, 0, 0, 0.25);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);

    --grain-opacity: 0.05;
}
