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

:root {
    --bg: #FDFCFB;
    --surface: #FFFFFF;
    --text-primary: #2A2A2A;
    --text-secondary: #8B8B8B;
    --text-tertiary: #B8B8B8;
    --border: #EBEBEB;
    --accent: #4A4A4A;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg);
    font-size: 14px;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

/* Logo Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 2rem 2.5rem;
    z-index: 100;
    background: transparent;
}

.logo {
    font-family: 'Crimson Pro', serif;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    background: #FDFCFB;
    padding: 0.5rem 1rem;
    display: inline-block;
}

/* Portfolio Grid */
.portfolio {
    padding: 7rem 2.5rem 4rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Filter Trigger */
.filter-trigger-container {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.filter-trigger {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.6rem 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-trigger:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Filter Panel */
.filter-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--surface);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.05);
}

.filter-panel.active {
    right: 0;
}

.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.filter-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.filter-panel-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-panel-header h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
}

.filter-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.3s ease;
}

.filter-close:hover {
    color: var(--text-primary);
}

.filter-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.filter-section {
    margin-bottom: 2.5rem;
}

.filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.filter-chip:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--text-primary);
    color: var(--surface);
    border-color: var(--text-primary);
}

.filter-panel-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
}

.filter-action-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
}

.filter-action-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.filter-action-btn.primary {
    background: var(--text-primary);
    color: var(--surface);
    border-color: var(--text-primary);
}

.filter-action-btn.primary:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    background: transparent;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* Project Cards */
.project-card {
    background: var(--surface);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    background: var(--bg);
}

.project-card:hover .project-image {
    opacity: 0.85;
}

.project-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
    transition: opacity 0.4s ease;
}

.project-info {
    padding: 1.5rem;
}

.project-title {
    font-family: 'Crimson Pro', serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.project-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.8;
    letter-spacing: 0.02em;
}

.project-details-item {
    display: flex;
    gap: 0.5rem;
    margin: 0.25rem 0;
}

.project-details-label {
    color: var(--text-tertiary);
    min-width: 60px;
}

.project-caption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background-color: var(--surface);
    margin: 3% auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

#modal-body {
    padding: 0;
}

.modal-layout {
    display: flex;
    gap: 3rem;
    min-height: 400px;
}

.modal-image-container {
    flex: 0 0 45%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
}

.modal-content-area {
    flex: 1;
    padding: 3rem 3rem 3rem 0;
    overflow-y: auto;
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-family: 'Crimson Pro', serif;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.modal-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 2;
    margin-bottom: 1.5rem;
}

.modal-details p {
    margin: 0.3rem 0;
    display: flex;
}

.modal-details strong {
    min-width: 80px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.modal-caption {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.modal-notes {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.modal-links {
    display: flex;
    gap: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.modal-links a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2px;
}

.modal-links a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

/* Footer */
.site-footer {
    padding: 3rem 2.5rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.footer-separator {
    color: var(--text-tertiary);
}

.instagram-link,
.footer-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.instagram-link:hover,
.footer-link:hover {
    color: var(--text-primary);
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 600px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cookie-consent.show {
    opacity: 1;
    pointer-events: all;
}

.cookie-consent p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.cookie-consent a {
    color: var(--text-primary);
    text-decoration: underline;
}

.cookie-btn {
    background: var(--text-primary);
    color: var(--surface);
    border: none;
    padding: 0.6rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.3s ease;
}

.cookie-btn:hover {
    background: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .site-header {
        padding: 1.5rem;
    }
    
    .portfolio {
        padding: 5rem 1rem 3rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .project-info {
        padding: 1rem;
    }
    
    .filter-panel {
        width: 100%;
        right: -100%;
    }
    
    .modal-layout {
        flex-direction: column;
        gap: 0;
    }
    
    .modal-image-container {
        padding: 2rem 2rem 1rem;
    }
    
    .modal-content-area {
        padding: 1rem 2rem 2rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .cookie-consent {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .cookie-btn {
        width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1201px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
