/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    overflow: hidden; /* Prevents whole-page scrolling and disables the body scrollbar */
}

body.no-scroll {
    overflow: hidden !important;
}

/* ==========================================
   BACKGROUND SLIDER
   ========================================== */
.background-slider {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #ffffff;
}

.background-slider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.20);
    z-index: 3;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    transition: opacity 2s cubic-bezier(0.42, 0, 0.58, 1);
    will-change: opacity;
}

#bg-active { z-index: 2; opacity: 1; }
#bg-next { z-index: 1; opacity: 1; }

/* ==========================================
   MAIN CARD & TYPOGRAPHY
   ========================================== */
.content {
    position: relative;
    z-index: 4;
    width: 100%;
    max-width: 450px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.03);
    padding: 40px 30px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);

    /* Prevents layer detachment on mobile scroll */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    isolation: isolate;

    /* Hide internal scrollbars for seamless appearance */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content::-webkit-scrollbar {
    display: none;
}

h1 {
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: 0.7rem;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.3rem;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

/* ==========================================
   NAVIGATION & LINKS
   ========================================== */
.main-navigation {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 0;
    text-align: center;
}

.nav-item:last-child {
    border-bottom: none; 
}

.nav-link {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    display: block;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.85;
}

.nav-link:hover {
    letter-spacing: 0.20rem;
    color: #ffffff;
    opacity: 1;
}

.menu-social {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
}

.social-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    background: transparent;
    padding: 6px;
    opacity: 0.75;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.social-link:hover {
    opacity: 1;
    transform: scale(1.15);
}

.social-link svg {
    stroke: #ffffff;
    display: block;
}

/* ==========================================
   DYNAMIC PANELS & SERVICES
   ========================================== */
.view-panel {
    width: 100%;
    animation: fadeInView 0.4s ease-out both;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.services-content {
    text-align: center;
    color: #ffffff;
    padding: 10px 5px 0 5px;
}

.services-intro {
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    letter-spacing: 0.05rem;
}

.services-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.services-list li {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.1rem;
    color: #ffffff;
    text-transform: uppercase;
}

.back-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 4px;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 10px;
}

.back-link:hover {
    color: #ffffff;
    border-bottom-color: #ffffff;
    letter-spacing: 0.2rem;
}

/* ==========================================
   CONTACT FORM & INPUTS
   ========================================== */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 1.5rem;
    margin-top: 10px;
}

form[aria-hidden="true"] {
    display: none;
}

.field-group {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

input, textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.12);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    opacity: 1;
}

textarea {
    resize: none;
    height: 100px;
}

span[data-fs-error] {
    font-size: 0.8rem;
    color: #ff4a4a;
    letter-spacing: 0.05rem;
    padding-left: 2px;
}

button {
    padding: 14px;
    background: #ffffff;
    color: #121212;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.3s ease;
    margin-top: 5px;
}

button:hover {
    opacity: 0.9;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-msg {
    font-size: 0.95rem;
    letter-spacing: 0.05rem;
    font-weight: 400;
    line-height: 1.6;
}

div[data-fs-success] {
    color: #ffffff;
    margin-bottom: 1.5rem;
}

div[data-fs-error]:not(:empty) {
    color: #ff4a4a;
    margin-bottom: 1.5rem;
    background: rgba(255, 74, 74, 0.1);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 74, 74, 0.2);
}

/* ==========================================
   PORTFOLIO OVERLAY & GALLERY
   ========================================== */
.portfolio-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(10, 10, 10, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
    scroll-behavior: smooth;
}

.portfolio-overlay.active {
    opacity: 1;
    visibility: visible;
}

.portfolio-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.15s ease, visibility 0.15s ease, background 0.3s ease, transform 0.3s ease;
    outline: none;
    padding: 0;
    margin: 0;
}

.portfolio-overlay.active ~ .portfolio-close-btn,
.portfolio-overlay.active .portfolio-close-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.portfolio-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.08) rotate(90deg);
}

.portfolio-close-btn svg {
    stroke: #ffffff;
    transition: transform 0.2s ease;
}

.portfolio-content {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 60px 24px 80px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInView 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.portfolio-header {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

.portfolio-gallery {
    display: flex;
    flex-direction: column;
    gap: 36px;
    width: 100%;
    align-items: center;
}

.portfolio-item {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease;
}

.project-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.65),
        rgba(0, 0, 0, 0)
    );
    z-index: 2;
    box-sizing: border-box;
}

.project-name {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.project-separator {
    margin: 0 8px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.project-client {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.65);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.portfolio-item:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-item:hover img {
    transform: scale(1.015);
}

.portfolio-footer {
    margin-top: 50px;
    text-align: center;
}

.portfolio-instagram-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.12rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    padding-bottom: 6px;
    transition: all 0.3s ease;
}

.portfolio-instagram-link:hover {
    color: #ffffff;
    border-bottom-color: #ffffff;
    letter-spacing: 0.18rem;
}

.portfolio-overlay::-webkit-scrollbar {
    width: 8px;
}

.portfolio-overlay::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.portfolio-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.portfolio-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ==========================================
   STATIC BRAND LOGO
   ========================================== */
.logo-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.8rem;
}

.logo-container a {
    display: inline-block;
    line-height: 0;
}

.brand-logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* ==========================================
   RESPONSIVE DESIGN (MOBILE OVERRIDES)
   ========================================== */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .content {
        max-height: calc(100dvh - 32px);
        padding: 30px 20px;
    }

    .portfolio-content {
        padding: 50px 16px 40px 16px;
        min-height: 100%;
    }

    .portfolio-close-btn {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }

    .portfolio-gallery {
        gap: 22px;
    }

    .portfolio-item {
        border-radius: 6px;
    }

    .portfolio-footer {
        margin-top: 25px;
        padding-bottom: 10px;
    }

    .brand-logo {
        max-width: 160px;
    }
}
