/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-black: #000000;
    --bg-dark: #111111;
    --bg-gray: #222222;
    --text-white: #ffffff;
    --text-light: #cccccc;
    --text-muted: #888888;
    --border: #333333;
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    --container-width: 1400px;
    --column-gap: 24px;
    --column-count: 1;
}

/* Base styles */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background-color: var(--bg-black);
    color: var(--text-white);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 500;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Header */
.header {
    padding: 4rem 0 3rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 3rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Masonry grid */
.main {
    padding-bottom: 6rem;
}

.grid {
    column-count: var(--column-count);
    column-gap: var(--column-gap);
    break-inside: avoid;
}

.grid-item {
    break-inside: avoid;
    margin-bottom: var(--column-gap);
}

.image-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.image-container:hover {
    border-color: var(--text-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.project-image {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

/* Caption */
.caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5), transparent);
    color: var(--text-white);
    transform: translateY(10px);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}
/* Caption details with icons */
.caption-details {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}
.caption-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    color: var(--text-light);
}
.caption-item:last-child {
    margin-bottom: 0;
}

/* Ensure caption has enough vertical space */
.caption {
    padding-bottom: 1.5rem;
}


/* Desktop: hover reveals caption */
@media (hover: hover) and (pointer: fine) {
    .image-container:hover .caption {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile: caption initially hidden, shown via JS toggle */
.mobile .caption {
    opacity: 0;
    transform: translateY(10px);
}

.mobile .caption.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Always show caption on mobile when grid item has "show-caption" class */
.grid-item.show-caption .caption {
    opacity: 1;
    transform: translateY(0);
}

/* Contact link */
.contact-link {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contact-link:hover {
    background-color: var(--bg-gray);
    border-color: var(--text-light);
}

/* Responsive columns */
@media (min-width: 768px) {
    :root {
        --column-count: 2;
    }
    h1 {
        font-size: 3rem;
    }
    .header {
        padding: 5rem 0 4rem;
    }
}

@media (min-width: 1024px) {
    :root {
        --column-count: 3;
    }
    h1 {
        font-size: 3.5rem;
    }
    .header {
        padding: 6rem 0 5rem;
    }
    .container {
        padding: 0 40px;
    }
}

/* Large screens */
@media (min-width: 1400px) {
    :root {
        --column-count: 4;
    }
}

/* Lightbox overlay (optional future enhancement) */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.overlay.active {
    display: flex;
}

.overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

/* Footer (minimal) */
.footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}