/* ═══════════════════════════════════════════════════════════════════════════
   Lyndsie Clark — Design Tokens  ·  direction: EMBER
   Single source of truth for colour, type, spacing and motion. Every other
   stylesheet consumes these; none of them hard-codes a hex value.

   WHERE THE PALETTE COMES FROM
   The violets, lavender, cyan and magenta are read out of the live WordPress
   site's Elementor kit, not invented — this is the same brand, not a
   reinterpretation of it:
       --e-global-color-primary   #cfbae2  lavender
       --e-global-color-accent    #da12e5  magenta
       --e-global-color-secondary #6a6c72  grey
       (custom)                   #48d0dc  cyan
       (custom)                   #2d9aa4  teal
       (custom)                   #2f1753  deep violet
       (custom)                   #cfbae2 @ 18%  tinted panel fill

   The ember amber is new, and it comes from the books: it is the burning sky
   and the title lettering on both In Memoriam and Anamnesis. It is the site's
   signal colour — the thing that says "this is live, press this".

   THE ONE IDEA WORTH KNOWING
   Her covers do not share a palette. In Memoriam and Anamnesis are ember on
   slate; Cloudbreaker is sky blue, lavender and coral. A site locked to either
   makes the other look like a different author's book. So the site is a quiet
   violet room, and every piece of work carries its own accent, taken from its
   own art, in --lc-work. Set --lc-work on a card, a section or a <body> and
   the rules, hairlines, chips and link underlines inside it follow. It falls
   back to ember, which is the flagship series' colour.

   TYPOGRAPHY
   The same four families the old site loaded:
       Montserrat             h1, nav, buttons   (kit's typography-primary)
       Montserrat Alternates  h2–h6              (what the live theme sets)
       Mulish / "Muli"        body               (kit's typography-text)
       Padyakke Expanded One  rare display       (kit's typography-accent)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Brand constants (theme-independent) ─────────────────────────────────── */
:root {
    /* Ember — the signal. From the covers' burning sky and title lettering. */
    --lc-ember:            #f59035;
    --lc-ember-bright:     #ffb061;
    --lc-ember-pale:       #ffd6a8;
    --lc-ember-deep:       #c75f16;
    --lc-ember-dark:       #8a3d08;
    /* Text that sits ON ember. Near-black, warm, so the edge doesn't buzz. */
    --lc-ember-ink:        #1a0e04;

    /* Lavender — headings and hairlines. The brand's primary. */
    --lc-lavender:         #cfbae2;
    --lc-lavender-light:   #dbbdef;
    --lc-lavender-bright:  #ece0f7;
    --lc-lavender-dark:    #9b7fba;
    --lc-lavender-deep:    #6b4f8c;

    /* Violet — the room. #2f1753 is the site's own colour; the ramp is built
       from it so every surface stays in one hue family instead of drifting to
       neutral charcoal, which is what every other dark genre site looks like. */
    --lc-violet-900:       #0b0712;
    --lc-violet-800:       #120d1f;
    --lc-violet-700:       #1a1430;
    --lc-violet-600:       #231a3f;
    --lc-violet-500:       #2f1753;
    --lc-violet-400:       #412073;

    /* Cyan — interactive. Links and anything that responds to a cursor. The
       cool half of a warm/cold split: ember means "act", cyan means "go". */
    --lc-cyan:             #48d0dc;
    --lc-cyan-bright:      #7ee3ec;
    --lc-cyan-dark:        #2d9aa4;
    --lc-cyan-deep:        #176d76;

    /* Magenta — a spark, not a voice. Kept because it is hers, used rarely. */
    --lc-magenta:          #da12e5;
    --lc-magenta-soft:     #ef7bf5;
    --lc-magenta-deep:     #8f0a97;

    /* Sky — Cloudbreaker's colours, available as a per-work accent. */
    --lc-sky:              #7fb6e6;
    --lc-sky-deep:         #3d7fb8;
    --lc-coral:            #e8826a;

    --lc-grey:             #6a6c72;
    --lc-grey-light:       #9a9ca3;

    /* Stone — the light end. Pale lavender, never clinical white. */
    --lc-stone-50:         #ffffff;
    --lc-stone-100:        #faf7fd;
    --lc-stone-200:        #f2ecf8;
    --lc-stone-300:        #e5daf0;
    --lc-stone-400:        #cfc1e0;

    /* Semantic status, hue-shifted toward the brand so a success message does
       not look like it arrived from a different website. */
    --lc-success:          #3f9d78;
    --lc-warning:          var(--lc-ember);
    --lc-danger:           #d9455f;
    --lc-info:             var(--lc-cyan-dark);

    /* ── Typography ─────────────────────────────────────────────────────── */
    /* "Muli" is the old name of the family Google now ships as "Mulish"; both
       are listed so the page renders the same whether the cached font or the
       current one answers. */
    --lc-font-display:     'Montserrat', 'Segoe UI', Helvetica, Arial, sans-serif;
    --lc-font-subhead:     'Montserrat Alternates', 'Montserrat', 'Segoe UI', sans-serif;
    --lc-font-body:        'Mulish', 'Muli', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --lc-font-accent:      'Padyakke Expanded One', 'Montserrat Alternates', serif;
    --lc-font-mono:        ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;

    /* Type scale — 1.25 minor third, fluid at the display end. Body is 16px,
       the size the old site set, not the 15px the admin tools use. */
    --lc-text-2xs:         0.6875rem;
    --lc-text-xs:          0.75rem;
    --lc-text-sm:          0.875rem;
    --lc-text-base:        1rem;
    --lc-text-md:          1.125rem;
    --lc-text-lg:          1.375rem;
    --lc-text-xl:          1.75rem;
    --lc-text-2xl:         2.25rem;
    --lc-text-display:     clamp(2.1rem, 5.6vw, 4rem);

    /* The live site sets Mulish 200 on body copy — very light, and part of its
       character. 200 is kept for large prose and raised to 300 for small text,
       where hairline strokes stop being legible. */
    --lc-weight-body:      200;
    --lc-weight-body-sm:   300;
    --lc-weight-heading:   600;

    --lc-track-display:    -0.012em;   /* Montserrat tightens well at size */
    --lc-track-eyebrow:    0.2em;

    /* ── Spacing — 4px base ─────────────────────────────────────────────── */
    --lc-space-1:  0.25rem;  --lc-space-2: 0.5rem;   --lc-space-3: 0.75rem;
    --lc-space-4:  1rem;     --lc-space-5: 1.5rem;   --lc-space-6: 2rem;
    --lc-space-7:  3rem;     --lc-space-8: 4rem;     --lc-space-9: 6rem;

    /* ── Radii ──────────────────────────────────────────────────────────── */
    --lc-radius-sm:   4px;
    --lc-radius:      8px;
    --lc-radius-lg:   14px;
    --lc-radius-xl:   22px;
    --lc-radius-pill: 999px;

    /* ── Layout ─────────────────────────────────────────────────────────── */
    --lc-measure:        66ch;
    --lc-container:      1140px;
    --lc-container-wide: 1440px;
    --lc-header-h:       68px;

    /* ── Motion ─────────────────────────────────────────────────────────── */
    /* One easing vocabulary for the whole site. --lc-ease-out is the "arrive"
       curve for anything entering the viewport; --lc-ease is the symmetric one
       for states that can go either way (hover, open/close). */
    --lc-ease:        cubic-bezier(0.4, 0, 0.2, 1);
    --lc-ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --lc-ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
    --lc-dur-fast:    140ms;
    --lc-dur:         240ms;
    --lc-dur-slow:    420ms;
    --lc-dur-reveal:  720ms;

    --lc-z-header: 1020;
    --lc-z-drawer: 1045;
    --lc-z-toast:  1090;

    /* ── Per-work accent ────────────────────────────────────────────────── */
    /* Overridden per book page, per card, per category. Ember is the default
       because the Savant Uprising is the flagship. */
    --lc-work:       var(--lc-ember);
    --lc-work-ink:   var(--lc-ember-ink);

    /* Hero wash, in two layers. Heroes are dark in both themes, as they are on
       the live site, which lays a 67% black veil over its header image.
       The horizontal layer is weighted to the side the headline sits on: it is
       what guarantees contrast for the type however the photograph happens to
       crop at a given viewport, and it keeps the subject on the right readable
       instead of veiling the whole frame evenly. */
    --lc-hero-scrim:
        linear-gradient(90deg,
            rgba(11, 7, 18, 0.80) 0%,
            rgba(11, 7, 18, 0.54) 34%,
            rgba(11, 7, 18, 0.14) 70%,
            rgba(11, 7, 18, 0.00) 100%),
        linear-gradient(180deg,
            rgba(11, 7, 18, 0.30) 0%,
            rgba(11, 7, 18, 0.60) 56%,
            rgba(11, 7, 18, 0.95) 100%);
    --lc-hero-bg: linear-gradient(162deg, #0b0712 0%, #1d1230 44%, #2f1753 74%, #120d1f 100%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK THEME — the default, and what the site looks like today.
   ═══════════════════════════════════════════════════════════════════════════ */
:root,
[data-bs-theme="dark"] {
    --lc-bg:              var(--lc-violet-800);
    --lc-bg-sunken:       var(--lc-violet-900);
    --lc-surface:         var(--lc-violet-700);
    --lc-surface-raised:  var(--lc-violet-600);
    --lc-surface-overlay: var(--lc-violet-600);

    --lc-text:            #efe9f6;
    --lc-text-secondary:  #c4bcd3;
    /* The kit's #6a6c72 measures 3.4:1 on this background — under AA. This is
       that grey lifted until it clears 4.5:1 everywhere it is used. */
    --lc-text-muted:      #9b93ad;
    --lc-text-inverse:    var(--lc-violet-900);

    --lc-heading:         var(--lc-lavender);
    /* The chrome: nameplate, navigation, social buttons, outline buttons.
       A separate token from --lc-heading because these sit on the header and
       footer rather than in the page, and because lavender written straight
       into those rules is unreadable on the light theme's parchment — 1.5:1,
       which is how the header came out white-on-white the first time. */
    --lc-chrome:          var(--lc-lavender);
    --lc-chrome-strong:   var(--lc-lavender-bright);
    --lc-link:            var(--lc-cyan);
    --lc-link-hover:      var(--lc-cyan-bright);
    --lc-signal:          var(--lc-ember);
    --lc-signal-hover:    var(--lc-ember-bright);
    --lc-signal-ink:      var(--lc-ember-ink);
    /* Magenta at full strength is 3.9:1 here — fine for a rule or an icon,
       not for text. This is the readable one. */
    --lc-spark-text:      var(--lc-magenta-soft);

    --lc-border:          rgba(207, 186, 226, 0.13);
    --lc-border-strong:   rgba(207, 186, 226, 0.3);
    --lc-border-signal:   rgba(245, 144, 53, 0.46);

    --lc-shadow-sm:       0 1px 2px rgba(0, 0, 0, 0.45);
    --lc-shadow:          0 2px 12px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
    --lc-shadow-lg:       0 18px 46px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
    --lc-shadow-signal:   0 8px 30px -8px var(--lc-work);

    /* The kit's #CFBAE22E — lavender at 18% — is the panel fill the live site
       uses for its footer bar. It is the whole tint ramp here. */
    --lc-tint:            rgba(207, 186, 226, 0.055);
    --lc-tint-hover:      rgba(207, 186, 226, 0.1);
    --lc-tint-strong:     rgba(207, 186, 226, 0.18);
    --lc-tint-signal:     rgba(245, 144, 53, 0.1);
    --lc-tint-signal-hover: rgba(245, 144, 53, 0.18);
    --lc-scrim:           rgba(11, 7, 18, 0.76);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME — pale lavender parchment.
   Ember, cyan and magenta all fail contrast as text on a light field at their
   brand values, so each moves to its deep variant here. The hues do not change;
   only lightness does, which is what keeps it the same brand.
   ═══════════════════════════════════════════════════════════════════════════ */
[data-bs-theme="light"] {
    --lc-bg:              var(--lc-stone-100);
    --lc-bg-sunken:       var(--lc-stone-200);
    --lc-surface:         var(--lc-stone-50);
    --lc-surface-raised:  #ffffff;
    --lc-surface-overlay: #ffffff;

    --lc-text:            #1b1324;
    --lc-text-secondary:  #4c4357;
    --lc-text-muted:      #6a6c72;
    --lc-text-inverse:    var(--lc-stone-100);

    --lc-heading:         var(--lc-violet-500);
    --lc-chrome:          var(--lc-violet-500);
    --lc-chrome-strong:   var(--lc-violet-900);
    --lc-link:            var(--lc-cyan-deep);
    --lc-link-hover:      var(--lc-violet-500);
    /* Ember stays the button fill — white on #c75f16 clears AA — but ember as
       TEXT on parchment needs the dark end of the ramp. */
    --lc-signal:          var(--lc-ember-deep);
    --lc-signal-hover:    var(--lc-ember-dark);
    --lc-signal-ink:      #ffffff;
    --lc-spark-text:      var(--lc-magenta-deep);

    --lc-border:          rgba(47, 23, 83, 0.14);
    --lc-border-strong:   rgba(47, 23, 83, 0.26);
    --lc-border-signal:   rgba(199, 95, 22, 0.44);

    --lc-shadow-sm:       0 1px 2px rgba(47, 23, 83, 0.07);
    --lc-shadow:          0 2px 10px rgba(47, 23, 83, 0.09), 0 1px 2px rgba(47, 23, 83, 0.06);
    --lc-shadow-lg:       0 14px 38px rgba(47, 23, 83, 0.15), 0 2px 6px rgba(47, 23, 83, 0.08);
    --lc-shadow-signal:   0 8px 26px -10px var(--lc-work);

    --lc-tint:            rgba(47, 23, 83, 0.04);
    --lc-tint-hover:      rgba(47, 23, 83, 0.07);
    --lc-tint-strong:     rgba(207, 186, 226, 0.34);
    --lc-tint-signal:     rgba(199, 95, 22, 0.08);
    --lc-tint-signal-hover: rgba(199, 95, 22, 0.14);
    --lc-scrim:           rgba(27, 19, 36, 0.5);

    --lc-work:            var(--lc-ember-deep);
    --lc-work-ink:        #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOOTSTRAP BRIDGE
   Map the tokens onto Bootstrap's own variables so every stock component —
   .btn, .card, .navbar, .table, .form-control, .modal, .offcanvas, .dropdown —
   inherits the brand with no component override, and so a block the page
   builder drops in is already on-brand the moment it lands.
   ═══════════════════════════════════════════════════════════════════════════ */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --bs-body-bg:                  var(--lc-bg);
    --bs-body-color:               var(--lc-text);
    --bs-body-font-family:         var(--lc-font-body);
    --bs-body-font-size:           var(--lc-text-base);
    --bs-body-font-weight:         var(--lc-weight-body);
    --bs-body-line-height:         1.75;

    --bs-emphasis-color:           var(--lc-text);
    --bs-secondary-color:          var(--lc-text-secondary);
    --bs-tertiary-color:           var(--lc-text-muted);
    --bs-heading-color:            var(--lc-heading);

    --bs-secondary-bg:             var(--lc-surface);
    --bs-tertiary-bg:              var(--lc-bg-sunken);

    --bs-border-color:             var(--lc-border);
    --bs-border-color-translucent: var(--lc-border);
    --bs-border-radius:            var(--lc-radius);
    --bs-border-radius-sm:         var(--lc-radius-sm);
    --bs-border-radius-lg:         var(--lc-radius-lg);
    --bs-border-radius-xl:         var(--lc-radius-xl);
    --bs-border-radius-pill:       var(--lc-radius-pill);

    --bs-primary:                  var(--lc-signal);
    --bs-primary-rgb:              245, 144, 53;
    --bs-secondary:                var(--lc-grey);
    --bs-secondary-rgb:            106, 108, 114;

    --bs-link-color:               var(--lc-link);
    --bs-link-hover-color:         var(--lc-link-hover);
    --bs-link-color-rgb:           72, 208, 220;

    --bs-success:                  var(--lc-success);
    --bs-warning:                  var(--lc-warning);
    --bs-danger:                   var(--lc-danger);
    --bs-info:                     var(--lc-info);

    --bs-card-bg:                  var(--lc-surface);
    --bs-card-border-color:        var(--lc-border);
    --bs-card-cap-bg:              var(--lc-tint);

    --bs-focus-ring-color:         rgba(72, 208, 220, 0.4);
    --bs-focus-ring-width:         3px;
}

/* ── Per-work accent presets ─────────────────────────────────────────────── */
/* Put one of these on a <body>, a section or a card and everything inside it
   picks up that work's colour. Added to as new books ship. */
[data-work="savant"]      { --lc-work: var(--lc-ember);     --lc-work-ink: var(--lc-ember-ink); }
[data-work="in-memoriam"] { --lc-work: #f0922e;            --lc-work-ink: var(--lc-ember-ink); }
[data-work="anamnesis"]   { --lc-work: #e8743a;            --lc-work-ink: #190a03; }
[data-work="cloudbreaker"]{ --lc-work: var(--lc-sky);      --lc-work-ink: #06182b; }
[data-work="editing"]     { --lc-work: var(--lc-cyan);     --lc-work-ink: #04212b; }
[data-work="blog"]        { --lc-work: var(--lc-lavender); --lc-work-ink: #1b1324; }
