/* -----------------------------
   Basic page settings
----------------------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;

    color: #d6d6d6;
    background-color: #181818;

    line-height: 1.6;

    background-image:
        linear-gradient(rgba(0, 0, 0, .3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, .2) 1px, transparent 1px);

    background-size: 40px 40px;
}

body::after {
    content: "";
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.12);

    pointer-events: none;
    z-index: 9999;
}

/* -----------------------------
   Navigation
----------------------------- */

header {
    background-color: #202020;
    border-bottom: 1px solid #383838;
}

.navbar {
    max-width: 1200px;

    margin: auto;

    padding: 25px 30px;

    display: flex;

    justify-content: space-between;
    align-items: center;

}

.logo {
    font-weight: bold;
    letter-spacing: 1px;
    color: #d6d6d6;
    text-decoration: none;
    font-size:24px;
}

.nav-links {
    position: relative;
    display: flex;
    gap: 30px;

    background-color: rgb(44, 43, 43);
    padding: 8px 24px;
    text-decoration: none;
}

.nav-links a {
    position: relative;
    z-index: 2;

    text-decoration: none;
    color: #dddddd;

    font-size:20px;

}

.slider {
    position: absolute;
    z-index: 1;

    top: 50%;

    height: calc(100%);;
    width: calc(100%);;

    background-color: rgb(58, 57, 57);

    opacity: 0;
    transform: translateY(-50%);
    transition:
        left 0.25s ease,
        width 0.25s ease,
        opacity 0.2s ease;
}

.nav-links a:hover {
    color: #dedede;
}


/* -----------------------------
   Hero section
----------------------------- */

.hero {
    min-height: 80vh;

    display: flex;
    align-items: center;
    gap: 40px;

    max-width: 1400px;

    margin: auto;

    padding: 50px 30px;
}

.hero-content {
    flex: 1;
    min-width: 0;
    max-width: 850px;
    text-align: center;
}

.hero-image {
    flex-shrink: 0;
    overflow: hidden;
    width: 427px;
    height: 640px;
    transform: translateY(80px);

}

.hero-image img {
    width: 100%;
    height: 80%;
    object-fit: cover;
    object-position: center;

    border: 1px solid #303030
}

.small-heading {
    font-size: 13px;

    letter-spacing: 2px;

    font-weight: bold;

    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(48px, 4.6vw, 72px);

    line-height: 1.05;

    margin-bottom: 30px;
}

.hero-title-line {
    display: inline-block;
}

.hero-description {
    max-width: 650px;

    font-size: 20px;

    color: #b5b5b5;

    margin-bottom: 40px;
}


/* -----------------------------
   Buttons
----------------------------- */

.button {
    display: inline-block;

    text-decoration: none;

    color: #181818;

    background-color: #d6d6d6;

    padding: 14px 24px;

    font-weight: bold;

    transition: 0.2s;
}

.button:hover {
    background-color: #adadad;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}


/* -----------------------------
   General sections
----------------------------- */

.section {
    max-width: 1200px;

    margin: auto;

    padding: 100px 30px;
}

.section-heading {
    margin-bottom: 50px;
}

.section-heading h2 {
    font-size: 42px;
}

.heading-highlight {
    background-color: rgb(44, 43, 43);
    padding: 16px 36px;
    border-radius: 2px;
    border: 2px solid #111111;
}

/* -----------------------------
   Projects
----------------------------- */

.project-grid {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 40px;
}

.project-card {
    background-color: #242424;

    border: 1px solid #3a3a3a;

    transition: transform 0.2s;

    color: inherit;

    text-decoration: none;

    display: block;
}

.project-card:hover {
    transform: translateY(-5px);

    border-color: #666666;
}


/* -----------------------------
   Project detail pages
----------------------------- */

.project-list {
    display: grid;
    gap: 20px;
}

.project-dropdown,
.gallery-dropdown {
    background: #242424;
    border: 1px solid #3a3a3a;
    text-align: left;
    min-width: 0;
}

.gallery-dropdown {
    max-width: 1200px;
    margin: 0 auto;
}

.project-dropdown summary,
.gallery-dropdown summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 30px;
    cursor: pointer;
    list-style: none;
}

.project-dropdown summary::-webkit-details-marker,
.gallery-dropdown summary::-webkit-details-marker {
    display: none;
}

.project-dropdown summary:hover,
.gallery-dropdown summary:hover {
    background: #303030;
}

.project-dropdown summary:focus-visible,
.gallery-dropdown summary:focus-visible {
    outline: 2px solid #d6d6d6;
    outline-offset: 3px;
}

.project-dropdown summary h3,
.gallery-dropdown summary h3 {
    font-size: clamp(20px, 2.5vw, 26px);
    line-height: 1.3;
}

.dropdown-indicator::before {
    content: "+";
    font-size: 30px;
}

details[open] > summary .dropdown-indicator::before {
    content: "\2212";
}

.dropdown-content {
    padding: 25px 30px 30px;
    border-top: 1px solid #3a3a3a;
}

.dropdown-content > p,
.dropdown-content > ol {
    color: #b5b5b5;
    margin-bottom: 20px;
    font-size: 18px;
}

.dropdown-content > ol {
    padding-left: 1.5em;
    font-family: inherit;
    line-height: inherit;
}

.project-tab-heading {
    flex: 1;
    min-width: 0;
}

.project-tab-image {
    width: 180px;
    height: 130px;
    flex-shrink: 0;
    object-fit: contain;
    background: #303030;
    border: 1px solid #3a3a3a;
}

@media (max-width: 600px) {
    .project-dropdown summary {
        flex-wrap: wrap;
    }

    .project-tab-image {
        width: 100%;
        height: 180px;
    }
}

.project-tab-heading .tags {
    margin-top: 14px;
}

.dropdown-indicator {
    flex-shrink: 0;
}

.dropdown-content .gallery-item img {
    height: 320px;
    object-fit: contain;
    background: #303030;
    border: 1px solid #3a3a3a;
}

.dropdown-content .gallery-caption h4 {
    font-size: 18px;
    margin-bottom: 3px;
    letter-spacing: 0.5px;
}

@media (max-width: 480px) {
    .project-dropdown summary,
    .gallery-dropdown summary,
    .dropdown-content {
        padding: 20px 16px;
    }

    .dropdown-content .gallery-item img {
        height: 240px;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .navbar {
        flex-wrap: wrap;
        gap: 20px;
    }
}

.project-hero {
    max-width: 1200px;
    margin: auto;
    padding: 90px 30px 70px;
}

.back-link {
    display: inline-block;
    margin-bottom: 35px;
    color: #b5b5b5;
    text-decoration: none;
}

.back-link:hover {
    color: #dedede;
}

.project-hero h1 {
    max-width: 900px;
    margin-bottom: 25px;
    font-size: 64px;
    line-height: 1.05;
}

.project-lead {
    max-width: 760px;
    color: #b5b5b5;
    font-size: 20px;
}

.project-cover,
.gallery-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #303030;
    border: 1px solid #3a3a3a;
    color: #999999;
}

.project-cover {
    min-height: 500px;
    margin-top: 55px;
}

.project-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 80px;
}

.project-copy h2,
.project-gallery h2 {
    margin-bottom: 20px;
    font-size: 36px;
}

.project-copy h3 {
    margin: 45px 0 12px;
    font-size: 24px;
}

.project-copy p {
    margin-bottom: 20px;
    color: #b5b5b5;
    font-size: 18px;
}

.project-facts {
    height: fit-content;
    padding: 30px;
    background-color: #242424;
    border: 1px solid #3a3a3a;
}

.project-facts h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

.project-facts dt {
    margin-top: 18px;
    color: #8c8c8c;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.project-facts dd {
    margin-top: 4px;
}

.project-gallery {
    padding-top: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.folder-gallery {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    align-items: start;
}

.folder-gallery .gallery-item img {
    height: 320px;
    object-fit: contain;
    background: #303030;
    border: 1px solid #3a3a3a;
}

/* Put items in a gallery-row and set --columns to control that row. */
.gallery-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(var(--columns, 2), minmax(0, 1fr));
    gap: 25px;
    align-items: start;
    min-width: 0;
}

.gallery-row > .gallery-item {
    grid-column: auto;
}

/* Optional: show large images at their natural aspect ratio. */
.dropdown-content .gallery-row-large .gallery-item img {
    height: auto;
}

@media (max-width: 800px) {
    .gallery-row {
        grid-template-columns: 1fr;
    }
}

.gallery-placeholder {
    min-height: 320px;
}

.gallery-item {
    margin: 0;
    min-width: 0;
}

.gallery-group {
    grid-column: 1 / -1;
    padding: 20px;
    background-color: #2c2c2c;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
}

.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 16px;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
}
.gallery-caption {
    padding: 18px 4px 5px;
}

.gallery-caption h3 {
    margin-bottom: 6px;
    color: #d6d6d6;
    font-size: 18px;
}

.gallery-caption p,
.model-description {
    color: #a9a9a9;
}

.model-viewer-wrap {
    padding-top: 20px;
}

model-viewer {
    width: 100%;
    height: 600px;
    margin-top: 30px;
    background-color: #242424;
    border: 1px solid #3a3a3a;
}

.model-fallback {
    color: #a9a9a9;
}

.document-viewer-wrap {
    padding-top: 20px;
}

.document-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 30px;
    margin-bottom: 25px;
}

.document-description {
    max-width: 700px;
    color: #a9a9a9;
}

.document-actions {
    display: flex;
    flex-shrink: 0;
    gap: 12px;
}

.document-link {
    padding: 10px 16px;
    border: 1px solid #555555;
    color: #d6d6d6;
    text-decoration: none;
}

.document-link:hover {
    background-color: #303030;
    border-color: #777777;
}

.pdf-viewer {
    display: block;
    width: 100%;
    height: 760px;
    background-color: #242424;
    border: 1px solid #3a3a3a;
}

.pdf-fallback {
    padding: 30px;
    color: #a9a9a9;
}

.project-image {
    height: 300px;
    overflow: hidden;

    background-color: #303030;

    display: flex;

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

    color: #999999;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: translate(var(--image-x, 0px), var(--image-y, 0px))
        scale(var(--image-scale, 1));
    transform-origin: center;
    display: block;
}

/* Individual image framing: positive x moves right, positive y moves down.
   Scale 1 fits the full image; 1.2 zooms in by 20%, 0.8 zooms out by 20%. */
.project-image-parachute {
    --image-x: 0px;
    --image-y: 0px;
    --image-scale: 1.1;
}

.project-image-dynamometer {
    --image-x: 0px;
    --image-y: 5px;
    --image-scale: 1.9;
}

.project-image-ev {
    --image-x: 0px;
    --image-y: 0px;
    --image-scale: 1;
}

.project-image-four {
    --image-x: 0px;
    --image-y: 0px;
    --image-scale: 1;
}

.project-info {
    padding: 30px;
}

.project-info h3 {
    font-size: 24px;

    margin-bottom: 15px;
}

.project-info p {
    color: #b5b5b5;

    margin-bottom: 20px;
}


/* -----------------------------
   Project tags
----------------------------- */

.tags {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}

.tags span {
    font-size: 12px;

    color: #dddddd;

    background-color: #343434;

    padding: 6px 10px;
}


/* -----------------------------
   Skills
----------------------------- */

/* Gallery section */
.gallery-section {
    background-color: rgba(112, 112, 112, 0.2);

    color: #d6d6d6;

    max-width: none;

    text-align: center;
    font-size: 20px;
}

.gallery-section .section-heading,
.gallery-section .skills-grid {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.gallery-section .section-heading h2 {
    font-size: 60px;
}

.gallery-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto 40px;
}

.gallery-preview img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: contain;
    background-color: #242424;
    border: 1px solid #3a3a3a;
}

@media (max-width: 800px) {
    .gallery-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .gallery-preview {
        grid-template-columns: 1fr;
    }
}

.dark-section {
    background-color: #202020;

    color: #d6d6d6;

    max-width: none;
}

.skills-section {
    background-color: rgba(32, 32, 32, 0.5); /* Opacity: 0 = clear, 1 = solid. */
    color: #d6d6d6;
    max-width: none;
    text-align: left;
}

.dark-section .section-heading,
.dark-section .skills-grid,
.skills-section .section-heading,
.skills-section .skills-grid {
    max-width: 800px;

    margin-left: auto;
    margin-right: auto;
}

.skills-grid {
    display: grid;

    grid-template-columns: repeat(5, minmax(0, 1fr));

    gap: 30px;
}

.skill h3 {
    margin-bottom: 20px;

    font-size: 22px;
}

.skill p {
    color: #b5b5b5;

    margin-bottom: 7px;
}


/* -----------------------------
   Certifications
----------------------------- */
#certifications {
    --certification-brightness: 0.8; /* 1 = original brightness, 0.8 = 80%. */
    padding-top: 40px;
    padding-bottom: 40px;
}

#certifications .section-heading {
    text-align: center;
    margin-bottom: 20px;
}

.certifications-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    max-width: 1900px;
    margin: 0 auto;

    gap: 0px;
}
.certification-image {
    padding: 0;
    cursor: zoom-in;
    flex: 0 0 auto;
    width: 600px; /* Adjust this width to scale the image. */
    max-width: 100%;

    background-color: #303030;

    display: flex;

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

    color: #999999;

    border: 3px solid #424242;
}

.certification-image img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(var(--certification-brightness, 0.8));
}

.certification-image:focus-visible {
    outline: 3px solid #d6d6d6;
    outline-offset: 5px;
}

.certification-dialog {
    margin: auto;
    padding: 45px 15px 15px;
    max-width: 95vw;
    max-height: 95vh;
    background: #202020;
    border: 1px solid #666;
    color: #d6d6d6;
}

.certification-dialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

.certification-enlarged {
    display: block;
    max-width: 100%;
    max-height: calc(95vh - 62px);
    width: auto;
    height: auto;
    object-fit: contain;
    filter: brightness(var(--certification-brightness, 0.8));
}

.certification-close {
    position: absolute;
    top: 5px;
    right: 10px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 30px;
    cursor: pointer;
}

html.certification-open {
    overflow: hidden;
}

/* -----------------------------
   Contact
----------------------------- */

.contact-section {
    text-align: center;

    padding: 120px 30px;

}

.contact-section h2 {
    font-size: 48px;

    margin-bottom: 20px;
}

.contact-section p {
    margin-bottom: 30px;

    color: #b5b5b5;
}


/* -----------------------------
   Footer
----------------------------- */

footer {
    padding: 30px;

    text-align: center;

    background-color: #121212;

    color: #8c8c8c;

    font-size: 13px;
}


/* -----------------------------
   Mobile layout
----------------------------- */

@media (max-width: 800px) {

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-content {
        flex: none;
        width: 100%;
    }

    .hero-image {
        width: 100%;
        max-width: 427px;
        height: auto;
        transform: none;
    }

    .hero-image img {
        height: auto;
        display: block;
    }

    .hero h1 {
        font-size: 48px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-section {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 15px;
    }

    .project-hero h1 {
        font-size: 44px;
    }

    .project-cover {
        min-height: 300px;
    }

    model-viewer {
        height: 420px;
    }

    .document-heading {
        align-items: start;
        flex-direction: column;
    }

    .pdf-viewer {
        height: 560px;
    }

    .project-details,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .project-details {
        gap: 45px;
    }

}
