/* ===========================================
   MUJUN.DAY — Maximalist Terracotta Circuit Festival
   =========================================== */

/* --- CSS Custom Properties --- */
:root {
    --dark-umber: #1A1410;
    --warm-brown: #3A3028;
    --terracotta: #C07040;
    --amber-fire: #D0A040;
    --rose-blaze: #D06080;
    --festival-cream: #F8F0E4;
    --circuit-dark: #4A4040;
    --deep-terracotta: #2A1810;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 400;
    color: var(--warm-brown);
    background: var(--festival-cream);
    overflow-x: hidden;
}

/* --- Typography --- */
.section-heading {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--dark-umber);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.light-heading {
    color: var(--festival-cream);
}

.body-text {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.8;
    color: var(--warm-brown);
    max-width: 600px;
}

.light-text {
    color: var(--festival-cream);
    opacity: 0.9;
}

.accent-label {
    font-family: 'Permanent Marker', cursive;
    font-weight: 400;
    color: var(--terracotta);
    letter-spacing: 0.05em;
}

/* --- Festival Section Base --- */
.festival-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-content {
    position: relative;
    z-index: 10;
    padding: 4rem 2rem;
    max-width: 1200px;
    width: 100%;
}

/* --- Blur-Focus Transition --- */
.blur-target {
    filter: blur(6px);
    opacity: 0.4;
    transition: filter 300ms ease-out, opacity 400ms ease-out;
}

.blur-target.in-view {
    filter: blur(0px);
    opacity: 1;
}

/* --- Gradient Mesh Backgrounds --- */
.gradient-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.mesh-hero {
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, #C07040 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 80% 70%, #D06080 0%, transparent 55%),
        radial-gradient(ellipse 90% 80% at 50% 50%, #D0A040 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 70% 20%, #C07040 0%, transparent 50%),
        var(--festival-cream);
    animation: meshPulseHero 8s ease-in-out infinite alternate;
}

@keyframes meshPulseHero {
    0% {
        background:
            radial-gradient(ellipse 80% 60% at 20% 30%, #C07040 0%, transparent 60%),
            radial-gradient(ellipse 70% 50% at 80% 70%, #D06080 0%, transparent 55%),
            radial-gradient(ellipse 90% 80% at 50% 50%, #D0A040 0%, transparent 70%),
            radial-gradient(ellipse 60% 40% at 70% 20%, #C07040 0%, transparent 50%),
            var(--festival-cream);
    }
    100% {
        background:
            radial-gradient(ellipse 85% 65% at 25% 35%, #D06080 0%, transparent 60%),
            radial-gradient(ellipse 75% 55% at 75% 65%, #C07040 0%, transparent 55%),
            radial-gradient(ellipse 85% 75% at 55% 45%, #D0A040 0%, transparent 70%),
            radial-gradient(ellipse 65% 45% at 65% 25%, #D06080 0%, transparent 50%),
            var(--festival-cream);
    }
}

.mesh-amber-rose {
    background:
        radial-gradient(ellipse 90% 70% at 30% 40%, #D0A040 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 70% 60%, #D06080 0%, transparent 50%),
        radial-gradient(ellipse 100% 80% at 50% 50%, #C07040 0%, transparent 65%),
        var(--festival-cream);
}

.mesh-type {
    background:
        radial-gradient(ellipse 70% 50% at 80% 30%, #D0A040 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 20% 70%, #C07040 0%, transparent 55%),
        var(--festival-cream);
}

.mesh-rose {
    background:
        radial-gradient(ellipse 80% 60% at 40% 30%, #D06080 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 70% 70%, #C07040 0%, transparent 50%),
        radial-gradient(ellipse 90% 70% at 30% 60%, #D0A040 0%, transparent 60%),
        var(--festival-cream);
}

.mesh-finale {
    background:
        radial-gradient(ellipse 100% 80% at 50% 50%, #C07040 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 20% 80%, #D06080 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 80% 20%, #D0A040 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #2A1810 0%, transparent 80%),
        var(--deep-terracotta);
}

/* --- Circuit Pattern Overlay --- */
.circuit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0.15;
    pointer-events: none;
    background-image:
        /* Horizontal lines */
        linear-gradient(0deg, transparent 49.5%, #4A4040 49.5%, #4A4040 50.5%, transparent 50.5%),
        linear-gradient(0deg, transparent 24.5%, #4A4040 24.5%, #4A4040 25.5%, transparent 25.5%),
        linear-gradient(0deg, transparent 74.5%, #4A4040 74.5%, #4A4040 75.5%, transparent 75.5%),
        /* Vertical lines */
        linear-gradient(90deg, transparent 19.5%, #4A4040 19.5%, #4A4040 20.5%, transparent 20.5%),
        linear-gradient(90deg, transparent 39.5%, #4A4040 39.5%, #4A4040 40.5%, transparent 40.5%),
        linear-gradient(90deg, transparent 59.5%, #4A4040 59.5%, #4A4040 60.5%, transparent 60.5%),
        linear-gradient(90deg, transparent 79.5%, #4A4040 79.5%, #4A4040 80.5%, transparent 80.5%);
    background-size: 100% 100%;
}

.circuit-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle 4px at 20% 25%, #4A4040 50%, transparent 50%),
        radial-gradient(circle 4px at 40% 50%, #4A4040 50%, transparent 50%),
        radial-gradient(circle 4px at 60% 75%, #4A4040 50%, transparent 50%),
        radial-gradient(circle 4px at 80% 25%, #4A4040 50%, transparent 50%),
        radial-gradient(circle 4px at 20% 75%, #4A4040 50%, transparent 50%),
        radial-gradient(circle 4px at 60% 25%, #4A4040 50%, transparent 50%),
        radial-gradient(circle 4px at 40% 75%, #4A4040 50%, transparent 50%),
        radial-gradient(circle 4px at 80% 50%, #4A4040 50%, transparent 50%),
        radial-gradient(circle 3px at 80% 75%, #4A4040 50%, transparent 50%),
        radial-gradient(circle 3px at 20% 50%, #4A4040 50%, transparent 50%);
}

.circuit-dense {
    opacity: 0.2;
}

/* ===========================================
   SECTION 1: HERO
   =========================================== */
.hero-section {
    background: var(--festival-cream);
    flex-direction: column;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(4rem, 14vw, 12rem);
    color: var(--dark-umber);
    line-height: 0.95;
    letter-spacing: -0.04em;
    position: relative;
    text-shadow: 4px 4px 0 rgba(192, 112, 64, 0.3);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.6rem);
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.hero-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border: 2px solid var(--terracotta);
    border-radius: 50%;
    opacity: 0;
    animation: pulseRing 3s ease-out infinite;
    z-index: 5;
    pointer-events: none;
}

.ring-2 {
    animation-delay: 1s;
    width: 400px;
    height: 400px;
}

.ring-3 {
    animation-delay: 2s;
    width: 500px;
    height: 500px;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.6;
        border-color: var(--terracotta);
    }
    50% {
        opacity: 0.3;
        border-color: var(--rose-blaze);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
        border-color: var(--amber-fire);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    animation: bobUpDown 2s ease-in-out infinite;
}

.scroll-indicator .accent-label {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
}

.scroll-arrow {
    width: 2px;
    height: 30px;
    background: var(--terracotta);
    position: relative;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--terracotta);
    border-bottom: 2px solid var(--terracotta);
}

@keyframes bobUpDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ===========================================
   SECTION 2: TERRACOTTA
   =========================================== */
.terracotta-section {
    background: var(--terracotta);
}

.terracotta-section .section-heading {
    color: var(--festival-cream);
    text-shadow: 3px 3px 0 rgba(26, 20, 16, 0.3);
}

.terracotta-section .body-text {
    color: var(--festival-cream);
    opacity: 0.9;
}

.text-collage {
    position: relative;
    width: 100%;
    height: 300px;
    margin: 2rem 0;
}

.collage-word {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: rotate(var(--rotate));
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--festival-cream);
    opacity: 0.7;
    transition: transform 300ms ease, opacity 300ms ease, font-size 300ms ease;
    cursor: default;
}

.collage-word:hover {
    opacity: 1;
    transform: rotate(0deg) scale(1.3);
}

/* ===========================================
   SECTION 3: GRADIENT MESH AMBER/ROSE
   =========================================== */
.mesh-section {
    background: var(--festival-cream);
}

.frequency-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 200px;
    margin: 3rem 0;
    padding: 0 1rem;
}

.freq-bar {
    width: clamp(20px, 4vw, 40px);
    height: var(--height);
    background: linear-gradient(to top, var(--terracotta), var(--amber-fire), var(--rose-blaze));
    border-radius: 4px 4px 0 0;
    animation: freqBounce 1.5s ease-in-out infinite alternate;
    animation-delay: var(--delay);
    transform-origin: bottom;
}

@keyframes freqBounce {
    0% { transform: scaleY(0.6); }
    100% { transform: scaleY(1); }
}

/* ===========================================
   SECTION 4: DARK CIRCUIT
   =========================================== */
.circuit-section {
    background: var(--deep-terracotta);
}

.circuit-nodes {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 2rem 0;
}

.node {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 60px;
    height: 60px;
    border: 2px solid var(--terracotta);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 300ms ease, box-shadow 300ms ease;
    cursor: default;
}

.node::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--terracotta);
    border-radius: 50%;
    animation: nodePulse 2s ease-in-out infinite;
}

.node:hover {
    transform: scale(1.3);
    box-shadow: 0 0 30px rgba(192, 112, 64, 0.5);
}

.node-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    white-space: nowrap;
    color: var(--amber-fire);
}

@keyframes nodePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.6); }
}

/* Node connection lines via SVG placed in JS */
.node-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.node-connections line {
    stroke: var(--terracotta);
    stroke-width: 1;
    opacity: 0.3;
}

/* ===========================================
   SECTION 5: TYPOGRAPHY SHOWCASE
   =========================================== */
.type-section {
    background: var(--festival-cream);
}

.type-showcase {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
}

.type-sample {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 2rem;
    border-left: 4px solid var(--terracotta);
    background: rgba(248, 240, 228, 0.8);
}

.type-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.type-display {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--dark-umber);
    letter-spacing: 0.05em;
}

.type-display-body {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--warm-brown);
    line-height: 1.8;
}

.type-display-accent {
    font-family: 'Permanent Marker', cursive;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--terracotta);
}

/* ===========================================
   SECTION 6: MANIFESTO
   =========================================== */
.manifesto-section {
    background: var(--festival-cream);
}

.manifesto-heading {
    font-size: clamp(3rem, 8vw, 7rem);
    text-align: center;
    background: linear-gradient(135deg, var(--terracotta), var(--rose-blaze), var(--amber-fire));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.manifesto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.manifesto-card {
    padding: 2.5rem;
    background: rgba(248, 240, 228, 0.9);
    border: 2px solid var(--terracotta);
    position: relative;
    overflow: hidden;
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.manifesto-card:hover {
    transform: translateY(-5px);
    box-shadow: 8px 8px 0 var(--terracotta);
}

.manifesto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--terracotta), var(--rose-blaze), var(--amber-fire));
}

.card-number {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

.card-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--dark-umber);
    margin-bottom: 1rem;
}

/* ===========================================
   SECTION 7: FINALE
   =========================================== */
.finale-section {
    background: var(--deep-terracotta);
    text-align: center;
}

.finale-heading {
    color: var(--festival-cream);
    font-size: clamp(3.5rem, 10vw, 9rem);
    text-shadow: 4px 4px 0 rgba(192, 112, 64, 0.4);
}

.finale-tagline {
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.2em;
    margin-top: 1rem;
    color: var(--amber-fire);
}

.finale-decoration {
    position: relative;
    width: 100%;
    height: 200px;
    margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deco-circle {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 2px solid var(--terracotta);
    border-radius: 50%;
    animation: decoSpin 10s linear infinite;
}

.circle-2 {
    width: 180px;
    height: 180px;
    border-color: var(--rose-blaze);
    animation-duration: 15s;
    animation-direction: reverse;
}

.circle-3 {
    width: 240px;
    height: 240px;
    border-color: var(--amber-fire);
    animation-duration: 20s;
}

@keyframes decoSpin {
    0% { transform: rotate(0deg); border-radius: 50%; }
    25% { border-radius: 40% 60% 60% 40%; }
    50% { transform: rotate(180deg); border-radius: 50%; }
    75% { border-radius: 60% 40% 40% 60%; }
    100% { transform: rotate(360deg); border-radius: 50%; }
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
    .section-content {
        padding: 3rem 1.5rem;
    }

    .text-collage {
        height: 250px;
    }

    .circuit-nodes {
        height: 300px;
    }

    .node {
        width: 45px;
        height: 45px;
    }

    .node-label {
        font-size: 0.6rem;
    }

    .manifesto-grid {
        grid-template-columns: 1fr;
    }

    .frequency-bars {
        height: 150px;
        gap: 5px;
    }
}

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

    .collage-word {
        font-size: clamp(1rem, 4vw, 1.8rem);
    }

    .text-collage {
        height: 200px;
    }
}
