/* ============================================
   mosun.xyz — Seapunk Contradiction Abyss
   ============================================ */

/* CSS Custom Properties */
:root {
    --abyss: #040a12;
    --deep-water: #0a1628;
    --aquamarine: #2ae8c8;
    --coral: #ff6b7f;
    --frost: #c8e6f5;
    --muted-ocean: #8fb4c8;
    --paradox-violet: #e0d6ff;
    --teal-gray: #5a8a9c;
    --translucent-teal: rgba(42, 232, 200, 0.08);
    --card-bg: rgba(10, 22, 40, 0.7);
    --card-border: rgba(42, 232, 200, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--abyss);
    color: var(--muted-ocean);
    overflow-x: hidden;
    line-height: 1.7;
}

/* ---- Floating Nav ---- */
.floating-nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 24px;
    padding: 10px 28px;
    background: rgba(10, 22, 40, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.floating-nav.visible {
    opacity: 1;
    pointer-events: auto;
}

.floating-nav a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--teal-gray);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color 0.3s;
}

.floating-nav a:hover {
    color: var(--aquamarine);
}

/* ---- Particle Pool ---- */
#particle-pool {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--aquamarine);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

/* ---- Ambient Lights ---- */
#ambient-lights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ambient-light {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(42, 232, 200, 0.3), transparent 70%);
    animation: drift-light 12s ease-in-out infinite alternate;
}

.light-1 { width: 30px; height: 30px; top: 20%; left: 15%; animation-delay: 0s; }
.light-2 { width: 25px; height: 25px; top: 45%; left: 75%; animation-delay: -3s; }
.light-3 { width: 35px; height: 35px; top: 70%; left: 40%; animation-delay: -6s; }
.light-4 { width: 20px; height: 20px; top: 30%; left: 60%; animation-delay: -9s; }
.light-5 { width: 28px; height: 28px; top: 85%; left: 25%; animation-delay: -2s; }

@keyframes drift-light {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, -30px); }
}

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

.bg-blob {
    position: absolute;
    animation: blob-drift 15s ease-in-out infinite alternate;
}

.bg-blob-1 { width: 350px; top: 10%; right: -50px; animation-duration: 12s; }
.bg-blob-2 { width: 250px; top: 50%; left: -30px; animation-duration: 14s; animation-delay: -4s; }
.bg-blob-3 { width: 180px; bottom: 15%; right: 10%; animation-duration: 10s; animation-delay: -7s; }

@keyframes blob-drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(20px, -15px) rotate(3deg); }
    100% { transform: translate(-10px, 10px) rotate(-2deg); }
}

/* Blob path breathing */
.blob-path {
    animation: blob-breathe 8s ease-in-out infinite alternate;
}

@keyframes blob-breathe {
    0% { transform: scale(1); transform-origin: center; }
    100% { transform: scale(1.04); transform-origin: center; }
}

/* ---- Section: The Descent ---- */
.section-descent {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

.descent-content {
    text-align: center;
    position: relative;
}

.hero-blob {
    width: 300px;
    height: 300px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: hero-blob-in 1s ease-out 0.4s forwards, hero-blob-pulse 4s ease-in-out 1.4s infinite alternate;
}

@keyframes hero-blob-in {
    to { opacity: 1; }
}

@keyframes hero-blob-pulse {
    0% { transform: translate(-50%, -50%) scale(0.95); }
    100% { transform: translate(-50%, -50%) scale(1.05); }
}

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--frost);
    opacity: 0.6;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    clip-path: inset(0 50% 0 50%);
    animation: title-reveal 0.6s ease-out 0.8s forwards;
}

@keyframes title-reveal {
    to { clip-path: inset(0 0% 0 0%); }
}

.kanji-subtitle {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--aquamarine);
    letter-spacing: 0.15em;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(10px);
    animation: kanji-in 0.8s ease-out 1.2s forwards;
}

@keyframes kanji-in {
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Section: Specimen Grid ---- */
.section-specimens {
    position: relative;
    z-index: 10;
    padding: 100px 24px 120px;
    min-height: 100vh;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(42, 232, 200, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(42, 232, 200, 0.05) 1px, transparent 1px);
    background-size: 80px 80px;
    transform: rotate(0.5deg);
    z-index: 0;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.specimen-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

.specimen-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.specimen-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 70%, rgba(42, 232, 200, 0.12), transparent 60%);
    pointer-events: none;
}

.specimen-card:hover {
    border-color: rgba(42, 232, 200, 0.6);
}

.card-tall {
    min-height: 380px;
}

.specimen-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--teal-gray);
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 12px;
}

.specimen-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    color: var(--frost);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
    line-height: 1.3;
}

.card-blob {
    width: 120px;
    height: 120px;
    display: block;
    margin: 0 auto 16px;
}

.specimen-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--muted-ocean);
    line-height: 1.7;
    max-width: 38ch;
}

/* ---- Section: Collision Zone ---- */
.section-collision {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

.collision-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collision-blob {
    position: absolute;
    width: 40vw;
    max-width: 450px;
    height: auto;
    transition: transform 0.1s linear;
}

.blob-spear {
    transform: translateX(-50vw);
}

.blob-shield {
    mix-blend-mode: screen;
    transform: translateX(50vw);
}

.collision-text {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 0 24px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.collision-text.visible {
    opacity: 1;
}

.collision-question {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--frost);
    letter-spacing: 0.06em;
    max-width: 600px;
    line-height: 1.5;
}

/* Glyphs */
.glyph {
    position: absolute;
    z-index: 3;
    opacity: 0.6;
    transition: transform 1s ease, opacity 1s ease;
}

.glyph-spear {
    width: 40px;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
}

.glyph-shield {
    width: 80px;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
}

/* ---- Section: Abyss Floor ---- */
.section-abyss {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 80px 24px;
}

#abyss-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.abyss-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--aquamarine);
    opacity: 0.2;
    transition: transform 0.6s ease-out;
}

.abyss-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--frost);
    opacity: 0.7;
    text-align: center;
    max-width: 550px;
    letter-spacing: 0.06em;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .hero-blob { opacity: 1; transform: translate(-50%, -50%); }
    .site-title { clip-path: none; opacity: 0.6; }
    .kanji-subtitle { opacity: 1; transform: none; }
    .specimen-card { opacity: 1; transform: none; }
    .collision-text { opacity: 1; }
    .blob-spear { transform: translateX(-10vw); }
    .blob-shield { transform: translateX(10vw); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .specimen-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }

    .collision-blob {
        width: 60vw;
    }

    .glyph-spear { left: 3%; }
    .glyph-shield { right: 3%; }

    .floating-nav {
        gap: 14px;
        padding: 8px 18px;
    }
}

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