/* Micro animations. Loaded after style.css and responsive.css.
   Everything that hides content is scoped to .js (set in <head>), so the page
   stays fully readable without JavaScript. */

:root{
    --ease_out: cubic-bezier(.2, 0, 0, 1);
    --accent: #ACCDD4;
    --accent_dark: #15353a;
    --grid_dot: #15353a;
}

/* ---------- scroll progress ---------- */
.scroll_progress{
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--accent_dark);
    transform: scaleX(0);
    transform-origin: 0 50%;
    z-index: 1000;
    pointer-events: none;
}

::selection{
    background: var(--accent);
    color: var(--bs-black);
}

/* ---------- hero: dot grid drawn by js/animations.js ---------- */
header{
    position: relative;
    overflow: hidden;
}

.hero_grid{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* quieter behind the headline, full strength toward the edges */
    -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 52%, rgba(0, 0, 0, .28), #000 85%);
    mask-image: radial-gradient(ellipse 60% 55% at 50% 52%, rgba(0, 0, 0, .28), #000 85%);
    animation: grid_in 1.6s var(--ease_out) backwards;
}

@keyframes grid_in{
    from{ opacity: 0; }
}

.banner{
    position: relative;
    z-index: 1;
}

/* ---------- sticky nav: airy at the top, compact once scrolling ---------- */
.site_nav{
    transition: padding .35s var(--ease_out), background-color .35s var(--ease_out),
        box-shadow .35s var(--ease_out), backdrop-filter .35s var(--ease_out);
}

.js .site_nav:not(.is-stuck){
    padding-top: 30px;
    padding-bottom: 30px;
    background-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
}

/* ---------- footer form status ---------- */
.form_status{
    min-height: 1.5em;
    color: var(--accent);
}

.form_status a{
    color: inherit;
}

.form_status.show{
    animation: rise .5s var(--ease_out) backwards;
}


/* ---------- reveal on scroll ----------
   Keep this selector list in sync with REVEAL in js/animations.js */
.js :is(
    .site_nav .theme_toggle,
    .site_nav .btn_dark,
    .banner p,
    .banner .gap-2,
    .about_us h2,
    .about_us .row > div,
    .process .col-lg-5 h2,
    .process .col-lg-5 p,
    .process .col-lg-5 .btn_dark,
    .process_box,
    #ready_to_start,
    #technologies h2,
    .service_box,
    .footer .row > div
):not(.is-in){
    opacity: 0;
}

.is-in{
    animation: rise .8s var(--ease_out) var(--d, 0ms) backwards;
}

@keyframes rise{
    from{
        opacity: 0;
        translate: 0 26px;
        filter: blur(6px);
    }
}

/* ---------- logo: mark spins in, letters rise one by one ---------- */
.logo_part{
    transform-box: fill-box;
    transform-origin: 50% 50%;
}

.js #logo:not(.is-in) .logo_part{
    opacity: 0;
}

#logo.is-in{
    animation: none;
}

#logo.is-in .logo_mark{
    animation: mark_in 1s var(--ease_out) backwards;
}

#logo.is-in .logo_letter{
    animation: letter_in .7s var(--ease_out) calc(var(--i) * 80ms + 150ms) backwards;
}

@keyframes mark_in{
    from{
        opacity: 0;
        rotate: -180deg;
        scale: .3;
    }
}

@keyframes letter_in{
    from{
        opacity: 0;
        translate: 0 70%;
    }
}

/* hover: the mark turns once, the letters hop in a wave */
.logo_mark{
    transition: rotate .9s var(--ease_out);
}

@keyframes letter_hop{
    40%{ translate: 0 -22%; }
}

@media (hover: hover){
    #logo:hover .logo_mark{
        rotate: 360deg;
    }

    #logo.is-in:hover .logo_letter{
        animation: letter_hop .55s var(--ease_out) calc(var(--i) * 55ms);
    }
}

/* ---------- theme toggle ---------- */
.theme_toggle{
    position: relative;
    display: grid;
    place-items: center;
    width: 41px;
    height: 41px;
    padding: 0;
    border: 1px solid var(--bs-black);
    background: transparent;
    color: var(--bs-black);
    cursor: pointer;
    transition: background-color .3s var(--ease_out), color .3s var(--ease_out), scale .15s ease-out;
}

.theme_toggle:active{
    scale: .96;
}

.theme_toggle svg{
    grid-area: 1 / 1;
    width: 18px;
    height: 18px;
    transition: opacity .3s var(--ease_out), scale .3s var(--ease_out), filter .3s var(--ease_out), rotate .5s var(--ease_out);
}

/* the icon shows where a click will take you */
.theme_toggle .icon_sun,
html[data-theme="dark"] .theme_toggle .icon_moon{
    opacity: 0;
    scale: .25;
    filter: blur(4px);
    rotate: -90deg;
}

html[data-theme="dark"] .theme_toggle .icon_sun{
    opacity: 1;
    scale: 1;
    filter: none;
    rotate: 0deg;
}

@media (hover: hover){
    .theme_toggle:hover{
        background: var(--bs-black);
        color: var(--bs-white);
    }
}

@media (max-width: 576px){
    .theme_toggle{
        width: 34px;
        height: 34px;
    }

    .theme_toggle svg{
        width: 15px;
        height: 15px;
    }
}

/* ---------- hero headline: word by word ---------- */
.js [data-split]:not(.split-ready){
    visibility: hidden;
}

.w{
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: .14em;
    margin-bottom: -.14em;
}

.w > span{
    display: inline-block;
}

.js [data-split]:not(.is-in) .w > span{
    translate: 0 115%;
}

[data-split].is-in{
    animation: none;
}

[data-split].is-in .w > span{
    animation: word_up .9s var(--ease_out) var(--wd, 0ms) backwards;
}

@keyframes word_up{
    from{ translate: 0 115%; }
}

/* marker swipe under the highlighted words */
.mark{
    padding: 0;
    color: inherit;
    background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 92% / 100% .3em;
    transition: background-size .8s var(--ease_out) .85s;
}

.js [data-split]:not(.is-in) .mark{
    background-size: 0% .3em;
}

/* ---------- buttons: fill wipe + press ---------- */
.btn_dark,
.btn_dark_outline{
    background-color: transparent;
    background-image: linear-gradient(var(--bs-black), var(--bs-black));
    background-repeat: no-repeat;
    background-origin: border-box;
    background-position: 0 100%;
    background-size: 100% 100%;
    transition: background-size .35s var(--ease_out), color .35s var(--ease_out),
        scale .15s ease-out, translate .3s var(--ease_out);
}

.btn_dark_outline{
    background-size: 100% 0%;
}

.btn_dark:hover{
    background-size: 100% 0%;
}

.btn_dark_outline:hover{
    background-size: 100% 100%;
}

.btn_dark:active,
.btn_dark_outline:active{
    scale: .96;
}

/* ---------- industries ---------- */
.about_us h4::after{
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    margin: 10px auto 14px;
    background: var(--accent);
    transition: transform .7s var(--ease_out) calc(var(--d, 0ms) + 350ms);
}

.js .about_us .row > div:not(.is-in) h4::after{
    transform: scaleX(0);
}

/* ---------- process boxes ---------- */
.process_box{
    transition: transform .35s var(--ease_out), box-shadow .35s var(--ease_out);
}

.process_box .process_num{
    transition: color .5s var(--ease_out), transform .5s var(--ease_out);
}

/* spine between the four steps; sits behind the boxes, in the centre gutter */
.process_track{
    position: relative;
    z-index: 0;
}

/* Bootstrap pads every direct child of a .row; these are not columns */
.process_track > :is(.process_line, .process_node){
    padding: 0;
}

.process_line{
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: rgba(21, 53, 58, .12);
    z-index: -1;
    pointer-events: none;
}

.process_line_fill{
    position: absolute;
    inset: 0;
    background: var(--accent_dark);
    transform: scaleY(0);
    transform-origin: 50% 0;
}

.process_node{
    position: absolute;
    left: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: var(--bs-white);
    border: 2px solid #c9d3d5;
    z-index: -1;
    pointer-events: none;
    transition: transform .4s var(--ease_out), background-color .4s var(--ease_out), border-color .4s var(--ease_out);
}

/* short tick from the node to its box */
.process_node::before{
    content: '';
    position: absolute;
    top: 50%;
    width: 7px;
    height: 2px;
    margin-top: -1px;
    background: #c9d3d5;
    transition: background-color .4s var(--ease_out);
}

.process_node.left::before{
    right: 100%;
    margin-right: 2px;
}

.process_node.right::before{
    left: 100%;
    margin-left: 2px;
}

.process_node.on{
    background: var(--accent);
    border-color: var(--accent_dark);
    transform: scale(1.3);
}

.process_node.on::before{
    background: var(--accent_dark);
}

.process_box.is-active .process_num{
    color: var(--accent);
}

/* ---------- call to action: one sheen pass ---------- */
#ready_to_start{
    position: relative;
    overflow: hidden;
}

#ready_to_start::after{
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .6) 50%, transparent 62%);
    translate: 100% 0;
    pointer-events: none;
}

.js #ready_to_start:not(.is-in)::after{
    translate: -100% 0;
}

#ready_to_start.is-in::after{
    animation: sheen 1.5s var(--ease_out) .45s backwards;
}

@keyframes sheen{
    from{ translate: -100% 0; }
}

/* ---------- service boxes: cursor spotlight ---------- */
.service_box{
    position: relative;
    overflow: hidden;
    transition: transform .35s var(--ease_out), box-shadow .35s var(--ease_out);
}

.service_box > *{
    position: relative;
}

.service_box::before{
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(172, 205, 212, .5), transparent 70%);
    opacity: 0;
    transition: opacity .4s var(--ease_out);
    pointer-events: none;
}

.service_box::after{
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--accent_dark);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform .45s var(--ease_out);
}

/* ---------- footer ---------- */
.footer_links a{
    background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0% 1px;
    transition: color .3s var(--ease_out), background-size .35s var(--ease_out);
}

.footer_social_links a{
    transition: background-color .3s var(--ease_out), transform .3s var(--ease_out);
}

.footer_social_links a:active{
    transform: scale(.96);
}

.subscribe_form input{
    border: 0;
    transition: box-shadow .25s var(--ease_out);
}

.subscribe_form input:focus-visible{
    box-shadow: 0 0 0 3px var(--accent);
}

/* ---------- hover-only effects ---------- */
@media (hover: hover){
    .process_box:hover{
        transform: translateY(-5px);
        box-shadow: 0 14px 30px #9a9a9a40;
    }

    .process_box:hover .process_num{
        color: var(--accent);
        transform: translateX(-8px);
    }

    .service_box:hover{
        transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px);
        box-shadow: 0 14px 30px #9a9a9a40;
        transition-duration: .2s, .35s;
        transition-timing-function: ease-out, var(--ease_out);
    }

    .service_box:hover::before{
        opacity: 1;
    }

    .service_box:hover::after{
        transform: scaleX(1);
    }

    .footer_links a:hover{
        background-size: 100% 1px;
    }

    .footer_social_links a:hover{
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: no-preference){
    html{
        scroll-behavior: smooth;
    }
}

/* ---------- reduced motion: show everything, move nothing ---------- */
@media (prefers-reduced-motion: reduce){
    .is-in,
    .hero_grid,
    #logo.is-in .logo_part,
    #logo.is-in:hover .logo_letter,
    .form_status.show,
    [data-split].is-in .w > span,
    #ready_to_start.is-in::after{
        animation: none;
    }

    .mark,
    .logo_mark,
    .theme_toggle svg,
    .process_node,
    .process_node::before,
    .site_nav,
    .about_us h4::after{
        transition: none;
    }

    #ready_to_start::after,
    .scroll_progress{
        display: none;
    }

    .process_box,
    .process_box .process_num,
    .service_box,
    .footer_social_links a,
    .btn_dark,
    .btn_dark_outline{
        transition-property: color, background-size, background-color, box-shadow;
    }

    .process_box:hover,
    .service_box:hover,
    .process_box:hover .process_num,
    .footer_social_links a:hover{
        transform: none;
    }

    .btn_dark:active,
    .btn_dark_outline:active{
        scale: none;
    }
}

/* ---------- easter eggs (js/easter-eggs.js) ---------- */
.egg_toast{
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 2001;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    background: var(--bs-black);
    color: var(--bs-white);
    font-size: 14px;
    text-align: center;
    opacity: 0;
    translate: -50% 16px;
    transition: opacity .3s var(--ease_out), translate .3s var(--ease_out);
    pointer-events: none;
}

.egg_toast.show{
    opacity: 1;
    translate: -50% 0;
}

.egg_confetti,
.egg_rocket{
    position: fixed;
    z-index: 2000;
    pointer-events: none;
}

.egg_confetti{
    outline: 1px solid rgba(0, 0, 0, .15);
}

.egg_rocket{
    width: 52px;
    height: auto;
}

/* blueprint mode: every box on the page, outlined on a drafting grid */
.blueprint body{
    background-image:
        linear-gradient(rgba(21, 53, 58, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 53, 58, .08) 1px, transparent 1px);
    background-size: 24px 24px;
}

.blueprint body *:not(.egg_toast, .egg_confetti, .egg_rocket, .scroll_progress, .hero_grid, .process_line, .process_line_fill, .process_node){
    outline: 1px dashed rgba(21, 53, 58, .45);
    outline-offset: -1px;
}

.blueprint :is(.about_us, .footer) *{
    outline-color: rgba(172, 205, 212, .6);
}

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