/* ============================================
   Custom Portfolio — overrides Quark 2 defaults
   ============================================ */

:root {
    --bg: #000000;
    --bg-card: #0a0a0a;
    --bg-hover: #111111;
    --text: #e8e4df;
    --text-muted: #8a8580;
    --accent: #c9a96e;
    --accent-hover: #dfc08a;
    --border: #2a2a2a;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --max-width: 1400px;
    --nav-height: 72px;
}

/* ---- Force dark theme ---- */
[data-theme="light"],
[data-theme="dark"],
html {
    background: var(--bg) !important;
    color: var(--text) !important;
}

/* ---- Strip Quark 2 defaults that conflict ---- */
#page-wrapper > header,
#page-wrapper > footer,
#start > .section > .container > .content-item,
#start > .section > .container .content-title {
    display: none;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover { color: var(--accent-hover); }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---- Gallery ---- */
.gallery-section {
    padding: 6rem clamp(24px, 5vw, 64px);
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    cursor: pointer;
    aspect-ratio: 1 / 1;
    border-radius: 2px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

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

.gallery-index {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.1em;
}

/* ---- Lightbox ---- */
html.lightbox-open {
    overflow: hidden !important;
}
html.lightbox-open body {
    overflow: hidden !important;
    touch-action: none;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

.lightbox.active {
    visibility: visible;
    opacity: 1;
}

.lightbox-close {
    position: fixed;
    top: env(safe-area-inset-top, 16px);
    right: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    opacity: 0.7;
    padding: 8px 12px;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-img {
    max-width: 92vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 2px;
}

/* ---- About ---- */
.about-section {
    padding: 6rem clamp(24px, 5vw, 64px);
    border-top: 1px solid var(--border);
}

.about-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text .section-title {
    text-align: left;
    margin-bottom: 1.5rem;
}

.about-body {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}
.about-body p { margin-bottom: 1rem; }

.about-cta {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
    padding-bottom: 4px;
}

/* ---- Contact ---- */
.contact-section {
    padding: 8rem clamp(24px, 5vw, 64px);
    border-top: 1px solid var(--border);
    text-align: center;
}

.contact-content { max-width: 600px; margin: 0 auto; }

.contact-text {
    color: var(--text-muted);
    margin: 1.5rem 0 2.5rem;
    font-size: 0.95rem;
}

.contact-email {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}
.contact-email:hover { color: var(--accent); }

.contact-social {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

/* ---- Footer ---- */
.portfolio-footer {
    padding: 2rem clamp(24px, 5vw, 64px);
    border-top: 1px solid var(--border);
    text-align: center;
}
.portfolio-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ---- Hero Particle Banner ---- */
.hero-particle-banner {
    width: 100%;
    min-height: 200px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000000;
    margin: 0;
}
.hero-particle-banner canvas {
    width: 100%;
    height: 30vw;
    min-height: 150px;
    max-height: 250px;
    display: block;
}

.hero-subtitle-bar {
    text-align: center;
    padding: 1rem 0 0;
    background: #000000;
}
.hero-subtitle-bar p {
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.hero-cta-bar {
    text-align: center;
    padding: 1.5rem 0 2rem;
    background: #000000;
}
.hero-cta-bar a {
    display: inline-block;
    padding: 14px 40px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.4s ease;
}
.hero-cta-bar a:hover {
    background: var(--accent);
    color: var(--bg);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.gallery-section { animation: fadeInUp 0.8s ease 0.3s both; }
.about-section { animation: fadeInUp 0.8s ease 0.4s both; }
.contact-section { animation: fadeInUp 0.8s ease 0.5s both; }

/* ---- Responsive ---- */
@media (min-width: 768px) {
    .hero-particle-banner canvas {
        height: 80vh;
        max-height: none;
    }
    .hero-particle-banner {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .gallery-item { aspect-ratio: 4 / 5; }
}
