body {
    padding-bottom: 4rem;
}

header {
    position: static;
    width: min(1000px, calc(100% - 2rem));
    margin: 2rem auto 1rem;
    border-radius: 20px;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: var(--card);
    border: 1px solid rgba(0, 245, 255, 0.18);
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

header p {
    color: var(--text-muted);
}

nav {
    width: min(1000px, calc(100% - 2rem));
    margin: 0 auto 2rem;
    padding: 0.85rem 1.25rem;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(0, 245, 255, 0.18), rgba(192, 38, 211, 0.18));
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

nav a,
.social-icon {
    color: var(--text);
}

nav a:hover,
aside a:hover,
section a:hover {
    color: var(--accent);
}

section {
    width: min(1000px, calc(100% - 2rem));
    margin: 0 auto 2rem;
    max-width: 1000px;
    padding: clamp(1rem, 4vw, 2rem);
    background: var(--card);
    border-radius: 18px;
    border: 1px solid rgba(0, 245, 255, 0.12);
}

section h2 {
    margin-bottom: 1.5rem;
}

section p,
section li,
section a {
    color: var(--text);
}

iframe,
embed,
img,
video {
    max-width: 100%;
    width: 100%;
    border-radius: 12px;
}

iframe {
    display: block;
    min-height: 500px;
    border: 0;
}

iframe[src*="youtube.com/embed/"],
iframe[src*="youtube-nocookie.com/embed/"] {
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
}

.project-description {
    columns: 2;
    column-gap: 2rem;
}

section h1,
section h2,
section h3,
section p,
section li {
    overflow-wrap: anywhere;
}

.project-description ul,
.skills-grid {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-description li,
.skills-grid li {
    break-inside: avoid;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid rgba(0, 245, 255, 0.12);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.gif-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.gif-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gif-description {
    color: var(--text-muted);
    text-align: center;
}

#tldr {
    text-align: left;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.pdf-container {
    width: 100%;
    height: min(1200px, calc(100vh - 12rem));
    min-height: 700px;
}

.pdf-viewer {
    height: 100%;
}

.pdf-fallback {
    margin-top: 0.75rem;
    text-align: center;
}

aside {
    position: fixed;
    left: 1rem;
    top: 6rem;
    width: 220px;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid rgba(0, 245, 255, 0.12);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

aside a {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
}

footer {
    position: static;
    padding: 2rem 5% 1rem;
}

@media (min-width: 1100px) {
    body > aside ~ header,
    body > aside ~ nav,
    body > aside ~ section {
        margin-left: calc(240px + 2rem);
        margin-right: 2rem;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 1099px) {
    aside {
        display: none;
    }
}

@media (max-width: 700px) {
    header {
        width: calc(100% - 1rem);
        margin-top: 0.5rem;
    }

    nav {
        width: calc(100% - 1rem);
        margin-bottom: 1rem;
    }

    section {
        width: calc(100% - 1rem);
        margin-bottom: 1rem;
    }

    .project-description {
        columns: 1;
    }

    iframe {
        min-height: 320px;
    }

    .pdf-container {
        height: max(500px, calc(100vh - 11rem));
        min-height: 0;
    }
}
