/* --- Professional Portfolio Page Styles --- */

:root {
    --primary-color: #c9a227;
    --secondary-color: #1a1a1a;
    --light-bg: #f7f7f7;
    --text-color: #555;
    --heading-font: 'Playfair Display', serif;
    --body-font: 'Poppins', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    overflow-x: hidden;
}

.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--heading-font);
    font-weight: 700;
    line-height: 1.2;
    color: var(--secondary-color);
}

h1 { font-size: clamp(2.5rem, 5vw, 4.8rem); }
h2 { font-size: clamp(2rem, 4vw, 3.3rem); }
h3 { font-size: 1.75rem; }

p { margin-bottom: 1rem; }

/* --- Header & Navigation --- */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    padding: 0 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
    max-width: 1380px;
    margin: 0 auto;
    gap: 24px;
}

.nav-logo {
    color: var(--secondary-color);
    font-family: var(--heading-font);
    font-size: 1.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.nav-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 14px;
    padding: 6px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15,23,42,0.12);
}

.nav-logo span {
    position: relative;
    display: inline-block;
}

.nav-logo span::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transform: scaleX(0.35);
    transform-origin: left center;
    animation: brandPulse 2.8s ease-in-out infinite;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-item {
    margin-left: 2.2rem;
}

.nav-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-family: var(--body-font);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-action-link {
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff !important;
    box-shadow: 0 12px 24px rgba(201,162,39,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-action-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(201,162,39,0.28);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--secondary-color);
}

/* --- Page Hero Section --- */
.page-hero {
    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
    padding: 120px 1.5rem 60px;
}

.page-hero-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: -2;
    transform: scale(1.03);
}

.page-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.55));
    z-index: -1;
}

.page-hero-content {
    max-width: 980px;
    margin: 0 auto;
}

.page-hero-content h1 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.1;
}

.page-hero-content p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #f0f0f0;
    max-width: 780px;
    margin: 0 auto;
}

/* --- Sections --- */
.section-padding {
    padding: 6rem 0;
}

.bg-light {
    background: linear-gradient(180deg, #ffffff 0%, #faf8f2 100%);
}

/* --- Section Header --- */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header .subheading {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin-bottom: 1rem;
}

/* --- Filter Buttons --- */
#portfolio-filters,
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 0.9rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.4rem;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    color: var(--secondary-color);
    border-radius: 999px;
    font-family: var(--body-font);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(15,23,42,0.05);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(201,162,39,0.22);
}

/* --- Portfolio Grid --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    align-items: stretch;
}

.portfolio-item {
    grid-column: span 6;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    min-height: 420px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    isolation: isolate;
    transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.35s ease;
}

.portfolio-item:nth-child(3n + 1) {
    grid-column: span 7;
}

.portfolio-item:nth-child(3n + 2) {
    grid-column: span 5;
}

.portfolio-item:nth-child(3n + 3) {
    grid-column: span 6;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.14);
}

.portfolio-item::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.14);
    pointer-events: none;
}

/* media wrapper works with your current JS and future JS changes */
.portfolio-media {
    width: 100%;
    height: 100%;
    position: relative;
}

.portfolio-item img,
.portfolio-item video,
.portfolio-media img,
.portfolio-media video {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
    display: block;
    transition: transform 0.7s ease, filter 0.7s ease;
    background: #eee;
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12,12,12,0.90) 10%, rgba(12,12,12,0.28) 55%, rgba(12,12,12,0.06) 100%);
    color: #fff;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    opacity: 1;
    padding: 2rem;
    transition: background 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
    background: linear-gradient(to top, rgba(12,12,12,0.94) 15%, rgba(12,12,12,0.34) 58%, rgba(12,12,12,0.08) 100%);
}

.portfolio-item:hover img,
.portfolio-item:hover video,
.portfolio-item:hover .portfolio-media img,
.portfolio-item:hover .portfolio-media video {
    transform: scale(1.06);
    filter: brightness(0.78);
}

.overlay-content {
    width: 100%;
    max-width: 520px;
    text-align: left;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.overlay-content h3 {
    color: #fff;
    font-size: clamp(1.4rem, 2vw, 2rem);
    margin-bottom: 0.2rem;
}

.overlay-content span {
    font-family: var(--body-font);
    font-size: 0.95rem;
    color: #e6e6e6;
    display: block;
    margin-bottom: 0.35rem;
}

.portfolio-meta {
    font-size: 0.85rem;
    color: #d1d5db;
}

.portfolio-action {
    margin-top: 0.3rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.4px;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-action {
    transform: translateX(5px);
}

.view-project-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    background: var(--primary-color);
    border: none;
    color: #fff;
    border-radius: 999px;
    font-family: var(--body-font);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(201, 162, 39, 0.24);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.view-project-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(201, 162, 39, 0.3);
    background: #b8901f;
    color: #fff;
}

/* --- Footer --- */
.footer {
    background: var(--secondary-color);
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
}

/* --- Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Login Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid #888;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--secondary-color);
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

#login-form input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-family: var(--body-font);
    font-size: 1rem;
}

/* Brand loader */
.brand-preloader {
    backdrop-filter: blur(12px);
}

.brand-loader-shell {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px 30px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(247,247,247,0.92));
    box-shadow: 0 30px 80px rgba(15,23,42,0.12);
}

.brand-loader-mark {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(201,162,39,0.18), rgba(26,26,26,0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-loader-mark img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    animation: floatBrand 2.8s ease-in-out infinite;
}

.brand-loader-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand-loader-kicker {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.72rem;
    color: #7c6f52;
}

.brand-loader-copy strong {
    font-family: var(--heading-font);
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    color: var(--secondary-color);
    animation: brandGlow 2.4s ease-in-out infinite;
}

@keyframes brandPulse {
    0%,100% { transform: scaleX(0.35); opacity: 0.4; }
    50% { transform: scaleX(1); opacity: 1; }
}

@keyframes brandGlow {
    0%,100% {
        letter-spacing: 0.02em;
        transform: translateY(0);
        text-shadow: 0 0 0 rgba(201,162,39,0);
    }
    50% {
        letter-spacing: 0.06em;
        transform: translateY(-2px);
        text-shadow: 0 12px 30px rgba(201,162,39,0.22);
    }
}

@keyframes floatBrand {
    0%,100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-4px) scale(1.04); }
}

/* --- Shared smooth loading states --- */
#preloader {
    backdrop-filter: blur(6px);
}

#preloader.fade-out {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

.loader-spinner {
    box-shadow: 0 0 30px rgba(201, 162, 39, 0.18);
}

#main-page-wrapper {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#main-page-wrapper.loaded,
body.site-ready #main-page-wrapper {
    opacity: 1 !important;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .portfolio-item,
    .portfolio-item:nth-child(3n + 1),
    .portfolio-item:nth-child(3n + 2),
    .portfolio-item:nth-child(3n + 3) {
        grid-column: span 1;
        min-height: 360px;
    }

    .portfolio-item img,
    .portfolio-item video,
    .portfolio-media img,
    .portfolio-media video {
        min-height: 360px;
    }
}

@media (max-width: 768px) {
    .hamburger { display: block; }

    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 90px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active { left: 0; }
    .nav-item { margin: 1rem 0; }

    .container {
        padding: 0 1rem;
    }

    .page-hero {
        min-height: 62vh;
        padding: 110px 1rem 50px;
    }

    .page-hero-content h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .page-hero-content p {
        font-size: 1rem;
    }

    .section-padding {
        padding: 4rem 0;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .portfolio-item,
    .portfolio-item:nth-child(3n + 1),
    .portfolio-item:nth-child(3n + 2),
    .portfolio-item:nth-child(3n + 3) {
        grid-column: span 1;
        min-height: 300px;
        border-radius: 18px;
    }

    .portfolio-item img,
    .portfolio-item video,
    .portfolio-media img,
    .portfolio-media video {
        min-height: 300px;
    }

    .portfolio-overlay {
        padding: 1.25rem;
        opacity: 1 !important;
        background: linear-gradient(to top, rgba(0,0,0,0.86), rgba(0,0,0,0.18), transparent);
    }

    .overlay-content h3 {
        font-size: 1.25rem;
    }

    .overlay-content span {
        font-size: 0.88rem;
        margin-bottom: 0.4rem;
    }

    .view-project-btn {
        width: 100%;
        text-align: center;
        padding: 0.9rem 1.2rem;
    }

    .portfolio-item:active {
        transform: scale(0.98);
    }

    .nav-logo img {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .nav-logo {
        gap: 10px;
    }

    .brand-loader-shell {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
}