/* ==========================================================================
   causality.club - Styles
   Palette: Deep Graphite #1a1a1e | Smoke #232328 | Charcoal Warm #2c2c32
            Parchment #e8e2d8 | Ash #8a8580 | Stone #6b6560
            Amber Glow #c9b99a | Pale Rose #c4a8a0 | Silver Mist #a8a4a0
   Fonts: Space Grotesk (display), DM Sans (body)
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #1a1a1e;
    color: #e8e2d8;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* ==========================================================================
   Bokeh Background System
   ========================================================================== */

#bokeh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.bokeh-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
}

/* ==========================================================================
   Hero / Full-Screen Narrative Opening
   ========================================================================== */

#hero {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hero-content {
    text-align: center;
    will-change: transform;
}

#hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 96px;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: #e8e2d8;
    opacity: 0;
    transition: none;
}

#hero-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6b6560;
    opacity: 0;
    margin-top: 20px;
    transition: none;
}

/* ==========================================================================
   SVG Connection Paths
   ========================================================================== */

#connection-paths {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   Masonry Grid
   ========================================================================== */

#masonry {
    position: relative;
    z-index: 2;
    max-width: 1208px;
    margin: 0 auto;
    padding: 80px 24px 120px;
    column-count: 4;
    column-gap: 24px;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    break-inside: avoid;
    margin-bottom: 24px;
    padding: 32px;
    background-color: #232328;
    border-radius: 0;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

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

.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #c9b99a;
    opacity: 0;
    transition: opacity 300ms ease-out;
}

.card:hover::after {
    opacity: 0.4;
}

.card:hover {
    background-color: #2c2c32;
}

/* Card: Text */
.card--text {
    padding: 40px 32px;
}

.card__headline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 0.92;
    color: #e8e2d8;
}

.card__headline--light {
    font-weight: 300;
}

.card--large .card__headline {
    font-size: 64px;
}

/* Card: Body Text */
.card__body {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0.005em;
    color: #8a8580;
    margin-bottom: 24px;
}

/* Card: Bokeh */
.card--bokeh {
    padding: 0;
    background-color: transparent;
    overflow: hidden;
}

.card--bokeh:hover {
    background-color: transparent;
}

.card-bokeh-field {
    display: block;
    width: 100%;
    height: auto;
}

/* Card: Bubble Cluster */
.card--bubble-cluster {
    padding: 24px;
    background-color: transparent;
}

.card--bubble-cluster:hover {
    background-color: transparent;
}

.bubble-cluster {
    display: block;
    width: 100%;
    height: auto;
}

.bubble-stroke {
    stroke-dasharray: 0;
    stroke-dashoffset: 0;
}

.bubble-word {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    fill: #c9b99a;
    fill-opacity: 0.4;
}

/* Bubble pulse on card hover */
.card--bubble-cluster:hover .bubble-stroke {
    animation: bubble-pulse 1500ms ease-in-out infinite;
}

@keyframes bubble-pulse {
    0%, 100% { stroke-opacity: 0.2; }
    50% { stroke-opacity: 0.35; }
}

/* Card: Annotated */
.card--annotated {
    padding: 32px;
}

.causal-diagram {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 16px;
}

.diagram-label,
.diagram-label-sm {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    letter-spacing: 0.1em;
    fill: #c9b99a;
    fill-opacity: 0.5;
}

.diagram-label {
    font-size: 13px;
}

.diagram-label-sm {
    font-size: 11px;
}

.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 800ms ease-out;
}

.draw-path.drawn {
    stroke-dashoffset: 0;
}

/* ==========================================================================
   Accent Labels (for potential future use)
   ========================================================================== */

.accent-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #c9b99a;
}

/* ==========================================================================
   Footer
   ========================================================================== */

#footer {
    position: relative;
    z-index: 2;
    padding: 40px 24px 60px;
    text-align: center;
}

.footer-line {
    width: 100%;
    max-width: 1208px;
    height: 1px;
    background-color: #c9b99a;
    opacity: 0.4;
    margin: 0 auto 32px;
}

.footer-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: #6b6560;
    text-transform: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    #masonry {
        column-count: 2;
        max-width: 608px;
    }

    #hero-title {
        font-size: 64px;
    }

    .card__headline {
        font-size: 42px;
    }

    .card--large .card__headline {
        font-size: 52px;
    }
}

@media (max-width: 640px) {
    #masonry {
        column-count: 1;
        max-width: 360px;
    }

    #hero-title {
        font-size: 42px;
    }

    #hero-subtitle {
        font-size: 12px;
    }

    .card__headline {
        font-size: 36px;
    }

    .card--large .card__headline {
        font-size: 42px;
    }

    .card {
        padding: 24px;
    }

    .card--text {
        padding: 28px 24px;
    }
}
