/* ==========================================================
   BEYONDWAFER — ENGINEERING JOURNEY
   File: journey-section.css
========================================================== */

.engineering-journey,
.engineering-journey * {
    box-sizing: border-box;
}

.engineering-journey {
    --journey-primary: #0a84ff;
    --journey-primary-dark: #0066cc;
    --journey-primary-soft: rgba(10, 132, 255, 0.12);
    --journey-primary-glow: rgba(10, 132, 255, 0.26);

    --journey-navy: #081a2e;
    --journey-text: #1e293b;
    --journey-muted: #64748b;
    --journey-border: #e4edf7;
    --journey-surface: #ffffff;
    --journey-surface-soft: #f7fbff;

    position: relative;
    overflow: hidden;
    padding: 110px 0;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(10, 132, 255, 0.08),
            transparent 35%
        ),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.engineering-journey::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(10, 132, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 132, 255, 0.025) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3),
        transparent 72%
    );
}

/* ==========================================================
   HEADER
========================================================== */

.journey-header {
    position: relative;
    z-index: 2;
    width: min(100%, 900px);
    margin: 0 auto 72px;
    text-align: center;
}

.journey-header__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    color: var(--journey-primary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.journey-header__eyebrow::before,
.journey-header__eyebrow::after {
    content: "";
    width: 34px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--journey-primary)
    );
}

.journey-header__eyebrow::after {
    transform: scaleX(-1);
}

.journey-header__title {
    margin: 0;
    color: var(--journey-navy);
    font-size: clamp(2.35rem, 4vw, 4.25rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.08;
    text-wrap: balance;
}

.journey-header__title span {
    color: var(--journey-primary);
}

.journey-header__description {
    max-width: 820px;
    margin: 26px auto 0;
    color: var(--journey-muted);
    font-size: clamp(1rem, 1.35vw, 1.16rem);
    line-height: 1.8;
}

/* ==========================================================
   TIMELINE
========================================================== */

.journey-timeline {
    --journey-progress: 0%;

    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    width: 100%;
    margin: 0 auto 68px;
}

/* Main line */
.journey-timeline__line {
    position: absolute;
    top: 61px;
    left: calc(100% / 12);
    right: calc(100% / 12);
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--journey-border);
    z-index: 0;
}

/* Filled line controlled by JS */
.journey-timeline__progress {
    display: block;
    width: var(--journey-progress);
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            var(--journey-primary),
            #42a5ff
        );
    box-shadow:
        0 0 12px rgba(10, 132, 255, 0.4),
        0 0 24px rgba(10, 132, 255, 0.16);
    transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================
   STEP
========================================================== */

.journey-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: 0 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: center;
    appearance: none;
}

.journey-step__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 124px;
    height: 124px;
    padding: 16px;
    overflow: visible;
    border: 3px solid var(--journey-border);
    border-radius: 50%;
    background: var(--journey-surface);
    box-shadow:
        0 12px 28px rgba(9, 30, 66, 0.07),
        inset 0 0 0 1px rgba(255, 255, 255, 0.9);
    transition:
        transform 280ms ease,
        border-color 280ms ease,
        box-shadow 280ms ease,
        background-color 280ms ease;
}

.journey-step__icon img {
    position: relative;
    z-index: 2;
    display: block;
    width: 72px;
    height: 72px;
    max-width: none;
    object-fit: contain;
    opacity: 1;
    visibility: visible;
    filter: none;
    transform: scale(1);
    transition:
        transform 280ms ease,
        filter 280ms ease;
}

.journey-step__title {
    display: block;
    margin-top: 22px;
    color: var(--journey-navy);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.35;
    transition:
        color 220ms ease,
        transform 220ms ease;
}

/* Hover */
.journey-step:not(.active):hover .journey-step__icon {
    transform: translateY(-4px);
    border-color: rgba(10, 132, 255, 0.45);
    box-shadow:
        0 16px 34px rgba(9, 30, 66, 0.1),
        0 0 20px rgba(10, 132, 255, 0.1);
}

.journey-step:not(.active):hover .journey-step__icon img {
    transform: scale(1.06);
}

.journey-step:not(.active):hover .journey-step__title {
    color: var(--journey-primary);
}

/* Active enterprise state */
.journey-step.active .journey-step__icon {
    border-color: var(--journey-primary);
    background: #ffffff;
    transform: translateY(-6px);
    box-shadow:
        0 0 0 7px rgba(10, 132, 255, 0.1),
        0 18px 38px rgba(10, 132, 255, 0.2),
        0 0 30px rgba(10, 132, 255, 0.2);
}

.journey-step.active .journey-step__icon img {
    transform: scale(1.1);
}

.journey-step.active .journey-step__title {
    color: var(--journey-primary);
    transform: translateY(-2px);
}

/* Pulsing ring */
.journey-step.active .journey-step__icon::before,
.journey-step.active .journey-step__icon::after {
    content: "";
    position: absolute;
    inset: -4px;
    z-index: -1;
    border: 2px solid rgba(10, 132, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    animation: journey-step-pulse 2.2s ease-out infinite;
}

.journey-step.active .journey-step__icon::after {
    animation-delay: 1.1s;
}

@keyframes journey-step-pulse {
    0% {
        opacity: 0.72;
        transform: scale(1);
    }

    75%,
    100% {
        opacity: 0;
        transform: scale(1.28);
    }
}

/* Focus */
.journey-step:focus-visible {
    outline: none;
}

.journey-step:focus-visible .journey-step__icon {
    border-color: var(--journey-primary);
    box-shadow:
        0 0 0 5px rgba(10, 132, 255, 0.14),
        0 16px 34px rgba(9, 30, 66, 0.1);
}

/* ==========================================================
   DETAILS CARD
========================================================== */

.journey-details {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: center;
    gap: 46px;
    min-height: 360px;
    overflow: hidden;
    padding: 48px 52px;
    border: 1px solid rgba(10, 132, 255, 0.14);
    border-radius: 30px;
    background:
        radial-gradient(
            circle at 88% 50%,
            rgba(10, 132, 255, 0.12),
            transparent 30%
        ),
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.98),
            rgba(245, 250, 255, 0.96)
        );
    box-shadow:
        0 26px 65px rgba(9, 30, 66, 0.11),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.journey-details::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            110deg,
            rgba(255, 255, 255, 0.5),
            transparent 32%,
            transparent 72%,
            rgba(10, 132, 255, 0.05)
        );
}

.journey-details__accent {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 5px;
    background:
        linear-gradient(
            180deg,
            var(--journey-primary),
            #52b7ff
        );
    box-shadow: 0 0 20px rgba(10, 132, 255, 0.3);
}

.journey-details__content {
    position: relative;
    z-index: 2;
}

.journey-details__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--journey-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.journey-details__eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: var(--journey-primary);
}

.journey-details__title {
    margin: 0;
    color: var(--journey-navy);
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.journey-details__description {
    max-width: 680px;
    margin: 20px 0 0;
    color: var(--journey-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.journey-details__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.journey-details__tags span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 13px;
    border: 1px solid rgba(10, 132, 255, 0.16);
    border-radius: 999px;
    color: #24527f;
    background: rgba(10, 132, 255, 0.055);
    font-size: 0.8rem;
    font-weight: 600;
}

.journey-details__button {
    margin-top: 28px;
}

.journey-details__button span:last-child {
    font-size: 1.15rem;
    transition: transform 220ms ease;
}

.journey-details__button:hover span:last-child {
    transform: translateX(4px);
}

/* ==========================================================
   DETAILS VISUAL
========================================================== */

.journey-details__visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 260px;
}

.journey-details__visual::before {
    content: "";
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(10, 132, 255, 0.17),
            rgba(10, 132, 255, 0.05) 45%,
            transparent 72%
        );
    filter: blur(10px);
}

.journey-details__visual-ring {
    position: absolute;
    width: 224px;
    height: 224px;
    border: 1px solid rgba(10, 132, 255, 0.2);
    border-radius: 50%;
    animation: journey-visual-rotate 18s linear infinite;
}

.journey-details__visual-ring::before,
.journey-details__visual-ring::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: var(--journey-primary);
    box-shadow: 0 0 14px var(--journey-primary);
}

.journey-details__visual-ring::before {
    top: 15px;
    left: 44px;
    width: 7px;
    height: 7px;
}

.journey-details__visual-ring::after {
    right: 20px;
    bottom: 42px;
    width: 6px;
    height: 6px;
}

@keyframes journey-visual-rotate {
    to {
        transform: rotate(360deg);
    }
}

.journey-details__visual img {
    position: relative;
    z-index: 2;
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter:
        drop-shadow(0 16px 24px rgba(9, 30, 66, 0.16))
        drop-shadow(0 0 18px rgba(10, 132, 255, 0.14));
    transition:
        opacity 220ms ease,
        transform 320ms ease;
}

/* Animation hook for JS */
.journey-details.is-updating .journey-details__content,
.journey-details.is-updating .journey-details__visual img {
    opacity: 0;
    transform: translateY(10px);
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 1180px) {
    .journey-step__icon {
        width: 108px;
        height: 108px;
        padding: 13px;
    }

    .journey-step__icon img {
        width: 64px;
        height: 64px;
    }

    .journey-timeline__line {
        top: 53px;
    }

    .journey-details {
        padding: 42px;
    }
}

@media (max-width: 900px) {
    .engineering-journey {
        padding: 90px 0;
    }

    .journey-header {
        margin-bottom: 56px;
    }

    .journey-timeline {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 46px;
    }

    .journey-timeline__line {
        display: none;
    }

    .journey-step {
        padding: 0 6px;
    }

    .journey-details {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .journey-details__description {
        margin-right: auto;
        margin-left: auto;
    }

    .journey-details__tags {
        justify-content: center;
    }

    .journey-details__visual {
        order: -1;
        min-height: 210px;
    }

    .journey-details__visual img {
        width: 138px;
        height: 138px;
    }

    .journey-details__visual-ring {
        width: 194px;
        height: 194px;
    }
}

@media (max-width: 620px) {
    .engineering-journey {
        padding: 74px 0;
    }

    .journey-header {
        margin-bottom: 42px;
    }

    .journey-header__title {
        font-size: clamp(2.15rem, 11vw, 3.2rem);
    }

    .journey-header__description {
        font-size: 0.96rem;
        line-height: 1.7;
    }

    .journey-timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 36px;
        margin-bottom: 48px;
    }

    .journey-step__icon {
        width: 98px;
        height: 98px;
    }

    .journey-step__icon img {
        width: 58px;
        height: 58px;
    }

    .journey-step__title {
        margin-top: 16px;
        font-size: 0.9rem;
    }

    .journey-details {
        gap: 26px;
        min-height: auto;
        padding: 34px 22px 30px;
        border-radius: 24px;
    }

    .journey-details__title {
        font-size: 2rem;
    }

    .journey-details__visual {
        min-height: 180px;
    }

    .journey-details__visual img {
        width: 118px;
        height: 118px;
    }

    .journey-details__visual-ring {
        width: 166px;
        height: 166px;
    }

    .journey-details__button {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .journey-step__icon {
        width: 88px;
        height: 88px;
    }

    .journey-step__icon img {
        width: 52px;
        height: 52px;
    }

    .journey-details {
        padding-right: 18px;
        padding-left: 18px;
    }
}

/* ==========================================================
   ACCESSIBILITY
========================================================== */

@media (prefers-reduced-motion: reduce) {
    .journey-step.active .journey-step__icon::before,
    .journey-step.active .journey-step__icon::after,
    .journey-details__visual-ring {
        animation: none;
    }

    .journey-step__icon,
    .journey-step__icon img,
    .journey-step__title,
    .journey-timeline__progress,
    .journey-details__content,
    .journey-details__visual img {
        transition-duration: 0.01ms !important;
    }
}