:root {
    --ink: #0a0c10;
    --navy: #2f3b5a;
    --navy-dark: #202b47;
    --paper: #ffffff;
    --soft: #f3f5f8;
    --line: #dfe4eb;
    --muted: #606977;
    --accent: #6f83b0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body,
button,
input,
textarea,
select {
    font-family: "Inter", Arial, sans-serif;
}

body {
    color: var(--ink);
    background: var(--paper);
}

body.lightbox-open {
    overflow: hidden;
}

/* ---------- Navigation ---------- */
#mainNav {
    min-height: 72px;
    padding: 0;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
}

#mainNav .container-fluid {
    min-height: 72px;
}

#mainNav .portfolio-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    white-space: nowrap;
}

#mainNav .portfolio-title:hover {
    color: var(--navy);
}

#mainNav .nav-sections {
    gap: 1.8rem;
}

#mainNav .nav-link {
    padding: 1.5rem 0;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    box-shadow: none;
}

#mainNav .nav-link:hover,
#mainNav .nav-link:focus,
#mainNav .nav-link.active {
    color: var(--accent);
    text-decoration: none;
    border: 0;
    box-shadow: none;
}

.navbar-social {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-link {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-size: 1.12rem;
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}

.social-link:hover,
.social-link:focus {
    background: var(--soft);
    color: var(--navy);
}

#mainNav .navbar-toggler {
    margin-left: auto;
    color: var(--ink);
    border: 1px solid var(--line);
    font-size: 0.85rem;
    font-weight: 600;
}

.navbar-toggler-label {
    margin-right: 0.35rem;
}

/* ---------- Home ---------- */
.hero-section {
    padding: 126px 0 4.5rem;
    background: var(--paper);
}

.hero-row {
    margin-top: 0.5rem;
}

.hero-visual-column,
.hero-copy-column {
    padding: 0.75rem 3vw;
}

.hero-image-wrap {
    width: min(100%, 500px);
    margin: 0 auto;
    overflow: hidden;
    border-radius: 4rem;
    background: var(--soft);
    box-shadow: 0 16px 45px rgba(24, 33, 53, 0.08);
}

.hero-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: cover;
}

.hero-copy {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
}

.hero-copy h1 {
    margin-bottom: 1.6rem;
    font-size: clamp(1.8rem, 3.6vw, 4.1rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.055em;
}

.hero-description {
    max-width: 680px;
    margin: 0 auto;
    color: #252a33;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.6;
}

.tech-sketch {
    position: absolute;
    z-index: -1;
    color: var(--navy);
    opacity: 0.12;
}

.sketch-one {
    top: -0.5rem;
    right: 2rem;
    font-size: 7rem;
    transform: rotate(10deg);
}

.sketch-two {
    left: -1.2rem;
    bottom: 7rem;
    font-size: 6rem;
    transform: rotate(-8deg);
}

.sketch-three {
    right: -1rem;
    bottom: 0.5rem;
    font-size: 6.5rem;
    transform: rotate(6deg);
}

/* ---------- Shared sections ---------- */
.section-space {
    padding: 7rem 0;
}

.section-heading-row {
    display: grid;
    grid-template-columns: 1fr;
    padding-bottom: 2rem;
    margin-bottom: 3.25rem;
    border-bottom: 1px solid var(--line);
}

.section-heading-row h2,
.contact-panel h2 {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 4.3rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.045em;
}

/* ---------- Experience ---------- */
.resume-section {
    background: var(--soft);
}

.resume-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.75fr);
    gap: 4rem;
}

.resume-main {
    position: relative;
}

.resume-main::before {
    content: "";
    position: absolute;
    top: 0.8rem;
    bottom: -0.5rem;
    left: 7px;
    width: 1px;
    background: #cdd4df;
}

.timeline-item {
    position: relative;
    padding-left: 2.4rem;
    padding-bottom: 3rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 15px;
    height: 15px;
    border: 3px solid var(--soft);
    border-radius: 50%;
    background: var(--navy);
    box-shadow: 0 0 0 1px var(--navy);
    z-index: 1;
}

.timeline-topline {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.timeline-topline h3 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.timeline-topline span {
    color: var(--muted);
    font-size: 0.83rem;
    white-space: nowrap;
}

.timeline-place {
    margin: 0.3rem 0 0.8rem;
    color: var(--navy);
    font-weight: 700;
}

.timeline-content>p:not(.timeline-place) {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.7;
}

.experience-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 540px;
    margin-top: 1.25rem;
}

.experience-gallery-single {
    grid-template-columns: 1fr;
    max-width: 260px;
}

.experience-image-button {
    width: 100%;
    height: 155px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

.experience-image-button:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 3px;
}

.experience-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.experience-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    margin-top: 0.9rem;
}

.experience-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--navy);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.experience-links a:hover,
.experience-links a:focus {
    text-decoration: underline;
}

.resume-sidebar {
    display: grid;
    align-content: start;
}

.info-card {
    padding: 1.7rem;
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    background: var(--paper);
}

.skill-list,
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.skill-list span,
.project-tags span {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: var(--soft);
    color: #384150;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ---------- Projects ---------- */
.projects-section-custom {
    background: var(--paper);
}

.projects-heading {
    margin-bottom: 2.5rem;
}

.project-row {
    margin-bottom: 5.5rem;
}

.project-row:last-child {
    margin-bottom: 0;
}

.project-row-text {
    padding: 2rem 3rem;
}

.project-number {
    margin-bottom: 0.7rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-row-text h3 {
    margin-bottom: 1rem;
    font-size: clamp(1.7rem, 2.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.project-row-text>p:not(.project-number) {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.project-carousel,
.project-single-image,
.project-placeholder {
    width: 100%;
    overflow: hidden;
    border-radius: 22px;
}

.project-carousel .carousel-inner {
    border-radius: 22px;
}

.project-image {
    width: 100%;
    height: 390px;
    display: block;
    object-fit: contain;
    border-radius: 22px;
}

.project-placeholder {
    height: 390px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border: 1px dashed #c8cfda;
    background: var(--soft);
    color: var(--muted);
    text-align: center;
}

.project-placeholder svg {
    color: var(--navy);
    font-size: 3rem;
    opacity: 0.8;
}

.project-placeholder span {
    font-size: 0.92rem;
    font-weight: 600;
}

.project-carousel .carousel-control-prev,
.project-carousel .carousel-control-next {
    width: 46px;
    height: 46px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.62);
    opacity: 1;
}

.project-carousel .carousel-control-prev {
    left: 15px;
}

.project-carousel .carousel-control-next {
    right: 15px;
}

.project-carousel .carousel-control-prev-icon,
.project-carousel .carousel-control-next-icon {
    width: 18px;
    height: 18px;
}

/* ---------- Contact ---------- */
.contact-cta {
    background: var(--soft);
}

.contact-panel {
    min-height: 300px;
    padding: clamp(2.2rem, 5vw, 4.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    border-radius: 2rem;
    background: var(--navy);
    color: white;
}

.contact-panel p {
    max-width: 600px;
    margin: 1rem 0 0;
    color: #d9deea;
}

.contact-actions {
    min-width: 190px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.portfolio-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.75rem 1.3rem;
    border-radius: 0 0 16px 16px;
    background: var(--navy);
    color: white;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}

.light-btn {
    background: white;
    color: var(--navy);
}

.light-btn:hover,
.light-btn:focus {
    background: var(--soft);
    color: var(--navy-dark);
}

.portfolio-footer {
    padding: 2.5rem 0;
    background: var(--soft);
    color: var(--muted);
    font-size: 0.82rem;
}

.portfolio-footer a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

/* ---------- Image lightbox ---------- */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.82);
    cursor: zoom-out;
}

.image-lightbox.is-open {
    display: flex;
}

.image-lightbox img {
    width: auto;
    height: auto;
    max-width: 92vw;
    max-height: 86vh;
    display: block;
    border-radius: 12px;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 2rem;
    line-height: 1;
}

.lightbox-close:hover,
.lightbox-close:focus {
    background: rgba(255, 255, 255, 0.22);
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    #mainNav .nav-sections {
        gap: 1.2rem;
    }

    .hero-visual-column,
    .hero-copy-column {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    html {
        scroll-padding-top: 66px;
    }

    #mainNav,
    #mainNav .container-fluid {
        min-height: 66px;
    }

    #mainNav .portfolio-title {
        position: static;
        transform: none;
        margin-right: auto;
        font-size: 0.95rem;
    }

    #navbarResponsive {
        padding: 0.8rem 0 1rem;
        background: white;
    }

    #mainNav .nav-sections {
        gap: 0;
    }

    #mainNav .nav-link {
        padding: 0.7rem 0;
    }

    .navbar-social {
        margin-top: 0.6rem;
        justify-content: flex-start;
    }

    .hero-section {
        padding-top: 76px;
    }

    .hero-row {
        margin-top: 0.25rem;
    }

    .hero-image-wrap {
        width: min(100%, 560px);
        border-radius: 2.5rem;
    }

    .resume-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .project-row {
        margin-bottom: 4.5rem;
    }

    .project-row-text {
        padding: 2rem 0.5rem 0;
    }

    .project-image,
    .project-placeholder {
        height: 320px;
    }
}

@media (max-width: 767.98px) {
    .section-space {
        padding: 5rem 0;
    }

    .projects-section-custom {
        padding-top: 3.5rem;
    }

    .section-heading-row {
        margin-bottom: 2.5rem;
    }

    .timeline-topline {
        display: block;
    }

    .timeline-topline span {
        display: block;
        margin-top: 0.35rem;
    }

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

    .contact-actions {
        width: 100%;
    }
}

@media (max-width: 575.98px) {

    .hero-visual-column,
    .hero-copy-column {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .hero-image-wrap {
        border-radius: 1.8rem;
    }

    .hero-copy h1 {
        font-size: 2.55rem;
    }

    .tech-sketch {
        display: none;
    }

    .experience-gallery {
        gap: 0.65rem;
    }

    .experience-image-button {
        height: 115px;
    }

    .project-image,
    .project-placeholder {
        height: 240px;
    }

    .project-row {
        margin-bottom: 4rem;
    }

    .image-lightbox {
        padding: 1rem;
    }
}