/* ===== EDUCATION & CERTIFICATES ===== */

.background {
    width: 100%;
    min-height: 100vh;
    background-color: var(--color-gainsboro-200);
    padding: 30px 40px 80px;
    font-family: var(--title-h1);
    color: var(--color-gray-100);
    display: flex;
    flex-direction: column;
    gap: 100px;
}

.bg-block {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.bg-heading {
    margin: 0 0 50px;
    font-size: var(--title-h1-size);
    line-height: 120%;
    font-weight: 700;
    font-family: var(--title-h1);
    color: var(--color-gray-100);
    text-align: center;
    text-transform: lowercase;
}

/* Shared card surface (same as the technology cards) */
.timeline-item,
.cert-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item:hover,
.cert-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
}

/* ===== EDUCATION TIMELINE ===== */
.timeline {
    list-style: none;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 36px;
    max-width: 1000px;
    margin: 0 auto;
    padding-left: 48px;
}

/* the line */
.timeline::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 15px;
    width: 2px;
    background: rgba(53, 76, 107, 0.25);
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 32px;
    padding: 32px;
}

/* the dot, centred on the line */
.timeline-item::before {
    content: '';
    position: absolute;
    top: 44px;
    left: -40px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-darkslategray);
    box-shadow: 0 0 0 5px var(--color-gainsboro-200);
}

.item-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    border-radius: 18px;
    flex-shrink: 0;
}

.item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.item-status {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(53, 76, 107, 0.1);
    color: var(--color-darkslategray);
    font-family: var(--font-nunito);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.item-status.upcoming {
    background: var(--color-darkslategray);
    color: white;
}

.item-title {
    margin: 4px 0 0;
    font-size: 30px;
    font-weight: 700;
    color: var(--color-gray-100);
    font-family: var(--title-h1);
    line-height: 1.3;
}

.item-subtitle {
    margin: 0;
    font-size: 19px;
    color: var(--color-dimgray);
    font-family: var(--font-nunito);
    font-weight: 500;
    line-height: 1.4;
}

.item-date {
    margin: 0;
    font-size: 17px;
    color: var(--color-dimgray);
    font-family: var(--font-nunito);
    font-weight: 400;
}

/* ===== BUTTONS ===== */
.item-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--color-darkslategray) 0%, #3a5568 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 35px;
    font-size: 16px;
    font-weight: 500;
    font-family: var(--font-roboto);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(47, 72, 88, 0.3);
}

.item-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(47, 72, 88, 0.4);
    background: linear-gradient(135deg, #3a5568 0%, var(--color-darkslategray) 100%);
}

.item-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ===== CERTIFICATE GRID ===== */
.cert-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
    padding: 0;
}

.cert-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 28px;
}

.cert-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 6px;
}

.cert-meta {
    margin: 0;
    font-size: 15px;
    color: var(--color-dimgray);
    font-family: var(--font-nunito);
    font-weight: 500;
}

.cert-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--color-gray-100);
    font-family: var(--title-h1);
}

/* buttons line up at the bottom of each card */
.cert-btn {
    margin-top: auto;
    padding: 12px 22px;
    font-size: 15px;
}

.cert-card .cert-title {
    margin-bottom: 12px;
}

/* ===== CERTIFICATE RECORD DIALOG ===== */
.cert-record {
    width: min(760px, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 24px;
    border: none;
    border-radius: 24px;
    background: white;
    color: var(--color-gray-100);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
}

.cert-record[open] {
    animation: recordIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes recordIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
}

.cert-record::backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

/* inside the frame, clear of its double border */
.cert-record .modal-close {
    top: 2.4rem;
    right: 2.4rem;
}

.cert-record-frame {
    border: 6px double var(--color-darkslategray);
    border-radius: 14px;
    padding: 48px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: linear-gradient(145deg, #ffffff 0%, #f4f6fa 100%);
}

.cert-record-kind {
    margin: 0;
    font-family: var(--font-nunito);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-dimgray);
}

.cert-record-heading {
    margin: 0 0 16px;
    font-family: var(--title-h1);
    font-size: 40px;
    color: var(--color-darkslategray);
}

.cert-record-line {
    margin: 0;
    font-family: var(--font-nunito);
    font-size: 17px;
    color: var(--color-dimgray);
}

.cert-record-name {
    margin: 4px 0 8px;
    font-family: var(--title-h1);
    font-size: 34px;
    font-weight: 700;
    color: var(--color-gray-100);
    border-bottom: 2px solid rgba(53, 76, 107, 0.25);
    padding-bottom: 10px;
}

.cert-record-title {
    margin: 4px 0;
    font-family: var(--title-h1);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-darkslategray);
    line-height: 1.3;
}

.cert-record-issuer {
    margin: 0;
    font-family: var(--font-nunito);
    font-size: 18px;
    font-weight: 500;
    color: var(--color-gray-100);
}

.cert-record-note {
    margin: 24px 0 0;
    font-family: var(--font-nunito);
    font-size: 14px;
    color: var(--color-dimgray);
    line-height: 1.5;
    max-width: 480px;
}

.cert-record-note a {
    color: var(--color-darkslategray);
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 1050px) {
    .bg-heading {
        font-size: 46px;
        margin-bottom: 36px;
    }
}

@media screen and (max-width: 768px) {
    .background {
        padding: 30px 20px 60px;
        gap: 70px;
    }

    .bg-heading {
        font-size: 40px;
    }

    .timeline {
        padding-left: 32px;
        gap: 24px;
    }

    .timeline::before {
        left: 7px;
    }

    .timeline-item {
        flex-direction: column;
        gap: 16px;
        padding: 24px;
    }

    .timeline-item::before {
        top: 32px;
        left: -32px;
    }

    .item-logo {
        width: 72px;
        height: 72px;
    }

    .item-title {
        font-size: 24px;
    }

    .item-subtitle {
        font-size: 16px;
    }

    .item-date {
        font-size: 15px;
    }

    .cert-grid {
        gap: 20px;
    }

    .cert-record-frame {
        padding: 40px 20px 28px;
    }

    .cert-record-heading {
        font-size: 30px;
    }

    .cert-record-name {
        font-size: 26px;
    }

    .cert-record-title {
        font-size: 21px;
    }
}

@media screen and (max-width: 450px) {
    .background {
        padding: 24px 16px 50px;
    }

    .bg-heading {
        font-size: 34px;
    }

    .timeline-item,
    .cert-card {
        padding: 20px;
    }

    .item-btn {
        padding: 12px 22px;
        font-size: 15px;
    }

    .cert-record {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .timeline-item,
    .cert-card,
    .item-btn,
    .cert-record[open] {
        transition: none;
        animation: none;
    }

    .timeline-item:hover,
    .cert-card:hover {
        transform: none;
    }
}
