/* React Bits-inspired effects (ShinyText, SpotlightCard), ported to plain CSS/JS. Decorative only. */
@media (prefers-reduced-motion: no-preference) {
    .bl-home-hero h1 em {
        background: linear-gradient(110deg, transparent 40%, var(--bl-cobalt) 50%, transparent 60%) 150% 0 / 250% 100% no-repeat, linear-gradient(var(--bl-night), var(--bl-night));
        -webkit-background-clip: text; background-clip: text;
        -webkit-text-fill-color: transparent; color: transparent;
        animation: bl-fx-shine 4.5s ease-in-out infinite;
    }
}
@keyframes bl-fx-shine { 0% { background-position: 150% 0; } 60%, 100% { background-position: -50% 0; } }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .bl-tour-card { position: relative; isolation: isolate; }
    .bl-tour-card::after {
        content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; opacity: 0;
        background: radial-gradient(260px circle at var(--fx-x, 50%) var(--fx-y, 50%), rgba(245, 213, 63, .22), transparent 70%);
        transition: opacity .25s ease-out;
    }
    .bl-tour-card.fx-lit::after { opacity: 1; }
}

/* ---- Stories: three more React Bits ideas, CSS only (no DOM changes, so Blazor re-renders stay safe) ---- */

/* BlurText: headline lines come into focus one after another on the story hero and the /stories feature card */
@media (prefers-reduced-motion: no-preference) {
    .bl-sd-hero-copy > *, .bl-stories-feature-copy > * { animation: bl-fx-focus .95s cubic-bezier(.2, .7, .2, 1) both; }
    .bl-sd-hero-copy > :nth-child(2), .bl-stories-feature-copy > :nth-child(2) { animation-delay: .12s; }
    .bl-sd-hero-copy > :nth-child(3), .bl-stories-feature-copy > :nth-child(3) { animation-delay: .26s; }
    .bl-sd-hero img { animation: bl-fx-settle 1.8s cubic-bezier(.2, .7, .2, 1) both; }
}
@keyframes bl-fx-focus { from { opacity: 0; filter: blur(10px); transform: translateY(14px); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes bl-fx-settle { from { transform: scale(1.06); } to { transform: none; } }

/* ScrollReveal: story text comes up out of the page as it scrolls into view (browsers without scroll timelines just show it) */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .bl-sd-lead, .bl-sd .bl-story-body p { animation: bl-fx-ink linear both; animation-timeline: view(); animation-range: entry 5% entry 80%; }
    }
}
@keyframes bl-fx-ink { from { opacity: .18; filter: blur(3px); transform: translateY(12px); } to { opacity: 1; filter: blur(0); transform: none; } }

/* GlareHover: a soft diagonal shine crosses the story photo tiles on hover */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .bl-stories-tile::before, .bl-stories-feature-media::before, .bl-stories-card .bl-stories-media::before, .bl-sd-hero::before {
        content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
        background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .26) 50%, transparent 62%) 130% 0 / 280% 100% no-repeat;
        transition: background-position .95s cubic-bezier(.2, .7, .2, 1);
    }
    .bl-stories-tile:hover::before, .bl-stories-feature:hover .bl-stories-feature-media::before, .bl-stories-card:hover .bl-stories-media::before, .bl-sd-hero:hover::before { background-position: -40% 0; }
}

/* Reading column: one wide column (1160px, double the old 580), original type sizes; the Try it card runs the same width below */
.bl-sd .bl-sd-text { max-width: 1160px; }
.bl-sd .bl-sd-rail { max-width: 1160px; margin: 40px auto 0; }
.bl-sd .bl-sd-rail .bl-sd-postcard { margin: 0; max-width: none; }
@media (min-width: 900px) { .bl-sd .bl-sd-rail .bl-sd-postcard { padding: 32px 40px; } }
.bl-sd .bl-sd-rail .bl-stories-postcard-line { font-size: clamp(26px, 2.6vw, 34px); }
/* A story that opens with a list number gets no drop cap */
.bl-sd .bl-story-body.no-cap p:first-child::first-letter { float: none; margin: 0; color: inherit; font: inherit; }

/* ---- Story carousel: switch stories without going back to the list ---- */
.bl-sd-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.bl-sd-bar .bl-story-back { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.bl-sd-switch { display: flex; align-items: center; gap: 10px; }
.bl-sd-step { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bl-line, #E7E9EC); background: #fff; color: var(--bl-night, #0b1530); font-size: 24px; line-height: 1; text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.bl-sd-step:hover { background: var(--bl-night, #0b1530); color: #fff; border-color: var(--bl-night, #0b1530); }
.bl-sd-step:focus-visible, .bl-sd-dot:focus-visible, .bl-sd-side:focus-visible { outline: 3px solid #2864ff; outline-offset: 3px; }
.bl-sd-count { min-width: 3.2em; text-align: center; color: var(--bl-slate, #64748B); font: 600 13px/1 var(--font-body, Inter, sans-serif); font-variant-numeric: tabular-nums; }
.bl-sd-dots { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.bl-sd-dot { display: block; position: relative; width: 24px; height: 24px; }
.bl-sd-dot::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 99px; transform: translate(-50%, -50%); background: rgba(11, 21, 48, .25); transition: width .3s cubic-bezier(.2, .7, .2, 1), background .2s; }
.bl-sd-dot:hover::before { background: rgba(11, 21, 48, .55); }
.bl-sd-dot.is-active::before { width: 22px; background: var(--bl-night, #0b1530); }

/* Big edge buttons on wide screens; the neighbouring title opens out on hover or focus */
.bl-sd-side { position: fixed; top: 50%; z-index: 30; display: none; align-items: center; gap: 12px; max-width: 56px; height: 56px; padding: 0 17px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .94); color: var(--bl-night, #0b1530); box-shadow: 0 6px 22px rgba(11, 21, 48, .22); text-decoration: none; white-space: nowrap; transform: translateY(-50%); transition: max-width .45s cubic-bezier(.2, .7, .2, 1), background .2s, color .2s; }
.bl-sd-side-prev { left: 16px; }
.bl-sd-side-next { right: 16px; justify-content: flex-end; }
.bl-sd-side-arrow { flex: none; font-size: 22px; line-height: 1; }
.bl-sd-side-label { overflow: hidden; text-overflow: ellipsis; font: 700 14px/1 var(--font-body, Inter, sans-serif); }
.bl-sd-side:hover, .bl-sd-side:focus-visible { max-width: min(320px, 28vw); background: var(--bl-night, #0b1530); color: #fff; }
@media (min-width: 1101px) { .bl-sd-side { display: flex; } }

/* The page slides in from the side you pressed (only the article and the tiles move, so the fixed arrows stay put) */
@media (prefers-reduced-motion: no-preference) {
    .bl-sd[data-dir="next"] > .bl-sd-wrap, .bl-sd[data-dir="next"] > .bl-sd-more { animation: bl-sd-from-right .6s cubic-bezier(.2, .7, .2, 1) both; }
    .bl-sd[data-dir="prev"] > .bl-sd-wrap, .bl-sd[data-dir="prev"] > .bl-sd-more { animation: bl-sd-from-left .6s cubic-bezier(.2, .7, .2, 1) both; }
}
@keyframes bl-sd-from-right { from { opacity: 0; transform: translateX(64px); } to { opacity: 1; transform: none; } }
@keyframes bl-sd-from-left { from { opacity: 0; transform: translateX(-64px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
    .bl-sd-bar { flex-wrap: wrap; row-gap: 8px; }
    .bl-sd-switch { width: 100%; justify-content: space-between; }
    .bl-sd-count { display: none; }
}

/* ---- /stories page: head and lead story come in, cards rise as they scroll into view, hover lifts ---- */
@media (prefers-reduced-motion: no-preference) {
    .bl-stories-head > * { animation: bl-fx-focus .9s cubic-bezier(.2, .7, .2, 1) both; }
    .bl-stories-head > :nth-child(2) { animation-delay: .12s; }
    .bl-stories-chips { animation: bl-fx-focus .9s .2s cubic-bezier(.2, .7, .2, 1) both; }
    .bl-stories-feature-media { animation: bl-fx-rise .9s .15s cubic-bezier(.2, .7, .2, 1) both; }
    .bl-stories-feature-media img { animation: bl-fx-settle 1.8s cubic-bezier(.2, .7, .2, 1) both; }
    .bl-stories-feature:hover .bl-stories-feature-media img, .bl-stories-feature:focus-visible .bl-stories-feature-media img { transform: scale(1.04); animation: none; }
    .bl-stories-card { transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
    .bl-stories-card:hover, .bl-stories-card:focus-visible { transform: translateY(-6px); }
}
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .bl-stories-grid > li, .bl-stories-more-title, .bl-stories-brand, .bl-stories-latest .bl-stories-postcard { animation: bl-fx-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .bl-stories-card .bl-stories-media::before { z-index: 1; }
}
@keyframes bl-fx-rise { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }

/* ---- Community story page: photo header sized to the window, a readable column, then more stories ---- */
.bl-sd .bl-sd-text.bl-sd-text-narrow { max-width: 780px; margin-top: 40px; }
.bl-sd-community .bl-sd-hero-copy { max-width: 34em; }
.bl-sd-community .bl-sd-hero::after { background: linear-gradient(180deg, rgba(11, 21, 48, 0) 12%, rgba(11, 21, 48, .5) 50%, rgba(11, 21, 48, .92) 100%); }
.bl-sd-community .bl-sd-experience { margin: 40px 0 0; }
.bl-sd-community .bl-story-report { margin-top: 28px; }
.bl-sd-community .bl-sd-more .bl-sec-head { margin-bottom: 24px; }
@media (min-width: 901px) {
    .bl-sd-community .bl-sd-hero { aspect-ratio: auto; height: clamp(340px, calc(var(--bl-vh) - var(--bl-nav-height) - 140px), 600px); }
}
@media (max-width: 600px) {
    .bl-sd .bl-sd-text.bl-sd-text-narrow { margin-top: 28px; }
    .bl-sd-community .bl-sd-experience { margin-top: 28px; }
}

/* ---- Pixel Card (React Bits): twinkling pixels fill the Plus and Pro cards on hover. js/pixel-card.js draws on the canvas. ---- */
[data-pixel-card] { position: relative; overflow: hidden; isolation: isolate; }
.bl-pixel-canvas { display: none; position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .bl-pixel-canvas { display: block; } }

/* The offer card at the top of /plus and /pro */
.bl-plan-card { max-width: 420px; padding: 24px 26px; border-radius: 20px; color: #fff;
    background: radial-gradient(120% 90% at 100% 0%, rgba(239, 255, 105, .16), transparent 55%), linear-gradient(135deg, var(--bl-night-2), var(--bl-night) 70%);
    box-shadow: 0 18px 44px rgba(11, 24, 48, .22), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.bl-plan-card.is-pro { background: radial-gradient(120% 90% at 100% 0%, rgba(40, 100, 255, .32), transparent 58%), linear-gradient(135deg, var(--bl-night-2), var(--bl-night) 70%); }
.bl-plan-card-name { margin: 0; color: var(--bl-lemon); font: italic 700 40px/1 var(--font-display); }
.bl-plan-card-price { margin: 18px 0 0; font: 700 26px/1.2 var(--font-body); }
.bl-plan-card-price span { font: 500 14px/1.2 var(--font-body); color: rgba(255, 255, 255, .72); }
.bl-plan-card-note { margin: 8px 0 0; font: 500 14px/1.45 var(--font-body); color: rgba(255, 255, 255, .86); }

/* Softer pixels so the text on the card stays easy to read */
.bl-pixel-canvas { opacity: .72; }

/* ---- Chroma Grid (React Bits): on the quiz cards and vibe tiles, everything away from the pointer fades to grey,
   and a colour spotlight follows the pointer. js/chroma-grid.js sets --chroma-x/y (grid) and --chroma-cx/cy (each card). ---- */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    [data-chroma-grid] { position: relative; }
    [data-chroma-grid]::after {
        content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .35s ease;
        -webkit-backdrop-filter: grayscale(1) brightness(.7); backdrop-filter: grayscale(1) brightness(.7);
        -webkit-mask-image: radial-gradient(circle 240px at var(--chroma-x, -1000px) var(--chroma-y, -1000px), transparent 0, transparent 20%, rgba(0, 0, 0, .4) 55%, rgba(0, 0, 0, .8) 82%, #000 100%);
        mask-image: radial-gradient(circle 240px at var(--chroma-x, -1000px) var(--chroma-y, -1000px), transparent 0, transparent 20%, rgba(0, 0, 0, .4) 55%, rgba(0, 0, 0, .8) 82%, #000 100%);
    }
    [data-chroma-grid].is-chroma::after { opacity: 1; }
    [data-chroma-grid] > .bl-flv-card, [data-chroma-grid] > .bl-flv-lang { position: relative; }
    [data-chroma-grid] > .bl-flv-card::before, [data-chroma-grid] > .bl-flv-tile::before, [data-chroma-grid] > .bl-flv-lang::before {
        content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .25s ease;
        background: radial-gradient(280px circle at var(--chroma-cx, 50%) var(--chroma-cy, 50%), color-mix(in srgb, var(--bl-flv-tint, #4fd6c2) 42%, transparent), transparent 70%);
    }
    [data-chroma-grid].is-chroma > .bl-flv-card:hover::before, [data-chroma-grid].is-chroma > .bl-flv-tile:hover::before, [data-chroma-grid].is-chroma > .bl-flv-lang:hover::before { opacity: 1; }
    [data-chroma-grid].is-chroma > .bl-flv-card:hover, [data-chroma-grid].is-chroma > .bl-flv-tile:not(:disabled):hover, [data-chroma-grid].is-chroma > .bl-flv-lang:hover { border-color: var(--bl-flv-tint, var(--bl-aqua)); }
}

/* The three quiz steps (who, vibes, language) share one entrance: options rise in one after another, the same focus-in the stories use.
   "backwards" only holds the start frame, so the hover lift keeps working afterwards. */
@media (prefers-reduced-motion: no-preference) {
    [data-chroma-grid] > .bl-flv-card, [data-chroma-grid] > .bl-flv-tile, [data-chroma-grid] > .bl-flv-lang { animation: bl-fx-focus .7s cubic-bezier(.2, .7, .2, 1) backwards; }
    [data-chroma-grid] > :nth-child(2) { animation-delay: .06s; }
    [data-chroma-grid] > :nth-child(3) { animation-delay: .12s; }
    [data-chroma-grid] > :nth-child(4) { animation-delay: .18s; }
    [data-chroma-grid] > :nth-child(5) { animation-delay: .24s; }
    [data-chroma-grid] > :nth-child(6) { animation-delay: .30s; }
    [data-chroma-grid] > :nth-child(n+7) { animation-delay: .36s; }
}

/* ---- Circular Gallery (React Bits): the /vibes tiles on an arc that loops. js/circular-gallery.js moves them; narrow screens keep the grid. ---- */
.bl-vibes-gallery-nav { display: none; }
.bl-vibes-grid.is-gallery {
    display: block; position: relative; height: clamp(380px, 32vw, 470px); overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.bl-vibes-grid.is-gallery:active { cursor: grabbing; }
.bl-vibes-grid.is-gallery > li {
    position: absolute; top: 12px; left: 0; flex: none; width: clamp(210px, 18vw, 270px); height: clamp(280px, 24vw, 360px);
    will-change: transform; transform-origin: 50% 100%;
}
.bl-vibes-grid.is-gallery .bl-vibes-tile { align-items: flex-end; padding: 18px; -webkit-user-drag: none; }
.bl-vibes-grid.is-gallery .bl-vibes-tile:hover { transform: none; }
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
    .bl-vibes-gallery-nav { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }
    .bl-vibes-gallery-nav button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--bl-line, #E7E9EC); border-radius: 50%; background: #fff; color: var(--bl-night, #0b1530); font-size: 22px; line-height: 1; cursor: pointer; transition: background .2s, color .2s; }
    .bl-vibes-gallery-nav button:hover { background: var(--bl-night, #0b1530); color: #fff; }
    .bl-vibes-gallery-nav button:focus-visible { outline: 3px solid #2864ff; outline-offset: 3px; }
}

/* ---- Dock (React Bits): the phone bottom nav. js/dock.js sets --dock-k (0..1) per link from the finger position
   and adds .bl-nav-away to <html> while someone types. The nav sits below every dropdown and modal, and slides away
   while a dropdown or modal is open, so it never covers them. ---- */
@media (max-width: 900px) {
    .bl-bottom-nav {
        z-index: 118000; transition: transform .25s ease, opacity .2s ease, visibility 0s;
        border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px rgba(26, 35, 64, .08);
    }
    .bl-bottom-nav a {
        position: relative; transform-origin: 50% 100%; will-change: transform;
        transform: translateY(calc(var(--dock-k, 0) * -7px)) scale(calc(1 + var(--dock-k, 0) * var(--dock-max, .24)));
        z-index: calc(1 + var(--dock-k, 0) * 10);
        transition: transform .14s ease-out, background .2s ease, color .2s ease;
    }
    @media (prefers-reduced-motion: reduce) { .bl-bottom-nav a { transform: none; transition: none; } }

    /* typing, keyboard up, or a dropdown / modal open: nav goes away (and so do the bars that sit on top of it) */
    html.bl-nav-away .bl-bottom-nav,
    html.bl-nav-away .bl-sticky-cta,
    html.bl-nav-away .bl-pp-mbar,
    html.bl-nav-away .bl-pp-connect-bar,
    html.bl-nav-away .bl-detail-cta,
    body:has(.bl-ps-pop, .bl-ps-list, .bl-sel-pop, .bl-when-pop, .bl-loc-pop, .bl-ps-backdrop, .bl-loc-backdrop, .bl-when-backdrop, .bl-confirm-overlay, .bl-admin-backdrop, .bl-ms-modal, .lightbox-overlay, .modal.show) .bl-bottom-nav {
        transform: translateY(120%); opacity: 0; visibility: hidden; pointer-events: none;
    }
}
