/* ============================================
   ipjosim.com - Votive Futurism / Glassmorphism
   Candle-atmospheric + creamy-pastel palette
   ============================================ */

/* --- Palette Reference ---
   Molten Ivory:  #FFF8F0  (primary background)
   Warm Frost:    #F0E6D8  (card bg tint, dividers)
   Tallow Gold:   #D4A574  (primary accent, links)
   Blush Wax:     #E8C4B0  (secondary accent, hover)
   Wick Char:     #3D2E24  (primary text)
   Altar Smoke:   #B8A899  (secondary text, muted)
   Votive Rose:   #F2D1C4  (decorative shapes)
   Protocol Teal: #7BBFB4  (futuristic accent)
*/

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

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

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    background-color: #FFF8F0;
    color: #3D2E24;
    line-height: 1.72;
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    overflow-x: hidden;
    perspective: 1200px;
}

/* --- Background Abstract Shapes Layer (parallax 0.02) --- */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    will-change: transform;
}

.abstract-shape {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    opacity: 0;
    will-change: transform, opacity;
}

/* Large ellipse - Votive Rose, top-right (~30vw) */
.shape-ellipse {
    width: 30vw;
    height: 22vw;
    background: #F2D1C4;
    top: 5%;
    right: -5%;
    opacity: 0;
    animation: shapeBreathe 10s ease-in-out infinite;
}

/* Medium rounded trapezoid - Blush Wax, bottom-left */
.shape-trapezoid {
    width: 20vw;
    height: 18vw;
    background: #E8C4B0;
    bottom: 15%;
    left: 5%;
    border-radius: 30% 70% 60% 40% / 55% 35% 65% 45%;
    opacity: 0;
    animation: shapeBreathe 12s ease-in-out infinite 1s;
}

/* Small circle - Protocol Teal at 15% opacity, center-left */
.shape-circle {
    width: 10vw;
    height: 10vw;
    background: rgba(123, 191, 180, 0.15);
    top: 40%;
    left: 15%;
    border-radius: 50%;
    opacity: 0;
    animation: shapeBreathe 8s ease-in-out infinite 0.5s;
}

/* Tallow Gold at 20% opacity */
.shape-gold {
    width: 16vw;
    height: 14vw;
    background: rgba(212, 165, 116, 0.2);
    top: 60%;
    right: 10%;
    border-radius: 50% 40% 60% 50% / 45% 55% 45% 55%;
    opacity: 0;
    animation: shapeBreathe 11s ease-in-out infinite 2s;
}

/* Large Votive Rose for lower page */
.shape-rose-lg {
    width: 24vw;
    height: 20vw;
    background: #F2D1C4;
    top: 120%;
    left: 30%;
    border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
    opacity: 0;
    animation: shapeBreathe 9s ease-in-out infinite 1.5s;
}

@keyframes shapeBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* --- Flame Pulsers (Foreground, parallax 0.08) --- */
.flame-pulsers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
    will-change: transform;
}

.flame-pulser {
    position: absolute;
    width: 14px;
    height: 22px;
    filter: blur(1px);
    animation: flameFlicker 2.5s ease-in-out infinite;
}

.fp-1 { top: 12%; left: 8%; animation-delay: 0s; animation-duration: 2.2s; }
.fp-2 { top: 28%; right: 12%; animation-delay: 0.7s; animation-duration: 2.8s; }
.fp-3 { top: 48%; left: 22%; animation-delay: 1.3s; animation-duration: 2.4s; }
.fp-4 { top: 65%; right: 20%; animation-delay: 0.4s; animation-duration: 3s; }
.fp-5 { top: 38%; right: 5%; animation-delay: 1.8s; animation-duration: 2.6s; }
.fp-6 { bottom: 18%; left: 35%; animation-delay: 0.9s; animation-duration: 2.3s; }
.fp-7 { top: 80%; left: 10%; animation-delay: 1.5s; animation-duration: 2.7s; }
.fp-8 { bottom: 30%; right: 8%; animation-delay: 0.2s; animation-duration: 2.1s; }

@keyframes flameFlicker {
    0%, 100% { opacity: 0.5; }
    30% { opacity: 0.7; }
    50% { opacity: 1; }
    70% { opacity: 0.6; }
}

/* --- Smoke Trails --- */
.smoke-trails {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
    will-change: transform;
}

.smoke-trail {
    position: absolute;
    width: 20px;
    height: 100px;
}

.smoke-trail path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: smokeRise 15s linear infinite;
}

.smoke-1 { top: 35%; left: 25%; }
.smoke-1 path { animation-delay: 0s; }
.smoke-2 { top: 50%; right: 30%; }
.smoke-2 path { animation-delay: 4s; }
.smoke-3 { top: 65%; left: 60%; }
.smoke-3 path { animation-delay: 8s; }
.smoke-4 { top: 75%; left: 42%; }
.smoke-4 path { animation-delay: 12s; }

@keyframes smokeRise {
    0% {
        stroke-dashoffset: 200;
        transform: translateY(0);
        opacity: 0.12;
    }
    80% {
        opacity: 0.08;
    }
    100% {
        stroke-dashoffset: 0;
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* --- Hero Section: The Candle Altar Zone --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

.hero-panel {
    position: relative;
    width: 60%;
    max-width: 800px;
    padding: 4rem 3rem;
    text-align: center;
    background: rgba(240, 230, 216, 0.45);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(61, 46, 36, 0.08), inset 0 1px 1px rgba(255, 248, 240, 0.6);
    opacity: 0;
    will-change: opacity, backdrop-filter;
    transition: backdrop-filter 600ms ease-out, -webkit-backdrop-filter 600ms ease-out, opacity 400ms ease-out;
}

.hero-panel.revealed {
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    opacity: 1;
}

.hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 6.5rem);
    color: #3D2E24;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    display: inline-block;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 350ms ease-out, transform 350ms ease-out;
}

.hero-title .letter.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-tagline {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #B8A899;
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity 500ms ease-out;
}

.hero-tagline.visible {
    opacity: 1;
}

/* --- Wax Drip Dividers --- */
.wax-divider {
    position: relative;
    z-index: 10;
    width: 100%;
    line-height: 0;
    margin: 0;
    padding: 0;
}

.wax-divider svg {
    display: block;
    width: 100%;
    height: 40px;
}

/* --- Content Sections (Fibonacci spacing: 34, 55, 89) --- */
.content-section {
    position: relative;
    z-index: 10;
    padding: 55px 5% 89px;
}

#initialization {
    padding-top: 34px;
}

#propagation {
    padding-top: 55px;
}

#transmissions {
    padding-top: 34px;
}

/* --- Section Labels (Frosted Pills) --- */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.4rem;
    margin-bottom: 2.5rem;
    background: rgba(240, 230, 216, 0.5);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(212, 165, 116, 0.15);
    border-radius: 100px;
    box-shadow: 0 4px 16px rgba(61, 46, 36, 0.05);
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.section-label.in-view {
    opacity: 1;
    transform: translateX(0);
}

.label-mono {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #d4a574;
}

.label-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #3D2E24;
}

/* --- Card Grid (auto-fit minmax 320px) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    perspective: 1200px;
}

/* --- Votive Cards (floating depth) --- */
.votive-card {
    position: relative;
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    transform-origin: center center;
    will-change: transform, opacity;
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.votive-card.in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.card-inner {
    position: relative;
    padding: 2rem 1.8rem;
    background: rgba(240, 230, 216, 0.45);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(61, 46, 36, 0.08), inset 0 1px 1px rgba(255, 248, 240, 0.6);
    transition:
        backdrop-filter 300ms ease,
        -webkit-backdrop-filter 300ms ease,
        border-color 300ms ease,
        box-shadow 300ms ease,
        transform 300ms ease;
}

/* Card hover: frost further, border brightens, halo expands, card lifts */
.card-inner:hover {
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-color: rgba(212, 165, 116, 0.5);
    box-shadow: 0 16px 48px rgba(212, 165, 116, 0.12), inset 0 1px 1px rgba(255, 248, 240, 0.7);
    transform: translateY(-4px);
}

/* On hover, the card flame holds steady at full brightness */
.card-inner:hover .card-flame svg {
    opacity: 1;
    filter: blur(0px);
    animation: none;
}

.card-flame {
    position: absolute;
    top: 1.2rem;
    right: 1.4rem;
}

.card-flame svg {
    width: 14px;
    height: 22px;
    opacity: 0.5;
    filter: blur(1px);
    transition: opacity 300ms ease, filter 300ms ease;
    animation: flameFlicker 2.5s ease-in-out infinite;
}

.card-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #3D2E24;
    margin-bottom: 0.75rem;
    padding-right: 2rem;
}

.card-body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    color: #3D2E24;
    line-height: 1.72;
    margin-bottom: 1rem;
}

.card-tag {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #7BBFB4;
    padding: 0.2rem 0.6rem;
    background: rgba(123, 191, 180, 0.1);
    border-radius: 6px;
}

/* --- Resonance Section (final atmospheric moment) --- */
.resonance-section {
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 89px 5%;
}

.resonance-shape {
    position: absolute;
    width: 40vw;
    height: 40vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(ellipse at center, rgba(242, 209, 196, 0.4) 0%, rgba(232, 196, 176, 0.15) 50%, transparent 70%);
    border-radius: 50%;
    animation: resonancePulse 8s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes resonancePulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.08); opacity: 0.9; }
}

.resonance-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.resonance-content.in-view {
    opacity: 1;
    transform: translateY(0);
}

.resonance-text {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #3D2E24;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.resonance-tag {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #d4a574;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem 5%;
    border-top: 1px solid rgba(212, 165, 116, 0.15);
}

.footer-text {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: #B8A899;
}

.footer-mono {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: #d4a574;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-panel {
        width: 90%;
        padding: 3rem 2rem;
    }

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

    .content-section {
        padding: 34px 4% 55px;
    }

    .shape-ellipse {
        width: 50vw;
        height: 35vw;
    }

    .shape-trapezoid {
        width: 35vw;
        height: 30vw;
    }

    .shape-circle {
        width: 18vw;
        height: 18vw;
    }

    .resonance-shape {
        width: 70vw;
        height: 70vw;
    }

    .flame-pulsers {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.2rem, 12vw, 3.5rem);
    }

    .section-label {
        padding: 0.4rem 1rem;
    }
}
