/* =============================================================================
   Skavinski Signature Finish (concept E) -- shared motion layer
   Served by nginx as /shared/skv-finish.css  (pin ?v=20260608c)

   Opt-in finish classes that any page can adopt with zero structural change:
     .skv-lift     hover micro-elevation (translateY + border + shadow)
     .skv-fx-rail  edge-lit active-state rail with a gliding slate bead,
                   faithfully extracted from TeploMap's shipped
                   .toggle-group.has-glider / .tg-glider mechanic
                   (teplomap index.html ~line 399-477)
     .skv-sheen    one-shot diagonal light sweep on first reveal

   NOTE on the .skv-fx-* namespace: the structural side-nav drawer already owns
   the class string ".skv-rail" (shared/skv-header.html <aside class="skv-rail">
   + the .skv-rail-* family in skv-shell.css). This finish primitive is a
   DIFFERENT thing, so it is namespaced .skv-fx-rail / .skv-fx-rail-bead to
   guarantee it can never select, clip, or decorate the navigation drawer.

   This sheet is purely additive. It defines its own motion tokens and DOES
   NOT redefine --skv-ease-out (that already lives in skv-shell.css). It binds
   to the shared alpine-slate ramp and glass tokens from skv-shell.css.

   The reduced-motion block at the very end is the layer that closes the
   reduced-motion gap for every page that loads this file: it neutralizes all
   transition/animation durations and freezes the rail bead and sheen in their
   resting state.
   ============================================================================= */

:root {
    /* Motion tokens (concept E). --skv-ease-out is intentionally NOT redefined
       here; it is owned by skv-shell.css. */
    --skv-spring: cubic-bezier(0.3, 1.3, 0.45, 1);
    --skv-dur-fast: 150ms;
    --skv-dur-base: 240ms;
    --skv-dur-slow: 420ms;
}

/* -----------------------------------------------------------------------------
   .skv-lift -- hover micro-elevation
   -------------------------------------------------------------------------- */
.skv-lift {
    transition: transform var(--skv-dur-fast) var(--skv-ease-out),
                border-color var(--skv-dur-fast),
                box-shadow var(--skv-dur-fast);
}

.skv-lift:hover {
    transform: translateY(-1px);
    border-color: var(--skv-border-hover);
    box-shadow: var(--skv-shadow-2);
}

/* -----------------------------------------------------------------------------
   .skv-fx-rail -- edge-lit active-state rail with a gliding slate bead.
   (Namespaced .skv-fx-* so it never collides with the structural side-nav
   .skv-rail drawer; see header note.)
   Faithful port of the TeploMap flagship glider:
     - host clips its bead and anchors the absolute children
     - a ::before hairline track spans the host (transparent -> white 0.14 -> transparent)
     - .skv-fx-rail-bead is a 1px slate seam (transparent -> #5C88B0 50% -> transparent)
     - bead ::before is a blurred slate pill (blur 7px, opacity 0.9)
     - bead ::after is a radial slate dome (rgba(92,136,176,0.26) fading out)
     - the bead transitions left + width over --skv-dur-slow with the spring
   The JS measures the .active (or [aria-selected="true"]) child and drives the
   bead. Without JS the host renders normally; nothing breaks.
   -------------------------------------------------------------------------- */
.skv-fx-rail {
    position: relative;
    overflow: hidden;
}

.skv-fx-rail::before {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 1px;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(255, 255, 255, 0.14) 50%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.skv-fx-rail-bead {
    position: absolute;
    bottom: 1px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, #5C88B0 50%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    transition: left var(--skv-dur-slow) var(--skv-spring),
                width var(--skv-dur-slow) var(--skv-spring);
}

/* Blurred slate pill that haloes the active segment from the seam. */
.skv-fx-rail-bead::before {
    content: "";
    position: absolute;
    width: 56%;
    height: 400%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #5C88B0;
    border-radius: 999px;
    filter: blur(7px);
    opacity: 0.9;
}

/* Radial light dome rising onto the active segment. */
.skv-fx-rail-bead::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 150%;
    height: 32px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse 58% 128% at 50% 100%, rgba(92, 136, 176, 0.26) 0%, rgba(92, 136, 176, 0.13) 50%, rgba(92, 136, 176, 0.05) 80%, rgba(0, 0, 0, 0) 96%);
    pointer-events: none;
}

/* When the host carries a bead, segments sit above it and shed their own
   active background so the rail is the sole active affordance. */
.skv-fx-rail.has-bead > .active,
.skv-fx-rail.has-bead > [aria-selected="true"] {
    position: relative;
    z-index: 1;
    background: transparent;
    box-shadow: none;
}

/* -----------------------------------------------------------------------------
   .skv-sheen -- one-shot diagonal light sweep, armed once on first reveal.
   The IntersectionObserver in skv-finish.js adds .skv-in a single time.
   -------------------------------------------------------------------------- */
.skv-sheen {
    position: relative;
    overflow: hidden;
}

.skv-sheen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.07) 46%, transparent 60%);
    transform: translateX(-130%);
    pointer-events: none;
}

.skv-sheen.skv-in::after {
    transition: transform 900ms var(--skv-ease-out) 150ms;
    transform: translateX(130%);
}

/* -----------------------------------------------------------------------------
   Reduced-motion guard (MANDATORY, last in file).
   Closes the reduced-motion gap for every page that loads skv-finish.css:
   neutralizes all transition/animation durations and freezes the rail bead and
   sheen in their resting state.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .skv-fx-rail-bead {
        transition: none;
    }

    .skv-sheen::after {
        transition: none;
        transform: translateX(130%);
    }
}
