/* ===================================
   HOLOS.WORKS - CHROME FAIRY REALM
   =================================== */

/* Root Variables */
:root {
    --primary-bg: #1A1A2E;
    --secondary-bg: #16213E;
    --surface-chrome: #C0C0C0;
    --surface-highlight: #E8E8E8;
    --fairy-primary: #D4C5E2;
    --fairy-secondary: #A8D8EA;
    --fairy-glow: #F0C6D4;
    --text-primary: #E0DDE4;
    --text-secondary: #9B9B9B;
    --danger-accent: #E85D75;

    --chrome-gradient: linear-gradient(135deg, #C0C0C0 0%, #E8E8E8 40%, #A8A8A8 70%, #C0C0C0 100%);
    --fairy-shimmer: linear-gradient(45deg, #D4C5E2, #A8D8EA, #F0C6D4, #D4C5E2);
    --geode-gradient: radial-gradient(ellipse at center, #D4C5E2 0%, #16213E 50%, #1A1A2E 100%);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1.domain-title {
    font-size: 96px;
    background: var(--chrome-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

h2.section-title {
    font-size: 64px;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

h2.chrome-gradient-text {
    background: var(--chrome-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3.subsection-title {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 28px;
    color: var(--fairy-primary);
    margin-bottom: 1rem;
    font-weight: 400;
}

p.body-text {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

p.accent-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.display-numeral {
    font-family: 'Libre Baskerville', serif;
    font-size: 200px;
    font-weight: 700;
    background: var(--chrome-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(180, 160, 220, 0.4);
    text-align: center;
    line-height: 1;
    margin-bottom: 2rem;
}

.heart-text {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 32px;
    color: var(--fairy-primary);
    text-align: center;
    margin-bottom: 2rem;
}

.heart-statement {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 20px;
}

/* Marble Background Generator */
.marble-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.02" numOctaves="4" result="noise" seed="1"/><feDisplacementMap in="SourceGraphic" in2="noise" scale="50"/></filter></defs><rect width="1000" height="1000" fill="%23C0C0C0" filter="url(%23noise)"/></svg>');
    background-size: cover;
    opacity: 0.15;
    z-index: 0;
}

.marble-background.marble-intense {
    opacity: 0.4;
}

/* Section Styles - Strata */
.stratum {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.stratum-1 {
    background-color: var(--primary-bg);
}

.stratum-2 {
    background-color: var(--secondary-bg);
}

.stratum-3 {
    background: var(--geode-gradient);
}

.stratum-4 {
    background: radial-gradient(ellipse at center, var(--fairy-primary) 0%, var(--secondary-bg) 40%, var(--primary-bg) 100%);
}

.stratum-5 {
    background-color: var(--secondary-bg);
}

/* Chrome Surface for Opening Section */
.chrome-surface {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chrome-gradient);
    z-index: 2;
}

.domain-title {
    position: relative;
    transform: rotate(-0.8deg);
    z-index: 3;
}

.fairy-shimmer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--fairy-shimmer);
    background-size: 300% 300%;
    opacity: 0.1;
    animation: shimmer-flow 8s ease-in-out infinite;
    pointer-events: none;
}

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

/* Broken Grid Layout */
.broken-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto auto;
    gap: 16px 24px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.stratum-2 .broken-grid {
    gap: 120px 24px;
    grid-template-rows: auto auto auto auto;
}

.stratum-3 .broken-grid {
    gap: 16px 24px;
    grid-template-rows: auto auto auto auto;
}

/* Content Blocks */
.content-block {
    position: relative;
    padding: 2.5rem;
    background: rgba(26, 26, 46, 0.7);
    border: 1px solid var(--surface-chrome);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translate(0, 20px) rotate(0deg);
    animation: block-entrance 400ms ease-out forwards;
    z-index: 1;
}

.content-block:nth-child(1) { animation-delay: 0.1s; transform: rotate(-1.5deg) translateX(-12px); }
.content-block:nth-child(2) { animation-delay: 0.2s; transform: rotate(1.2deg) translateX(8px); }
.content-block:nth-child(3) { animation-delay: 0.3s; transform: rotate(-0.8deg) translateX(-8px); }
.content-block:nth-child(4) { animation-delay: 0.4s; transform: rotate(2deg) translateX(12px); }
.content-block:nth-child(5) { animation-delay: 0.5s; transform: rotate(-1.8deg) translateX(-14px); }
.content-block:nth-child(6) { animation-delay: 0.6s; transform: rotate(1.5deg) translateX(10px); }
.content-block:nth-child(7) { animation-delay: 0.7s; transform: rotate(-1.2deg) translateX(-10px); }
.content-block:nth-child(8) { animation-delay: 0.8s; transform: rotate(0.9deg) translateX(6px); }
.content-block:nth-child(9) { animation-delay: 0.9s; transform: rotate(-1deg) translateX(-8px); }

@keyframes block-entrance {
    from {
        opacity: 0;
        transform: translate(0, 20px);
    }
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

.content-block.with-marble {
    background:
        linear-gradient(135deg, #D4C5E2 0%, #A8D8EA 50%, #F0C6D4 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><filter id="m"><feTurbulence type="fractalNoise" baseFrequency="0.01" numOctaves="5" result="noise"/><feDisplacementMap in="SourceGraphic" in2="noise" scale="80"/></filter></defs><rect width="1000" height="1000" fill="%23C0C0C0" filter="url(%23m)"/></svg>');
    background-size: cover, cover;
    mix-blend-mode: overlay;
}

.block-overlap-rear {
    opacity: 0.7;
    mix-blend-mode: screen;
    z-index: 0;
}

.content-block:hover {
    transform: scale(1.02) rotate(var(--rotation, 0deg));
    box-shadow: 0 0 20px rgba(212, 197, 226, 0.3);
}

/* Interactive Links with Shake */
.interactive-link {
    cursor: pointer;
    color: var(--fairy-primary);
    text-decoration: underline;
    transition: color 200ms ease;
}

.interactive-link:hover {
    animation: shake-subtle 100ms ease-out-back;
    color: var(--fairy-glow);
}

/* Shake Animations */
@keyframes shake-subtle {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes shake-strong {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-8px) translateY(1px); }
    75% { transform: translateX(8px) translateY(-1px); }
}

@keyframes shake-cascade {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

[data-alive]:hover {
    animation: shake-subtle 150ms ease-out-back;
    will-change: transform;
}

/* Crystal Clusters */
.crystal-cluster {
    position: absolute;
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, var(--surface-chrome) 0%, var(--surface-highlight) 50%, var(--fairy-primary) 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0;
    animation: cluster-fade-in 800ms ease-out forwards;
}

@keyframes cluster-fade-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.cluster-1 { top: 20%; right: 5%; animation-delay: 0.2s; }
.cluster-2 { bottom: 30%; left: 3%; animation-delay: 0.4s; }
.cluster-3 { top: 15%; right: 8%; animation-delay: 0.3s; }
.cluster-4 { bottom: 25%; left: 5%; animation-delay: 0.5s; }
.cluster-5 { top: 45%; right: 12%; animation-delay: 0.4s; }
.cluster-center-1 { top: 20%; left: 10%; animation-delay: 0.2s; }
.cluster-center-2 { bottom: 20%; right: 10%; animation-delay: 0.3s; }

/* Facet Overlay */
.facet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="facets" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><polyline points="10,0 20,10 10,20 0,10" fill="none" stroke="%23C0C0C0" stroke-width="0.5" opacity="0.08"/></pattern></defs><rect width="100" height="100" fill="url(%23facets)"/></svg>');
    opacity: 0.08;
    z-index: 1;
    pointer-events: none;
}

/* Refraction Strips */
.refraction-strip {
    position: absolute;
    left: 0;
    width: 100%;
    height: 8px;
    backdrop-filter: hue-rotate(30deg) brightness(1.2);
    z-index: 1;
}

/* Floating Motes */
.floating-motes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.mote {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: var(--fairy-primary);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(212, 197, 226, 0.6);
    opacity: 0.6;
}

.mote-1 { top: 20%; left: 15%; animation: drift 40s linear infinite; }
.mote-2 { top: 40%; left: 80%; animation: drift 45s linear infinite 2s; }
.mote-3 { top: 60%; left: 30%; animation: drift 50s linear infinite 4s; }
.mote-4 { top: 75%; left: 70%; animation: drift 35s linear infinite 1s; }
.mote-5 { top: 10%; left: 50%; animation: drift 42s linear infinite 3s; }
.mote-6 { top: 25%; left: 10%; animation: drift 48s linear infinite 2.5s; }
.mote-7 { top: 55%; left: 85%; animation: drift 38s linear infinite 1.5s; }
.mote-8 { top: 70%; left: 25%; animation: drift 44s linear infinite 3.5s; }
.mote-9 { top: 15%; left: 60%; animation: drift 40s linear infinite 0.5s; }
.mote-10 { top: 45%; left: 20%; animation: drift 46s linear infinite 2s; }
.mote-11 { top: 65%; left: 75%; animation: drift 41s linear infinite 3s; }
.mote-12 { top: 30%; left: 85%; animation: drift 39s linear infinite 1.2s; }
.mote-13 { top: 50%; left: 35%; animation: drift 43s linear infinite 2.8s; }
.mote-14 { top: 80%; left: 55%; animation: drift 47s linear infinite 0.8s; }
.mote-15 { top: 35%; left: 70%; animation: drift 36s linear infinite 2.2s; }
.mote-16 { top: 20%; left: 40%; animation: drift 42s linear infinite 1s; }
.mote-17 { top: 60%; left: 60%; animation: drift 38s linear infinite 2.5s; }
.mote-18 { top: 40%; left: 50%; animation: drift 44s linear infinite 1.5s; }
.mote-19 { top: 25%; left: 30%; animation: drift 40s linear infinite 0.7s; }
.mote-20 { top: 70%; left: 80%; animation: drift 45s linear infinite 2s; }

@keyframes drift {
    0% { transform: translate(0, 0); }
    50% { transform: translate(20px, -10px); }
    100% { transform: translate(0, 0); }
}

/* The Heart Section */
.heart-center {
    position: relative;
    text-align: center;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

/* Crack Animations */
.crack-line {
    position: absolute;
    top: 0;
    right: 20%;
    width: 2px;
    height: 0;
    background: linear-gradient(180deg, rgba(212, 197, 226, 0.6), transparent);
    animation: crack-grow 3s ease-out forwards;
    z-index: 2;
}

@keyframes crack-grow {
    from { height: 0; }
    to { height: 40%; }
}

.crack-transition {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(180deg, rgba(212, 197, 226, 0.1) 0%, transparent 30%),
        linear-gradient(90deg, rgba(212, 197, 226, 0.05) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
}

.final-crack-reveal {
    position: absolute;
    bottom: 0;
    right: 20%;
    width: 3px;
    height: 30%;
    background: linear-gradient(180deg, var(--fairy-glow), var(--fairy-primary));
    box-shadow: 0 0 20px var(--fairy-glow);
    animation: crack-reveal-glow 2s ease-out forwards;
}

@keyframes crack-reveal-glow {
    from {
        height: 0;
        opacity: 0;
        box-shadow: 0 0 0px var(--fairy-glow);
    }
    to {
        height: 30%;
        opacity: 1;
        box-shadow: 0 0 30px var(--fairy-glow);
    }
}

.final-mirror {
    position: relative;
}

.final-mirror::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 0;
    right: 0;
    height: 100%;
    background: inherit;
    transform: scaleY(-1);
    filter: blur(8px);
    opacity: 0.15;
    pointer-events: none;
}

/* Crystal Navigation */
.crystal-nav {
    position: fixed;
    top: 40px;
    right: 40px;
    display: flex;
    gap: 20px;
    z-index: 100;
    flex-direction: column;
}

.nav-crystal {
    width: 24px;
    height: 32px;
    background: linear-gradient(135deg, var(--surface-chrome), var(--surface-highlight));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    cursor: pointer;
    transition: all 300ms ease;
    opacity: 0.6;
}

.nav-crystal:hover {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(212, 197, 226, 0.4);
}

.nav-crystal.active {
    background: linear-gradient(135deg, var(--fairy-primary), var(--fairy-glow));
    box-shadow: 0 0 20px var(--fairy-primary), inset 0 0 15px rgba(240, 198, 212, 0.3);
    animation: crystal-pulse 1.5s ease-in-out infinite;
}

@keyframes crystal-pulse {
    0%, 100% { box-shadow: 0 0 20px var(--fairy-primary), inset 0 0 15px rgba(240, 198, 212, 0.3); }
    50% { box-shadow: 0 0 30px var(--fairy-primary), inset 0 0 25px rgba(240, 198, 212, 0.5); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .broken-grid {
        grid-template-columns: repeat(6, 1fr);
        width: 95%;
    }

    .content-block {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        padding: 1.5rem;
    }

    h1.domain-title {
        font-size: 48px;
    }

    h2.section-title {
        font-size: 36px;
    }

    h3.subsection-title {
        font-size: 20px;
    }

    p.body-text {
        font-size: 16px;
    }

    .display-numeral {
        font-size: 120px;
    }

    .crystal-nav {
        top: 20px;
        right: 20px;
        flex-direction: row;
    }

    .crystal-cluster {
        display: none;
    }
}

@media (max-width: 480px) {
    .broken-grid {
        grid-template-columns: 1fr;
    }

    h1.domain-title {
        font-size: 36px;
    }

    h2.section-title {
        font-size: 28px;
    }

    .display-numeral {
        font-size: 80px;
    }

    .fairy-shimmer-overlay {
        display: none;
    }
}

/* Z-Index Stack */
.stratum { z-index: 1; }
.marble-background { z-index: 0; }
.facet-overlay { z-index: 1; }
.broken-grid { z-index: 2; }
.content-block { z-index: 3; }
.crystal-cluster { z-index: 2; }
.floating-motes { z-index: 1; }
.crystal-nav { z-index: 100; }
