/* /Components/Hero.razor.rz.scp.css */
/* Hero layout and the Kasil logo animation. Elements created by JavaScript are styled in wwwroot/app.css. Spacing and
   easing steps (--space-*, --ease-*) and the entrance timeline (--t-*) are tokens in wwwroot/app.css. */

.aurora[b-09dhscabne],
.light-rays[b-09dhscabne],
.ghost-cursor[b-09dhscabne] {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

/* The shaders own their entrances (rays ignite, aurora dawns), so no CSS fade runs on top of them; the layers
   only wait for their effect to mount. Reduced motion cross-fades the static frames in (end of this file). */
.aurora[b-09dhscabne],
.light-rays[b-09dhscabne] {
    opacity: 0;
}

.aurora[b-09dhscabne] {
    z-index: 0;
}

/* Rays fall from the top onto the logo, above the aurora and below the content. */
.light-rays[b-09dhscabne] {
    z-index: 1;
}

/* The rays shader composites as light over a dark ground; over the light theme's grey sky the same output would
   darken it (an overcast look), so there the layer is screened and can only add light. */
@media (prefers-color-scheme: light) {
    .light-rays[b-09dhscabne] {
        mix-blend-mode: screen;
    }
}

.has-aurora .aurora[b-09dhscabne],
.has-rays .light-rays[b-09dhscabne] {
    opacity: 1;
}

.ghost-cursor[b-09dhscabne] {
    z-index: 3;
}

/* The block starts at 16% of the viewport height: the tagline's two rows should stay above the aurora's resting band.
   100dvh tracks the visible viewport as mobile browser bars show and hide, so the contact line stays on the bottom edge.
   overflow: clip keeps the page from growing past the viewport on any layer that bleeds; clip (unlike hidden) makes no
   scroll container, and the hero still grows, and the page scrolls, when the content is taller than the viewport. */
.hero[b-09dhscabne] {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
    overflow: clip;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding:
        max(16svh, env(safe-area-inset-top))
        max(var(--space-l), env(safe-area-inset-right))
        max(clamp(1.25rem, 3svh, 2rem), env(safe-area-inset-bottom))
        max(var(--space-l), env(safe-area-inset-left));
    text-align: center;
}

/* The minimum yields to the viewport (15vw) so a large root font size or a narrow phone never clips the name; a word
   still wider than the line breaks instead of being cut. */
.hero-title[b-09dhscabne] {
    margin: clamp(1.25rem, 4svh, 2.5rem) 0 0;
    max-width: 100%;
    font-size: clamp(min(3.25rem, 15vw), min(14vw, 13svh), 7.25rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.06em;
    /* A negative tracking leaves the box shorter than the ink by the same amount at the end; shift back so the word stays optically centred. */
    margin-inline-start: -0.06em;
    color: var(--ink);
    /* Display text, not copy: it never takes the I-beam or a selection highlight. Assistive tech still reads it. */
    -webkit-user-select: none;
    user-select: none;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

/* The tagline sits closer to the name than the name does to the mark: the pair reads as one statement. */
.hero-tagline[b-09dhscabne] {
    margin: var(--space-s) 0 0;
    /* A detailed second headline on two balanced rows; `data-measure` (below) sets the width from the text length. 12em
       is only the fallback without the attribute. */
    max-width: min(12em, 100%);
    font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.5rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    /* A clear grey step below the title's ink (mid warm grey on dark, slate grey on light; OKLCH lightness gap about
       0.25 in both themes) so the promise reads second to the name. Worst pixel behind the tagline through the aurora's
       sway cycle: 3.8:1 dark, 3.3:1 light, above the 3:1 AA floor for this large text (DESIGN.md, Contrast). */
    color: var(--ink-soft);
    -webkit-user-select: none;
    user-select: none;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

/* Two balanced rows for every tagline: the measure follows the text length (`data-measure`, in ch, set in
   Components/Hero.razor); attribute values cannot feed a length without inline styles, so each value has its rule. */
.hero-tagline[data-measure="8"][b-09dhscabne] { max-width: min(8ch, 100%); }
.hero-tagline[data-measure="9"][b-09dhscabne] { max-width: min(9ch, 100%); }
.hero-tagline[data-measure="10"][b-09dhscabne] { max-width: min(10ch, 100%); }
.hero-tagline[data-measure="11"][b-09dhscabne] { max-width: min(11ch, 100%); }
.hero-tagline[data-measure="12"][b-09dhscabne] { max-width: min(12ch, 100%); }
.hero-tagline[data-measure="13"][b-09dhscabne] { max-width: min(13ch, 100%); }
.hero-tagline[data-measure="14"][b-09dhscabne] { max-width: min(14ch, 100%); }
.hero-tagline[data-measure="15"][b-09dhscabne] { max-width: min(15ch, 100%); }
.hero-tagline[data-measure="16"][b-09dhscabne] { max-width: min(16ch, 100%); }
.hero-tagline[data-measure="17"][b-09dhscabne] { max-width: min(17ch, 100%); }
.hero-tagline[data-measure="18"][b-09dhscabne] { max-width: min(18ch, 100%); }
.hero-tagline[data-measure="19"][b-09dhscabne] { max-width: min(19ch, 100%); }
.hero-tagline[data-measure="20"][b-09dhscabne] { max-width: min(20ch, 100%); }
.hero-tagline[data-measure="21"][b-09dhscabne] { max-width: min(21ch, 100%); }
.hero-tagline[data-measure="22"][b-09dhscabne] { max-width: min(22ch, 100%); }
.hero-tagline[data-measure="23"][b-09dhscabne] { max-width: min(23ch, 100%); }
.hero-tagline[data-measure="24"][b-09dhscabne] { max-width: min(24ch, 100%); }
.hero-tagline[data-measure="25"][b-09dhscabne] { max-width: min(25ch, 100%); }

/* Where an effect does not take the text over (no WebGL2, script failed) the plain text arrives on the same beat as
   the effect would: the title with the warp (--t-title), the tagline with the stroke draw (--t-tagline). While an
   effect owns the text its native glyphs are transparent (wwwroot/app.css) and the effect does the entrance. */
.hero-title:not(.is-warped)[b-09dhscabne] {
    animation: text-in-b-09dhscabne 0.9s var(--ease-entrance) var(--t-title) both;
}

.hero-tagline:not(.is-stroked)[b-09dhscabne] {
    animation: text-in-b-09dhscabne 0.9s var(--ease-entrance) var(--t-tagline) both;
}

/* ---------- Extra (optional ChildContent: the 404's sentence and way home) ---------- */

/* The slot's content is written by the page, so its elements carry no scope attribute: ::deep reaches them. It fades
   in with the tagline and shows at once when focus is inside. */
.hero-extra[b-09dhscabne] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-l);
    animation: text-in-b-09dhscabne 0.9s var(--ease-entrance) var(--t-tagline) both;
}

.hero-extra:focus-within[b-09dhscabne] {
    animation: none;
}

/* A text link in the same type system as the contact pills; its ring comes from `a:focus-visible` (wwwroot/app.css). */
.hero-extra[b-09dhscabne]  .hero-home {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding-inline: var(--space-xs);
    border-radius: var(--space-xs);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, var(--ink) 55%, transparent);
    text-underline-offset: 0.35em;
    transition: text-decoration-color 0.2s var(--ease-standard);
}

@media (hover: hover) {
    .hero-extra[b-09dhscabne]  .hero-home:hover {
        text-decoration-color: currentColor;
    }
}

/* ---------- Contact ---------- */

/* Last beat of the intro (CSS only, no script needed): each pill rises 10 px while it fades in, 0.12 s apart, from
   --t-contact. Focus inside the row shows both at once, so a keyboard visitor never lands on an invisible link. */
.hero-contact[b-09dhscabne] {
    margin-top: auto;
    padding-top: var(--space-2xl);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-s) var(--space-m);
    font-size: 1rem;
    line-height: 1.25;
}

/* Glass pill: frosted glass with a sheen over its upper half, a bright top rim, a darker bottom edge and a soft drop
   shadow (tokens in wwwroot/app.css). Hover lights the border in the logo gradient and thickens the frost; nothing
   moves. 2.75rem (44 px) tall. */
.contact-link[b-09dhscabne] {
    --order: 0;
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-s);
    min-height: 2.75rem;
    padding: var(--space-s) var(--space-l);
    border: 1px solid var(--glass-rim);
    border-radius: 999px;
    background-color: var(--glass);
    background-image: linear-gradient(180deg, var(--glass-sheen), transparent 55%);
    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        inset 0 -1px 0 var(--glass-lowlight),
        0 10px 28px -10px var(--glass-shadow);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    backdrop-filter: blur(20px) saturate(1.3);
    color: var(--ink);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s var(--ease-standard), border-color 0.2s var(--ease-standard);
    animation: contact-in-b-09dhscabne 0.9s var(--ease-entrance) calc(var(--t-contact) + var(--order) * 0.12s) both;
}

.contact-link:nth-child(2)[b-09dhscabne] { --order: 1; }

/* The lit border: the logo gradient shows through a 1 px ring (mask), fading in over the glass rim. */
.contact-link[b-09dhscabne]::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(110deg, var(--lit-start), var(--lit-end));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-standard);
}

.contact-link:active[b-09dhscabne] {
    background-color: var(--glass-active);
}

.contact-link:active[b-09dhscabne]::before {
    opacity: 1;
}

@media (hover: hover) {
    .contact-link:hover[b-09dhscabne] {
        background-color: var(--glass-hover);
    }

    .contact-link:hover[b-09dhscabne]::before {
        opacity: 1;
    }
}

.hero-contact:focus-within .contact-link[b-09dhscabne] {
    animation: none;
}

/* One outline icon family: 24-unit grid, 1.75 stroke, round caps. */
.contact-icon[b-09dhscabne] {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* The number never breaks inside; the label may wrap before it on the narrowest screens. */
.contact-nowrap[b-09dhscabne] {
    white-space: nowrap;
}

/* Narrow phones: the pills stack and share the width of the longer one. */
@media (max-width: 30.99rem) {
    .hero-contact[b-09dhscabne] {
        display: grid;
        grid-auto-columns: minmax(0, max-content);
        justify-content: center;
    }

    .contact-link[b-09dhscabne] {
        width: 100%;
    }
}

/* Short landscape (phones on their side): the mark and the name sit beside the tagline, which keeps its size and its
   rows, so the contact stays on screen. */
@media (max-height: 32rem) and (orientation: landscape) {
    .hero[b-09dhscabne] {
        display: grid;
        grid-template:
            ". logo tagline ." auto
            ". title tagline ." auto
            ". extra extra ." auto
            "contact contact contact contact" 1fr / 1fr auto auto 1fr;
        align-content: start;
        column-gap: clamp(var(--space-l), 5vw, var(--space-2xl));
        padding-top: max(var(--space-m), env(safe-area-inset-top));
        padding-inline: max(var(--space-m), env(safe-area-inset-left)) max(var(--space-m), env(safe-area-inset-right));
    }

    .hero-logo[b-09dhscabne] {
        grid-area: logo;
        justify-self: center;
        width: clamp(3.5rem, 15svh, 9rem);
    }

    .hero-title[b-09dhscabne] {
        grid-area: title;
        justify-self: center;
        /* The track is sized from the margin box, which the negative start margin shortens: say the full width. */
        width: max-content;
        max-width: 80vw;
        margin-top: var(--space-s);
    }

    .hero-tagline[b-09dhscabne] {
        grid-area: tagline;
        align-self: center;
        margin: 0;
        /* Grid tracks size from min-content: `anywhere` would let the track shrink below a whole word. */
        overflow-wrap: break-word;
    }

    .hero-extra[b-09dhscabne] {
        grid-area: extra;
        justify-self: center;
        margin-top: var(--space-s);
    }

    .hero-contact[b-09dhscabne] {
        grid-area: contact;
        align-self: end;
        justify-content: center;
        gap: var(--space-s);
        padding-top: var(--space-m);
    }

    .contact-link[b-09dhscabne] {
        padding-inline: var(--space-m);
    }
}

/* ---------- Logo ---------- */

/* Logo gradient stops take their colour from the palette tokens (wwwroot/app.css); SVG attributes cannot read variables. */
.kasil-stop--navy[b-09dhscabne] { stop-color: var(--kasil-navy); }
.kasil-stop--blue[b-09dhscabne] { stop-color: var(--kasil-blue); }
.kasil-stop--cyan[b-09dhscabne] { stop-color: var(--kasil-cyan); }
.kasil-stop--teal[b-09dhscabne] { stop-color: var(--kasil-teal); }
.kasil-stop--green[b-09dhscabne] { stop-color: var(--kasil-green); }
.kasil-stop--shine[b-09dhscabne] { stop-color: var(--kasil-shine); }
.kasil-stop--mid[b-09dhscabne] { stop-color: var(--c0); }

/* Colour flow (owner request 2026-12-02, owner's sketch): every leaf keeps its gradient direction while its colours
   travel clockwise round the mark. Each leaf has three stops (start, middle, end; the middle one rests on the sRGB mix
   of its neighbours, which is exactly what the two-stop gradient showed there, so the resting logo is unchanged).
   The ring is fourteen places in the order the colour passes them on screen: 0-2 across the top-left leaf
   (left → right), 3-5 across the top-right leaf (upper-left edge → lower-right edge), 6-7 the gap between the
   top-right and bottom-right leaves, 8-10 across the bottom-right leaf (upper-right edge = its end stop → lower-left
   edge = its start stop), 11-13 across the bottom-left leaf (right = its end stop → left = its start stop), then up
   into 0 again. The two gap places carry bridge colours that are never shown at rest (owner request: green against
   navy was too harsh): green → two OKLCH steps → navy, so the lightness falls in even steps wherever that pair
   crosses a leaf. Each step every place takes the colour of the place before it: fourteen steps, a 20 s loop, at a
   constant speed (no easing per step, so the colours flow instead of pulsing). Each base gradient feeds exactly one
   leaf (kasil-leaf-a…d in Components/Hero.razor): cyan-teal top-left, teal-green top-right, blue-navy bottom-right,
   cyan-blue bottom-left. --c0…--c13 are the ring colours a stop shows at each step. :where() keeps the specificity
   low, so the hover reset and reduced motion below can switch it off with a plain selector. */
.kasil-logo[b-09dhscabne] {
    --ring-0: var(--kasil-cyan);
    --ring-1: color-mix(in srgb, var(--kasil-cyan), var(--kasil-teal));
    --ring-2: var(--kasil-teal);
    --ring-3: var(--kasil-teal);
    --ring-4: color-mix(in srgb, var(--kasil-teal), var(--kasil-green));
    --ring-5: var(--kasil-green);
    --ring-6: color-mix(in oklch, var(--kasil-green) 67%, var(--kasil-navy));
    --ring-7: color-mix(in oklch, var(--kasil-green) 33%, var(--kasil-navy));
    --ring-8: var(--kasil-navy);
    --ring-9: color-mix(in srgb, var(--kasil-blue), var(--kasil-navy));
    --ring-10: var(--kasil-blue);
    --ring-11: var(--kasil-blue);
    --ring-12: color-mix(in srgb, var(--kasil-cyan), var(--kasil-blue));
    --ring-13: var(--kasil-cyan);
}

:where(#kasil-cyan-teal, #kasil-teal-green, #kasil-blue-navy, #kasil-cyan-blue) stop[b-09dhscabne] {
    animation: stop-flow-b-09dhscabne 20s linear calc(var(--t-lock) + 1.4s) infinite;
}

#kasil-cyan-teal stop:first-child[b-09dhscabne] { --c0: var(--ring-0); --c1: var(--ring-13); --c2: var(--ring-12); --c3: var(--ring-11); --c4: var(--ring-10); --c5: var(--ring-9); --c6: var(--ring-8); --c7: var(--ring-7); --c8: var(--ring-6); --c9: var(--ring-5); --c10: var(--ring-4); --c11: var(--ring-3); --c12: var(--ring-2); --c13: var(--ring-1); }
#kasil-cyan-teal stop:nth-child(2)[b-09dhscabne] { --c0: var(--ring-1); --c1: var(--ring-0); --c2: var(--ring-13); --c3: var(--ring-12); --c4: var(--ring-11); --c5: var(--ring-10); --c6: var(--ring-9); --c7: var(--ring-8); --c8: var(--ring-7); --c9: var(--ring-6); --c10: var(--ring-5); --c11: var(--ring-4); --c12: var(--ring-3); --c13: var(--ring-2); }
#kasil-cyan-teal stop:last-child[b-09dhscabne] { --c0: var(--ring-2); --c1: var(--ring-1); --c2: var(--ring-0); --c3: var(--ring-13); --c4: var(--ring-12); --c5: var(--ring-11); --c6: var(--ring-10); --c7: var(--ring-9); --c8: var(--ring-8); --c9: var(--ring-7); --c10: var(--ring-6); --c11: var(--ring-5); --c12: var(--ring-4); --c13: var(--ring-3); }
#kasil-teal-green stop:first-child[b-09dhscabne] { --c0: var(--ring-3); --c1: var(--ring-2); --c2: var(--ring-1); --c3: var(--ring-0); --c4: var(--ring-13); --c5: var(--ring-12); --c6: var(--ring-11); --c7: var(--ring-10); --c8: var(--ring-9); --c9: var(--ring-8); --c10: var(--ring-7); --c11: var(--ring-6); --c12: var(--ring-5); --c13: var(--ring-4); }
#kasil-teal-green stop:nth-child(2)[b-09dhscabne] { --c0: var(--ring-4); --c1: var(--ring-3); --c2: var(--ring-2); --c3: var(--ring-1); --c4: var(--ring-0); --c5: var(--ring-13); --c6: var(--ring-12); --c7: var(--ring-11); --c8: var(--ring-10); --c9: var(--ring-9); --c10: var(--ring-8); --c11: var(--ring-7); --c12: var(--ring-6); --c13: var(--ring-5); }
#kasil-teal-green stop:last-child[b-09dhscabne] { --c0: var(--ring-5); --c1: var(--ring-4); --c2: var(--ring-3); --c3: var(--ring-2); --c4: var(--ring-1); --c5: var(--ring-0); --c6: var(--ring-13); --c7: var(--ring-12); --c8: var(--ring-11); --c9: var(--ring-10); --c10: var(--ring-9); --c11: var(--ring-8); --c12: var(--ring-7); --c13: var(--ring-6); }
#kasil-blue-navy stop:last-child[b-09dhscabne] { --c0: var(--ring-8); --c1: var(--ring-7); --c2: var(--ring-6); --c3: var(--ring-5); --c4: var(--ring-4); --c5: var(--ring-3); --c6: var(--ring-2); --c7: var(--ring-1); --c8: var(--ring-0); --c9: var(--ring-13); --c10: var(--ring-12); --c11: var(--ring-11); --c12: var(--ring-10); --c13: var(--ring-9); }
#kasil-blue-navy stop:nth-child(2)[b-09dhscabne] { --c0: var(--ring-9); --c1: var(--ring-8); --c2: var(--ring-7); --c3: var(--ring-6); --c4: var(--ring-5); --c5: var(--ring-4); --c6: var(--ring-3); --c7: var(--ring-2); --c8: var(--ring-1); --c9: var(--ring-0); --c10: var(--ring-13); --c11: var(--ring-12); --c12: var(--ring-11); --c13: var(--ring-10); }
#kasil-blue-navy stop:first-child[b-09dhscabne] { --c0: var(--ring-10); --c1: var(--ring-9); --c2: var(--ring-8); --c3: var(--ring-7); --c4: var(--ring-6); --c5: var(--ring-5); --c6: var(--ring-4); --c7: var(--ring-3); --c8: var(--ring-2); --c9: var(--ring-1); --c10: var(--ring-0); --c11: var(--ring-13); --c12: var(--ring-12); --c13: var(--ring-11); }
#kasil-cyan-blue stop:last-child[b-09dhscabne] { --c0: var(--ring-11); --c1: var(--ring-10); --c2: var(--ring-9); --c3: var(--ring-8); --c4: var(--ring-7); --c5: var(--ring-6); --c6: var(--ring-5); --c7: var(--ring-4); --c8: var(--ring-3); --c9: var(--ring-2); --c10: var(--ring-1); --c11: var(--ring-0); --c12: var(--ring-13); --c13: var(--ring-12); }
#kasil-cyan-blue stop:nth-child(2)[b-09dhscabne] { --c0: var(--ring-12); --c1: var(--ring-11); --c2: var(--ring-10); --c3: var(--ring-9); --c4: var(--ring-8); --c5: var(--ring-7); --c6: var(--ring-6); --c7: var(--ring-5); --c8: var(--ring-4); --c9: var(--ring-3); --c10: var(--ring-2); --c11: var(--ring-1); --c12: var(--ring-0); --c13: var(--ring-13); }
#kasil-cyan-blue stop:first-child[b-09dhscabne] { --c0: var(--ring-13); --c1: var(--ring-12); --c2: var(--ring-11); --c3: var(--ring-10); --c4: var(--ring-9); --c5: var(--ring-8); --c6: var(--ring-7); --c7: var(--ring-6); --c8: var(--ring-5); --c9: var(--ring-4); --c10: var(--ring-3); --c11: var(--ring-2); --c12: var(--ring-1); --c13: var(--ring-0); }

.hero-logo[b-09dhscabne] {
    position: relative;
    width: clamp(6rem, min(18vw, 15svh), 9rem);
    aspect-ratio: 1;
    /* Depth for the pointer tilt (wwwroot/js/tilt.js, React Bits TiltedCard perspective). */
    perspective: 800px;
}

/* Aurora-coloured glow: a blurred radial layer behind the mark. It lights at the lock (--t-lock), then breathes
   slowly (cheap: opacity + transform only). */
.hero-logo[b-09dhscabne]::before {
    content: "";
    position: absolute;
    inset: -28%;
    border-radius: 50%;
    background:
        radial-gradient(closest-side at 38% 40%, color-mix(in srgb, var(--kasil-cyan) 55%, transparent), transparent),
        radial-gradient(closest-side at 64% 62%, color-mix(in srgb, var(--kasil-green) 38%, transparent), transparent);
    filter: blur(30px);
    opacity: 0;
    /* The glow reaches past the mark; only the mark itself should count as hovered for the tilt. */
    pointer-events: none;
    animation:
        glow-lock-b-09dhscabne 1.4s var(--ease-out) var(--t-lock) both,
        glow-breathe-b-09dhscabne 10s ease-in-out calc(var(--t-lock) + 1.4s) infinite;
}

.kasil-logo[b-09dhscabne] {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Assemble: each leaf converges from its own corner with a slight turn and blur, while its outline draws
   and the gradient fill rises. 120 ms stagger, signature exponential ease-out. */
.leaf[b-09dhscabne] {
    --leaf-base: var(--t-leaves);
    transform-box: fill-box;
    transform-origin: center;
    animation: leaf-assemble-b-09dhscabne 1.1s var(--ease-out) both;
}

.leaf path[b-09dhscabne] {
    stroke-width: 1.4;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    fill-opacity: 0;
    animation:
        leaf-draw-b-09dhscabne 0.8s var(--ease-out) forwards,
        leaf-fill-b-09dhscabne 0.7s var(--ease-out) forwards;
}

/* Four leaves, 120 ms apart, from --t-leaves (wwwroot/app.css). */
.leaf:nth-of-type(1)[b-09dhscabne] { --dx: -22px; --dy: -22px; --turn: -18deg; --order: 0; }
.leaf:nth-of-type(2)[b-09dhscabne] { --dx: 22px; --dy: -22px; --turn: 18deg; --order: 1; }
.leaf:nth-of-type(3)[b-09dhscabne] { --dx: -22px; --dy: 22px; --turn: 18deg; --order: 2; }
.leaf:nth-of-type(4)[b-09dhscabne] { --dx: 22px; --dy: 22px; --turn: -18deg; --order: 3; }

.leaf[b-09dhscabne] { animation-delay: calc(var(--leaf-base) + var(--order) * 0.12s); }

.leaf path[b-09dhscabne] {
    animation-delay:
        calc(var(--leaf-base) + var(--order) * 0.12s),
        calc(var(--leaf-base) + 0.45s + var(--order) * 0.12s);
}

/* wwwroot/js/landing.js adds `is-replay` before the first hover replay, so the replay starts at once instead of waiting
   for the intro's lead-in: the leaves 0.2 s earlier than --t-leaves, so the lock (and everything timed from it) too. */
.hero-logo.is-replay .leaf[b-09dhscabne] { --leaf-base: 0.15s; }
.hero-logo.is-replay[b-09dhscabne] { --t-lock: 1.15s; }

/* wwwroot/js/landing.js adds this class for one frame on hover; dropping the animations and restoring them restarts
   every logo animation together (assembly, glow, colour flow, arrow trace; the script restarts the SMIL shimmer), so
   no two cycles collide. */
.hero-logo.is-resetting[b-09dhscabne]::before,
.hero-logo.is-resetting .leaf[b-09dhscabne],
.hero-logo.is-resetting .leaf path[b-09dhscabne],
.hero-logo.is-resetting stop[b-09dhscabne],
.hero-logo.is-resetting .arrow-trace[b-09dhscabne],
.hero-logo.is-resetting .arrow-trace *[b-09dhscabne] {
    animation: none;
}

.shimmer[b-09dhscabne] {
    mix-blend-mode: soft-light;
    pointer-events: none;
}

/* Gold arrow trace (owner request 2026-12-02), drawn as React Bits Star Border draws its star: a thin line of light
   whose trail fades behind a bright head with a soft round bloom. It shares the logo's 10 s beat with the shimmer
   (twice per 20 s colour loop): the shimmer sweeps first, and as it leaves the mark (2 s into the beat) one star starts
   partway down the top and one partway up the bottom of the mark's left edge and runs along the leaf edges to the
   arrow's tip (2 s, easing in and out); there the trails drain into the tip, a soft bloom swells on it, and the arrow's
   line glows faintly and fades (about 1.3 s). The rest of the beat is calm: only the colour flow moves.
   Layers: every star is the same side path (pathLength 1) drawn five times with a dash that ends at the head --h
   (0 at the start, 1 at the tip); --len is how far back the layer reaches, so the overlapping layers fade the trail
   toward its end, like the original's 30 % trail. Widths are logo units (1 unit ≈ 0.58 px at the largest logo). */
@property --h {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

.arrow-trace[b-09dhscabne] {
    pointer-events: none;
}

.arrow-comet[b-09dhscabne] {
    opacity: 0;
    animation:
        comet-run-b-09dhscabne 10s linear calc(var(--t-lock) + 2s) infinite,
        comet-fade-b-09dhscabne 10s linear calc(var(--t-lock) + 2s) infinite;
}

.arrow-comet use[b-09dhscabne] {
    fill: none;
    stroke: var(--kasil-gold);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: calc(var(--len) * 1px) 3px;
    stroke-dashoffset: calc((var(--len) - var(--h)) * 1px);
}

.comet-glow[b-09dhscabne] { --len: 0.3; stroke-width: 4.5; opacity: 0.14; }
.comet-tail[b-09dhscabne] { --len: 0.3; stroke-width: 1.3; opacity: 0.32; }
.comet-body[b-09dhscabne] { --len: 0.12; stroke-width: 1.5; opacity: 0.5; }
.comet-bloom[b-09dhscabne] { --len: 0.001; stroke-width: 9; opacity: 0.6; filter: url(#kasil-gold-bloom); }
.comet-head[b-09dhscabne] { --len: 0.012; stroke-width: 2; stroke: var(--kasil-gold-core); }

.arrow-line[b-09dhscabne] {
    fill: none;
    stroke: var(--kasil-gold);
    stroke-width: 1.1;
    stroke-linejoin: round;
    opacity: 0;
    animation: arrow-line-b-09dhscabne 10s linear calc(var(--t-lock) + 2s) infinite;
}

.arrow-tip[b-09dhscabne] {
    fill: var(--kasil-gold-core);
    filter: url(#kasil-gold-bloom);
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
    animation: arrow-tip-b-09dhscabne 10s linear calc(var(--t-lock) + 2s) infinite;
}

@keyframes leaf-assemble-b-09dhscabne {
    from {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) rotate(var(--turn)) scale(0.82);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}

@keyframes leaf-draw-b-09dhscabne {
    to { stroke-dashoffset: 0; }
}

@keyframes leaf-fill-b-09dhscabne {
    from { fill-opacity: 0; stroke-opacity: 1; }
    to { fill-opacity: 1; stroke-opacity: 0; }
}

/* The lock: the glow blooms to a quick peak as the last leaf settles, then eases down to its resting level. */
@keyframes glow-lock-b-09dhscabne {
    0% { opacity: 0; transform: scale(0.88); animation-timing-function: var(--ease-out); }
    22% { opacity: var(--glow-flash); transform: scale(1.1); animation-timing-function: ease-in-out; }
    100% { opacity: var(--glow-rest); transform: scale(1); }
}

@keyframes glow-breathe-b-09dhscabne {
    0%, 100% { opacity: var(--glow-rest); transform: scale(1); }
    50% { opacity: var(--glow-peak); transform: scale(1.08); }
}

/* Constant speed: each keyframe is the next arrangement, so the colours flow without slowing at any step. */
@keyframes stop-flow-b-09dhscabne {
    0% { stop-color: var(--c0); }
    7.143% { stop-color: var(--c1); }
    14.286% { stop-color: var(--c2); }
    21.429% { stop-color: var(--c3); }
    28.571% { stop-color: var(--c4); }
    35.714% { stop-color: var(--c5); }
    42.857% { stop-color: var(--c6); }
    50% { stop-color: var(--c7); }
    57.143% { stop-color: var(--c8); }
    64.286% { stop-color: var(--c9); }
    71.429% { stop-color: var(--c10); }
    78.571% { stop-color: var(--c11); }
    85.714% { stop-color: var(--c12); }
    92.857% { stop-color: var(--c13); }
    100% { stop-color: var(--c0); }
}

/* Percentages of the 10 s beat: the heads ease into the tip by 2 s, then the trails drain into it. */
@keyframes comet-run-b-09dhscabne {
    0% { --h: 0; animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
    20% { --h: 1; animation-timing-function: ease-out; }
    24.8%, 100% { --h: 1.3; }
}

@keyframes comet-fade-b-09dhscabne {
    0% { opacity: 0; }
    2.4%, 21.6% { opacity: 1; }
    25.6%, 100% { opacity: 0; }
}

/* The arrow's line glows faintly as the stars arrive, then fades slowly. */
@keyframes arrow-line-b-09dhscabne {
    0%, 17.6% { opacity: 0; }
    21.2%, 23.2% { opacity: 0.6; animation-timing-function: ease-out; }
    32.8%, 100% { opacity: 0; }
}

@keyframes arrow-tip-b-09dhscabne {
    0%, 18.4% { opacity: 0; transform: scale(0.4); }
    21.2% { opacity: 0.9; transform: scale(1); animation-timing-function: ease-out; }
    31.2%, 100% { opacity: 0; transform: scale(1.5); }
}

@keyframes contact-in-b-09dhscabne {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes text-in-b-09dhscabne {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    /* No spatial movement: the static aurora and rays frames cross-fade in (at most 400 ms), everything else is present at once. */
    .aurora[b-09dhscabne],
    .light-rays[b-09dhscabne] { transition: opacity 0.4s ease-out; }

    .leaf[b-09dhscabne],
    .leaf path[b-09dhscabne],
    .kasil-logo stop[b-09dhscabne],
    .hero-logo[b-09dhscabne]::before,
    .hero-title:not(.is-warped)[b-09dhscabne],
    .hero-tagline:not(.is-stroked)[b-09dhscabne],
    .hero-extra[b-09dhscabne],
    .contact-link[b-09dhscabne] {
        animation: none;
    }

    .leaf path[b-09dhscabne] {
        stroke-dashoffset: 0;
        fill-opacity: 1;
        stroke-opacity: 0;
    }

    .hero-logo[b-09dhscabne]::before { opacity: var(--glow-rest); }

    .shimmer[b-09dhscabne],
    .arrow-trace[b-09dhscabne] { display: none; }
}
