/* ===================================================
   mujun.work — Gilded Cottagecore / Layered Depth
   Palette: Obsidian Night → Antique Gold → Warm Parchment
   Fonts: Space Grotesk / Libre Baskerville / Cormorant Garamond
   =================================================== */

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

html {
    scroll-behavior: auto;
    overflow-x: hidden;
    height: 100%;
}

body {
    background: #0d0b07;
    color: #e8dcc0;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Grain Overlay (body::after) --- */
body::after {
    content: '';
    position: fixed;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: 100;
    pointer-events: none;
    filter: url(#grain);
    mix-blend-mode: overlay;
    opacity: 0;
    animation: grainFadeIn 800ms ease-out 500ms forwards, grainShift 600ms steps(6) infinite;
}

@keyframes grainFadeIn {
    to { opacity: 0.06; }
}

@keyframes grainShift {
    0%   { transform: translate(0, 0); }
    16%  { transform: translate(-1px, 1px); }
    33%  { transform: translate(2px, -1px); }
    50%  { transform: translate(-2px, 2px); }
    66%  { transform: translate(1px, -2px); }
    83%  { transform: translate(-1px, -1px); }
    100% { transform: translate(0, 0); }
}

/* --- Perspective Container --- */
#perspective-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    perspective: 1200px;
    perspective-origin: 50% 50%;
}

/* --- Depth Layers --- */
.depth-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}

#layer-0 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    background: #0d0b07;
}

#layer-1 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
}

#layer-2 {
    position: relative;
    z-index: 5;
    pointer-events: auto;
    min-height: 100vh;
}

#layer-3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 10;
    overflow: hidden;
}

#layer-4 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    pointer-events: auto;
}

/* --- Layer 1: Botanical Silhouettes (Dark Brass #3a3018) --- */
.botanical-silhouette {
    position: absolute;
    opacity: 0.12;
    pointer-events: none;
    will-change: transform;
    color: #3a3018;
}

/* --- Layer 2: Main Content Grid --- */
.content-section {
    display: grid;
    grid-template-columns: [margin-start] 1fr [content-start] minmax(320px, 720px) [content-end] 1fr [margin-end];
    padding: 0 1rem;
}

.content-section > * {
    grid-column: content-start / content-end;
}

/* --- Specimen Cards --- */
.specimen-card {
    border: 1px solid #b8960c;
    padding: clamp(2rem, 4vw, 4rem);
    background: rgba(13, 11, 7, 0.85);
    margin-bottom: clamp(4rem, 10vh, 8rem);
    transition: border-color 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55),
                border-width 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55),
                background-color 400ms ease;
    will-change: transform, opacity;
}

.specimen-card:hover {
    border-color: #c9a84c;
    border-width: 2px;
    background: #1a1610;
}

/* --- Hover Highlight (Burnished Copper accent) --- */
.specimen-card:hover .card-title {
    color: #e8c84c;
    transition: color 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.specimen-card:hover .pull-quote {
    color: #8b6914;
    transition: color 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* --- Scroll Reveal --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 700ms ease-out, transform 700ms ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2.6rem, 6.5vw, 5rem);
    letter-spacing: 0.06em;
    color: #c9a84c;
    text-rendering: geometricPrecision;
    opacity: 0;
    transform: translateY(20px);
}

.hero-title.animate-in {
    animation: heroFadeUp 900ms ease-out forwards;
}

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

.hero-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #e8dcc0;
    margin-top: 1.2rem;
    opacity: 0;
    transform: translateY(10px);
}

.hero-subtitle.animate-in {
    animation: heroFadeUp 900ms ease-out forwards;
}

/* --- Card Typography --- */
.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.06em;
    color: #c9a84c;
    margin-bottom: 1.5rem;
    text-rendering: geometricPrecision;
}

.card-body {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #e8dcc0;
    margin-bottom: 1.5rem;
}

.card-body:last-child {
    margin-bottom: 0;
}

/* --- Proposition Text --- */
.proposition-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #e8dcc0;
    text-align: center;
}

/* --- Pull Quotes --- */
.pull-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.6rem, 4vw, 3rem);
    line-height: 1.4;
    color: #b8960c;
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    border: none;
    margin: 1rem 0 0;
}

/* --- Navigation (Layer 4) --- */
#nav-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.8rem 2rem 1rem;
    opacity: 0;
}

#nav-bar.visible {
    opacity: 1;
    transition: opacity 600ms ease-out;
}

.nav-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c9a84c;
    text-rendering: geometricPrecision;
}

.nav-rule {
    width: 60%;
    height: 1px;
    background: #b8960c;
    margin: 0.5rem auto 0;
    opacity: 0;
}

.nav-rule.visible {
    opacity: 1;
    transition: opacity 600ms ease-out 200ms;
}

/* --- Gold Leaf Dividers --- */
.gold-leaf-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 2rem auto;
}

.divider-line {
    display: block;
    width: 40px;
    height: 1px;
    background: #b8960c;
}

.divider-diamond {
    display: block;
    width: 6px;
    height: 6px;
    background: #b8960c;
    transform: rotate(45deg);
}

/* --- Coda / Footer --- */
.coda-section {
    text-align: center;
    padding: clamp(4rem, 10vh, 8rem) 2rem clamp(3rem, 6vh, 5rem);
}

.coda-domain {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #c9a84c;
    letter-spacing: 0.04em;
}

.coda-divider-bottom {
    margin: 1.5rem auto;
}

.coda-copyright {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    color: rgba(232, 220, 192, 0.4);
    letter-spacing: 0.06em;
}

/* --- Gold Particles --- */
.gold-particle {
    position: fixed;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: radial-gradient(circle, #f5d76e 0%, #c9a84c 60%, transparent 100%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    will-change: transform, opacity;
}

.gold-particle.active {
    animation-fill-mode: both;
}

/* Particle drift keyframes — unique per particle via inline style */
@keyframes particleDriftA {
    0%   { transform: translateY(0) translateX(0); opacity: 0.1; }
    25%  { transform: translateY(-25vh) translateX(10px); opacity: 0.45; }
    50%  { transform: translateY(-50vh) translateX(-15px); opacity: 0.2; }
    75%  { transform: translateY(-75vh) translateX(8px); opacity: 0.5; }
    100% { transform: translateY(-100vh) translateX(-5px); opacity: 0.1; }
}

@keyframes particleDriftB {
    0%   { transform: translateY(0) translateX(0); opacity: 0.15; }
    25%  { transform: translateY(-25vh) translateX(-12px); opacity: 0.5; }
    50%  { transform: translateY(-50vh) translateX(18px); opacity: 0.15; }
    75%  { transform: translateY(-75vh) translateX(-6px); opacity: 0.4; }
    100% { transform: translateY(-100vh) translateX(10px); opacity: 0.15; }
}

@keyframes particleDriftC {
    0%   { transform: translateY(0) translateX(0); opacity: 0.12; }
    25%  { transform: translateY(-25vh) translateX(15px); opacity: 0.35; }
    50%  { transform: translateY(-50vh) translateX(-10px); opacity: 0.5; }
    75%  { transform: translateY(-75vh) translateX(20px); opacity: 0.2; }
    100% { transform: translateY(-100vh) translateX(-8px); opacity: 0.12; }
}

@keyframes particleDriftD {
    0%   { transform: translateY(0) translateX(0); opacity: 0.18; }
    25%  { transform: translateY(-25vh) translateX(-8px); opacity: 0.4; }
    50%  { transform: translateY(-50vh) translateX(12px); opacity: 0.15; }
    75%  { transform: translateY(-75vh) translateX(-18px); opacity: 0.55; }
    100% { transform: translateY(-100vh) translateX(6px); opacity: 0.18; }
}

/* Match-strike ignition glow */
@keyframes matchStrike {
    0%   { width: 0px; height: 0px; box-shadow: 0 0 0px #c9a84c; opacity: 0; }
    50%  { width: 4px; height: 4px; box-shadow: 0 0 20px #c9a84c; opacity: 0.8; }
    100% { width: 3px; height: 3px; box-shadow: 0 0 6px rgba(201, 168, 76, 0.3); opacity: 0.4; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-section {
        grid-template-columns: [margin-start] 0.5fr [content-start] minmax(280px, 1fr) [content-end] 0.5fr [margin-end];
        padding: 0 0.75rem;
    }

    .specimen-card {
        padding: clamp(1.5rem, 4vw, 3rem);
        margin-bottom: clamp(3rem, 8vh, 6rem);
    }

    .botanical-silhouette {
        opacity: 0.06;
    }

    #nav-bar {
        padding: 1.2rem 1rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .pull-quote {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }
}
