/* ============================================
   rational.group - Fairycore Crystalline Sanctuary
   Ma-Negative-Space Layout
   ============================================ */

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

:root {
    /* Palette (Midnight-Blue) */
    --deep-midnight: #0A1628;
    --crystal-white: #E8EDF5;
    --starlight-blue: #4A90D9;
    --fairy-lilac: #B8A9E8;
    --ice-crystal: #D4E4F7;
    --deep-sapphire: #1A2D50;

    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Lato', sans-serif;
}

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

body {
    background-color: var(--deep-midnight);
    color: var(--crystal-white);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Crystal Field (scattered diamond motifs) --- */
.crystal-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.crystal {
    position: absolute;
    opacity: 0.3;
    animation: crystal-shimmer 8s ease-in-out infinite;
}

.crystal::before {
    content: '';
    display: block;
    background: linear-gradient(
        135deg,
        var(--starlight-blue) 0%,
        var(--fairy-lilac) 40%,
        var(--ice-crystal) 70%,
        transparent 100%
    );
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.crystal-1 {
    top: 8%;
    left: 5%;
    animation-delay: 0s;
}
.crystal-1::before {
    width: 40px;
    height: 40px;
}

.crystal-2 {
    top: 15%;
    right: 8%;
    animation-delay: -1.5s;
}
.crystal-2::before {
    width: 28px;
    height: 28px;
}

.crystal-3 {
    top: 35%;
    left: 3%;
    animation-delay: -3s;
}
.crystal-3::before {
    width: 52px;
    height: 52px;
}

.crystal-4 {
    top: 55%;
    right: 4%;
    animation-delay: -4.5s;
}
.crystal-4::before {
    width: 36px;
    height: 36px;
}

.crystal-5 {
    top: 72%;
    left: 7%;
    animation-delay: -2s;
}
.crystal-5::before {
    width: 24px;
    height: 24px;
}

.crystal-6 {
    top: 88%;
    right: 10%;
    animation-delay: -5.5s;
}
.crystal-6::before {
    width: 44px;
    height: 44px;
}

.crystal-7 {
    top: 45%;
    left: 92%;
    animation-delay: -6.5s;
}
.crystal-7::before {
    width: 20px;
    height: 20px;
}

.crystal-8 {
    top: 22%;
    left: 88%;
    animation-delay: -7s;
}
.crystal-8::before {
    width: 32px;
    height: 32px;
}

@keyframes crystal-shimmer {
    0%, 100% {
        opacity: 0.15;
        transform: rotate(0deg) scale(1);
    }
    25% {
        opacity: 0.35;
        transform: rotate(5deg) scale(1.05);
    }
    50% {
        opacity: 0.2;
        transform: rotate(-3deg) scale(0.98);
    }
    75% {
        opacity: 0.4;
        transform: rotate(2deg) scale(1.03);
    }
}

/* --- Bubble Field (water-bubble floating spheres) --- */
.bubble-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(74, 144, 217, 0.15),
        rgba(184, 169, 232, 0.08) 50%,
        rgba(212, 228, 247, 0.03) 80%,
        transparent 100%
    );
    box-shadow:
        inset 0 0 20px rgba(74, 144, 217, 0.1),
        inset -4px -4px 12px rgba(184, 169, 232, 0.06),
        0 0 30px rgba(74, 144, 217, 0.04);
    animation: bubble-float 12s ease-in-out infinite;
}

.bubble-1 {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 82%;
    animation-delay: 0s;
    animation-duration: 14s;
}

.bubble-2 {
    width: 80px;
    height: 80px;
    top: 30%;
    left: 2%;
    animation-delay: -3s;
    animation-duration: 11s;
}

.bubble-3 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 5%;
    animation-delay: -6s;
    animation-duration: 13s;
}

.bubble-4 {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 6%;
    animation-delay: -2s;
    animation-duration: 15s;
}

.bubble-5 {
    width: 45px;
    height: 45px;
    top: 48%;
    left: 90%;
    animation-delay: -8s;
    animation-duration: 10s;
}

.bubble-6 {
    width: 70px;
    height: 70px;
    top: 5%;
    left: 15%;
    animation-delay: -4.5s;
    animation-duration: 12s;
}

@keyframes bubble-float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-15px) translateX(8px);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-8px) translateX(-5px);
        opacity: 0.35;
    }
    75% {
        transform: translateY(-20px) translateX(3px);
        opacity: 0.55;
    }
}

/* --- Sanctuary (Main Content) --- */
.sanctuary {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 12vh 1.5rem;
}

/* --- Header --- */
.sanctuary-header {
    margin-bottom: 16vh;
    text-align: left;
}

.site-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--crystal-white);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.site-tagline {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--fairy-lilac);
    line-height: 1.6;
    opacity: 0.85;
}

/* --- Content Blocks --- */
.content-block {
    margin-bottom: 12vh;
    transition: transform 0.3s ease;
}

.content-block:hover {
    transform: scale(1.05);
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--starlight-blue);
    margin-bottom: 1.2rem;
    letter-spacing: -0.01em;
}

.section-body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--crystal-white);
    opacity: 0.9;
}

/* --- Principle Cards --- */
.principle-cards {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.principle-card {
    background-color: var(--deep-sapphire);
    border-radius: 12px;
    padding: 2rem 2rem 1.8rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(74, 144, 217, 0.1);
}

.principle-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 40px rgba(74, 144, 217, 0.1), 0 0 60px rgba(184, 169, 232, 0.05);
}

.principle-icon {
    margin-bottom: 1rem;
    opacity: 0.8;
}

.principle-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ice-crystal);
    margin-bottom: 0.6rem;
}

.principle-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--crystal-white);
    opacity: 0.8;
}

/* --- Conversation Threads --- */
.conversation-threads {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.thread-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(74, 144, 217, 0.12);
    transition: transform 0.3s ease;
}

.thread-item:last-child {
    border-bottom: none;
}

.thread-item:hover {
    transform: scale(1.05);
}

.thread-label {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--fairy-lilac);
    display: block;
    margin-bottom: 0.5rem;
}

.thread-preview {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--crystal-white);
    opacity: 0.75;
}

/* --- Community / Join --- */
.join-prompt {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 0.8rem 1.6rem;
    background-color: var(--deep-sapphire);
    border: 1px solid rgba(74, 144, 217, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.join-prompt:hover {
    transform: scale(1.05);
    border-color: var(--starlight-blue);
    box-shadow: 0 4px 24px rgba(74, 144, 217, 0.12);
}

.join-text {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--starlight-blue);
}

.join-arrow {
    font-size: 1.1rem;
    color: var(--fairy-lilac);
    transition: transform 0.3s ease;
}

.join-prompt:hover .join-arrow {
    transform: translateX(4px);
}

/* --- Footer --- */
.sanctuary-footer {
    margin-top: 8vh;
    padding-top: 2rem;
    border-top: 1px solid rgba(74, 144, 217, 0.08);
}

.footer-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--crystal-white);
    opacity: 0.4;
    letter-spacing: 0.02em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sanctuary {
        padding: 8vh 1.25rem;
    }

    .sanctuary-header {
        margin-bottom: 10vh;
    }

    .content-block {
        margin-bottom: 8vh;
    }

    .principle-card {
        padding: 1.5rem;
    }

    .crystal-1::before { width: 28px; height: 28px; }
    .crystal-3::before { width: 36px; height: 36px; }
    .crystal-6::before { width: 30px; height: 30px; }

    .bubble-1 { width: 80px; height: 80px; }
    .bubble-4 { width: 70px; height: 70px; }
}

@media (max-width: 480px) {
    .sanctuary {
        padding: 6vh 1rem;
    }

    .sanctuary-header {
        margin-bottom: 8vh;
    }

    .content-block {
        margin-bottom: 6vh;
    }
}
