/* =============================================
   DAVID MACY — VIRTUAL MUSEUM
   Cinematic dark gallery design
   ============================================= */

:root {
    --bg: #0a0a0a;
    --bg-nav: #111111;
    --surface: #161616;
    --text: #e8e8e8;
    --text-dim: #888888;
    --text-faint: #555555;
    --accent: #c9b06b;
    --glow: rgba(255, 255, 255, 0.12);
    --glow-strong: rgba(255, 255, 255, 0.22);

    --font-serif: 'Cormorant Garamond', 'Georgia', serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
}

/* ===================== TOP BAR ===================== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 2rem;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.top-icon {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--text-dim);
    transition: color 0.3s;
}

.top-icon:hover {
    color: var(--text);
}

/* ===================== MAIN NAV ===================== */
.main-nav {
    position: fixed;
    top: 38px;
    left: 0;
    right: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 3rem;
    background: var(--bg-nav);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.4s, padding 0.4s;
}

.main-nav.scrolled {
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-logo a {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 6px;
    color: var(--text);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 2.5px;
    color: var(--text-dim);
    position: relative;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text);
    transition: width 0.3s var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 1px;
    background: var(--text);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-nav);
        padding: 2rem 3rem;
        gap: 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
}

/* ===================== HERO ===================== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-media-wrap {
    position: absolute;
    inset: 0;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* object-position shifts the crop — adjust to taste */
    object-position: center center;
}

/* Still image fallback */
.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: slowZoom 25s infinite alternate linear;
}

@keyframes slowZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.08);
    }
}

/* ─── HERO OVERLAY — switch variant with class on <header> ─── */

/* DEFAULT overlay (removed — variants below handle it) */
.hero-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* ═══════════════════════════════════════════════════════
   VARIANT A  — Frosted glass pill, zero overlay
   Add class="hero hero-a" to <header>
   ═══════════════════════════════════════════════════════ */
.hero-a .hero-overlay {
    display: none;
}

.hero-a .hero-content {
    /* Pin to bottom-center */
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: auto;
    max-width: 90%;
    /* Frosted glass pill */
    background: rgba(10, 10, 10, 0.45);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 1.6rem 3rem;
    /* Override base animation positioning */
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    animation: fadeUpPill 1.2s 0.5s var(--ease-out) forwards;
}

@keyframes fadeUpPill {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════
   VARIANT B  — Thin bottom-fade only, text bottom-left
   Add class="hero hero-b" to <header>
   ═══════════════════════════════════════════════════════ */
.hero-b .hero-overlay {
    display: block;
    background: linear-gradient(to bottom,
            transparent 0%,
            transparent 50%,
            rgba(10, 10, 10, 0.6) 80%,
            var(--bg) 100%);
}

.hero-b .hero-content {
    position: absolute;
    bottom: 2.5rem;
    left: 3.5rem;
    text-align: left;
    max-width: 520px;
    /* No fade-up — slide from left */
    opacity: 0;
    transform: translateX(-24px);
    animation: fadeRight 1.2s 0.5s var(--ease-out) forwards;
}

@keyframes fadeRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-b .hero-title {
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8), 0 1px 4px rgba(0, 0, 0, 0.9);
}

.hero-b .hero-subtitle {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
    color: rgba(255, 255, 255, 0.85);
}

/* ═══════════════════════════════════════════════════════
   VARIANT C  — Split: dark top with text / raw video bottom
   Add class="hero hero-c" to <header>
   ═══════════════════════════════════════════════════════ */
.hero-c .hero-overlay {
    display: block;
    /* Dark panel covering only the top ~45% */
    background: linear-gradient(to bottom,
            rgba(10, 10, 10, 0.92) 0%,
            rgba(10, 10, 10, 0.85) 35%,
            rgba(10, 10, 10, 0.2) 55%,
            transparent 70%);
}

.hero-c .hero-content {
    position: absolute;
    top: 8rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100%;
    opacity: 0;
    animation: fadeIn 1.2s 0.5s var(--ease-out) forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ─── Shared hero text (unaffected by variant) ─── */
.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 2rem;
    opacity: 0;
    transform: translateY(24px);
    animation: fadeUp 1.2s 0.5s var(--ease-out) forwards;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 400;
    letter-spacing: 2px;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--text-dim);
    font-weight: 300;
    letter-spacing: 1px;
}

/* ===================== GALLERY TABS ===================== */
.gallery-tabs-wrap {
    display: flex;
    justify-content: center;
    padding: 3rem 2rem 0;
}

.gallery-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-tab {
    padding: 1rem 2.5rem;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-faint);
    position: relative;
    transition: color 0.3s;
    cursor: pointer;
}

.gallery-tab:hover {
    color: var(--text-dim);
}

.gallery-tab.active {
    color: var(--text);
}

.gallery-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--text);
    transform: scaleX(0);
    transition: transform 0.3s var(--ease-out);
}

.gallery-tab.active::after {
    transform: scaleX(1);
}

@media (max-width: 600px) {
    .gallery-tab {
        padding: 0.8rem 1.2rem;
        font-size: 0.6rem;
        letter-spacing: 2px;
    }
}

/* ===================== GALLERY GRID ===================== */
.piece-viewfinder {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    background-color: #000;
}

.piece-viewfinder img {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
}

.hero-view {
    border-radius: 0; /* Full bleed hero */
    margin-bottom: 2rem;
}

.sub-view {
    border-radius: 4px;
}

.gallery-section {
    padding: 3rem 3rem 8rem;
    max-width: 1400px;
    margin: 0 auto;
    display: none;
    /* tab-controlled */
}

.gallery-section.active {
    display: block;
}

.section-heading {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-dim);
    display: none;
    /* hidden — tabs serve as headings */
}

.empty-section {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-faint);
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-style: italic;
    letter-spacing: 1px;
}

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

.gallery-card {
    position: relative;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.gallery-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: top center;
    background: #fff;
    box-shadow: 0 8px 40px rgba(255, 255, 255, 0.04);
    transition: box-shadow 0.4s, transform 0.4s var(--ease-out);
}

.gallery-card:hover .gallery-card-img {
    box-shadow: 0 12px 60px var(--glow);
    transform: translateY(-4px);
}

.gallery-card-info {
    margin-top: 1rem;
}

.gallery-card-info h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 1px;
}

.gallery-card-info p {
    font-size: 0.75rem;
    color: var(--text-faint);
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

/* ===================== PIECE DETAIL VIEW ===================== */
.piece-detail {
    padding: 110px 3rem 6rem;
    max-width: 1200px;
    margin: 0 auto;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 3rem;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--text);
}

.detail-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.detail-arrow {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: var(--text-faint);
    text-transform: uppercase;
    transition: color 0.3s;
}

.detail-arrow:hover {
    color: var(--text);
}

.detail-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 5rem;
}

.artwork-frame {
    max-width: 100%;
    width: 100%;
    box-shadow: 0 0 80px var(--glow-strong), 0 0 200px var(--glow);
    margin-bottom: 3rem;
    transition: box-shadow 0.6s var(--ease-out);
}

.artwork-frame img {
    width: 100%;
    height: auto;
    display: block;
    background: #fff;
    cursor: pointer;
}

.detail-info {
    text-align: center;
    max-width: 600px;
}

.detail-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 400;
    letter-spacing: 4px;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.detail-artist {
    font-size: 0.75rem;
    letter-spacing: 4px;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

.detail-description {
    font-family: var(--font-serif);
    font-size: 1.4rem; font-weight: 300;
    color: var(--text-dim); line-height: 1.8;
    font-style: italic;
    white-space: pre-line;
    margin-bottom: 2rem;
}

.detail-story {
    font-family: var(--font-serif);
    font-size: 1.15rem; font-weight: 300;
    color: var(--text); line-height: 1.8;
    text-align: left;
    white-space: pre-line;
}

/* Split Layout Variants */
@media (min-width: 1024px) {
    .detail-hero.layout-split-right,
    .detail-hero.layout-split-left {
        display: grid;
        grid-template-columns: 1fr 450px;
        gap: 6rem;
        align-items: start;
        text-align: left;
    }

    /* Flip order for left-side text */
    .detail-hero.layout-split-left {
        grid-template-columns: 450px 1fr;
    }
    .detail-hero.layout-split-left .artwork-frame {
        order: 2;
    }
    .detail-hero.layout-split-left .detail-info {
        order: 1;
    }

    .detail-hero[class*="layout-split"] .artwork-frame {
        margin-bottom: 0;
        max-width: none;
    }
    .detail-hero[class*="layout-split"] .detail-info {
        text-align: left;
        max-width: none;
        position: sticky;
        top: 120px;
    }
}

/* Additional images stacked below */
.detail-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5rem;
}

.detail-images img {
    max-width: 100%;
    height: auto;
    background: #fff;
    box-shadow: 0 0 60px var(--glow), 0 0 120px rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: box-shadow 0.4s;
}

.detail-images img:hover {
    box-shadow: 0 0 80px var(--glow-strong), 0 0 180px var(--glow);
}

/* ===================== ZOOM LIGHTBOX ===================== */
.zoom-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.97);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}

.zoom-lightbox.active {
    display: flex;
}

.zoom-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 100px var(--glow-strong);
}

.zoom-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: var(--text-dim);
    z-index: 1001;
    transition: color 0.3s, transform 0.3s;
}

.zoom-close:hover {
    color: var(--text);
    transform: rotate(90deg);
}

.zoom-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    z-index: 1001;
    padding: 1rem;
    transition: color 0.3s;
    cursor: pointer;
}

.zoom-arrow:hover {
    color: var(--text);
}

.zoom-arrow.prev {
    left: 1rem;
}

.zoom-arrow.next {
    right: 1rem;
}

/* ===================== FOOTER ===================== */
.site-footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    font-size: 0.72rem;
    letter-spacing: 2.5px;
    color: var(--text-dim);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-copy {
    font-size: 0.65rem;
    color: var(--text-faint);
    letter-spacing: 1px;
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Image crossfade */
.artwork-frame.switching img {
    opacity: 0;
    transform: scale(0.97);
}

.artwork-frame img {
    transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}
/* ===== CONTACT SECTION ===== */
.contact-section {
    padding: 10rem 2rem;
    background: #0a0a0a;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.contact-container {
    max-width: 700px;
    margin: 0 auto;
}

.contact-header {
    text-align: center;
    margin-bottom: 5rem;
}

.contact-sub {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-top: 1rem;
    font-style: italic;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group label {
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding: 1rem 0;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--text);
    transition: all 0.4s ease;
    border-radius: 0;
    outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #fff;
    padding-left: 0.5rem;
}

.submit-btn {
    align-self: center;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 1.2rem 4rem;
    font-size: 0.8rem;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    margin-top: 2rem;
}

.submit-btn:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
    .contact-section {
        padding: 6rem 1.5rem;
    }
    .submit-btn {
        width: 100%;
    }
}

/* ===== FORM STATUS & ERRORS ===== */
.form-status {
    display: none; /* Formspree will show this automatically */
    padding: 1.5rem;
    margin-bottom: 2rem;
    font-family: var(--font-serif);
    font-size: 1rem;
    text-align: center;
    border: 1px solid transparent;
}

.form-status.success {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.2);
}

.form-status.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.2);
}

.field-error {
    display: block;
    font-size: 0.7rem;
    color: #e74c3c;
    margin-top: 0.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* State during submission */
.submit-btn:disabled {
    opacity: 0.5;
    cursor: wait;
    border-color: var(--text-dim);
}

/* ===================== JOURNAL TEASER ===================== */
.journal-teaser {
    padding: 8rem 3rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: #0a0a0a;
}

.journal-teaser-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.journal-teaser-heading {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.journal-teaser-sub {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text-faint);
    margin-bottom: 4rem;
}

.journal-teaser-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 3.5rem;
    text-align: left;
}

.journal-card {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    cursor: pointer;
    transition: opacity 0.3s;
    text-decoration: none;
    display: block;
    color: inherit;
}

.journal-card:hover {
    opacity: 0.72;
}

.journal-card-date {
    font-size: 0.68rem;
    letter-spacing: 2px;
    color: var(--text-faint);
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.journal-card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.journal-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-faint);
    font-style: italic;
    line-height: 1.5;
}

.journal-card-pinned {
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: rgba(200,180,120,0.8);
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.journal-teaser-link {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 3px;
    transition: color 0.3s, border-color 0.3s;
}

.journal-teaser-link:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.6);
}

@media (max-width: 600px) {
    .journal-teaser {
        padding: 5rem 1.5rem;
    }
    .journal-teaser-posts {
        grid-template-columns: 1fr;
    }
}
