/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --marble-white: #faf9f7;
    --marble-cream: #f5f3f0;
    --marble-gray: #e8e6e3;
    --marble-dark: #d4d2cf;
    --text-primary: #2d2d2d;
    --text-secondary: #6b6b6b;
    --gold-accent: #b8956a;
    --shadow: rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: var(--marble-cream);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--marble-dark);
}

.site-title {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: 0.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.middot-decoration {
    opacity: 0.4;
}

.middot-link {
    color: inherit;
    text-decoration: none;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.middot-link:visited {
    color: inherit;
    opacity: 0.4;
}

.middot-link:hover {
    opacity: 0.8;
}

.site-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
}

/* Gallery Grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-bottom: 5rem;
}

/* Cards */
.card {
    background-color: var(--marble-white);
    border: 1px solid var(--marble-gray);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
    border-color: var(--gold-accent);
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: var(--marble-gray);
    overflow: hidden;
    position: relative;
}

.card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(248, 247, 244, 0.15) 0%,
        rgba(232, 230, 227, 0.25) 100%
    );
    z-index: 3;
    pointer-events: none;
}

.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--marble-cream);
    mix-blend-mode: color;
    opacity: 0.3;
    z-index: 2;
    pointer-events: none;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
    filter: grayscale(15%) brightness(1.05) contrast(0.95);
    transition: filter 0.3s ease;
}

.card:hover .card-image img {
    filter: grayscale(5%) brightness(1.1) contrast(1);
}

.card-content {
    padding: 1.5rem;
    text-align: center;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.05rem;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--marble-dark);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.footer-link:hover {
    opacity: 1;
}

/* Project Detail Page */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--gold-accent);
}

.hero-image {
    width: 100%;
    aspect-ratio: 21 / 9;
    background-color: var(--marble-gray);
    margin-bottom: 3rem;
    overflow: hidden;
    border: 1px solid var(--marble-dark);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    filter: grayscale(12%) brightness(1.08) contrast(0.95) saturate(0.9);
}

.hero-image img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(250, 249, 247, 0.1) 0%,
        rgba(245, 243, 240, 0.2) 100%
    );
    pointer-events: none;
}

/* Contain mode for specific heroes (no crop) */
.hero-image-contain {
    background-color: var(--marble-gray);
}

.hero-image-contain img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Cover mode for specific heroes (crop to fill) */
.hero-image-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Wrapper for overlay on contain images */
.hero-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(250, 249, 247, 0.1) 0%,
        rgba(245, 243, 240, 0.2) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--marble-cream);
    mix-blend-mode: color;
    opacity: 0.25;
    pointer-events: none;
    z-index: 1;
}

.detail-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--marble-dark);
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.3rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.detail-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.15rem;
}

.detail-description {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.detail-link {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--marble-white);
    border: 2px solid var(--gold-accent);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-align: center;
}

.detail-link:hover {
    background-color: var(--gold-accent);
    color: var(--marble-white);
}

.detail-cta {
    text-align: center;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem;
    }

    .site-title {
        font-size: 2.5rem;
        letter-spacing: 0.3rem;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .detail-title {
        font-size: 2rem;
        letter-spacing: 0.2rem;
    }

    header {
        margin-bottom: 3rem;
    }
}
