/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --accent: #E8530A;
    --accent-dark: #C4420A;
    --bg: #0C0C0C;
    --surface: #161616;
    --surface-2: #1E1E1E;
    --text: #FFFFFF;
    --muted: rgba(255,255,255,0.5);
    --border: rgba(255,255,255,0.08);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ===== Selection ===== */
::selection { background: var(--accent); color: white; }

/* ============================================================
   PAGE TRANSITION SYSTEM
   ============================================================ */

#page-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    pointer-events: none;
    transform: translateY(0);
    /* JS controls transition timing */
}

/* ===== Progress bar ===== */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #ff8c5a);
    width: 0%;
    z-index: 10001;
    opacity: 0;
    transition: width 0.4s var(--ease-out-expo), opacity 0.3s ease;
    border-radius: 0 2px 2px 0;
}

/* ============================================================
   HERO ANIMATIONS
   ============================================================ */

.hero-animate {
    opacity: 0;
    transform: translateY(48px);
    animation: heroReveal 1s var(--ease-out-expo) forwards;
}

.hero-animate-1 { animation-delay: 0.25s; }
.hero-animate-2 { animation-delay: 0.4s; }
.hero-animate-3 { animation-delay: 0.52s; }
.hero-animate-4 { animation-delay: 0.68s; }
.hero-animate-5 { animation-delay: 0.85s; }

@keyframes heroReveal {
    to { opacity: 1; transform: translateY(0); }
}

/* Hero title gets a stronger, skewed reveal */
.hero-title-animate {
    opacity: 0;
    transform: translateY(80px) skewY(4deg);
    animation: heroTitleReveal 1.1s var(--ease-out-expo) 0.52s forwards;
}

@keyframes heroTitleReveal {
    to { opacity: 1; transform: translateY(0) skewY(0deg); }
}

/* ===== Navigation entrance ===== */
#navbar {
    animation: navbarSlide 0.8s var(--ease-out-expo) 0.1s both;
}

@keyframes navbarSlide {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* ============================================================
   SCROLL REVEALS
   ============================================================ */

.fade-in {
    opacity: 0;
    transform: translateY(36px);
    transition:
        opacity 0.8s var(--ease-out-expo),
        transform 0.8s var(--ease-out-expo);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide in from left for labels */
.fade-left {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.fade-left.visible { opacity: 1; transform: translateX(0); }

/* Scale up for stats / large numbers */
.fade-scale {
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.fade-scale.visible { opacity: 1; transform: scale(1); }

/* ===== Image Reveal ===== */
.img-reveal {
    overflow: hidden;
}

.img-reveal img,
.img-reveal-direct {
    transform: scale(1.1);
    transition: transform 1.4s var(--ease-out-expo);
    will-change: transform;
}

.img-reveal.visible img,
.img-reveal.visible .img-reveal-direct {
    transform: scale(1);
}

/* ============================================================
   NAVIGATION
   ============================================================ */

#navbar.scrolled {
    background: rgba(12,12,12,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero-section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(12,12,12,0.85) 0%, rgba(12,12,12,0.4) 50%, rgba(232,83,10,0.15) 100%);
    z-index: 1;
}

.hero-bg {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    transform: scale(1.06);
    transition: transform 10s ease;
    will-change: transform;
}

.hero-bg.loaded { transform: scale(1.02); }

.hero-content { position: relative; z-index: 2; }

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 12vw, 12rem);
    line-height: 0.9;
    letter-spacing: -0.02em;
    color: white;
}

/* ============================================================
   ARTWORK CARDS
   ============================================================ */

.artwork-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
    transform-style: preserve-3d;
    transition:
        transform 0.5s var(--ease-out-expo),
        box-shadow 0.5s var(--ease-out-expo);
    will-change: transform;
}

.artwork-card img {
    transition: transform 0.8s var(--ease-out-expo);
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}

.artwork-card:hover {
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

.artwork-card:hover img { transform: scale(1.08); }

.artwork-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12,12,12,0.92) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.45s ease;
    z-index: 2;
}

.artwork-card:hover .artwork-card-overlay { opacity: 1; }

.artwork-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 3;
    transform: translateY(14px);
    opacity: 0;
    transition: transform 0.45s var(--ease-out-expo), opacity 0.45s ease;
}

.artwork-card:hover .artwork-card-info {
    transform: translateY(0);
    opacity: 1;
}

/* ============================================================
   AVAILABILITY BADGES
   ============================================================ */

.badge-available {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: .25rem .75rem;
    background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.25);
    border-radius: 999px; font-size: .75rem; color: #4ade80;
}
.badge-sold {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: .25rem .75rem;
    background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.25);
    border-radius: 999px; font-size: .75rem; color: #f87171;
}
.badge-commission {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: .25rem .75rem;
    background: rgba(232,83,10,.12); border: 1px solid rgba(232,83,10,.25);
    border-radius: 999px; font-size: .75rem; color: #E8530A;
}

/* ============================================================
   SECTION LABELS
   ============================================================ */

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.section-label::before {
    content: '';
    display: block;
    width: 2rem;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease-out-expo) 0.1s;
}

.section-label.visible::before { transform: scaleX(1); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.display-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

/* ============================================================
   BUTTONS — with magnetic hover
   ============================================================ */

.btn-primary {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--accent); color: white;
    padding: .875rem 1.75rem; border-radius: 999px;
    font-size: .875rem; font-weight: 500;
    transition: background 0.2s ease, transform 0.35s var(--ease-out-expo), box-shadow 0.35s ease;
    cursor: pointer; border: none; text-decoration: none;
    will-change: transform;
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 8px 30px rgba(232,83,10,0.35);
}

.btn-outline {
    display: inline-flex; align-items: center; gap: .5rem;
    background: transparent; color: white;
    padding: .875rem 1.75rem; border-radius: 999px;
    font-size: .875rem; font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2);
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.35s var(--ease-out-expo);
    cursor: pointer; text-decoration: none;
    will-change: transform;
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.form-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: white;
    padding: .875rem 1.25rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232,83,10,0.12);
}

.form-input::placeholder { color: rgba(255,255,255,0.3); }
textarea.form-input { resize: vertical; min-height: 120px; }

/* ============================================================
   MASONRY GRID
   ============================================================ */

.masonry-grid { column-count: 3; column-gap: 1rem; }
.masonry-item { break-inside: avoid; margin-bottom: 1rem; }

@media (max-width: 1024px) { .masonry-grid { column-count: 2; } }
@media (max-width: 640px)  { .masonry-grid { column-count: 1; } }

/* ===== Divider ===== */
.divider {
    width: 3rem; height: 2px;
    background: var(--accent);
    margin: 1.5rem 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease-out-expo) 0.2s;
}
.divider.visible { transform: scaleX(1); }

/* ===== Page Header ===== */
.page-header {
    padding-top: 8rem; padding-bottom: 4rem;
    background: linear-gradient(to bottom, rgba(232,83,10,0.05), transparent);
    border-bottom: 1px solid var(--border);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

#lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(12px);
}

#lightbox.active { opacity: 1; pointer-events: all; }

#lightbox img {
    max-width: 90vw; max-height: 90vh;
    object-fit: contain; border-radius: .5rem;
    transform: scale(0.95);
    transition: transform 0.4s var(--ease-out-expo);
}

#lightbox.active img { transform: scale(1); }

/* ============================================================
   FILTER BUTTONS
   ============================================================ */

.filter-btn {
    padding: .5rem 1.25rem; border-radius: 999px;
    font-size: .8125rem; font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    transition: all 0.25s ease;
    cursor: pointer; background: transparent;
}

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

/* ============================================================
   STATS
   ============================================================ */

.stat-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem; color: var(--accent); line-height: 1;
}

/* ============================================================
   NUMBERED LIST
   ============================================================ */

.numbered-item {
    display: flex; align-items: flex-start; gap: 1.25rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}
.numbered-item:last-child { border-bottom: none; }

.numbered-item .num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.25rem; color: var(--accent);
    min-width: 2.5rem; line-height: 1; margin-top: .2rem;
}

/* ============================================================
   TIMELINE
   ============================================================ */

.timeline-item {
    position: relative; padding-left: 2rem; padding-bottom: 2.5rem;
}
.timeline-item::before {
    content: ''; position: absolute;
    left: 0; top: .5rem; bottom: 0;
    width: 1px; background: var(--border);
}
.timeline-item::after {
    content: ''; position: absolute;
    left: -4px; top: .5rem;
    width: 9px; height: 9px;
    border-radius: 50%; background: var(--accent);
    transition: box-shadow 0.3s ease;
}
.timeline-item:hover::after {
    box-shadow: 0 0 0 4px rgba(232,83,10,0.2);
}

/* ============================================================
   ADMIN
   ============================================================ */

.admin-sidebar-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem 1rem; border-radius: .5rem;
    color: rgba(255,255,255,.6); font-size: .875rem;
    transition: all 0.2s ease; text-decoration: none;
}

.admin-sidebar-link:hover,
.admin-sidebar-link.active { background: rgba(232,83,10,.1); color: white; }
.admin-sidebar-link.active { color: var(--accent); }

/* ============================================================
   SHIMMER
   ============================================================ */

@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position:  1000px 0; }
}

.shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #1a1a1a 4%, #242424 25%, #1a1a1a 36%);
    background-size: 1000px 100%;
}

/* ============================================================
   CURSOR GLOW
   ============================================================ */

.cursor-glow {
    position: fixed;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(232,83,10,0.05) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    transition: opacity 0.3s ease;
}

/* ============================================================
   MARQUEE STRIP
   ============================================================ */

@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-33.33%); }
}

/* ============================================================
   SCROLL LINE DRAW (horizontal rules)
   ============================================================ */

.line-draw {
    height: 1px;
    background: var(--border);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s var(--ease-out-expo);
}
.line-draw.visible { transform: scaleX(1); }

/* ============================================================
   LOADING SHIMMER PLACEHOLDER
   ============================================================ */

img[data-src] { background: var(--surface-2); }
