/* Academics page: intro, qualification cards with grade seals, coursework bookshelf.
   No hover effects by design. */

.academics-intro h1 {
    font-size: clamp(2.8rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 0.9;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.academics-intro p {
    font-size: 1.15rem;
    max-width: 720px;
}

/* ===== Qualifications ===== */
.certs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px;
    padding-top: 25px;
    border-top: 3px solid var(--bg-black);
}

.cert {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 28px;
    background: white;
    border: 3px solid var(--bg-black);
    border-radius: var(--radius-card);
    box-shadow: 8px 8px 0 var(--bg-black);
}

.cert-main {
    grid-column: 1 / -1;
    padding: 32px 36px;
}

.cert-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.cert-kicker {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
}

.cert h2 {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.05;
    text-transform: uppercase;
}

.cert-main h2 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.cert-school {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.cert-school img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    object-fit: contain;
    padding: 3px;
    border: 2px solid var(--bg-black);
    border-radius: 8px;
    background: white;
}

.cert-facts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.cert-facts li {
    padding: 4px 12px;
    background: var(--bg-black);
    color: var(--bg-yellow);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.cert-facts strong {
    font-size: 1rem;
    font-weight: 900;
}

.cert-facts a {
    color: var(--bg-yellow);
}

/* Grade seal: a rotated ink stamp */
.seal {
    flex-shrink: 0;
    position: relative;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: var(--bg-yellow);
    border: 4px solid var(--bg-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotate(-12deg);
    box-shadow: 4px 4px 0 var(--bg-black);
}

.seal::before {
    content: '';
    position: absolute;
    inset: 7px;
    border: 2px dashed var(--bg-black);
    border-radius: 50%;
}

.seal strong {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1;
}

.seal span {
    margin-top: 4px;
    font-family: 'Space Mono', monospace;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cert-main .seal {
    width: 160px;
    height: 160px;
}

.cert-main .seal strong {
    font-size: 3rem;
}

/* ===== Bookshelf ===== */
.bookshelf {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 25px;
    border-top: 3px solid var(--bg-black);
}

.shelf-head h2 {
    font-size: 1.6rem;
    font-weight: 900;
    text-transform: uppercase;
}

.shelf-head p {
    margin-top: 4px;
    font-size: 1.02rem;
}

.shelves {
    display: flex;
    flex-direction: column;
    gap: 34px;
    padding: 30px 28px 26px;
    background: white;
    border: 3px solid var(--bg-black);
    border-radius: var(--radius-card);
}

.shelf {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: end;
    gap: 22px;
}

.shelf-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 18px;
}

.shelf-label strong {
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
}

.shelf-label span,
.shelf-label em {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    font-style: normal;
}

.shelf-label em {
    opacity: 0.6;
    text-transform: uppercase;
}

/* the books stand on a thick plank */
.shelf-books {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 6px;
    padding: 0 14px;
    border-bottom: 12px solid var(--bg-black);
    border-radius: 0 0 4px 4px;
    min-height: 120px;
}

/* ----- Book spine ----- */
.book {
    position: relative;
    width: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    border: 3px solid var(--bg-black);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    text-decoration: none;
    cursor: pointer;
}

.book:focus-visible {
    outline: 3px solid var(--bg-black);
    outline-offset: 3px;
}

.book-title {
    flex-grow: 1;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding: 8px 0;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    text-align: center;
    overflow: hidden;
}

/* two thin rules near each end, like a real spine */
.book-band {
    width: 70%;
    height: 7px;
    flex-shrink: 0;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

/* AI & ML: black spine, yellow lettering */
.book-ai {
    background: var(--bg-black);
    color: var(--bg-yellow);
}

/* Systems & programming: white spine */
.book-sys {
    background: white;
    color: var(--text-black);
}

/* Robotics & IoT: hazard stripes with a white label */
.book-robo {
    background: repeating-linear-gradient(45deg,
            var(--bg-black) 0 8px, var(--bg-yellow) 8px 16px);
    color: var(--text-black);
}

.book-robo .book-title {
    background: white;
    border: 2px solid var(--bg-black);
    border-radius: 4px;
    padding: 8px 2px;
    margin: 4px 0;
}

/* Bioinformatics & signal processing: yellow spine, dotted */
.book-bio {
    background:
        radial-gradient(rgba(0, 0, 0, 0.28) 1.5px, transparent 1.6px) 0 0 / 9px 9px,
        var(--bg-yellow);
    color: var(--text-black);
}

/* Industry: wide yellow binder */
.book-work {
    width: 74px;
    background: var(--bg-yellow);
    color: var(--text-black);
    border-width: 4px;
}

/* ----- Legend ----- */
.shelf-legend {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    font-size: 0.85rem;
    font-weight: 700;
}

.shelf-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.swatch {
    width: 22px;
    height: 22px;
    border: 2px solid var(--bg-black);
    border-radius: 4px;
}

@media (max-width: 860px) {
    .certs {
        grid-template-columns: minmax(0, 1fr);
    }

    .cert {
        flex-wrap: wrap;
    }

    .shelf {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .shelf-label {
        flex-direction: row;
        align-items: baseline;
        gap: 10px;
        padding-bottom: 0;
    }
}
