:root {
    --primary: #6366f1;
    --primary-dark: #4f46cf;
    --primary-light: #eef0ff;
    --text: #17203f;
    --muted: #687087;
    --bg: #fafbff;
    --card: #ffffff;
    --border: #e5e7eb;
    --radius: 14px;
    --shadow: 0 10px 28px rgba(23, 32, 63, .07);
    --max-width: 1180px;
}

* {
    box-sizing: border-box; 
}

html { 
    scroll-behavior: smooth; 
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 10%, rgba(99,102,241,.05), transparent 28%),
        var(--bg);
    line-height: 1.65;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.story-label {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.page {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 28px auto 70px;
}


.story, .chapter {
    position: relative;
    z-index: 1;
    margin: 0 auto 54px;
}

.story {
    width: 100%;
    max-width: 1020px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: center;
}

.story::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 4px solid var(--bg);
    transform: translate(-50%, -50%);
}

.story-text {
    padding: 8px 20px;
}

.story-text h2, .chapter h2 {
    margin: 7px 0 10px;
    font: 700 28px/1.15 Georgia, serif;
    color: var(--text);
}

.story-text p, .chapter p{
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 15px;
}

.story figure {
    margin: 0;
}

.story figure img {
    display: block;
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.story.left .story-text { 
    text-align: right; 
}

.story.right .story-text { 
    text-align: left; 
}

.story.left figure { 
    order: 2; 
}

.story.right figure { 
    order: 1; 
}

.chapter::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 4px solid var(--bg);
    transform: translateX(-50%);
}

.small-photo img {
    max-width: 360px;
    margin: auto;
}

.chapter {
    max-width: 900px;
    padding: 34px;
    background: linear-gradient(145deg, #fff, #f5f6ff);
    border: 1px solid #e0e3f4;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.chapter h2 {
    font-size: 34px;
}

.computer-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
}

.computer-gallery figure {
    margin: 0;
    padding: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.computer-gallery img {
    width: 100%;
    height: 210px;
    object-fit: contain;
}

figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.graduation-photo {
    display: block;
    width: min(490px, 100%);
    max-height: 500px;
    object-fit: contain;
    margin: 18px auto 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.final-chapter {
    text-align: center;
}

.final-photo {
    display: block;
    width: min(400px, 100%);
    max-height: 560px;
    object-fit: contain;
    margin: 20px auto 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.button {
    display: inline-block;
    padding: 11px 20px;
    border: 1px solid var(--primary);
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
}

.button.primary {
    color: white;
    background: var(--primary);
}

.button.primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

footer {
    background: var(--primary);
    color: white;
    min-height: 65px;
    padding: 18px max(25px, calc((100% - var(--max-width))/2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    font-size: 12px;
}

@media (max-width: 800px) {
    .nav-container {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 12px;
        padding-bottom: 8px;
    }

    .nav-container nav {
        width: 100%;
        overflow-x: auto;
    }

    .nav-container nav a {
        white-space: nowrap;
        padding-top: 8px;
    }

    .story {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .story::after, .chapter::before {
        display: none;
    }

    .story.left .story-text, .story.right .story-text {
        text-align: left;
    }

    .story.left figure, .story.right figure {
        order: initial;
    }

    .story figure img {
        max-height: 520px;
    }

    .computer-gallery {
        grid-template-columns: 1fr;
    }

    footer {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .page {
        width: min(100% - 24px, var(--max-width));
    }

    .story-text {
        padding: 0;
    }
}

.story-sections {
    margin-top: 42px;
}

.story-section {
    position: relative;
    margin: 0 auto 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.story-section > summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: 58px 1fr 34px;
    gap: 18px;
    align-items: center;
    min-height: 92px;
    padding: 18px 24px;
    background: linear-gradient(100deg, #fff, #f5f6ff);
    transition: background .2s ease;
}

.story-section > summary::-webkit-details-marker { 
    display: none; 
}

.story-section > summary:hover { 
    background: linear-gradient(100deg, #fff, #eef0ff); 
}

.summary-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    font: 700 13px Georgia, serif;
}

.summary-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.summary-content .story-label { 
    margin-bottom: 2px; 
}

.summary-content strong {
    font: 700 25px/1.15 Georgia, serif;
    color: var(--text);
}

.summary-content small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.summary-chevron {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid #d9ddf2;
    border-radius: 50%;
    color: var(--primary-dark);
    font-size: 22px;
    line-height: 1;
    transition: transform .2s ease, background .2s ease;
}

.story-section[open] > summary {
    border-bottom: 1px solid var(--border);
}

.story-section[open] .summary-chevron {
    transform: rotate(45deg);
    background: var(--primary-light);
}

.section-timeline {
    position: relative;
    padding: 34px 20px 10px;
}

.section-timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: #e1e4f5;
    transform: translateX(-50%);
}

.section-timeline > .story {
    margin-bottom: 48px;
}

.section-timeline > .story:last-child {
    margin-bottom: 18px;
}

.section-timeline > .chapter {
    margin-bottom: 35px;
}

.graduate-story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: center;
    margin-top: 35px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.graduate-story figure { 
    margin: 0; 
}

.graduate-story img {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

@media (max-width: 800px) {
    .story-section > summary {
        grid-template-columns: 48px 1fr 30px;
        gap: 13px;
        padding: 16px;
    }

    .summary-icon { 
        width: 42px; height: 42px; 
    }

    .summary-content strong { 
        font-size: 21px; 
    }

    .summary-content small { 
        font-size: 12px; 
    }

    .section-timeline { 
        padding: 25px 12px 5px; 
    }
    .section-timeline::before { 
        display: none; 
    }

    .graduate-story { 
        grid-template-columns: 1fr; 
    }
}

@media (max-width: 520px) {
    .story-section > summary {
        grid-template-columns: 42px 1fr 28px;
        gap: 10px;
        padding: 14px;
    }

    .summary-content strong { 
        font-size: 19px; 
    }

    .summary-content small { 
        display: none; 
    }

    .section-timeline { 
        padding-left: 4px; 
        padding-right: 4px; 
    }
}
