/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --bg-hover: #1a1a1a;
    --text: #e8e8e8;
    --text-muted: #888;
    --accent: #c9a87c;
    --accent-glow: rgba(201, 168, 124, 0.15);
    --border: #222;
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1400px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.logo img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color var(--transition);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 6rem 2rem 4rem;
    background: linear-gradient(180deg, rgba(201, 168, 124, 0.06) 0%, transparent 100%);
}

.hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ===== Project Grid (Home) ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.project-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
}

.card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .card-image img {
    transform: scale(1.05);
}

.card-info {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-info h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Gallery Header ===== */
.gallery-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: color var(--transition);
}

.back-link:hover { color: var(--accent); }

.gallery-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.image-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Gallery Grid ===== */
.gallery-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem 4rem;
    columns: 3;
    column-gap: 1rem;
}

.gallery-grid.icons-grid {
    columns: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: var(--bg-card);
    border: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(201, 168, 124, 0.1);
}

.gallery-item img {
    width: 100%;
    height: auto;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

.icons-grid .gallery-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-card);
}

.icons-grid .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    padding: 2rem;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2rem;
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition);
    line-height: 1;
}

.lightbox-close:hover { opacity: 1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ===== Contact ===== */
.contact-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.contact-page h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.contact-intro {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.submit-btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    align-self: flex-start;
}

.submit-btn:hover:not(:disabled) {
    background: #d4b68a;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.success-message {
    color: #6bc46b;
    font-size: 0.9rem;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ===== Not Found ===== */
.not-found {
    text-align: center;
    padding: 6rem 2rem;
}

.not-found h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.not-found a {
    color: var(--accent);
    font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .site-header { padding: 0.75rem 1rem; }

    .hamburger { display: flex; }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        padding: 1rem 2rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
    }

    nav.open { display: flex; }

    .hero { padding: 4rem 1.5rem 3rem; }

    .project-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem 3rem;
    }

    .gallery-grid {
        columns: 2;
        padding: 0 1rem 3rem;
    }

    .gallery-grid.icons-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .gallery-header { padding: 2rem 1rem 1rem; }

    .contact-page { padding: 3rem 1rem; }
}

@media (max-width: 480px) {
    .gallery-grid { columns: 1; }

    .gallery-grid.icons-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ===== Fade-in animation for gallery items ===== */
.gallery-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }
.gallery-item:nth-child(n+11) { animation-delay: 0.55s; }
