:root {
    --bg-color: #000;
    --text-color: #fff;
    --accent-color: #888;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --font-main: 'Roboto', sans-serif;
    --font-heading: 'Roboto', sans-serif;
    --max-width: 1400px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
}

body.no-scroll {
    overflow: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: none;
}

p,
a,
span,
li {
    text-transform: none;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 60px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: var(--max-width);
    z-index: 2000;
    background: transparent;
    transition: padding 0.3s ease;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background: #000000;
    z-index: -1;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

header.scrolled::before {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

header.scrolled {
    padding: 15px 60px;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-family: var(--font-heading);
    color: white;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2001;
    margin-top: 5px;
}

.custom-hamburger-icon {
    width: 28px;
    height: auto;
    display: block;
    transition: var(--transition-smooth);
}

.hamburger.open .custom-hamburger-icon {
    opacity: 0.6;
}

.nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center horizontally and vertically */
    padding: 60px;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s 0.8s;
    z-index: 1999;
}

.nav-links.active {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s;
}

.nav-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: clamp(28px, 5vw, 42px);
    /* Slightly increased */
    font-weight: 700;
    font-family: var(--font-heading);
    transition: var(--transition-smooth);
    opacity: 0.3;
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: #fff;
    transition: var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-links a:hover {
    opacity: 1;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-footer {
    display: flex;
    gap: 25px;
    margin-top: 40px;
    /* Space below Home/About/Contact */
}

.nav-footer a {
    color: white;
    opacity: 0.5;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
}

.nav-footer a:hover {
    opacity: 1;
}

.nav-footer i {
    font-size: 20px;
}

/* Hero */
.hero {
    min-height: auto;
    padding: 120px 60px 40px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.hero h1 {
    font-size: 32px;
    line-height: 1.1;
    max-width: 800px;
}

.keep-together {
    white-space: nowrap;
    display: inline-block;
}

/* Filter Nav */
.filter-nav {
    margin-bottom: 5px;
}

.filter-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.filter-nav li {
    font-size: 13px;
    cursor: pointer;
    color: var(--accent-color);
    text-transform: uppercase;
    transition: var(--transition-smooth);
    position: relative;
    padding-bottom: 4px;
}

.filter-nav li.active,
.filter-nav li:hover {
    color: white;
}

.filter-nav li::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #fff;
    transition: var(--transition-smooth);
}

.filter-nav li.active::after {
    width: 100%;
}

/* Portfolio Grid */
.portfolio-container {
    padding: 0 60px 40px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(100px, auto);
    grid-auto-flow: dense;
    gap: 15px;
    transition: opacity 0.3s ease;
}

.portfolio-grid.loading-projects {
    opacity: 0;
    pointer-events: none;
}

.grid-item {
    position: relative;
    overflow: hidden;
    background: #111;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    aspect-ratio: 1 / 1;
}

.grid-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.grid-item>a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #111;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition-smooth);
}

.grid-item:hover img {
    transform: scale(1.05);
}

.grid-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.grid-item.small {
    grid-column: span 1;
    grid-row: span 1;
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    opacity: 0;
    transition: var(--transition-smooth);
    pointer-events: none;
}

.grid-item:hover .overlay {
    opacity: 1;
}

.overlay span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
}

/* Project Navigation */
/* Project Navigation */
.project-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    padding: 60px 60px;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
}

.project-navigation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 60px;
    right: 60px;
    height: 1px;
    background-color: #eaeaea;
}

.nav-btn {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: #444;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-prev {
    justify-self: start;
}

.nav-home {
    justify-self: center;
    color: #000;
}

.nav-next {
    justify-self: end;
}

.nav-btn:hover {
    color: #000;
}

.nav-label,
.nav-text {
    position: relative;
    display: inline-block;
    width: fit-content;
}

.nav-label::after,
.nav-text::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 50%;
    background-color: #000;
    transition: width 0.3s ease;
    transform: translateX(-50%);
}

.nav-btn:hover .nav-label::after,
.nav-btn:hover .nav-text::after {
    width: 100%;
}

.nav-thumb {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: opacity 0.3s;
}

.nav-btn:hover .nav-thumb {
    opacity: 0.7;
}

.nav-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-prev .nav-info {
    align-items: flex-start;
    text-align: left;
}

.nav-next .nav-info {
    align-items: flex-end;
    text-align: right;
}

.nav-label {
    font-size: 16px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #000;
}

.nav-title {
    font-size: 12px;
    font-weight: 400;
    font-family: var(--font-main);
    color: #888;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 2px;
}

/* Footer */
.site-footer {
    background-color: #000;
    width: 100%;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 60px;
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    /* required for absolute centering */
}

.footer-contact {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.footer-contact a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-family: var(--font-heading);
    position: relative;
    padding-bottom: 2px;
}

.footer-contact a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: #fff;
    transform-origin: bottom right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-contact a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.footer-socials {
    display: flex;
    gap: 20px;
}

.footer-socials a {
    color: #fff;
    font-size: 18px;
    transition: color 0.3s;
}

.footer-socials a:hover {
    color: #888;
}

.footer-copy {
    font-size: 12px;
    color: #fff;
}

@media (max-width: 1100px) {

    header,
    .portfolio-container,
    .project-navigation,
    .footer-inner {
        padding: 30px;
    }

    .project-navigation::before {
        left: 30px;
        right: 30px;
    }

    .hero {
        padding: 120px 30px 40px;
    }

    .hero-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .filter-nav {
        margin-bottom: 0;
        width: 100%;
    }

    .filter-nav ul {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .portfolio-grid {
        gap: 8px;
    }

    .overlay {
        padding: 12px 10px;
        /* Slightly better padding for text breathing room */
    }

    .overlay span {
        font-size: 11px;
        /* Slightly increased font on mobile */
        line-height: 1.1;
        /* Tightened line height for multi-line text */
        display: block;
    }

    .nav-thumb {
        gap: 8px;
    }

    .nav-thumb img {
        width: 40px;
        height: 40px;
    }

    .nav-label {
        font-size: 13px;
    }

    .nav-home {
        font-size: 13px;
    }

    .nav-title {
        font-size: 11px;
        white-space: normal;
        line-height: 1.2;
        max-width: 80px;
    }

    header {
        padding: 20px;
    }

    .portfolio-container,
    .project-navigation,
    .footer-inner {
        padding: 20px;
    }

    .project-navigation::before {
        left: 20px;
        right: 20px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-contact {
        position: relative;
        left: auto;
        transform: none;
        order: -1;
        /* Move email above copyright */
    }
}

/* --- ADMIN PANEL STYLES --- */
.admin-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #1d1d1b;
}

.login-container {
    background-color: rgba(178, 178, 178, 0.8);
    /* 3rd gray color at 80% opacity */
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    color: #1d1d1b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.login-container h2 {
    margin-bottom: 30px;
    font-size: 24px;
    text-align: center;
}

.login-container .input-group {
    margin-bottom: 20px;
}

.login-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.login-container input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(29, 29, 27, 0.2);
    border-radius: 4px;
    background: transparent;
    color: #1d1d1b;
    font-family: inherit;
    font-size: 16px;
}

.login-container input:focus {
    outline: none;
    border-color: #1d1d1b;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background-color: #1d1d1b;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: inherit;
    font-weight: 500;
}

.login-btn:hover {
    background-color: #333;
}

.error-msg {
    color: #c0392b;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    min-height: 20px;
}

/* --- CMS TABS & LIST --- */
.cms-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.cms-tab-btn {
    background: transparent;
    border: 1px solid #1d1d1b;
    color: #1d1d1b;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s;
}

.cms-tab-btn.active {
    background: #1d1d1b;
    color: #f0f0f0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

/* custom scrollbar for project list */
.project-list::-webkit-scrollbar {
    width: 6px;
}

.project-list::-webkit-scrollbar-thumb {
    background: rgba(29, 29, 27, 0.3);
    border-radius: 4px;
}

.project-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 4px;
    cursor: grab;
    transition: transform 0.2s, background-color 0.2s;
}

.project-list-item:active {
    cursor: grabbing;
}

.project-list-item:hover {
    background: rgba(255, 255, 255, 0.6);
}

.project-list-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.project-list-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-list-title {
    font-weight: 600;
    font-size: 14px;
}

.project-list-cat {
    font-size: 12px;
    opacity: 0.7;
}

.edit-btn {
    background: #1d1d1b;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* Staging Area Styles */
.staging-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.staged-item {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    gap: 15px;
}

.staged-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f0f0f0;
    border-radius: 4px;
}

.staged-controls {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.staged-controls select {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.reorder-btns {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reorder-btns button {
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-staged-btn {
    background: #c0392b;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* 12-Column Grid Layout */
.detail-css-grid {
    display: grid !important;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.layout-col-1 {
    grid-column: span 12;
    width: 100%;
}

.layout-col-2 {
    grid-column: span 6;
    width: 100%;
}

.layout-col-3 {
    grid-column: span 4;
    width: 100%;
}

.layout-col-4 {
    grid-column: span 3;
    width: 100%;
}

@media (max-width: 768px) {
    .detail-css-grid {
        grid-template-columns: 1fr;
    }

    .layout-col-4 {
        grid-column: span 1 !important;
    }
}

/* --- CONTACT PAGE STYLES --- */
.contact-page-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.contact-page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 180px 60px 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    width: 100%;
}

.contact-hero-email {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 60px;
    text-align: center;
    position: relative;
}

.contact-hero-email a {
    color: #000;
    text-decoration: none;
    position: relative;
    padding-bottom: 5px;
}

.contact-hero-email a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 3px;
    bottom: 0;
    left: 0;
    background-color: #000;
    transform-origin: bottom right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-hero-email a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.contact-form-wrapper {
    width: 100%;
    max-width: 800px;
    text-align: center;
    margin-bottom: 80px;
}

.form-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #000;
}

.form-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 40px;
}

.custom-contact-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.custom-contact-form .input-group {
    width: 100%;
}

.custom-contact-form input,
.custom-contact-form textarea {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: #000;
    outline: none;
    transition: border-color 0.3s;
    resize: none;
}

.custom-contact-form input::placeholder,
.custom-contact-form textarea::placeholder {
    color: #666;
    font-size: 14px;
}

.custom-contact-form input:focus,
.custom-contact-form textarea:focus {
    border-bottom-color: #000;
}

.custom-contact-form .submit-btn {
    align-self: flex-start;
    background: transparent;
    border: 1px solid #000;
    padding: 12px 30px;
    font-size: 14px;
    font-family: inherit;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.custom-contact-form .submit-btn:hover {
    background: #000;
    color: #fff;
}

@media (max-width: 768px) {
    .contact-page-container {
        padding: 120px 20px 60px;
    }
}