/* =============================================
   LRX.WIKI - Art Deco Encyclopedia
   Design: Midnight blue, gold accents, organic flow
   ============================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0A0E1E;
    color: #8B9BB5;
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Noise Overlay --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    filter: url(#noiseFilter);
    background-color: #1A2040;
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #D4A44C;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 1rem;
}

.deco-ornament-small {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.deco-ornament-small svg {
    width: 60px;
    height: 20px;
}

/* =============================================
   SECTION 1: FOYER (Hero)
   ============================================= */
.foyer {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #0A0E1E;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: foyerFadeIn 400ms ease-out 100ms forwards;
}

@keyframes foyerFadeIn {
    from { background-color: #000000; opacity: 0; }
    to { background-color: #0A0E1E; opacity: 1; }
}

/* --- Sunbursts --- */
.sunburst {
    position: absolute;
    width: 300px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sunburst svg {
    width: 100%;
    height: 100%;
}

.sunburst-upper {
    top: calc(50% - 180px);
}

.sunburst-lower {
    bottom: calc(50% - 180px);
    transform: rotate(180deg);
}

.sunburst-line {
    stroke: #D4A44C;
    stroke-width: 1;
    stroke-linecap: round;
    transform-origin: 0 0;
}

/* --- Foyer Content --- */
.foyer-content {
    text-align: center;
    z-index: 2;
    opacity: 0;
    animation: titleFadeIn 500ms ease-out 800ms forwards;
}

@keyframes titleFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.site-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #D4A44C;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.site-subtitle {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    color: #8B9BB5;
    letter-spacing: 0.04em;
    font-feature-settings: 'liga' 1;
    animation: breatheSpacing 4s ease-in-out infinite;
}

@keyframes breatheSpacing {
    0%, 100% { letter-spacing: 0.02em; }
    50% { letter-spacing: 0.06em; }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeInScroll 500ms ease-out 2000ms forwards;
}

@keyframes fadeInScroll {
    from { opacity: 0; }
    to { opacity: 0.6; }
}

.scroll-dot {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { cy: 10; }
    50% { cy: 24; }
}

/* =============================================
   ORGANIC FLOW TRANSITIONS
   ============================================= */
.flow-transition {
    width: 100%;
    height: 120px;
    margin-top: -1px;
    position: relative;
    z-index: 1;
}

.flow-transition svg {
    width: 100%;
    height: 100%;
    display: block;
}

.flow-transition-1 {
    background-color: #0A0E1E;
}

.flow-transition-2 {
    background-color: #111628;
}

.flow-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.flow-line.drawn {
    stroke-dashoffset: 0;
}

/* =============================================
   SECTION 2: KNOWLEDGE STREAM
   ============================================= */
.knowledge-stream {
    background-color: #111628;
    padding: 5rem 2rem 6rem;
    position: relative;
}

.stream-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* --- Article Cards --- */
.article-card {
    background-color: #111628;
    border: 1px solid #D4A44C;
    border-radius: 2px 2px 16px 2px;
    padding: 2rem 2.2rem;
    width: 100%;
    max-width: 580px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
    position: relative;
}

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

.article-card:hover {
    border-color: #E8BC5A;
}

.card-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-counter {
    font-family: 'Poiret One', cursive;
    font-size: 2rem;
    color: #D4A44C;
    line-height: 1;
}

.card-counter-label {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #8B9BB5;
    text-transform: lowercase;
}

.card-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    letter-spacing: 0.05em;
    color: #D4A44C;
    margin-bottom: 0.75rem;
}

.card-excerpt {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: #8B9BB5;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.card-tag {
    display: inline-block;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #2D8B70;
    border: 1px solid #2D8B70;
    border-radius: 2px;
    padding: 0.2em 0.8em;
}

.card-tag-new {
    color: #C47D6D;
    border-color: #C47D6D;
}

/* --- Connecting Curves --- */
.connecting-curve {
    width: 200px;
    height: 80px;
    margin: 0.5rem 0;
}

.connecting-curve svg {
    width: 100%;
    height: 100%;
}

.scroll-draw-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 0.8s ease-out;
}

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

/* =============================================
   SECTION 3: ARCHIVE CHAMBER
   ============================================= */
.archive-chamber {
    background-color: #0A0E1E;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
}

.archive-layout {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 1000px;
    gap: 0;
}

/* --- Archive Columns --- */
.archive-column {
    width: 45%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.archive-column-left {
    align-items: flex-end;
    padding-right: 2rem;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.archive-column-right {
    align-items: flex-start;
    padding-left: 2rem;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.archive-column-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.archive-column-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Deco Pillar --- */
.deco-pillar {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pillar-svg {
    width: 40px;
    height: 100%;
    min-height: 400px;
}

.pillar-line {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 800ms ease-out;
}

.pillar-line.drawn {
    stroke-dashoffset: 0;
}

/* --- Archive Items --- */
.archive-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 300ms ease;
    opacity: 0;
    transform: translateY(8px);
    width: 100%;
    max-width: 280px;
}

.archive-item.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 300ms ease-out, transform 300ms ease-out, border-color 300ms ease;
}

.archive-item:hover {
    border-bottom-color: #D4A44C;
}

.archive-item-text {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #D4A44C;
    letter-spacing: 0.03em;
    transition: color 300ms ease;
}

.archive-item:hover .archive-item-text {
    color: #E8BC5A;
}

.archive-item-count {
    font-family: 'Poiret One', cursive;
    font-size: 0.9rem;
    color: #8B9BB5;
    opacity: 0.6;
    margin-left: auto;
}

.archive-column-left .archive-item {
    justify-content: flex-end;
    text-align: right;
}

.archive-column-left .archive-item-count {
    order: -1;
    margin-left: 0;
    margin-right: auto;
}

/* =============================================
   SECTION 4: FOOTER
   ============================================= */
.deco-footer {
    background-color: #111628;
    padding: 4rem 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.footer-ornament {
    margin-bottom: 1rem;
}

.footer-ornament svg {
    width: 120px;
    height: auto;
}

.footer-sunburst {
    margin-bottom: 1.5rem;
}

.footer-sunburst svg {
    width: 160px;
    height: 80px;
}

.footer-text {
    font-family: 'Poiret One', cursive;
    font-size: 1rem;
    color: #8B9BB5;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.footer-bottom-line {
    width: 100%;
    display: flex;
    justify-content: center;
}

.footer-bottom-line svg {
    width: 300px;
    height: 10px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .archive-layout {
        flex-direction: column;
        align-items: center;
    }

    .archive-column {
        width: 100%;
        max-width: 320px;
        align-items: center !important;
        padding: 0 !important;
    }

    .archive-column-left .archive-item {
        justify-content: center;
        text-align: center;
    }

    .archive-column-left .archive-item-count {
        order: 0;
        margin-left: 0;
    }

    .deco-pillar {
        display: none;
    }

    .sunburst {
        width: 200px;
        height: 100px;
    }

    .article-card {
        padding: 1.5rem;
    }

    .connecting-curve {
        width: 120px;
        height: 50px;
    }
}

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

    .archive-item {
        flex-direction: column;
        gap: 0.2rem;
        text-align: center;
    }
}
