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

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: #EAAC59;
    color: #fff;
    font-family: 'Fira Code', "Poppins", sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* enable smooth full-section scrolling */
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

/* Header */
/* full-bleed site header */
.site-header {
    /* configurable via inline style */
    /* default hero height (one viewport) — spacer controls required scroll distance */
    --site-header-height: 100vh;
    --header-clip-y: 18%;
    position: relative;
    width: 100%;
    height: var(--site-header-height);
    overflow: hidden;
    margin: 0 0 24px 0;
    display: block;
    transition: height 420ms cubic-bezier(.2, .9, .2, 1);
}

.site-header .header-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

/* pin overlay above everything else */
.header-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 1100px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(.2, .9, .2, 1);
}

/* remove all other overlay-related styles that might conflict */
.site-header .header-overlay,
body.header-collapsed .header-overlay {
    /* remove any competing styles */
}

.header-title {
    margin: 0;
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.98);
    text-align: center;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
    /* responsive sizing */
    font-size: clamp(32px, 9vw, 96px);
    pointer-events: none;
    transform: none;
    /* remove any transforms */
    transition: font-size 0.4s cubic-bezier(.2, .9, .2, 1);
}

.header-sub {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    letter-spacing: 0.02em;
    font-size: clamp(14px, 2.2vw, 20px);
    pointer-events: none;
}

/* header media container becomes full-bleed background of header */
.header-media {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100%;
    display: block;
    z-index: 1;
    /* below overlay text */
    overflow: hidden;
    background: #000;
    transition: opacity 420ms ease, transform 420ms ease, visibility 420ms ease;
    will-change: opacity, transform;
}

/* animated glow / edge effect */
.header-media::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    /* diagonal warm glow */
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.04), rgba(234, 172, 89, 0.12) 40%, rgba(255, 255, 255, 0) 75%);
    filter: blur(26px) saturate(1.05);
    /* reduce this so the video fade is visible */
    opacity: 0.32;
    mix-blend-mode: screen;
    transform: translateZ(0);
    animation: glowPulse 3.6s ease-in-out infinite;
    transition: opacity 420ms ease;
}

/* the video itself */
.header-clip {
    position: absolute;
    /* anchor to top, center horizontally */
    top: 0;
    left: 50%;
    /* ensure cover-like behavior without re-centering vertically on resize */
    transform: translateX(-50%);
    /* fill header vertically, and ensure it doesn't leave gaps horizontally */
    height: 100%;
    min-width: 100%;
    width: auto;
    object-fit: cover;
    /* nudge which part of the video is visible (lower percentage = show more top) */
    object-position: center var(--header-clip-y, 18%);
    display: block;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    /* ensure visible */
    filter: none;
    will-change: transform;
    /* ensure the video fades smoothly when JS adjusts opacity */
    transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
}

/* Make the container relative so text can be positioned on top */
.overlay-container {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 16px;
    /* match your gallery styling */
}

/* Style the overlay text */
.overlay-text {
    position: absolute;
    bottom: 16px;
    /* distance from bottom of image */
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-weight: 600;
    font-size: 2rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.9;
}

/* Optional hover effect */
.overlay-container:hover .overlay-text {
    transform: translateX(-50%) translateY(-4px);
    opacity: 1;
}

/* Links */
.links {
    text-align: center;
    margin-bottom: 40px;
}

.links a {
    display: block;
    width: 90%;
    margin: 10px auto;
    padding: 16px 0;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.3rem;
    text-align: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transition: 0.3s;
}

.links a:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    justify-items: center;
    /* centers grid items */
    /* make gallery initially hidden (will be faded in by JS) */
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 420ms ease, transform 420ms ease;
    will-change: opacity, transform;
}


.gallery img,
.gallery video,
.gallery .gallery-video {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    /* crop nicely while keeping same footprint as images */
    display: block;
}

/* if you want a larger video on wider screens, tweak with a media query */
@media (min-width: 1100px) {

    .gallery img,
    .gallery video,
    .gallery .gallery-video {
        height: 420px;
    }
}

/* About section: centered, constrained width, pleasant spacing */
/* About section container */
.about {
    max-width: 900px;
    /* match gallery width */
    margin: 48px auto 60px;
    /* center horizontally, spacing top/bottom */
    padding: 0 20px;
    /* small padding on mobile */
    text-align: center;
    /* center text on mobile */
    line-height: 1.6;
    font-size: clamp(14px, 1.9vw, 16px);
    color: #fff;
}

/* About row: optional portrait + text side by side on larger screens */
.about-row {
    display: flex;
    flex-direction: column;
    /* stack on mobile */
    /* align-items: center;s */
    gap: 24px;
}

.about-img {
    width: 140px;
    height: 140px;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

/* On wider screens, place image and text side by side */
@media (min-width: 900px) {
    .about-row {
        flex-direction: row;
        /* align-items: center; */
    }
}

/* Oscilloscope: visible by default and non-interactive */
#oscilloscope {
    position: fixed;
    /* already fixed */
    top: 0;
    left: 0;
    width: 100vw;
    /* ensure full width */
    height: 100vh;
    /* ensure full height */
    z-index: 2;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
}

/* ensure header overlay remains on top of the oscilloscope */
.header-overlay {
    z-index: 10;
}

/* Video section */
.video-section {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0 48px;
    z-index: 10;
}

.video-wrap {
    max-width: 900px;
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-wrap video {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    outline: none;
    background: #000;
}

/* Gallery split row: ensure consistent spacing and make video its own grid item */
.gallery-row {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
    width: 100%;
}

/* small responsive tweak for the gallery items */
@media (max-width: 820px) {
    .gallery-row {
        grid-template-columns: 1fr;
    }

    .gallery-info {
        order: 2;
    }
}

/* gallery feature: big left media + right info column */
.gallery-feature {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) 320px;
    /* left large, right fixed-ish */
    gap: 24px;
    align-items: start;
    width: 100%;
    margin-bottom: 18px;
}

/* make the left feature media noticeably taller on desktop */
.gallery-feature-media img {
    width: 100%;
    height: 720px;
    /* larger portrait display */
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.24);
    display: block;
}

/* tidy gallery-item video below */
.gallery-item .gallery-video {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 6px 26px rgba(0, 0, 0, 0.2);
    display: block;
}

/* right column styling remains */
.gallery-info {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14);
}

/* responsive: stack columns on small screens and reduce image height */
@media (max-width: 980px) {
    .gallery-feature {
        grid-template-columns: 1fr;
    }

    .gallery-feature-media img {
        height: 480px;
    }

    .gallery-item .gallery-video {
        height: 320px;
    }
}

/* small phones */
@media (max-width: 460px) {
    .gallery-feature-media img {
        height: 360px;
    }

    .gallery-item .gallery-video {
        height: 240px;
    }
}

/* hero spacer placed between header and gallery to demand a big scroll */
.hero-spacer {
    /* reduced so user doesn't have to scroll absurdly far */
    height: 0vh;
    /* shorter so fade completes reliably */
    width: 100%;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 100%);
}

/* small floating motion for life */
@keyframes glowPulse {
    0% {
        opacity: 0.8;
        transform: translateY(0) scale(1);
    }

    50% {
        opacity: 0.95;
        transform: translateY(-4px) scale(1.01);
    }

    100% {
        opacity: 0.8;
        transform: translateY(0) scale(1);
    }
}

/* when collapsed (after scroll) hide the video and make header compact */
body.header-collapsed .header-media {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.995);
    pointer-events: none;
    /* keep display removal but after transition — keep for layout safety */
    display: none;
}

/* collapsed header: shrink height so gallery shows up (keeps overlay pinned) */
body.header-collapsed .site-header {
    height: 72px;
    /* compact header height when video removed */
}

.contact {
    max-width: 900px;
    /* match gallery/about width */
    margin: 60px auto 0px;
    /* spacing top/bottom */
    padding: 0 20px;
    text-align: center;
    color: #fff;
}

.contact h2 {
    font-size: clamp(24px, 6vw, 48px);
    margin-bottom: 12px;
}

.contact p {
    font-size: clamp(14px, 1.8vw, 16px);
    margin-bottom: 20px;
    line-height: 1.5;
}

.contact-link {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: background 0.3s, transform 0.3s;
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.portfolio-videos {
    margin: 10px auto 40px;
}

/* Portfolio Videos Section */
.portfolio-video-wrapper {
    padding: 0 20px;
    display: flex;
    flex-direction: row;
    gap: 60px;
}

/* Each feature: video + text */
.portfolio-feature {
    display: grid;
    grid-template-columns: 0.7fr 1fr;
    /* video 70%, text 100% remaining */
    gap: 24px;
    align-items: start;
    /* align text top */
    width: 100%;
}

/* Video container: responsive 16:9 aspect ratio, no extra shadows */
.portfolio-video {
    position: relative;
    width: 30%;
    /* 16:9 ratio */
    border-radius: 12px;
    /* slightly smaller */
    overflow: hidden;
    box-shadow: none;
    /* remove weird shadow/contour */
    background: #000;
    /* fallback black */
}

/* iframe inside video container */
.portfolio-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.portfolio-release iframe {
    width: 100%;
    max-width: 350px;
    height: auto;
}

/* Text info next to video */
.portfolio-info h3 {
    font-size: clamp(20px, 4vw, 28px);
    color: #fff;
    margin-bottom: 12px;
}

.portfolio-info p {
    font-size: clamp(14px, 1.8vw, 16px);
    color: #fff;
    line-height: 1.5;
}

/* Responsive: stack vertically on small screens */
@media (max-width: 820px) {
    .portfolio-feature {
        grid-template-columns: 1fr;
    }

    .portfolio-video {
        padding-top: 56.25%;
        /* maintain 16:9 ratio on mobile */
        margin-bottom: 20px;
    }
}

.portfolio-release-wrapper {
    display: flex;
    margin: 10px auto 40px;
}

.portfolio-release {
    padding: 12px;
}

.content-container {
    overflow-x: auto;
}

.content-container>* {
    flex: 0 0 auto;
    max-width: 90vw;
    scroll-snap-align: start;
}