/* Vula Systems - "Paper Intelligence" design system.
 *
 * Palette, component classes and print rules, shared by every page. Extracted
 * from the <style> block that used to sit inline in index.html so the legal
 * pages can use the same system instead of duplicating it.
 *
 * Every colour is an RGB triplet in a --c-* variable, which is what lets .dark
 * swap the whole palette without a second set of classes, and what lets
 * Tailwind's opacity modifiers (bg-paper/90) keep working. Retuning a colour
 * here needs no stylesheet rebuild.
 *
 * Loaded BEFORE assets/tailwind.css on every page - utilities must win ties.
 */
/* ==========================================================================
   PALETTE
   --------------------------------------------------------------------------
   Values are space-separated RGB triplets, not hex, because Tailwind composes
   them as rgb(var(--x) / <alpha-value>) to support bg-paper/90 and friends.
   Dark mode redefines the same names — no component below needs to know which
   theme is active.
   ========================================================================== */
:root {
    --c-ink:          23 25 28;      /* #17191c */
    --c-paper:       255 255 255;    /* #ffffff */
    --c-mist:        242 242 243;    /* #f2f2f3 */
    --c-fog:         250 250 251;    /* #fafafb */
    --c-slate:       119 123 134;    /* #777b86 */
    --c-ash:         151 151 153;    /* #979799 */
    --c-smoke:       163 166 175;    /* #a3a6af */
    --c-rule:        236 236 236;    /* #ececec */
    --c-primary:      83  65 205;    /* #5341cd */
    --c-primary-dark: 64  41 186;    /* #4029ba */
    --c-on-primary:  255 255 255;    /* #ffffff */
    --c-wash:        228 223 255;    /* #e4dfff */
    --c-on-wash:      22   0 102;    /* #160066 */
    --c-tertiary:    136  72   0;    /* #884800 */
    --shadow-artifact: 0 0 0 1px rgba(4,23,43,0.05), 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    color-scheme: light;
}

/* Dark keeps the same tonal relationships: fog sits under paper, mist sits above
   it, so the light-mode surface rules ("cards are mist on a paper band, paper on
   a fog band") still hold without touching a single utility class. */
.dark {
    --c-ink:         241 241 243;    /* #f1f1f3 */
    --c-paper:        23  24  28;    /* #17181c  cards + the lighter band */
    --c-mist:         33  36  41;    /* #212429  raised card on a paper band */
    --c-fog:          15  16  19;    /* #0f1013  the darkest band */
    --c-slate:       155 157 170;    /* #9b9daa */
    --c-ash:         124 126 138;    /* #7c7e8a */
    --c-smoke:       106 108 120;    /* #6a6c78 */
    --c-rule:         43  45  52;    /* #2b2d34 */
    --c-primary:     169 156 255;    /* #a99cff  lifted so it holds up on dark */
    --c-primary-dark:186 176 255;    /* #bab0ff  hover goes lighter, not darker */
    --c-on-primary:   23  21  38;    /* #171526  dark ink on a light purple pill */
    --c-wash:         39  32  96;    /* #272060 */
    --c-on-wash:     222 216 255;    /* #ded8ff */
    --c-tertiary:    224 164  92;    /* #e0a45c */
    --shadow-artifact: 0 0 0 1px rgba(255,255,255,0.06), 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.4);
    color-scheme: dark;
}

body {
    background-color: rgb(var(--c-paper));
    color: rgb(var(--c-ink));
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s ease, color .2s ease;
}

/* Material Symbols are drawn at a light weight so icons stay quiet next to Inter. */
.material-symbols-outlined { font-variation-settings: "wght" 300; }

/* --- Pill buttons ---------------------------------------------------------
   Every action in the system is a pill. Defined here rather than as a Tailwind
   class soup so the markup stays readable and the two variants can't drift. */
.pill {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 9999px; padding: 12px 22px;
    font-size: 16px; line-height: 1.2; white-space: nowrap;
    border: 1px solid transparent;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.pill-filled {
    background: rgb(var(--c-primary));
    border-color: rgb(var(--c-primary));
    color: rgb(var(--c-on-primary));
}
.pill-filled:hover {
    background: rgb(var(--c-primary-dark));
    border-color: rgb(var(--c-primary-dark));
}
.pill-ghost {
    background: transparent;
    border-color: rgb(var(--c-ink));
    color: rgb(var(--c-ink));
}
.pill-ghost:hover {
    background: rgb(var(--c-ink));
    color: rgb(var(--c-paper));
}
.pill-sm { padding: 9px 18px; font-size: 15px; }

/* --- Currency switch ------------------------------------------------------
   Styled off aria-selected, which renderPrices() already maintains — no class
   toggling from JS, so the control can't fall out of sync with the state. */
.cur-group {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 3px; border-radius: 9999px;
    border: 1px solid rgb(var(--c-rule));
    background: rgb(var(--c-paper));
}
.cur-btn {
    border-radius: 9999px; padding: 6px 14px;
    font-size: 14px; line-height: 1.4; color: rgb(var(--c-slate));
    transition: background-color .2s ease, color .2s ease;
}
.cur-btn:hover { color: rgb(var(--c-ink)); }
.cur-btn[aria-selected="true"] {
    background: rgb(var(--c-primary));
    color: rgb(var(--c-on-primary));
}

/* --- Theme toggle --------------------------------------------------------- */
.theme-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 9999px;
    border: 1px solid rgb(var(--c-rule));
    color: rgb(var(--c-slate));
    transition: color .2s ease, border-color .2s ease;
}
.theme-btn:hover { color: rgb(var(--c-ink)); border-color: rgb(var(--c-slate)); }
/* Only the icon for the theme you can switch *to* is shown. */
.theme-btn .icon-dark { display: none; }
.dark .theme-btn .icon-dark { display: inline; }
.dark .theme-btn .icon-light { display: none; }


/* --- Compact nav ----------------------------------------------------------
   Below ~480px the wordmark, the currency switch and two icon buttons no
   longer fit on one row at full size, so the whole cluster steps down.
   #menu-btn is targeted by id because it carries Tailwind w-10/h-10. */
@media (max-width: 480px) {
    nav .nav-logo { font-size: 20px; }
    .cur-btn { padding: 5px 10px; font-size: 13px; }
    .theme-btn, #menu-btn { width: 36px; height: 36px; }
}

/* --- Lists ---------------------------------------------------------------- */
.ink-list li { position: relative; padding-left: 18px; }
.ink-list li::before {
    content: ""; position: absolute; left: 0; top: 0.72em;
    width: 8px; height: 1px; background: rgb(var(--c-ash));
}
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .tick { color: rgb(var(--c-primary)); flex-shrink: 0; font-size: 16px; line-height: 1.5; }

/* Text link with arrow — the arrow carries the affordance, so no rest underline. */
.arrow-link { display: inline-flex; align-items: center; gap: 6px; transition: color .2s ease; }
.arrow-link:hover { color: rgb(var(--c-primary)); }

a:focus-visible, button:focus-visible, summary:focus-visible {
    outline: 2px solid rgb(var(--c-primary));
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, body { transition: none !important; }
}

/* --- Printable price list ---
   Print is always light: the document goes on paper, so the dark palette is
   explicitly overridden here rather than inherited. */
#price-doc { display: none; }

@media print {
    @page { size: A4; margin: 18mm; }

    html, body {
        background: #fff !important;
        background-image: none !important;
        color: #000 !important;
    }
    /* Hide the whole site; show only the document */
    body > *:not(#price-doc) { display: none !important; }

    #price-doc {
        display: block !important;
        font-family: Inter, system-ui, sans-serif;
        font-size: 10pt;
        line-height: 1.45;
        color: #000 !important;
    }
    #price-doc * { color: #000 !important; background: transparent !important; }
    #price-doc h1, #price-doc h2, #price-doc h3 {
        font-family: Archivo, system-ui, sans-serif;
        break-after: avoid;
    }
    #price-doc h1 { font-size: 20pt; letter-spacing: 0.02em; margin: 0 0 2mm; }
    #price-doc h2 { font-size: 13pt; margin: 7mm 0 2mm; border-bottom: 1px solid #000; padding-bottom: 1.5mm; }
    #price-doc h3 { font-size: 11pt; margin: 4mm 0 1mm; }
    #price-doc p  { margin: 0 0 2mm; }
    #price-doc table { width: 100%; border-collapse: collapse; margin: 2mm 0 4mm; break-inside: avoid; }
    #price-doc th, #price-doc td {
        border: 1px solid #999; padding: 1.6mm 2mm; text-align: left; vertical-align: top;
    }
    #price-doc th { background: #f2f2f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9pt; }
    #price-doc td.num, #price-doc th.num { text-align: right; white-space: nowrap; }
    #price-doc .doc-meta { font-size: 8.5pt; margin-bottom: 4mm; }
    #price-doc .pkg { break-inside: avoid; margin-bottom: 4mm; }
    #price-doc .pkg-price { font-weight: 700; }
    #price-doc .saves { font-size: 9pt; }
    #price-doc .fine { font-size: 8pt; }
    #price-doc .doc-foot { margin-top: 6mm; border-top: 1px solid #999; padding-top: 2mm; font-size: 8pt; }
}
