/* ============================================
   aei.st - Contemplative Pixel Temple
   ============================================ */

/* --- Color Palette ---
   Void Black:        #0A0A0A
   Temple Charcoal:   #1A1714
   Imperial Gold:     #C9A84C
   Burnished Bronze:  #8B7335
   Pale Parchment:    #F5F0E1
   Weathered Gold:    #A89F8A
   Deep Lacquer:      #2A1F0F
   Ember Red:         #8C3A2A
   Pure Black:        #000000
*/

/* --- Reset & Global --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0;
    box-shadow: none;
}

html {
    font-size: 16px;
    scroll-behavior: auto;
}

body {
    background: #0A0A0A;
    background-image: radial-gradient(circle at 50% 50%, #0A0A0A 0%, #000000 100%);
    color: #A89F8A;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    line-height: 1.8;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle noise texture overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect x='0' y='0' width='1' height='1' fill='%23fff' opacity='0.5'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23fff' opacity='0.3'/%3E%3Crect x='1' y='3' width='1' height='1' fill='%23fff' opacity='0.4'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%23fff' opacity='0.2'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Scroll Container --- */
#scroll-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
    scroll-behavior: smooth;
}

/* --- Pixel utility --- */
.pixel {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* --- Pixel font (Silkscreen) --- */
.pixel-font {
    font-family: 'Silkscreen', cursive;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
}

/* --- Chamber (section) base --- */
.chamber {
    min-height: 100vh;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0A0A0A;
}

.chamber-alt {
    background: #1A1714;
}

/* --- Chamber content column --- */
.chamber-content {
    max-width: 640px;
    width: 100%;
    padding: 80px 24px 40px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-align: center;
}

/* --- Section titles --- */
.section-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2rem, 5vw, 4.5rem);
    color: #C9A84C;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 32px;
    line-height: 1.2;
}

/* --- Section Icons --- */
.section-icon {
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.section-icon svg {
    display: block;
}

/* --- Section Dividers --- */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    background: #0A0A0A;
    position: relative;
    z-index: 3;
    gap: 0;
}

.divider-line {
    display: block;
    width: 60vw;
    max-width: 600px;
    height: 1px;
    background: #C9A84C;
}

.diamond {
    display: block;
    width: 8px;
    height: 8px;
    background: #C9A84C;
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* ============================================
   CHAMBER 1: THE GATE
   ============================================ */
#the-gate {
    background: #0A0A0A;
}

.sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    z-index: 0;
    pointer-events: none;
}

.sunburst::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            #2A1F0F 0deg 2deg,
            transparent 2deg 10deg
        );
    opacity: 0.4;
}

.gate-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.gate-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(4rem, 10vw, 8rem);
    color: #C9A84C;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 32px;
}

.gate-tagline {
    color: #A89F8A;
    font-size: 16px;
    letter-spacing: 0.1em;
}

.scroll-chevron {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: pulse-chevron 4s ease-in-out infinite;
}

@keyframes pulse-chevron {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* ============================================
   CHAMBER 2: THE GARDEN
   ============================================ */
#the-garden {
    background: #1A1714;
}

.garden-stones {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 48px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.stone-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 180px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease-in-out, transform 600ms ease-in-out;
}

.stone-group.visible {
    opacity: 1;
    transform: translateY(0);
}

.stone-icon {
    margin-bottom: 16px;
}

.stone-icon svg {
    display: block;
}

.stone-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.875rem;
    color: #A89F8A;
    line-height: 1.8;
    text-align: center;
}

/* Bubble container */
.bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.pixel-bubble {
    position: absolute;
    background: #C9A84C;
    opacity: 0.18;
    clip-path: polygon(
        25% 0%, 75% 0%,
        100% 25%, 100% 75%,
        75% 100%, 25% 100%,
        0% 75%, 0% 25%
    );
    animation: bubble-rise linear infinite;
    animation-timing-function: steps(60);
}

@keyframes bubble-rise {
    0% {
        transform: translateY(100vh);
        opacity: 0.18;
    }
    80% {
        opacity: 0.18;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

/* ============================================
   CHAMBER 3: THE ARCHIVE
   ============================================ */
#the-archive {
    background: #0A0A0A;
}

.archive-cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 8px;
    text-align: left;
}

.archive-card {
    display: flex;
    align-items: center;
    height: 80px;
    border-left: 4px solid #8B7335;
    padding: 0 24px;
    position: relative;
    transition: border-color 600ms ease-in-out;
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 600ms ease-in-out, transform 600ms ease-in-out, border-color 600ms ease-in-out;
}

.archive-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.archive-card:hover {
    border-left-color: #C9A84C;
}

.archive-card:hover .card-bubble {
    opacity: 1;
    transform: scale(1);
}

.card-label {
    color: #C9A84C;
    font-size: 16px;
    min-width: 120px;
    flex-shrink: 0;
}

.card-desc {
    color: #A89F8A;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.card-bubble {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: scale(0) translateY(-50%);
    width: 8px;
    height: 8px;
    background: #C9A84C;
    clip-path: polygon(
        25% 0%, 75% 0%,
        100% 25%, 100% 75%,
        75% 100%, 25% 100%,
        0% 75%, 0% 25%
    );
    opacity: 0;
    transition: opacity 400ms ease-in-out, transform 400ms ease-in-out;
}

/* ============================================
   CHAMBER 4: THE LANTERN
   ============================================ */
#the-lantern {
    background: #1A1714;
}

.lantern-icon-wrap {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.lantern-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.lantern-text {
    text-align: left;
    max-width: 560px;
    margin: 0 auto;
}

.lantern-text p {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: #A89F8A;
    line-height: 2.0;
    margin-bottom: 24px;
}

.lantern-text p:last-child {
    margin-bottom: 0;
}

/* ============================================
   CHAMBER 5: THE REFLECTION
   ============================================ */
#the-reflection {
    background: #0A0A0A;
}

.reflection-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.reflection-words {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #C9A84C;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.4;
    text-align: center;
    max-width: 600px;
    margin-bottom: 48px;
}

.reveal-word {
    opacity: 0;
    transition: opacity 600ms ease-in-out;
    display: inline;
}

.reveal-word.visible {
    opacity: 1;
}

.reflection-attribution {
    color: #A89F8A;
    font-size: 16px;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 800ms ease-in-out;
}

.reflection-attribution.visible {
    opacity: 1;
}

/* ============================================
   CHAMBER 6: THE SEAL
   ============================================ */
#the-seal {
    background: #1A1714;
}

.seal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.seal-identity {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: #C9A84C;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.seal-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.seal-link {
    color: #A89F8A;
    text-decoration: none;
    font-size: 16px;
    letter-spacing: 0.05em;
    transition: color 600ms ease-in-out;
}

.seal-link:hover {
    color: #C9A84C;
}

.hanko-seal {
    margin-top: 24px;
}

.hanko-seal svg {
    display: block;
}

.deco-fan {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 200px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.15;
}

.deco-fan::before {
    content: '';
    position: absolute;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    border: 1px solid #2A1F0F;
    border-radius: 0;
    background:
        repeating-conic-gradient(
            from 0deg at 50% 100%,
            #2A1F0F 0deg 3deg,
            transparent 3deg 12deg
        );
}

/* --- Stepped chevron border pattern --- */
.archive-content::before,
.lantern-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 640px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8' viewBox='0 0 16 8'%3E%3Crect x='0' y='6' width='2' height='2' fill='%238B7335'/%3E%3Crect x='2' y='4' width='2' height='2' fill='%238B7335'/%3E%3Crect x='4' y='2' width='2' height='2' fill='%238B7335'/%3E%3Crect x='6' y='0' width='2' height='2' fill='%238B7335'/%3E%3Crect x='8' y='0' width='2' height='2' fill='%238B7335'/%3E%3Crect x='10' y='2' width='2' height='2' fill='%238B7335'/%3E%3Crect x='12' y='4' width='2' height='2' fill='%238B7335'/%3E%3Crect x='14' y='6' width='2' height='2' fill='%238B7335'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    opacity: 0.5;
}

/* --- Pixel dissolve transition between sections --- */
.section-divider {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='4' height='4' fill='%230A0A0A'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%230A0A0A'/%3E%3Crect x='4' y='0' width='4' height='4' fill='%231A1714' opacity='0.5'/%3E%3Crect x='0' y='4' width='4' height='4' fill='%231A1714' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
    .garden-stones {
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .stone-group {
        max-width: 280px;
    }

    .archive-card {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 16px 24px;
        gap: 4px;
    }

    .card-label {
        min-width: auto;
    }

    .gate-title {
        letter-spacing: 0.15em;
    }

    .reflection-words {
        font-size: clamp(1.5rem, 5vw, 3rem);
    }

    .lantern-icon-wrap svg {
        width: 128px;
        height: 128px;
    }
}

@media (max-width: 480px) {
    .chamber-content {
        padding: 60px 16px 32px;
    }

    .seal-nav {
        gap: 8px;
    }
}

/* --- Floating decorative icons for wide screens --- */
@media (min-width: 1200px) {
    .chamber::before {
        content: '';
        position: absolute;
        width: 64px;
        height: 64px;
        left: calc(50% - 400px);
        top: 50%;
        transform: translateY(-50%);
        background: none;
        pointer-events: none;
    }

    #the-garden::before {
        content: '';
        position: absolute;
        left: calc(50% - 420px);
        top: 40%;
        width: 32px;
        height: 32px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Crect x='2' y='0' width='4' height='6' fill='%23C9A84C'/%3E%3Crect x='1' y='6' width='6' height='2' fill='%238B7335'/%3E%3C/svg%3E") no-repeat;
        background-size: contain;
        image-rendering: pixelated;
        opacity: 0.3;
    }

    #the-garden::after {
        content: '';
        position: absolute;
        right: calc(50% - 420px);
        top: 60%;
        width: 24px;
        height: 24px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Crect x='3' y='1' width='2' height='4' fill='%23C9A84C'/%3E%3Crect x='2' y='5' width='4' height='2' fill='%238B7335'/%3E%3C/svg%3E") no-repeat;
        background-size: contain;
        image-rendering: pixelated;
        opacity: 0.25;
    }

    #the-archive::after {
        content: '';
        position: absolute;
        right: calc(50% - 440px);
        top: 45%;
        width: 32px;
        height: 32px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Crect x='1' y='1' width='6' height='5' fill='%23C9A84C'/%3E%3Crect x='3' y='0' width='2' height='1' fill='%238B7335'/%3E%3Crect x='2' y='6' width='4' height='1' fill='%238B7335'/%3E%3C/svg%3E") no-repeat;
        background-size: contain;
        image-rendering: pixelated;
        opacity: 0.2;
    }
}

/* --- Reveal items base --- */
.reveal-item {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease-in-out, transform 600ms ease-in-out;
}

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