/* ========================================
   SYSTEMS — PAGE
======================================== */

#systems {
    width: 100%;
    min-height: 100%;
    background: #f4f4f4;
}

#systems[hidden] {
    display: none;
}

.systems-page-inner {
    width: 100%;
    min-height: 100%;
    padding: 72px 8vw 96px;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* ========================================
   SYSTEMS — HEADER
======================================== */

.top-content {
    position: relative;
}

/* Contextual Navigation */

.systems-nav {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    width: max-content;
    max-width: 100%;

    z-index: 100;
}

.systems-nav[hidden] {
    display: none;
}


/* ========================================
   SYSTEMS — NAVIGATION PILLS
======================================== */

.systems-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 16px;

    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 100px;

    background: transparent;
    color: #6a6a6a;

    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;

    white-space: nowrap;
    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.systems-pill:hover {
    border-color: #1d1d1f;
    color: #1d1d1f;
}

.systems-pill.active,
.systems-pill[aria-pressed="true"] {
    background: #1d1d1f;
    border-color: #1d1d1f;
    color: #fff;
}

.systems-pill:focus-visible {
    outline: 2px solid #1d1d1f;
    outline-offset: 3px;
}


/* ========================================
   SYSTEMS — CONTENT CONTAINER
======================================== */

.systems-content {
    width: 100%;
    max-width: 900px;
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: stretch;
}


/* ========================================
   SYSTEMS — CASE STUDY STAGE
======================================== */

#systems-stage {
    width: 100%;
    min-height: 340px;

    display: grid;
    align-items: center;
}

/* Individual Panel */

.systems-panel {
    width: 100%;
    min-width: 0;
}

.systems-panel[hidden] {
    display: none;
}

.systems-panel.active {
    animation: systemsReveal 0.4s ease-out both;
}


/* ========================================
   SYSTEMS — TYPOGRAPHY
======================================== */

/* Category Label */

.systems-label {
    margin: 0 0 20px;

    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.12em;

    text-transform: uppercase;
    color: #6a6a6a;
}

/* Case Study Heading */

.systems-title {
    max-width: 16ch;
    margin: 0 0 28px;

    font-size: clamp(36px, 4vw, 56px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.035em;

    color: #1d1d1f;

    text-wrap: balance;
}

/* Description */

.systems-description {
    max-width: 54ch;
    margin: 0;

    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.01em;

    color: rgba(0, 0, 0, 0.68);

    white-space: pre-line;
}


/* ========================================
   SYSTEMS — PAGINATION
======================================== */

.systems-pagination {
    width: 100%;
    margin-top: 48px;

    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);

    align-items: center;
    gap: 20px;
}


/* ========================================
   SYSTEMS — PAGINATION BUTTONS
======================================== */

.systems-page-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: fit-content;
    padding: 8px 0;

    border: none;
    border-radius: 0;
    outline: none;
    box-shadow: none;

    background: transparent;
    color: #6a6a6a;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;

    white-space: nowrap;
    cursor: pointer;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

/* Hover */

.systems-page-button:hover:not(:disabled) {
    color: #1d1d1f;
}

/* Disabled */

.systems-page-button:disabled {
    visibility: hidden;
    pointer-events: none;
}

/* Keyboard Focus */

.systems-page-button:focus-visible {
    outline: 2px solid #1d1d1f;
    outline-offset: 4px;
}

/* Previous Button */

#systems-prev {
    justify-self: start;
}

/* Next Button */

#systems-next {
    justify-self: end;
    margin-left: 0;
}

/* Pagination Arrows */

.systems-page-button span[aria-hidden="true"] {
    display: inline-block;

    font-size: 18px;
    font-weight: 400;
    line-height: 1;

    transition: transform 0.2s ease;
}

/* Previous Arrow Hover */

#systems-prev:hover:not(:disabled)
span[aria-hidden="true"] {
    transform: translateX(-3px);
}

/* Next Arrow Hover */

#systems-next:hover:not(:disabled)
span[aria-hidden="true"] {
    transform: translateX(3px);
}


/* ========================================
   SYSTEMS — PROGRESS INDICATORS
======================================== */

.systems-progress {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;
}

/* Inactive Dots */

.systems-dot {
    display: block;

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #c8c8c8;

    transition:
        background 0.25s ease,
        transform 0.25s ease;
}

/* Active Dot */

.systems-dot.active {
    background: #1d1d1f;
    transform: scale(1.3);
}


/* ========================================
   SYSTEMS — ANIMATIONS
======================================== */

@keyframes systemsReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ========================================
   SYSTEMS — REDUCED MOTION
======================================== */

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

    .systems-panel.active {
        animation: none;
    }

    .systems-pill,
    .systems-page-button,
    .systems-page-button span[aria-hidden="true"],
    .systems-dot {
        transition: none;
    }

}


/* ========================================
   SYSTEMS — TABLET
======================================== */

@media (max-width: 900px) {

    .systems-page-inner {
        padding: 64px 6vw 80px;
    }

    .systems-content {
        max-width: 720px;
    }

    .systems-title {
        font-size: clamp(34px, 5vw, 48px);
    }

    .systems-description {
        font-size: 17px;
    }

}


/* ========================================
   SYSTEMS — MOBILE HEADER PILLS
======================================== */

@media (max-width: 768px) {

    .systems-nav {
        position: static;
        transform: none;

        width: 100%;
        max-width: 100%;

        justify-content: center;
        flex-wrap: wrap;

        gap: 6px;
        padding: 8px 16px;
    }

    .systems-pill {
        padding: 7px 12px;
        font-size: 11px;
    }

}


/* ========================================
   SYSTEMS — MOBILE
======================================== */

@media (max-width: 640px) {

    /* Page */

    #systems {
        min-height: calc(100svh - 120px);
    }

    .systems-page-inner {
        min-height: calc(100svh - 120px);
        padding: 40px 24px 72px;

        align-items: flex-start;
    }

    /* Content */

    .systems-content {
        max-width: 100%;
    }

    #systems-stage {
        min-height: 280px;
    }

    /* Typography */

    .systems-label {
        margin-bottom: 16px;
        font-size: 11px;
    }

    .systems-title {
        max-width: 100%;

        font-size: clamp(32px, 8.6vw, 42px);
        line-height: 1.04;
        letter-spacing: -0.045em;

        margin-bottom: 24px;
    }

    .systems-description {
        max-width: 100%;

        font-size: 16px;
        line-height: 1.5;
    }

    /* Pagination */

    .systems-pagination {
        margin-top: 36px;
        gap: 10px;
    }

    .systems-page-button {
        padding: 6px 0;

        font-size: 11px;
        gap: 5px;
    }

    .systems-page-button span[aria-hidden="true"] {
        font-size: 15px;
    }

    /* Progress Dots */

    .systems-progress {
        gap: 6px;
    }

    .systems-dot {
        width: 4px;
        height: 4px;
    }

}