/* ==========================================================================
   resar.one — Pop-Art Gold-Black Masonry
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #FAF8F0;
    color: #3A3828;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---------- Cursor-Follow Gold Spotlight ---------- */
#cursor-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle 160px, rgba(200,168,64,0.04), transparent);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

body:hover #cursor-spotlight {
    opacity: 1;
}

/* ---------- Hero / Opening Sequence ---------- */
#hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.hero-title {
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 7rem);
    color: #C8A840;
    letter-spacing: 0.06em;
    line-height: 1.1;
    animation: heroFadeIn 1.2s ease-out both;
}

.hero-dot {
    color: #0A0A08;
}

.hero-tagline {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    color: #8A7830;
    margin-top: 1.5rem;
    letter-spacing: 0.04em;
    animation: heroFadeIn 1.2s ease-out 0.4s both;
}

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

/* ---------- Gallery (Masonry) ---------- */
#gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    position: relative;
}

.masonry {
    columns: 3;
    column-gap: 12px;
}

/* ---------- Masonry Card ---------- */
.masonry-card {
    break-inside: avoid;
    margin-bottom: 12px;
    background: #FFFDF6;
    border: 2px solid #C8A840;
    border-radius: 2px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    animation: cardCascade 0.6s ease-out both;
}

.masonry-card:hover {
    border-color: #8A7830;
    box-shadow: 0 4px 24px rgba(200, 168, 64, 0.12);
}

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

/* Stagger card cascade animations */
.masonry-card:nth-child(1)  { animation-delay: 0.1s; }
.masonry-card:nth-child(2)  { animation-delay: 0.15s; }
.masonry-card:nth-child(3)  { animation-delay: 0.2s; }
.masonry-card:nth-child(4)  { animation-delay: 0.25s; }
.masonry-card:nth-child(5)  { animation-delay: 0.3s; }
.masonry-card:nth-child(6)  { animation-delay: 0.35s; }
.masonry-card:nth-child(7)  { animation-delay: 0.4s; }
.masonry-card:nth-child(8)  { animation-delay: 0.45s; }
.masonry-card:nth-child(9)  { animation-delay: 0.5s; }
.masonry-card:nth-child(10) { animation-delay: 0.55s; }
.masonry-card:nth-child(11) { animation-delay: 0.6s; }
.masonry-card:nth-child(12) { animation-delay: 0.65s; }

/* ---------- Gallery Tag ---------- */
.gallery-tag {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #8A7830;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.75rem;
}

/* ---------- Card Heading ---------- */
.card-heading {
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    color: #C8A840;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

/* ---------- Card Body ---------- */
.card-body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: #3A3828;
    line-height: 1.85;
}

/* ---------- Glitch Image Blocks ---------- */
.glitch-image {
    width: 100%;
    height: 80px;
    margin-top: 16px;
    position: relative;
    overflow: hidden;
    border-radius: 1px;
}

.glitch-image--1 {
    background: linear-gradient(135deg, #C8A840 0%, #8A7830 40%, #C8A840 60%, #3A3828 100%);
}

.glitch-image--2 {
    background: linear-gradient(45deg, #3A3828 0%, #C8A840 30%, #0A0A08 50%, #C8A840 70%, #3A3828 100%);
    height: 100px;
}

.glitch-image--3 {
    background: linear-gradient(180deg, #C8A840 0%, #FFFDF6 30%, #8A7830 60%, #C8A840 100%);
    height: 60px;
}

.glitch-image--4 {
    background: linear-gradient(90deg, #0A0A08 0%, #C8A840 25%, #3A3828 50%, #C8A840 75%, #0A0A08 100%);
    height: 90px;
}

/* Glitch animation on glitch cards */
.glitch-card .glitch-image {
    animation: luxuryGlitch 8s ease-in-out infinite;
}

@keyframes luxuryGlitch {
    0%, 100% {
        transform: translate(0, 0);
        filter: none;
    }
    24% {
        transform: translate(0, 0);
        filter: none;
    }
    25% {
        transform: translate(4px, 0);
        filter: saturate(1.6) hue-rotate(10deg);
    }
    25.5% {
        transform: translate(-3px, 0);
        filter: saturate(0.8) hue-rotate(-5deg);
    }
    26% {
        transform: translate(0, 0);
        filter: none;
    }
    49% {
        transform: translate(0, 0);
        filter: none;
    }
    50% {
        transform: translate(-5px, 0);
        filter: saturate(1.8) hue-rotate(15deg);
    }
    50.3% {
        transform: translate(3px, 1px);
        filter: saturate(0.6) hue-rotate(-10deg);
    }
    50.6% {
        transform: translate(0, 0);
        filter: none;
    }
    74% {
        transform: translate(0, 0);
        filter: none;
    }
    75% {
        transform: translate(6px, -1px);
        filter: saturate(2) hue-rotate(20deg);
    }
    75.2% {
        transform: translate(-2px, 0);
        filter: saturate(0.7);
    }
    75.4% {
        transform: translate(0, 0);
        filter: none;
    }
}

/* Glitch effect on card borders on hover */
.glitch-card:hover {
    animation: borderGlitch 0.6s ease-in-out;
}

@keyframes borderGlitch {
    0%   { border-color: #C8A840; }
    20%  { border-color: #0A0A08; }
    40%  { border-color: #C8A840; }
    60%  { border-color: #508848; }
    80%  { border-color: #C8A840; }
    100% { border-color: #8A7830; }
}

/* ---------- Glitch overlay on hero title ---------- */
.hero-title {
    position: relative;
}

.hero-title::before,
.hero-title::after {
    content: 'RESAR.ONE';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-title::before {
    color: rgba(200, 168, 64, 0.5);
    animation: heroGlitch1 6s ease-in-out infinite;
    clip-path: inset(0 0 60% 0);
}

.hero-title::after {
    color: rgba(138, 120, 48, 0.4);
    animation: heroGlitch2 6s ease-in-out infinite 0.5s;
    clip-path: inset(60% 0 0 0);
}

@keyframes heroGlitch1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(0, 0); }
    33.5% { transform: translate(3px, -1px); }
    34% { transform: translate(-2px, 1px); }
    34.5% { transform: translate(0, 0); }
    66% { transform: translate(0, 0); }
    66.5% { transform: translate(-4px, 0); }
    67% { transform: translate(2px, -1px); }
    67.5% { transform: translate(0, 0); }
}

@keyframes heroGlitch2 {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(0, 0); }
    20.5% { transform: translate(-3px, 1px); }
    21% { transform: translate(4px, 0); }
    21.5% { transform: translate(0, 0); }
    50% { transform: translate(0, 0); }
    50.5% { transform: translate(5px, -1px); }
    51% { transform: translate(-2px, 1px); }
    51.5% { transform: translate(0, 0); }
    80% { transform: translate(0, 0); }
    80.3% { transform: translate(-3px, 0); }
    80.6% { transform: translate(0, 0); }
}

/* ---------- Nature Organic Grounding ---------- */
.nature-grounding {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 3rem 0 1rem;
    opacity: 0.05;
    pointer-events: none;
}

.nature-element {
    width: 40px;
    height: auto;
    fill: #508848;
}

.nature-leaf {
    width: 30px;
}

.nature-acorn {
    width: 26px;
}

.nature-stone {
    width: 42px;
}

/* ---------- Footer ---------- */
#footer {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    border-top: 1px solid rgba(200, 168, 64, 0.15);
}

.footer-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #8A7830;
    letter-spacing: 0.05em;
}

.footer-text .gallery-tag {
    font-size: 0.8rem;
    margin-bottom: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .masonry {
        columns: 2;
    }
}

@media (max-width: 560px) {
    .masonry {
        columns: 1;
    }

    #hero {
        min-height: 80vh;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
}

/* ---------- Selection ---------- */
::selection {
    background: rgba(200, 168, 64, 0.2);
    color: #3A3828;
}
