/* =================================================================== THEME MOOD =================================================================== */
/* A theme layer, not a section: V4's black / light "scenes" on the V2 page (client change,
   2026-12-01). Each section carries data-scene="ink|paper"; the `scene` preset sets <html data-mood>
   while that section holds the middle of the screen. In the paper mood the dark-surface tokens are
   remapped to paper + ink (the same remap as theme-light.css), so every section re-colours itself
   through the tokens it already uses — section files stay untouched.
   The tokens are registered with @property, so the whole page cross-fades instead of snapping.
   No JS / reduced motion: no data-mood, the page stays dark (V2 as before).
   Load it LAST, after theme-weights.css. */

@property --background    { syntax: "<color>"; inherits: true; initial-value: #111111; }
@property --background-40 { syntax: "<color>"; inherits: true; initial-value: rgba(17, 17, 17, .4); }
@property --background-60 { syntax: "<color>"; inherits: true; initial-value: rgba(17, 17, 17, .6); }
@property --background-70 { syntax: "<color>"; inherits: true; initial-value: rgba(17, 17, 17, .7); }
@property --grey          { syntax: "<color>"; inherits: true; initial-value: #272727; }
@property --white         { syntax: "<color>"; inherits: true; initial-value: #FFFFFF; }
@property --white-08      { syntax: "<color>"; inherits: true; initial-value: rgba(255, 255, 255, .08); }
@property --white-10      { syntax: "<color>"; inherits: true; initial-value: rgba(255, 255, 255, .1); }
@property --white-20      { syntax: "<color>"; inherits: true; initial-value: rgba(255, 255, 255, .2); }
@property --white-40      { syntax: "<color>"; inherits: true; initial-value: rgba(255, 255, 255, .4); }
@property --white-50      { syntax: "<color>"; inherits: true; initial-value: rgba(255, 255, 255, .5); }
@property --white-60      { syntax: "<color>"; inherits: true; initial-value: rgba(255, 255, 255, .6); }
@property --white-75      { syntax: "<color>"; inherits: true; initial-value: rgba(255, 255, 255, .75); }
@property --light-grey    { syntax: "<color>"; inherits: true; initial-value: #939393; }
@property --muted         { syntax: "<color>"; inherits: true; initial-value: #D2D2D2; }
@property --dot           { syntax: "<color>"; inherits: true; initial-value: rgba(244, 244, 244, .2); }
@property --black         { syntax: "<color>"; inherits: true; initial-value: #000000; }

html.theme-mood {
    transition:
        --background .9s ease, --background-40 .9s ease, --background-60 .9s ease, --background-70 .9s ease,
        --grey .9s ease, --white .9s ease, --white-08 .9s ease, --white-10 .9s ease, --white-20 .9s ease,
        --white-40 .9s ease, --white-50 .9s ease, --white-60 .9s ease, --white-75 .9s ease,
        --light-grey .9s ease, --muted .9s ease, --dot .9s ease, --black .9s ease;

    &[data-mood="paper"], &[data-mood="grey"] {
        /* surfaces: dark → paper */
        --background: var(--paper);
        --background-40: var(--paper-40);
        --background-60: var(--paper-60);
        --background-70: var(--paper-70);
        --grey: var(--toggle);

        /* "white on dark" → ink on paper */
        --white: var(--ink);
        --white-08: var(--ink-08);
        --white-10: var(--ink-10);
        --white-20: var(--ink-20);
        --white-40: var(--ink-40);
        --white-50: var(--ink-50);
        --white-60: var(--ink-60);
        --white-75: var(--ink-75);
        --light-grey: var(--muted-ink);
        --muted: var(--muted-ink);
        --dot: var(--ink-15);

        /* text off orange is warm ink (theme-gradient keeps it white on orange); soft shadows */
        --black: var(--ink);
        --shadow-md: var(--shadow-soft);

        & .btn-link.btn-ink { color: var(--ink); }
        & .site-header__link:hover { color: var(--orange); }

        /* the liquid background on paper: the ink multiplies instead of screens */
        & .bg-trail .bg-trail__bloom { opacity: .5; mix-blend-mode: multiply; }

        & .site-header .site-header__menu-btn:hover { border-color: var(--ink-50); }
        & .cookie-banner .cookie-banner__btn { border-color: var(--ink-20); background: var(--paper); color: var(--ink); }
    }

    /* grey: the paper scene on a light-grey page (Recent work, client 2026-12-01) — the whole page
       turns grey, so there is no hard edge between sections */
    &[data-mood="grey"] {
        --background: var(--light);
        --background-40: rgba(244, 244, 244, .4);
        --background-60: rgba(244, 244, 244, .6);
        --background-70: rgba(244, 244, 244, .7);
    }


    /* the FAQ drops its grey band and follows the scene like every other section, so the page goes
       black → white as it arrives (client, 2026-12-01). Its ink tokens point at the mood tokens:
       white on black in the ink scene, ink on white in the paper scene. JS only — without JS the
       page stays dark and the FAQ keeps its light band. */
    &.scenes-live .questions.bg-light {
        --ink: var(--white);
        --ink-40: var(--white-40);
        --ink-15: var(--white-20);
        --muted-ink: var(--light-grey);
        --text: var(--white);
        --text-soft: var(--light-grey);

        background-color: transparent;
        color: var(--text);
    }
}

/* the header (and its menus) stays dark in every mood (client, 2026-12-02): the dark-surface tokens are
   pinned back on .site-header, so a paper / grey scene never re-colours it */
html.theme-mood .site-header {
    --background: #111111;
    --background-40: rgba(17, 17, 17, .4);
    --background-60: rgba(17, 17, 17, .6);
    --background-70: rgba(17, 17, 17, .7);
    --grey: #272727;
    --white: #FFFFFF;
    --white-08: rgba(255, 255, 255, .08);
    --white-10: rgba(255, 255, 255, .1);
    --white-20: rgba(255, 255, 255, .2);
    --white-40: rgba(255, 255, 255, .4);
    --white-50: rgba(255, 255, 255, .5);
    --white-60: rgba(255, 255, 255, .6);
    --white-75: rgba(255, 255, 255, .75);
    --light-grey: #939393;
    --muted: #D2D2D2;
    --black: #000000;
    color: var(--white);
}
