/* =====================================================
   THE IGNORANT OBSERVER - Website Styles
   A metaphysical theme bridging consciousness and physics
   ===================================================== */

/* CSS Variables */
:root {
    --color-bg-deep: #0a0a0f;
    --color-bg-primary: #0d0d14;
    --color-bg-secondary: #14141f;
    --color-bg-card: #1a1a28;
    --color-bg-card-hover: #222235;

    --color-accent-primary: #8b7ec8;
    --color-accent-secondary: #6b5b95;
    --color-accent-glow: rgba(139, 126, 200, 0.3);
    --color-accent-gold: #c9a962;
    --color-accent-gold-glow: rgba(201, 169, 98, 0.3);

    --color-text-primary: #e8e6f0;
    --color-text-secondary: #a8a6b8;
    --color-text-muted: #6b6980;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Philosopher', 'Segoe UI', sans-serif;

    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;

    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 8px 40px rgba(139, 126, 200, 0.2);
    --shadow-glow: 0 0 30px var(--color-accent-glow);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-deep);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Star Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
        180deg,
        var(--color-bg-deep) 0%,
        #0f0f1a 50%,
        #12121f 100%
    );
}

.stars, .stars2, .stars3 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.stars {
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 230px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 370px 50px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 450px 200px, rgba(255,255,255,0.5), transparent);
    background-repeat: repeat;
    background-size: 500px 300px;
    animation: twinkle 8s ease-in-out infinite;
}

.stars2 {
    background-image:
        radial-gradient(1px 1px at 50px 100px, rgba(139,126,200,0.6), transparent),
        radial-gradient(2px 2px at 150px 50px, rgba(139,126,200,0.4), transparent),
        radial-gradient(1px 1px at 250px 180px, rgba(139,126,200,0.5), transparent),
        radial-gradient(2px 2px at 350px 90px, rgba(201,169,98,0.4), transparent),
        radial-gradient(1px 1px at 420px 160px, rgba(201,169,98,0.3), transparent);
    background-repeat: repeat;
    background-size: 500px 250px;
    animation: twinkle 12s ease-in-out infinite;
    animation-delay: -4s;
}

.stars3 {
    background-image:
        radial-gradient(1px 1px at 80px 140px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 200px 80px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 320px 200px, rgba(255,255,255,0.4), transparent);
    background-repeat: repeat;
    background-size: 400px 280px;
    animation: twinkle 15s ease-in-out infinite;
    animation-delay: -8s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Snake Animation */
.snake-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.snake-path {
    /* Path is hidden, only used for orb movement calculation */
}

.snake-orb, .snake-orb-core {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.snake-orb.active {
    opacity: 0.6;
}

.snake-orb-core.active {
    opacity: 0.8;
}

.snake-orb.glowing {
    opacity: 1;
    filter: url(#glow-filter);
    animation: orbPulse 1s ease-in-out;
}

.snake-orb-core.glowing {
    opacity: 1;
    animation: corePulse 1s ease-in-out;
}

@keyframes orbPulse {
    0%, 100% {
        r: 6;
    }
    50% {
        r: 10;
    }
}

@keyframes corePulse {
    0%, 100% {
        r: 3;
    }
    50% {
        r: 5;
    }
}

/* Header */
.header {
    text-align: center;
    padding: 80px 20px 60px;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--color-accent-primary),
        transparent
    );
}

.site-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
    background: linear-gradient(
        135deg,
        var(--color-text-primary) 0%,
        var(--color-accent-primary) 50%,
        var(--color-accent-gold) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px var(--color-accent-glow);
}

.site-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--color-text-secondary);
    font-weight: 400;
    letter-spacing: 0.05em;
    font-style: italic;
}

.site-dedication {
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    color: var(--color-accent-gold);
    font-weight: 400;
    letter-spacing: 0.08em;
    font-style: italic;
    margin-top: 20px;
    opacity: 0.85;
}

/* Main Content */
.main-content {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* Document Sections */
.document-section {
    margin-bottom: 80px;
}

.document-section.featured {
    margin-bottom: 60px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 400;
    text-align: center;
    margin-bottom: 40px;
    color: var(--color-text-primary);
    letter-spacing: 0.1em;
    position: relative;
    padding-bottom: 16px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--color-accent-secondary),
        var(--color-accent-primary)
    );
}

/* Document Grid */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-items: center;
}

.document-grid.single {
    grid-template-columns: 1fr;
    max-width: 550px;
    margin: 0 auto;
}

/* Document Cards */
.document-card {
    display: block;
    width: 100%;
    max-width: 350px;
    background: var(--color-bg-card);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
    border: 1px solid rgba(139, 126, 200, 0.1);
    position: relative;
}

.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(139, 126, 200, 0.3),
        transparent,
        rgba(201, 169, 98, 0.2)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: var(--transition-smooth);
}

.document-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
    background: var(--color-bg-card-hover);
}

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

.document-card.main-document {
    max-width: 550px;
}

.document-card.main-document .card-image {
    height: 280px;
}

/* Compact card (half height, full width like main document) */
.document-card.compact-card {
    max-width: 550px;
}

.document-card.compact-card .card-image {
    height: 140px;
}

.document-card.compact-card .card-content {
    padding: 16px 24px;
}

.document-card.compact-card .card-content h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.document-card.compact-card .card-content p {
    font-size: 0.9rem;
}

/* Card Image */
.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        var(--color-bg-secondary) 0%,
        var(--color-bg-card) 100%
    );
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.document-card:hover .card-image img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
}

.document-card:hover .card-overlay {
    opacity: 1;
}

.view-text {
    padding: 12px 28px;
    background: var(--color-accent-primary);
    color: white;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(139, 126, 200, 0.4);
}

.document-card:hover .view-text {
    transform: translateY(0);
}

/* Card Content */
.card-content {
    padding: 24px;
}

.card-content h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text-primary);
    transition: var(--transition-fast);
}

.document-card:hover .card-content h3 {
    color: var(--color-accent-primary);
}

.card-content p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* Cards with pending links */
.document-card[data-document] {
    cursor: default;
}

.document-card[data-document] .card-overlay {
    background: rgba(10, 10, 15, 0.85);
}

.document-card[data-document] .view-text {
    background: var(--color-text-muted);
    box-shadow: none;
}

.document-card[data-document]:hover {
    transform: translateY(-4px);
}

/* Footer */
.footer {
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(10, 10, 15, 0.8) 100%
    );
    padding: 60px 20px 40px;
    text-align: center;
    border-top: 1px solid rgba(139, 126, 200, 0.1);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.quote {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-style: italic;
    color: var(--color-text-secondary);
    margin-bottom: 30px;
    letter-spacing: 0.03em;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.footer-links a {
    color: var(--color-accent-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    padding: 8px 16px;
    border: 1px solid rgba(139, 126, 200, 0.3);
    border-radius: 4px;
}

.footer-links a:hover {
    background: rgba(139, 126, 200, 0.1);
    border-color: var(--color-accent-primary);
}

.copyright {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header {
        padding: 60px 20px 40px;
    }

    .document-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .document-card {
        max-width: 100%;
    }

    .card-image {
        height: 180px;
    }

    .document-card.main-document .card-image {
        height: 220px;
    }

    .main-content {
        padding: 30px 16px 60px;
    }

    .document-section {
        margin-bottom: 50px;
    }
}

@media (max-width: 480px) {
    .site-title {
        letter-spacing: 0.08em;
    }

    .card-content {
        padding: 20px;
    }

    .card-content h3 {
        font-size: 1.2rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
.document-card:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 4px;
}

.document-card:focus:not(:focus-visible) {
    outline: none;
}

/* Future Publication Cards */
.document-card.future-publication {
    opacity: 0.75;
}

.document-card.future-publication .card-image {
    filter: grayscale(20%);
}

.document-card.future-publication:hover {
    opacity: 1;
}

.document-card.future-publication:hover .card-image {
    filter: grayscale(0%);
}

.footer-links a:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}
