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

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    overflow-y: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: white;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 40px);
    z-index: 1000;
    background: transparent;
    pointer-events: none;
}

header * {
    pointer-events: auto;
}

header .logo-container {
    align-self: center;
}

.logo-container {
    height: clamp(60px, 6vw, 80px);
}

.logo-canvas {
    height: 100%;
    width: auto;
    display: block;
}

.logo-desktop,
.logo-mobile {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.logo-desktop {
    display: none;
}

.logo-mobile {
    display: none;
}

.social-nav {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.2vw, 15px);
}

.instagram-link,
.facebook-link {
    display: inline-block;
    position: relative;
}

.nyheter-dropdown {
    position: relative;
    display: inline-block;
}

.nyheter-link {
    font-family: 'Inter', sans-serif;
    font-size: clamp(14px, 1.5vw, 22px);
    text-transform: uppercase;
    color: black;
    text-decoration: none;
    margin-top: clamp(12px, 1.5vw, 17px);
    padding: clamp(3px, 0.4vw, 4px) clamp(6px, 0.8vw, 8px);
    font-weight: 400;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: inline-block;
    cursor: pointer;
    position: relative;
}

.nyheter-text {
    display: inline-block;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    width: 20px;
    height: 16px;
    justify-content: space-between;
}

.hamburger-menu span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: black;
    transition: all 0.3s ease;
}

.nyheter-link:hover {
    background-color: #b0c3ca;
    color: black;
}

.nyheter-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: rgba(0, 0, 0, 0.039);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    margin-top: clamp(3px, 0.4vw, 4px);
    border: 1px solid black;
}

/* Desktop: hover to show dropdown */
@media (min-width: 851px) {
    .nyheter-dropdown:hover .nyheter-dropdown-content {
        display: block !important;
    }
    
    /* Ensure active state doesn't show dropdown on desktop */
    .nyheter-dropdown.active .nyheter-dropdown-content {
        display: none;
    }
}

/* Mobile: click to show dropdown (via .active class) */
@media (max-width: 850px) {
    .nyheter-dropdown.active .nyheter-dropdown-content {
        display: block;
    }
}

.nyheter-dropdown-item {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: clamp(13px, 1.3vw, 18px);
    color: black;
    text-decoration: none;
    padding: clamp(8px, 0.8vw, 12px) clamp(12px, 1.2vw, 16px);
    transition: background-color 0.3s ease, color 0.3s ease;
    text-transform: none;
}

.nyheter-dropdown-item:hover {
    background-color: #b0c3ca;
    color: black;
}

/* Social links in dropdown */
.dropdown-social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1.2vw, 15px);
    padding: clamp(8px, 0.8vw, 12px) clamp(12px, 1.2vw, 16px);
    border-top: 1px solid #b0c3ca;
    margin-top: clamp(4px, 0.4vw, 6px);
}

.dropdown-instagram-logo,
.dropdown-facebook-logo {
    height: clamp(24px, 2.5vw, 38px);
    width: auto;
    display: block;
}

.dropdown-instagram-link,
.dropdown-facebook-link {
    display: inline-block;
    position: relative;
    transition: opacity 0.3s ease;
}

.dropdown-instagram-link:hover,
.dropdown-facebook-link:hover {
    opacity: 0.7;
}

/* Hide social links in dropdown on desktop */
@media (min-width: 851px) {
    .dropdown-social-links {
        display: none;
    }
}

.instagram-logo,
.facebook-logo {
    height: clamp(24px, 2.5vw, 38px);
    width: auto;
    display: block;
    margin-top: clamp(12px, 1.5vw, 17px);
    position: relative;
    z-index: 1;
}

.instagram-link::before,
.facebook-link::before {
    content: '';
    position: absolute;
    top: clamp(12px, 1.5vw, 17px);
    left: 50%;
    transform: translateX(-50%);
    /* Scale proportionally to icon: icon is clamp(24px, 2.5vw, 38px), background is ~8% larger */
    width: clamp(20px, 2.3vw, 43px);
    height: clamp(20px, 2.3vw, 43px);
    border-radius: clamp(8px, 0.7vw, 8px);
    background-color: transparent;
    transition: background-color 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.instagram-link:hover::before,
.facebook-link:hover::before {
    background-color: #b0c3ca;
}

/* Main Content */
main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-bottom: clamp(60px, 6vw, 80px);
}

.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: white;
    z-index: 0;
}

.background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}


.slogan-overlay {
    position: absolute;
    /* Fluid positioning: scales with viewport, maintains spacing from footer */
    /* Formula: position based on available space, ensuring minimum gap */
    top: clamp(35vh, calc(60vh - max(12vh, 10vw)), 60vh);
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    padding: clamp(1.4vh, 2.5vw, 3.2vh);
    max-width: 98vw;
    width: 98vw;
    box-sizing: border-box;
    bottom: auto;
    /* Fluid height limit: ensures gap is maintained, but allows content to show */
    max-height: calc(50vh - max(12vh, 10vw));
    overflow: visible;
}

.slogan-overlay h1 {
    color: black;
    /* Fluid font size: scales down when screen is square (vw ≈ vh) */
    font-size: clamp(3.5rem, min(11vh, 8vw + 2.5vh, 8vh + 2.5vw), 8rem);
    font-weight: 300;
    letter-spacing: clamp(0.5px, 0.1vw + 0.05vh, 2px);
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 0;
}

.vi-capital {
    text-transform: none;
}

.kaffe-emphasis {
    font-weight: 600;
    font-style: italic;
    text-transform: none;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: clamp(1.5vh, 2vw, 1.5vh) clamp(1.5vw, 2vw, 2.5vw);
    z-index: 1000;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    max-width: 100vw;
    box-sizing: border-box;
    /* Fluid height limit: ensures gap is maintained proportionally */
    max-height: calc(50vh - max(12vh, 10vw));
    overflow: hidden;
    /* Fluid gap: scales with viewport, maintains minimum spacing */
    padding-top: max(12vh, 10vw);
}

.footer-content-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Fluid gap: scales with viewport, uses min to handle square screens */
    gap: clamp(0.7vh, min(2vw, 2.5vh), 2.78vh);
    width: 100%;
    max-width: 98vw;
    box-sizing: border-box;
    transform-origin: center bottom;
    /* Fluid padding: scales proportionally */
    padding: clamp(0.6vh, min(1.5vw, 1.8vh), 1.85vh);
    transition: all 0.3s ease;
}

.in-between {
    /* Fluid font size: scales down when screen is square (vw ≈ vh) */
    font-size: clamp(14px, min(1.5vw + 1vh, 2.8vh, 1.5vh + 1vw), 28px);
    font-weight: 400;
    text-align: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -100vh;
    z-index: 0;
    pointer-events: none;
}

footer:hover::before {
    pointer-events: auto;
}

/* Footer logos - desktop only */
.footer-logo-left,
.footer-logo-right {
    position: absolute;
    bottom: clamp(1.5vh, 2vw, 1.5vh);
    z-index: 1001;
    display: none;
    align-items: flex-end;
}

.footer-logo-left {
    left: clamp(1.5vw, 2vw, 2.5vw);
    bottom: clamp(0.5vh, 1vw, 0.8vh);
}

.footer-logo-right {
    right: clamp(1.5vw, 2vw, 2.5vw);
}

.footer-logo {
    width: auto;
    display: block;
}

.nal-logo {
    height: clamp(28px, 3.5vw, 50px);
}

.arkitektur-bedriftene-logo {
    height: clamp(16px, 1.8vw, 25px);
}

/* Show logos only on desktop */
@media (min-width: 851px) {
    .footer-logo-left,
    .footer-logo-right {
        display: flex;
    }
}

.footer-text {
    /* Fluid font size: scales down when screen is square (vw ≈ vh) */
    font-size: clamp(20px, min(3vw + 1.5vh, 5.5vh, 3vh + 1.5vw), 55px);
    font-weight: 300;
    text-align: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    border: 1px solid white;
    padding: clamp(8px, min(1.2vw + 0.5vh, 2vh, 1.2vh + 0.5vw), 18px) clamp(15px, min(2.5vw + 1vh, 3.8vh, 2.5vh + 1vw), 35px);
    transition: background-color 0.3s ease, color 0.3s ease, backdrop-filter 0.3s ease;
    color: white;
    background-color: rgba(0, 0, 0, 0.039);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-decoration: none;
    display: inline-block;
    max-width: 95%;
    width: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.footer-text:hover {
    background-color: #b0c3ca;
    color: black;
    border: 1px solid black;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.contact-details {
    display: flex;
    justify-content: center;
    gap: clamp(12px, 1.5vw + 0.5vh, 32px);
    flex-wrap: wrap;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    position: relative;
    z-index: 2;
    pointer-events: none;
    max-width: 100%;
    box-sizing: border-box;
    width: 100%;
}

.footer-content-box:hover .contact-details,
footer:hover .contact-details {
    opacity: 1;
    max-height: 500px;
    pointer-events: auto;
}

.contact-link {
    color: black;
    text-decoration: none;
    /* Fluid font size: scales down when screen is square (vw ≈ vh) */
    font-size: clamp(14px, min(1.4vw + 0.8vh, 2.4vh, 1.4vh + 0.8vw), 26px);
    font-weight: 400;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid black;
    background-color: #b0c3ca7a;
    padding: clamp(6px, min(0.8vw + 0.3vh, 1.1vh, 0.8vh + 0.3vw), 12px) clamp(12px, min(1.5vw + 0.5vh, 2.1vh, 1.5vh + 0.5vw), 22px);
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.contact-link:hover {
    color: black;
    background-color: #b0c3ca;
}

/* Responsive Design */
@media (min-width: 851px) {
    .logo-canvas {
        display: block !important;
    }
    
    .logo-desktop {
        display: none !important;
    }
    
    .logo-mobile {
        display: none !important;
    }
}

@media (max-width: 850px) {
    body {
        background-color: #b0c3ca;
    }

    header {
        padding: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 40px);
    }

    .logo-container {
        height: clamp(50px, 5.5vw, 70px);
    }

    .logo-canvas {
        display: none !important;
    }

    .logo-desktop {
        display: none !important;
    }

    .logo-mobile {
        display: block !important;
    }

    /* Hide regular Instagram and Facebook links on mobile - they're in the dropdown */
    .instagram-link,
    .facebook-link {
        display: none !important;
    }

    /* Show social links in dropdown on mobile */
    .dropdown-social-links {
        display: flex !important;
    }

    .nyheter-dropdown-content {
        min-width: 220px;
        right: 0 !important;
        padding: clamp(8px, 1vw, 12px) 0;
    }

    .dropdown-social-links {
        padding: clamp(12px, 1.5vw, 16px) 0 0 0;
        gap: clamp(16px, 2vw, 20px);
    }

    .dropdown-instagram-logo,
    .dropdown-facebook-logo {
        height: clamp(32px, 4vw, 40px);
        width: auto;
    }

    .nyheter-dropdown-item {
        font-size: clamp(16px, 2vw, 20px);
        padding: clamp(16px, 2vw, 20px) clamp(20px, 2.5vw, 24px);
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    /* Hide text and show hamburger menu on mobile */
    .nyheter-text {
        display: none;
    }

    .hamburger-menu {
        display: flex;
    }

    .nyheter-link {
        padding: clamp(6px, 0.8vw, 8px) clamp(8px, 1vw, 10px);
        border: 1px solid black;
        border-radius: 2px;
    }

    /* Disable all hover effects on mobile - use click/touch instead */
    .nyheter-link:hover {
        background-color: transparent;
        color: black;
    }

    .nyheter-link:active,
    .nyheter-dropdown.active .nyheter-link {
        background-color: #b0c3ca;
        color: black;
    }

    .nyheter-dropdown-item:hover {
        background-color: transparent;
        color: black;
    }

    .instagram-link:hover::before,
    .facebook-link:hover::before {
        background-color: transparent;
    }

    .footer-text:hover {
        background-color: transparent !important;
        color: black !important;
        border: 1px solid black !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    /* Change background when footer-content-box is active (clicked) */
    .footer-content-box.active .footer-text {
        background-color: #b0c3ca !important;
        color: black !important;
        border: 1px solid black !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .footer-content-box:hover .contact-details,
    footer:hover .contact-details {
        opacity: 0 !important;
        max-height: 0 !important;
        pointer-events: none !important;
    }

    /* Show contact-details on click in mobile */
    .footer-content-box.active .contact-details {
        opacity: 1 !important;
        max-height: 500px !important;
        pointer-events: auto !important;
    }

    /* Add background fill to footer-content-box when active on mobile (same as desktop hover effect) */
    .footer-content-box.active {
        position: relative;
    }

    /* Use pseudo-element for background so it doesn't affect contact-details */
    .footer-content-box.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.039);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 4px;
        z-index: 0;
        /* Only cover the box content, not the contact-details */
        height: auto;
        min-height: fit-content;
    }

    /* Ensure content is above the background */
    .footer-content-box.active .in-between,
    .footer-content-box.active .footer-text {
        position: relative;
        z-index: 1;
    }

    /* Ensure contact-details are positioned correctly and maintain their own backgrounds */
    .footer-content-box.active .contact-details {
        background: transparent !important;
        position: relative;
        z-index: 1;
        /* Ensure contact-details don't inherit the backdrop-filter */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Contact links should keep their own button backgrounds */
    .footer-content-box.active .contact-link {
        background-color: #b0c3ca7a !important;
        /* Ensure buttons are above the parent background */
        position: relative;
        z-index: 2;
    }

    .contact-link:hover {
        background-color: #b0c3ca7a !important;
        color: black !important;
    }

    footer:hover::before {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    main {
        padding-bottom: 70px;
    }

    .video-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    /* Initial position for JS-driven pan on mobile (kept in sync with JS) */
    .background-video {
        object-position: 60% center;
    }

    .slogan-overlay {
        top: 45%;
        transform: translate(-50%, -50%);
        padding: clamp(12px, 2vw, 20px);
        max-width: 98vw;
        width: 98vw;
        /* Ensure it doesn't overlap footer on mobile */
        max-height: calc(45vh - 120px);
    }

    .slogan-overlay h1 {
        font-size: clamp(3rem, 6vw + 2vh, 6.5rem);
        letter-spacing: clamp(0.5px, 0.1vw + 0.05vh, 1px);
    }

    footer {
        padding: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 40px);
    }

}

/* Landscape orientation on mobile: two-column layout for contact links */
@media (max-width: 850px) and (orientation: landscape) {
    .logo-container {
        height: clamp(40px, 5vw, 50px) !important;
    }

    .slogan-overlay {
        top: 25% !important;
        transform: translate(-50%, -50%) !important;
        padding: clamp(8px, 2vw, 12px) !important;
    }

    .slogan-overlay h1 {
        font-size: clamp(2.5rem, 5vw + 1.5vh, 4.5rem);
    }


}

@media (max-width: 540px) {
    main {
        padding-bottom: 60px;
    }

    .slogan-overlay {
        top: 45%;
        transform: translate(-50%, -50%);
    }

    .slogan-overlay h1 {
        font-size: clamp(2.5rem, 5.5vw + 1.8vh, 5rem);
    }
}

/* Short screens - adjust position */
@media (max-width: 850px) and (max-height: 667px) {
    .slogan-overlay {
        top: 40%;
        transform: translate(-50%, -50%);
        padding: clamp(10px, 1.5vw, 15px);
    }

    .slogan-overlay h1 {
        font-size: clamp(2.5rem, 5vw + 1.5vh, 4.5rem);
    }
}

/* Ensure minimum margin between slogan and footer - handled via positioning constraints */

