/* ==========================================================================
   React Bits — vanilla ports, restyled for the LeverageFlows instrument theme.
   Behaviour lives in js/reactbits.js. Nothing here depends on a framework.
   ========================================================================== */

/* ==========================================================================
   1. ClickSpark — document-wide, pointer-events: none
   ========================================================================== */

.click-spark-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-spark);
    user-select: none;
}

@media (prefers-reduced-motion: reduce) {
    .click-spark-canvas {
        display: none;
    }
}

/* ==========================================================================
   2. GlareHover — two jobs.
      (a) `.media` is the loading skeleton: the glare sweeps while bytes are
          in flight and the image cross-fades in on load. This is the
          slow-connection surface.
      (b) `.glare-hover` is the interaction sweep on already-loaded panels.
   ========================================================================== */

.glare-hover {
    --gh-angle: -32deg;
    --gh-duration: 780ms;
    --gh-size: 260%;
    --gh-rgba: oklch(0.792 0.138 214 / 0.22);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.glare-hover::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(var(--gh-angle),
            transparent 42%,
            var(--gh-rgba) 50%,
            oklch(1 0 0 / 0.06) 54%,
            transparent 62%,
            transparent 100%);
    background-size: var(--gh-size) var(--gh-size);
    background-repeat: no-repeat;
    background-position: -120% -120%;
    transition: background-position var(--gh-duration) var(--ease-out-quart);
}

.glare-hover:hover::after,
.glare-hover:focus-within::after {
    background-position: 120% 120%;
}

/* --- (a) media skeleton ------------------------------------------------- */

.media {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: inherit;
    isolation: isolate;
}

/* Images are visible by default. Only the JS path — which knows when the
   bytes have actually arrived — is allowed to hide one behind a skeleton,
   so a failed script leaves a working page rather than an empty frame. */
.media>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 520ms var(--ease-out-quart);
}

.js .media:not(.is-loaded)>img {
    opacity: 0;
}

/* The skeleton: a static base plus a travelling glare, shown only while the
   image is genuinely in flight. This is the slow-connection surface. */
.js .media:not(.is-loaded)::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        repeating-linear-gradient(-45deg,
            oklch(1 0 0 / 0.014) 0 10px,
            transparent 10px 20px),
        var(--surface-2);
}

.js .media:not(.is-loaded)::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(-32deg,
            transparent 40%,
            oklch(0.792 0.138 214 / 0.16) 48%,
            oklch(1 0 0 / 0.10) 52%,
            transparent 60%);
    background-size: 260% 260%;
    background-repeat: no-repeat;
    animation: media-glare 1.9s var(--ease-out-quart) infinite;
}

@keyframes media-glare {
    0% {
        background-position: -130% -130%;
    }

    60%,
    100% {
        background-position: 130% 130%;
    }
}

/* Failed load: say what is missing. An empty box is a bug, not a state. */
.media.is-error::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--surface-2);
}

.media.is-error::after {
    content: attr(data-error-label);
    position: absolute;
    inset: 0;
    z-index: 2;
    animation: none;
    background: none;
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.6;
    letter-spacing: 0.05em;
    color: var(--ink-3);
    padding: 1rem;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {

    .js .media:not(.is-loaded)::after,
    .glare-hover::after {
        animation: none;
        background-image: none;
    }
}

/* ==========================================================================
   3. LogoLoop
   ========================================================================== */

.logoloop {
    --logoloop-gap: 3.25rem;
    --logoloop-logoHeight: 30px;
    --logoloop-fadeColor: var(--bg);
    position: relative;
    width: 100%;
    overflow: hidden;
}

.logoloop__track {
    display: flex;
    width: max-content;
    will-change: transform;
    user-select: none;
}

.logoloop__list {
    display: flex;
    align-items: center;
}

.logoloop__item {
    flex: 0 0 auto;
    margin-right: var(--logoloop-gap);
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color var(--dur) var(--ease-out-quart);
}

.logoloop__item i,
.logoloop__item svg {
    font-size: var(--logoloop-logoHeight);
    line-height: 1;
    color: var(--ink-2);
    transition: color var(--dur) var(--ease-out-quart),
        transform var(--dur) var(--ease-out-quart);
}

.logoloop__item:hover {
    color: var(--ink);
}

.logoloop__item:hover i,
.logoloop__item:hover svg {
    color: var(--signal);
    transform: translateY(-2px);
}

.logoloop--fade::before,
.logoloop--fade::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(48px, 12%, 180px);
    pointer-events: none;
    z-index: var(--z-raised);
}

.logoloop--fade::before {
    left: 0;
    background: linear-gradient(to right, var(--logoloop-fadeColor), transparent);
}

.logoloop--fade::after {
    right: 0;
    background: linear-gradient(to left, var(--logoloop-fadeColor), transparent);
}

@media (prefers-reduced-motion: reduce) {
    .logoloop__track {
        transform: none !important;
    }

    .logoloop {
        overflow-x: auto;
    }
}

/* ==========================================================================
   4. InfiniteMenu — WebGL2 disc sphere
   ========================================================================== */

.infinite-menu {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Positioned so it stays above an absolutely positioned backdrop layer
   (.laser-flow), which would otherwise paint over in-flow content. */
.infinite-menu__canvas {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    outline: none;
    touch-action: none;
}

.infinite-menu__canvas:active {
    cursor: grabbing;
}

/* Fallback when WebGL2 is unavailable — a real list, not a blank box. */
.infinite-menu__fallback {
    position: relative;
    z-index: 1;
    display: none;
    height: 100%;
    place-content: center;
    gap: 0.5rem;
    padding: var(--sp-4);
}

.infinite-menu.is-unsupported .infinite-menu__canvas {
    display: none;
}

.infinite-menu.is-unsupported .infinite-menu__fallback {
    display: grid;
}

.infinite-menu__fallback a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
    background: var(--surface);
}

.infinite-menu__fallback a:hover {
    border-color: var(--signal);
}

/* Read-out panel driven by the active disc */
.infinite-menu__meta {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: grid;
    justify-items: center;
    gap: 0.4rem;
    padding: 0 1rem 0.25rem;
    text-align: center;
    pointer-events: none;
    z-index: var(--z-raised);
}

/* The disc is a screenshot and carries no text, so the whole identification
   happens here: name, then category, then the one-line description. */
.infinite-menu__name {
    font-size: clamp(1.15rem, 1.9vw, 1.6rem);
    font-weight: 700;
    font-variation-settings: 'wdth' 108;
    letter-spacing: -0.015em;
    line-height: 1.1;
    color: var(--ink);
    margin: 0;
}

.infinite-menu__name:empty {
    display: none;
}

.infinite-menu__title {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    line-height: 1.4;
    color: var(--signal);
    margin: 0;
}

.infinite-menu__title:empty {
    display: none;
}

.infinite-menu__desc {
    font-size: 0.9rem;
    color: var(--ink-2);
    max-width: 38ch;
    margin: 0;
    line-height: 1.5;
}

.infinite-menu__meta--moving .infinite-menu__name,
.infinite-menu__meta--moving .infinite-menu__title,
.infinite-menu__meta--moving .infinite-menu__desc {
    opacity: 0;
    transition: opacity 120ms linear;
}

.infinite-menu__name,
.infinite-menu__title,
.infinite-menu__desc {
    opacity: 1;
    transition: opacity 420ms var(--ease-out-quart);
}

.infinite-menu__action {
    position: absolute;
    left: 50%;
    bottom: 0.5rem;
    translate: -50% 0;
    z-index: var(--z-raised);
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--signal);
    color: var(--bg);
    border: 4px solid var(--bg);
    font-size: 1.25rem;
    cursor: pointer;
    text-decoration: none;
    opacity: 1;
    scale: 1;
    transition: opacity 420ms var(--ease-out-quart),
        scale 420ms var(--ease-out-expo),
        background-color var(--dur) var(--ease-out-quart);
    box-shadow: 0 0 0 1px oklch(0.792 0.138 214 / 0.4),
        0 0 34px -6px oklch(0.792 0.138 214 / 0.75);
}

.infinite-menu__action:hover {
    background: var(--ink);
    color: var(--bg);
}

.infinite-menu__action[hidden] {
    display: none;
}

/* When the open-button is present, lift the read-out clear of it. */
.infinite-menu:has(.infinite-menu__action:not([hidden])) .infinite-menu__meta {
    padding-bottom: 4.75rem;
}

.infinite-menu.is-moving .infinite-menu__action {
    opacity: 0;
    scale: 0.5;
    pointer-events: none;
    transition-duration: 120ms;
}

/* Sphere sits in a violet well — this is where --flow does its work.
   No clipping: `overflow: hidden` used to cut the discs off mid-orbit at the
   top of the box, and the cyan wash beneath still had brightness left when it
   reached the corners, so the well announced itself as a rectangle. The mask
   is the guarantee — an ellipse fitted to the box takes the glow to zero
   before it can reach any edge, whatever the viewport does to the aspect. */
.sphere-well {
    position: relative;
    isolation: isolate;
}

.sphere-well::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60% 60% at 50% 46%, oklch(0.60 0.208 298 / 0.30), transparent 72%),
        radial-gradient(90% 70% at 50% 110%, oklch(0.792 0.138 214 / 0.16), transparent 70%);
    -webkit-mask-image: radial-gradient(closest-side, #000 45%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 45%, transparent 100%);
}

/* ==========================================================================
   5. LineSidebar — the navigation index
   ========================================================================== */

/* Every reactive property below reads one number, `--effect` (0..1), which JS
   eases per item. Nothing here transitions on its own: colour, shift, width
   axis and marker length are all functions of that single value, which is what
   keeps them in step.

   Colour split follows the palette rule: the *type* runs --ink-3 → --ink, and
   cyan is spent on the markers and the index numerals — the machine-produced
   parts. A nav where every hovered word turns cyan is exactly the template
   look the wheel was built to avoid. */
.line-sidebar {
    --ls-text: var(--ink-3);
    --ls-text-live: var(--ink);
    --ls-marker: var(--line-bright);
    --ls-marker-live: var(--signal);
    --ls-marker-length: clamp(2.25rem, 6vw, 4.5rem);
    --ls-marker-gap: clamp(0.9rem, 2.2vw, 1.6rem);
    --ls-tick-scale: 0.42;
    --ls-max-shift: clamp(8px, 1.6vw, 20px);
    --ls-item-gap: clamp(0.85rem, 2.2vw, 1.5rem);
    --ls-font-size: clamp(1.5rem, 5.5vw, 2.6rem);
    position: relative;
    display: flex;
    justify-content: flex-start;
}

/* The markers hang in this padding, outside the list's content box. */
.line-sidebar--markers {
    padding-left: calc(var(--ls-marker-length) + var(--ls-marker-gap));
}

.line-sidebar__list {
    /* Positioned on purpose: the proximity maths measures item.offsetTop
       against this element, so it has to be the offset parent. */
    position: relative;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--ls-item-gap);
}

.line-sidebar__item {
    position: relative;
}

.line-sidebar__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-block: 0.12em;
    text-decoration: none;
    color: inherit;
}

.line-sidebar__label {
    display: inline-flex;
    align-items: baseline;
    gap: 0.7rem;
    white-space: nowrap;
    font-size: var(--ls-font-size);
    line-height: 1.05;
    letter-spacing: -0.02em;
    transform: translateX(calc(var(--effect, 0) * var(--ls-max-shift)));
}

/* Archivo's width axis carries the emphasis, not a colour change alone —
   the same move the display type makes, at nav scale. */
.line-sidebar__text {
    font-weight: calc(300 + var(--effect, 0) * 350);
    font-variation-settings: 'wdth' calc(104 + var(--effect, 0) * 8);
    color: color-mix(in oklab, var(--ls-text-live) calc(var(--effect, 0) * 100%), var(--ls-text));
}

.line-sidebar__index {
    font-family: var(--font-mono);
    font-size: 0.34em;
    letter-spacing: 0.06em;
    color: color-mix(in oklab, var(--ls-marker-live) calc(var(--effect, 0) * 100%), var(--ls-marker));
    opacity: calc(0.6 + var(--effect, 0) * 0.4);
}

.line-sidebar__marker {
    position: absolute;
    top: 50%;
    left: calc(-1 * (var(--ls-marker-length) + var(--ls-marker-gap)));
    width: var(--ls-marker-length);
    height: 1px;
    background: color-mix(in oklab, var(--ls-marker-live) calc(var(--effect, 0) * 100%), var(--ls-marker));
    transform-origin: left center;
    transform: translateY(-50%) scaleX(calc(0.7 + var(--effect, 0) * 0.5));
}

/* Short tick centred in the gap between two entries — the rhythm that makes
   the set read as one ruled index rather than five separate links. */
.line-sidebar--markers .line-sidebar__item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: calc(100% + var(--ls-item-gap) / 2);
    left: calc(-1 * (var(--ls-marker-length) + var(--ls-marker-gap)));
    width: calc(var(--ls-marker-length) * var(--ls-tick-scale));
    height: 1px;
    background: var(--ls-marker);
    opacity: 0.5;
    transform: translateY(-50%);
}

.line-sidebar--scale-tick .line-sidebar__item:not(:last-child)::after {
    transform-origin: left center;
    transform: translateY(-50%) scaleX(calc(0.7 + var(--effect, 0) * 0.6));
}

.line-sidebar__link:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 8px;
    border-radius: 2px;
}

/* --- the overlay it lives in ------------------------------------------- */

.nav-menu {
    position: fixed;
    inset: 0;
    z-index: var(--z-menu);
    border: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    background: oklch(0.108 0.012 245 / 0.86);
    backdrop-filter: blur(22px) saturate(1.3);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    color: var(--ink);
    overflow: hidden;
}

.nav-menu::backdrop {
    background: oklch(0.09 0.01 245 / 0.7);
}

.nav-menu[open] {
    display: grid;
}

.nav-menu__inner {
    position: relative;
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: min(100% - (var(--gutter) * 2), var(--container));
    margin-inline: auto;
}

.nav-menu__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.35rem;
    border-bottom: 1px solid var(--line);
}

.nav-menu__body {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
}

.nav-menu__aside {
    display: none;
}

.nav-menu__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.35rem;
    border-top: 1px solid var(--line);
}

@media (min-width: 62rem) {
    .nav-menu__body {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        gap: var(--sp-6);
    }

    .nav-menu__aside {
        display: grid;
        align-content: center;
        gap: var(--sp-4);
    }
}

.nav-menu__hint {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

@starting-style {
    .nav-menu[open] {
        opacity: 0;
    }
}

.nav-menu {
    opacity: 1;
    transition: opacity var(--dur) var(--ease-out-quart), display var(--dur) allow-discrete;
}

.nav-menu:not([open]) {
    opacity: 0;
}

/* ==========================================================================
   6. ElectricBorder
   ========================================================================== */

.electric-border {
    --electric-border-color: var(--signal-hex);
    position: relative;
    border-radius: var(--eb-radius, 20px);
    isolation: isolate;
}

/* `clip`, not `hidden`. The canvas inside is 40px larger than this box on every
   side (see .eb-canvas below) and that slack was contributing to the page's
   scrollable width — the CTA block sits inside the container on every page, so
   its 40px of right-hand bleed put a horizontal scrollbar on the whole site.
   `overflow: clip` with a matching clip margin keeps every pixel of the bleed
   painted while contributing nothing to scrollable overflow; `hidden` would
   have cut the trace off at the border it is drawn around. */
.eb-canvas-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: plus-lighter;
    overflow: clip;
    overflow-clip-margin: 40px;
}

/* The canvas is deliberately wider and taller than the element — borderOffset
   of slack on every side so the noise displacement is never clipped. Two things
   it therefore cannot rely on: shrink-to-fit (an absolutely positioned box at
   left: 50% gets at most half the element's width, which drew the trace at half
   scale) and the global `canvas { max-width: 100% }` reset. Position it
   directly and opt it out of both. */
.eb-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    max-width: none;
    display: block;
}

.eb-content {
    position: relative;
    border-radius: inherit;
    z-index: 1;
}

.eb-layers {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

.eb-glow-1,
.eb-glow-2,
.eb-background-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.eb-glow-1 {
    border: 1.5px solid color-mix(in oklab, var(--signal) 55%, transparent);
    filter: blur(1px);
}

.eb-glow-2 {
    border: 2px solid var(--signal);
    filter: blur(5px);
    opacity: 0.55;
}

.eb-background-glow {
    z-index: -1;
    scale: 1.06;
    filter: blur(34px);
    opacity: 0.22;
    background: linear-gradient(-30deg, var(--signal), transparent 55%, var(--flow));
}

@media (prefers-reduced-motion: reduce) {
    .eb-background-glow {
        opacity: 0.14;
    }
}

/* ==========================================================================
   7. CurvedInput
   ========================================================================== */

.curved-input {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
}

.curved-input__svg {
    display: block;
    overflow: visible;
    width: 100%;
    height: auto;
    cursor: text;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.curved-input__svg text {
    font-family: var(--font-sans);
}

.curved-input__ring {
    opacity: 0;
    transition: opacity 260ms var(--ease-out-quart);
}

.curved-input--focused .curved-input__ring {
    opacity: 0.3;
}

.curved-input__button {
    cursor: pointer;
    outline: none;
}

.curved-input__button-bg {
    transition: filter 200ms var(--ease-out-quart);
}

.curved-input__button:hover .curved-input__button-bg {
    filter: brightness(1.14);
}

.curved-input__button:active .curved-input__button-bg {
    filter: brightness(0.94);
}

.curved-input__button:focus-visible .curved-input__button-bg {
    filter: brightness(1.2);
}

.curved-input__field {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px;
    /* prevents iOS zoom-on-focus */
    pointer-events: none;
    outline: none;
}

/* ==========================================================================
   8. BorderGlow — pointer-tracked edge light.
      One delegated rAF-throttled pointermove in JS feeds every instance.
   ========================================================================== */

[data-glow] {
    --edge-proximity: 0;
    --cursor-angle: 45deg;
    --edge-sensitivity: 26;
    --glow-color: oklch(0.792 0.138 214);
    position: relative;
    isolation: isolate;
    transform: translate3d(0, 0, 0.01px);
}

[data-glow]>.edge-light {
    content: '';
    position: absolute;
    inset: calc(var(--glow-padding, 26px) * -1);
    border-radius: calc(var(--glow-radius, 14px) + var(--glow-padding, 26px));
    pointer-events: none;
    z-index: -1;
    mask-image: conic-gradient(from var(--cursor-angle) at center,
            black 2.5%, transparent 11%, transparent 89%, black 97.5%);
    opacity: calc((var(--edge-proximity) - var(--edge-sensitivity)) / (100 - var(--edge-sensitivity)));
    mix-blend-mode: plus-lighter;
    transition: opacity 260ms var(--ease-out-quart);
}

[data-glow]:not(:hover)>.edge-light {
    opacity: 0;
    transition: opacity 620ms var(--ease-out-quart);
}

[data-glow]>.edge-light::before {
    content: '';
    position: absolute;
    inset: var(--glow-padding, 26px);
    border-radius: var(--glow-radius, 14px);
    box-shadow:
        inset 0 0 0 1px var(--glow-color),
        inset 0 0 3px 0 color-mix(in oklab, var(--glow-color) 50%, transparent),
        inset 0 0 10px 0 color-mix(in oklab, var(--glow-color) 30%, transparent),
        0 0 3px 0 color-mix(in oklab, var(--glow-color) 50%, transparent),
        0 0 10px 0 color-mix(in oklab, var(--glow-color) 34%, transparent),
        0 0 26px 2px color-mix(in oklab, var(--glow-color) 20%, transparent),
        0 0 52px 3px color-mix(in oklab, var(--glow-color) 10%, transparent);
}

/* Violet variant, for surfaces that should read as depth rather than signal */
[data-glow='flow'] {
    --glow-color: oklch(0.68 0.19 299);
}

@media (prefers-reduced-motion: reduce) {
    [data-glow]>.edge-light {
        display: none;
    }
}

/* ==========================================================================
   9. Dock
   ========================================================================== */

.dock-outer {
    position: fixed;
    left: 50%;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: var(--z-dock);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    max-width: calc(100vw - 1.5rem);
    pointer-events: none;
    opacity: 0;
    translate: -50% 18px;
    transition: opacity var(--dur) var(--ease-out-quart),
        translate var(--dur) var(--ease-out-expo);
}

.dock-outer.is-visible {
    opacity: 1;
    translate: -50% 0;
    pointer-events: auto;
}

.dock-panel {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.4rem 0.55rem;
    border-radius: var(--radius-lg);
    background: oklch(0.196 0.017 245 / 0.82);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--line);
    box-shadow: 0 20px 50px -22px oklch(0.05 0 0 / 0.95),
        0 1px 0 0 oklch(1 0 0 / 0.05) inset;
    overflow-x: auto;
    scrollbar-width: none;
}

.dock-panel::-webkit-scrollbar {
    display: none;
}

.dock-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    cursor: pointer;
    outline: none;
    text-decoration: none;
    transition: background-color var(--dur-fast) var(--ease-out-quart),
        border-color var(--dur-fast) var(--ease-out-quart),
        color var(--dur-fast) var(--ease-out-quart);
}

.dock-item:hover,
.dock-item:focus-visible {
    color: var(--ink);
    border-color: var(--line-bright);
}

.dock-item[aria-current='true'] {
    color: var(--signal);
    border-color: color-mix(in oklab, var(--signal) 45%, transparent);
    background: var(--signal-dim);
}

.dock-icon {
    display: grid;
    place-items: center;
    font-size: clamp(0.95rem, calc(var(--dock-size, 48px) * 0.36), 1.5rem);
    line-height: 1;
    pointer-events: none;
}

.dock-label {
    position: absolute;
    top: -2.1rem;
    left: 50%;
    translate: -50% 6px;
    width: fit-content;
    white-space: pre;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    padding: 0.2rem 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    color: var(--ink);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms var(--ease-out-quart),
        translate 200ms var(--ease-out-expo);
}

.dock-item:hover .dock-label,
.dock-item:focus-visible .dock-label {
    opacity: 1;
    translate: -50% 0;
}

@media (prefers-reduced-motion: reduce) {
    .dock-outer {
        transition: none;
    }
}

/* ==========================================================================
   10. LaserFlow — a volumetric beam
   ========================================================================== */

/* A backdrop layer: fills its host and takes no pointer events, so the copy
   in front of it stays clickable. Explicitly z-indexed rather than left to
   paint order, because it can sit under in-flow content. */
.laser-flow {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.laser-flow__canvas {
    width: 100%;
    height: 100%;
    max-width: none;
    display: block;
}

/* No WebGL: the same shaft and flare in static CSS rather than a dead box —
   a narrow vertical gradient falling to the point where the beam lands. */
.laser-flow.is-unsupported {
    background:
        linear-gradient(180deg, oklch(0.792 0.138 214 / 0.34) 0%, oklch(0.792 0.138 214 / 0.10) 46%, transparent 54%)
            50% 0 / 9% 100% no-repeat,
        radial-gradient(44% 16% at 50% 50%, oklch(0.792 0.138 214 / 0.20), transparent 72%);
}
