/* ==========================================================================
   Corporate Projukti — Redesign :: Motion layer

   Everything here is decoration. The page is complete and readable with
   this file absent, with JavaScript off, and under prefers-reduced-motion
   — the block at the foot of this file switches all of it off.

   Two rules from the design contract constrain what is allowed:
     · a slab cell is never transformed — it tears the shared hairlines,
       so cell feedback stays light and colour only;
     · inside a slab, reveal is fade-only for the same reason.
   Movement therefore lives on non-slab elements and on parts *inside* a
   cell (icon tile, arrow, numeral), never on the cell itself.
   ========================================================================== */

/* ==========================================================================
   REVEAL VARIANTS
   The base fade+rise lives in system.css. These are opt-in via
   data-reveal="…" for elements outside a slab.
   ========================================================================== */

:root.rd-reveal-armed [data-reveal="scale"] {
    transform: scale(.965);
    transform-origin: center;
}

:root.rd-reveal-armed [data-reveal="blur"] {
    filter: blur(9px);
    transform: none;
    transition: opacity var(--dur-bloom) var(--ease),
                filter var(--dur-bloom) var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}

:root.rd-reveal-armed [data-reveal="blur"].rd-in { filter: blur(0); }

:root.rd-reveal-armed [data-reveal="left"]  { transform: translateX(-26px); }
:root.rd-reveal-armed [data-reveal="right"] { transform: translateX(26px); }

:root.rd-reveal-armed [data-reveal="scale"].rd-in,
:root.rd-reveal-armed [data-reveal="left"].rd-in,
:root.rd-reveal-armed [data-reveal="right"].rd-in { transform: none; }

/* ==========================================================================
   SCROLL PROGRESS
   A hairline of brand gradient across the very top. Width is driven from
   script via --rd-progress.
   ========================================================================== */

.rd-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    z-index: calc(var(--z-topbar) + 5);
    pointer-events: none;
    transform: scaleX(var(--rd-progress, 0));
    transform-origin: 0 50%;
    background: var(--grad-btn);
    opacity: .9;
}

/* ==========================================================================
   TYPEWRITER
   The caret is CSS; the typing itself is script. The element keeps its real
   text in the markup, so with JavaScript off the full heading is simply
   there — nothing is typed and nothing is missing.
   ========================================================================== */

.rd-type-caret {
    display: inline-block;
    width: .06em;
    min-width: 2px;
    height: .92em;
    margin-left: .06em;
    vertical-align: -.08em;
    background: var(--accent-ink);
    animation: rd-caret 1.05s steps(1) infinite;
}

@keyframes rd-caret {
    0%, 45%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Holds the line's height while words swap, so nothing jumps. */
.rd-type-slot { display: inline; }

/* ==========================================================================
   ORBIT — a slow rotating ring behind hero art
   Purely decorative, sits under the content and ignores pointer events.
   ========================================================================== */

/* Inset rather than bled outwards: the hero frame clips overflow to keep
   its glows tidy, so a negative inset would cut the travelling dot. */
.rd-orbit {
    position: absolute;
    inset: 3%;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    border: 1px dashed var(--border-str);
    opacity: .55;
    animation: rd-spin 46s linear infinite;
}

.rd-orbit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -5px;
    width: 9px;
    height: 9px;
    margin-top: -4.5px;
    border-radius: 50%;
    background: var(--accent-ink);
    box-shadow: 0 0 14px 2px rgba(var(--brand-2-rgb), .55);
}

.rd-orbit-inner {
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    border: 1px solid var(--border);
    opacity: .5;
    animation: rd-spin 32s linear infinite reverse;
    pointer-events: none;
}

@keyframes rd-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   FLOAT — a slow vertical drift, for hero art and standalone media
   ========================================================================== */

.rd-float { animation: rd-float 7.5s var(--ease) infinite alternate; }

@keyframes rd-float {
    from { transform: translateY(-7px); }
    to   { transform: translateY(7px); }
}

/* ==========================================================================
   PULSE — the badge dot, so the page has one small live signal
   ========================================================================== */

.rd-badge-dot {
    position: relative;
    animation: rd-dot 2.6s var(--ease) infinite;
}

.rd-badge-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--accent-ink);
    opacity: 0;
    animation: rd-ping 2.6s var(--ease) infinite;
}

@keyframes rd-dot {
    0%, 100% { opacity: 1; }
    50%      { opacity: .55; }
}

@keyframes rd-ping {
    0%   { transform: scale(.7); opacity: .8; }
    70%  { transform: scale(1.9); opacity: 0; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* ==========================================================================
   CELL INTERIOR MOTION
   Allowed because it moves parts inside the cell, never the cell itself.
   ========================================================================== */

.rd-tile,
.rd-tech-icon,
.rd-partner-mark,
.rd-contact-icon {
    transition: border-color var(--t), background var(--t),
                color var(--t), transform var(--t);
}

.rd-cell:hover .rd-tile,
.rd-cell:focus-within .rd-tile { transform: rotate(-6deg) scale(1.06); }

.rd-cell:hover .rd-tech-icon { transform: rotate(6deg) scale(1.05); }
.rd-cell:hover .rd-partner-mark { transform: rotate(-5deg) scale(1.05); }

/* The ghost numeral drifts a little as the cell lights up. */
.rd-numeral {
    transition: -webkit-text-stroke-color var(--t), transform var(--dur-bloom) var(--ease);
}

.rd-cell:hover .rd-numeral { transform: translate(-6px, -6px); }

/* Product and article covers lift inside their frame. */
.rd-product-shot img,
.rd-article-cover img,
.rd-kb-cover img,
.rd-event-shot img,
.rd-shot img,
.rd-split-media img,
.rd-project-shot img {
    transition: opacity var(--t), transform 1.1s var(--ease);
}

.rd-cell:hover .rd-product-shot img,
.rd-cell:hover .rd-article-cover img,
.rd-cell:hover .rd-kb-cover img,
.rd-cell:hover .rd-event-shot img,
.rd-cell:hover .rd-shot img,
.rd-cell:hover .rd-project-shot img,
.rd-split:hover .rd-split-media img { transform: scale(1.045); }

/* ==========================================================================
   BUTTONS & LINKS
   ========================================================================== */

.rd-btn {
    position: relative;
    overflow: hidden;
}

/* A light sweep crossing the button on hover. */
.rd-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(100deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, .26) 50%,
        rgba(255, 255, 255, 0) 100%);
    transform: skewX(-18deg);
    transition: left .55s var(--ease);
}

.rd-btn-primary:hover::after { left: 118%; }

.rd-btn-ghost { transition: background var(--t), border-color var(--t), color var(--t); }

/* Nav links draw an underline from the left. */
.rd-nav > a,
.rd-mega-trigger {
    position: relative;
}

.rd-nav > a::after,
.rd-mega-trigger::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    height: 1px;
    width: 100%;
    background: var(--accent-ink);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform var(--t);
}

.rd-nav > a:hover::after,
.rd-nav > a[aria-current="page"]::after,
.rd-has-mega:hover .rd-mega-trigger::after { transform: scaleX(1); }

/* ==========================================================================
   COUNTERS
   Script writes the value; tabular figures stop the width jittering as
   digits change.
   ========================================================================== */

.rd-stat-value { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   REDUCED MOTION — everything above is switched off and settled
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .rd-orbit,
    .rd-orbit-inner,
    .rd-float,
    .rd-badge-dot,
    .rd-badge-dot::after,
    .rd-type-caret { animation: none !important; }

    .rd-badge-dot::after { opacity: 0; }
    .rd-type-caret { display: none; }
    .rd-progress { display: none; }

    .rd-cell:hover .rd-tile,
    .rd-cell:hover .rd-tech-icon,
    .rd-cell:hover .rd-partner-mark,
    .rd-cell:hover .rd-numeral,
    .rd-cell:hover img,
    .rd-split:hover .rd-split-media img { transform: none !important; }

    .rd-btn-primary::after { display: none; }

    :root.rd-reveal-armed [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }
}
