/* Palette */
:root {
    --color-deep-void: #0B0D17;
    --color-dark-void: #1C1F2E;
    --color-midnight: #252840;
    --color-silver: #C8CDD9;
    --color-slate: #7B8294;
    --color-purple: #9B7EC8;
    --color-rust: #C4524A;
    --color-bronze: #B8A472;
    --color-teal: #5EADB8;
    --color-light-gray: #E8ECF2;

    --font-display: 'Jost', sans-serif;
    --font-serif: 'Lora', serif;
    --font-sans: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--color-deep-void);
    color: var(--color-silver);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
}

/* Meridian Overlay */
.meridian-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent calc(100% / 360 * 1 - 1px),
            rgba(155, 126, 200, 0.03) calc(100% / 360 * 1)
        );
    opacity: 0.5;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.15;
    mix-blend-mode: screen;
    border-radius: 50%;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background-color: var(--color-purple);
    top: 10%;
    left: 5%;
    animation: blob-float 8s ease-in-out infinite;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background-color: var(--color-bronze);
    top: 50%;
    right: 10%;
    animation: blob-float 10s ease-in-out infinite reverse;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background-color: var(--color-rust);
    bottom: 10%;
    left: 40%;
    animation: blob-float 12s ease-in-out infinite;
}

@keyframes blob-float {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(30px, -50px);
    }
    66% {
        transform: translate(-20px, 30px);
    }
}

/* Main Container */
main {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 3rem);
}

/* Masonry Grid */
.masonry-container {
    width: 100%;
    max-width: 100%;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(1rem, 2vw, 2rem);
    grid-auto-rows: clamp(280px, 30vh, 400px);
}

.masonry-card.span-2 {
    grid-column: span 2;
}

/* Card Styles */
.masonry-card {
    position: relative;
    background: linear-gradient(135deg, rgba(200, 205, 217, 0.1) 0%, rgba(155, 126, 200, 0.05) 100%);
    border: 1px solid rgba(200, 205, 217, 0.2);
    border-radius: 12px;
    padding: clamp(1.5rem, 3vw, 2rem);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.masonry-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.masonry-card:hover {
    background: linear-gradient(135deg, rgba(200, 205, 217, 0.15) 0%, rgba(155, 126, 200, 0.1) 100%);
    border-color: rgba(200, 205, 217, 0.4);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(155, 126, 200, 0.2);
}

.masonry-card:hover::before {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.card-title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-silver);
    text-transform: uppercase;
}

.card-subtitle {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--color-slate);
    font-style: italic;
    line-height: 1.4;
}

.card-text {
    font-size: 0.9rem;
    color: var(--color-slate);
    line-height: 1.5;
    flex-grow: 1;
}

/* Chrome Surface Element */
.chrome-surface {
    width: 100%;
    height: 80px;
    background: linear-gradient(45deg,
        var(--color-silver) 0%,
        rgba(200, 205, 217, 0.6) 25%,
        rgba(155, 126, 200, 0.3) 50%,
        rgba(200, 205, 217, 0.6) 75%,
        var(--color-silver) 100%);
    border-radius: 8px;
    box-shadow:
        inset -2px -2px 4px rgba(0, 0, 0, 0.4),
        inset 2px 2px 4px rgba(255, 255, 255, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.3);
    animation: chrome-shimmer 3s ease-in-out infinite;
}

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

/* Globe Wireframe */
.globe-wireframe {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.globe-core {
    width: 120px;
    height: 120px;
    border: 2px solid var(--color-silver);
    border-radius: 50%;
    position: relative;
    animation: rotate-globe 20s linear infinite;
    box-shadow:
        0 0 30px rgba(155, 126, 200, 0.3),
        inset 0 0 20px rgba(155, 126, 200, 0.1);
}

@keyframes rotate-globe {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.globe-line {
    position: absolute;
    background-color: var(--color-purple);
}

.globe-line-1 {
    width: 100%;
    height: 2px;
    top: 25%;
    left: 0;
    opacity: 0.6;
}

.globe-line-2 {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    opacity: 0.8;
}

.globe-line-3 {
    width: 100%;
    height: 2px;
    top: 75%;
    left: 0;
    opacity: 0.6;
}

.globe-line-4 {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    opacity: 0.7;
}

/* Ripple Effect */
.ripple-effect {
    width: 100%;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ripple-effect::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid var(--color-purple);
    border-radius: 50%;
    animation: ripple 2s ease-out infinite;
}

@keyframes ripple {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* Frost Crystal */
.frost-crystal {
    width: 100%;
    height: 80px;
    background:
        radial-gradient(circle at 30% 30%, var(--color-silver), transparent),
        radial-gradient(circle at 70% 70%, var(--color-purple), transparent);
    border-radius: 8px;
    opacity: 0.6;
    filter: blur(1px);
    animation: crystal-pulse 3s ease-in-out infinite;
}

@keyframes crystal-pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

/* Magnetic Field */
.magnetic-field {
    width: 100%;
    height: 100px;
    background:
        conic-gradient(from 0deg, var(--color-purple), var(--color-bronze), var(--color-rust), var(--color-purple));
    border-radius: 8px;
    opacity: 0.4;
    animation: magnetic-spin 8s linear infinite;
}

@keyframes magnetic-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Drift Wave */
.drift-wave {
    width: 100%;
    height: 60px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.drift-wave::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        var(--color-purple),
        transparent);
    animation: drift 3s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

/* Parallax Layers */
.parallax-layers {
    width: 100%;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.parallax-layers::before,
.parallax-layers::after {
    content: '';
    position: absolute;
    width: 90%;
    height: 3px;
    background-color: var(--color-purple);
    border-radius: 2px;
}

.parallax-layers::before {
    top: 30%;
    transform: translateZ(20px);
    opacity: 0.8;
}

.parallax-layers::after {
    bottom: 30%;
    transform: translateZ(-20px);
    opacity: 0.5;
}

/* Void Swirl */
.void-swirl {
    width: 100%;
    height: 120px;
    background:
        conic-gradient(from 0deg at 50% 50%,
            var(--color-deep-void) 0deg,
            var(--color-purple) 90deg,
            var(--color-slate) 180deg,
            var(--color-midnight) 270deg,
            var(--color-deep-void) 360deg);
    border-radius: 8px;
    opacity: 0.6;
    animation: swirl 4s linear infinite;
}

@keyframes swirl {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Reflection */
.reflection {
    width: 100%;
    height: 80px;
    background: linear-gradient(180deg,
        var(--color-silver) 0%,
        rgba(200, 205, 217, 0.5) 50%,
        transparent 100%);
    border-radius: 8px;
    transform: scaleY(-1);
    opacity: 0.6;
}

/* Hemisphere Split */
.hemisphere-split {
    width: 100%;
    height: 80px;
    display: flex;
    border-radius: 8px;
    overflow: hidden;
}

.hemisphere-split::before {
    content: '';
    flex: 1;
    background: linear-gradient(90deg, var(--color-purple), transparent);
}

.hemisphere-split::after {
    content: '';
    flex: 1;
    background: linear-gradient(90deg, transparent, var(--color-slate));
}

/* Gradient Field */
.gradient-field {
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg,
        var(--color-purple) 0%,
        var(--color-bronze) 50%,
        var(--color-rust) 100%);
    border-radius: 8px;
    animation: gradient-shift 4s ease-in-out infinite;
    background-size: 200% 200%;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Convergence Spiral */
.convergence-spiral {
    width: 100%;
    height: 80px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convergence-spiral::before {
    content: '';
    width: 80%;
    height: 60%;
    border: 2px solid var(--color-purple);
    border-radius: 50%;
    animation: spiral 3s ease-in-out infinite;
}

@keyframes spiral {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.5) rotate(180deg);
        opacity: 0;
    }
}

/* Dimensional Gate */
.dimensional-gate {
    width: 100%;
    height: 120px;
    background: repeating-linear-gradient(
        45deg,
        var(--color-purple),
        var(--color-purple) 10px,
        var(--color-midnight) 10px,
        var(--color-midnight) 20px
    );
    border-radius: 8px;
    animation: gate-pulse 2s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes gate-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

/* Echo Wave */
.echo-wave {
    width: 100%;
    height: 80px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.echo-wave::before,
.echo-wave::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--color-slate);
    opacity: 0;
}

.echo-wave::before {
    animation: echo 2s ease-out infinite;
}

.echo-wave::after {
    animation: echo 2s ease-out infinite 0.3s;
}

@keyframes echo {
    from {
        width: 0;
        opacity: 1;
    }
    to {
        width: 100%;
        opacity: 0;
    }
}

/* Chrome Pod */
.chrome-pod {
    width: 100%;
    height: 80px;
    background: radial-gradient(circle at 40% 40%,
        rgba(200, 205, 217, 0.8) 0%,
        rgba(155, 126, 200, 0.4) 50%,
        rgba(11, 13, 23, 0.8) 100%);
    border-radius: 50%;
    box-shadow:
        inset -2px -2px 8px rgba(0, 0, 0, 0.5),
        inset 2px 2px 8px rgba(255, 255, 255, 0.2),
        0 10px 30px rgba(155, 126, 200, 0.3);
}

/* Chromatic Blend */
.chromatic-blend {
    width: 100%;
    height: 80px;
    background: linear-gradient(90deg,
        var(--color-teal) 0%,
        var(--color-purple) 50%,
        var(--color-light-gray) 100%);
    border-radius: 8px;
    animation: chromatic-shift 4s ease-in-out infinite;
    background-size: 200% 100%;
}

@keyframes chromatic-shift {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
        grid-auto-rows: clamp(200px, 25vh, 300px);
    }

    .masonry-card.span-2 {
        grid-column: span 1;
    }

    .card-title {
        font-size: clamp(1rem, 2.5vw, 1.3rem);
    }

    .globe-core {
        width: 90px;
        height: 90px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.75rem;
    }

    .masonry-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        grid-auto-rows: 250px;
    }

    .card-content {
        gap: 0.75rem;
    }

    .card-title {
        font-size: 1.1rem;
    }
}
