/* ============================================================
   hanun.ai — Crystalline Graffiti Throne
   Navy-Metallic Cold Palette | Serif-Revival | Pulse-Attention
   ============================================================ */

/* --- Custom Properties --- */
:root {
    --deep-foundation: #0A1628;
    --secondary-ground: #132238;
    --metallic-primary: #C0C0C0;
    --metallic-accent: #E0DFE0;
    --crystal-accent: #4A7FB5;
    --crystal-glow: #6BA3D6;
    --warm-metallic: #8B7355;
    --text-muted: #5A6A7A;
    --steel-blue-silver: #B8C4D0;
    --body-text: #8899AA;
    --body-emphasis: #A0B0C0;
    --bright-silver: #E0E0E0;
    --platinum-sheen: #E8E8E8;
    --chrome-sweep: linear-gradient(135deg, #C0C0C0 0%, #E8E8E8 30%, #E0DFE0 50%, #A0A0A0 70%, #C0C0C0 100%);
    --navy-depth: radial-gradient(ellipse at 30% 20%, #1A2D4A 0%, #0A1628 70%);
    --crystal-edge: linear-gradient(90deg, transparent 0%, #4A7FB5 50%, transparent 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-foundation);
    background-image: var(--navy-depth);
    background-attachment: fixed;
    color: var(--body-text);
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Facet Grid Overlay --- */
.facet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    opacity: 0.05;
    z-index: 1;
}

/* --- Crystal Dust Particles --- */
.crystal-dust {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

.dust-particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: radial-gradient(circle, var(--crystal-accent) 0%, transparent 70%);
    animation: particleDrift var(--dur) ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: 0.6;
}

@keyframes particleDrift {
    0% {
        transform: translate(0, 0) scale(0.8);
        opacity: 0.4;
    }
    25% {
        transform: translate(2vw, -3vh) scale(1.1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-1vw, -6vh) scale(1.2);
        opacity: 0.5;
    }
    75% {
        transform: translate(3vw, -2vh) scale(0.9);
        opacity: 0.6;
    }
    100% {
        transform: translate(0, 0) scale(0.8);
        opacity: 0.4;
    }
}

/* --- Panels --- */
.panel {
    position: relative;
    width: 100%;
    z-index: 3;
}

.panel--hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-depth);
}

.panel--statement {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 12vw;
    padding-right: 12vw;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 70% 40%, #1A2D4A 0%, var(--deep-foundation) 70%);
}

.panel--gallery {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6vw;
    padding: 8vh 12vw;
    flex-wrap: wrap;
    background: radial-gradient(ellipse at 40% 60%, #1A2D4A 0%, var(--deep-foundation) 70%);
}

.panel--archive {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 20% 50%, #1A2D4A 0%, var(--deep-foundation) 70%);
}

.panel--seal {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4vh;
    padding: 8vh 16vw;
    position: relative;
    background: radial-gradient(ellipse at 50% 50%, #1A2D4A 0%, var(--deep-foundation) 60%);
    overflow: hidden;
}

/* --- Fracture Zones --- */
.fracture-zone {
    width: 100%;
    height: 30vh;
    position: relative;
    z-index: 3;
    overflow: hidden;
}

.lattice-mesh {
    width: 100%;
    height: 100%;
}

.lattice-node {
    animation: nodePulse 10s ease-in-out infinite;
}

.lattice-node:nth-child(2) { animation-delay: 1.5s; }
.lattice-node:nth-child(3) { animation-delay: 3s; }
.lattice-node:nth-child(4) { animation-delay: 4.5s; }
.lattice-node:nth-child(5) { animation-delay: 6s; }
.lattice-node:nth-child(6) { animation-delay: 7.5s; }
.lattice-node:nth-child(7) { animation-delay: 9s; }
.lattice-node:nth-child(8) { animation-delay: 10.5s; }

@keyframes nodePulse {
    0%, 100% {
        opacity: 0;
        r: 2;
    }
    50% {
        opacity: 0.8;
        r: 4;
    }
}

/* === SECTION 1: THE WALL (Hero) === */
.hero-lockup {
    width: 80vw;
    max-width: 90vmin;
    height: auto;
}

/* Facet pulse animation */
.facet {
    animation: facetPulse 4s ease-in-out infinite;
    animation-delay: calc(var(--facet-index, 0) * 0.3s);
}

@keyframes facetPulse {
    0%, 100% {
        opacity: 0.85;
    }
    50% {
        opacity: 1;
    }
}

.facet.shimmer {
    animation: shimmerPulse 5s ease-in-out infinite;
    animation-delay: calc(var(--facet-index, 0) * 0.4s);
}

@keyframes shimmerPulse {
    0%, 100% {
        opacity: 0.08;
    }
    50% {
        opacity: 0.22;
    }
}

.facet.crystal {
    animation: crystalPulse 3.5s ease-in-out infinite;
    animation-delay: calc(var(--facet-index, 0) * 0.35s);
}

@keyframes crystalPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

.facet.crystal-glow {
    animation: glowPulse 4s ease-in-out infinite;
    animation-delay: calc(var(--facet-index, 0) * 0.5s);
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.05;
    }
    50% {
        opacity: 0.15;
    }
}

/* Hero letter entry animation */
.letter {
    animation: letterAssemble 2.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: calc(var(--facet-index, 0) * 0.15s);
    opacity: 0;
    transform-origin: center center;
}

@keyframes letterAssemble {
    0% {
        opacity: 0;
        transform: translate(calc(var(--facet-index, 0) * -10px), calc(var(--facet-index, 0) * 15px)) rotate(calc(var(--facet-index, 0) * 3deg));
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }
}

/* Drip animation */
.drip {
    animation: dripPulse 6s ease-in-out infinite;
    animation-delay: calc(var(--facet-index, 0) * 0.5s);
}

@keyframes dripPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

/* Prismatic ray subtle pulse */
.prismatic-ray {
    animation: rayPulse 8s ease-in-out infinite;
}

@keyframes rayPulse {
    0%, 100% {
        opacity: 0.08;
    }
    50% {
        opacity: 0.2;
    }
}

/* === SECTION 2: THE PROCLAMATION === */
.proclamation-content {
    position: relative;
    z-index: 2;
    max-width: 60vw;
}

.proclamation-text {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 5rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--steel-blue-silver);
    line-height: 1.2;
    animation: textPulse 4s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.85;
    }
    50% {
        opacity: 1;
    }
}

.prismatic-diagonal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.crystal-formation {
    position: absolute;
    height: 70%;
    width: auto;
    z-index: 1;
}

.crystal-formation--right {
    right: 0;
    top: 15%;
}

.crystal-formation--left {
    left: 0;
    top: 15%;
}

.crystal-cluster .facet {
    animation: facetPulse 4s ease-in-out infinite;
    animation-delay: calc(var(--facet-index, 0) * 0.6s);
}

/* === SECTION 3: THE GALLERY === */
.gallery-piece {
    position: relative;
    flex-shrink: 0;
}

.gallery-piece--1 {
    align-self: flex-end;
}

.gallery-piece--2 {
    align-self: center;
}

.gallery-piece--3 {
    align-self: flex-start;
}

.crystal-art {
    width: clamp(12rem, 20vw, 22rem);
    height: auto;
}

.tag-flourish {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.2rem;
    color: var(--text-muted);
    opacity: 0.3;
    position: absolute;
    bottom: -2rem;
    right: -1rem;
    transform: rotate(-5deg);
    text-shadow: 1px 1px 3px var(--deep-foundation);
}

/* === SECTION 4: THE ARCHIVE === */
.archive-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5vh;
    z-index: 2;
    padding: 0 16vw;
    width: 100%;
}

.archive-specimen {
    text-align: center;
}

.archive-specimen--playfair .specimen-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(6rem, 16vw, 18vw);
    letter-spacing: -0.04em;
    line-height: 1;
    background: var(--chrome-sweep);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: chromeShimmer 6s ease-in-out infinite;
}

@keyframes chromeShimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gold-rule {
    border: none;
    height: 1px;
    width: 20vw;
    background: var(--warm-metallic);
    opacity: 0.7;
}

.gold-rule--seal {
    width: 10vw;
    opacity: 0.5;
}

.archive-specimen--cormorant .specimen-label {
    display: block;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 1.5vh;
}

.archive-specimen--cormorant .specimen-text {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 6rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--steel-blue-silver);
}

.archive-specimen--marker .specimen-text {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(2rem, 4vw, 4rem);
    color: var(--bright-silver);
    text-shadow: 2px 2px 6px var(--deep-foundation);
    animation: tagPulse 4s ease-in-out infinite;
}

@keyframes tagPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* === SECTION 5: THE SEAL === */
.crystal-dust--dense {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.seal-emblem {
    width: clamp(15rem, 30vw, 25rem);
    height: auto;
    z-index: 2;
}

.seal-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: 1.125rem;
    color: var(--body-emphasis);
    text-align: center;
    z-index: 2;
    animation: textPulse 4s ease-in-out infinite;
    animation-delay: 1s;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .facet,
    .facet.shimmer,
    .facet.crystal,
    .facet.crystal-glow,
    .letter,
    .drip,
    .prismatic-ray,
    .lattice-node,
    .dust-particle,
    .proclamation-text,
    .archive-specimen--playfair .specimen-text,
    .archive-specimen--marker .specimen-text,
    .seal-text {
        animation: none;
    }

    .letter {
        opacity: 1;
        transform: none;
    }
}
