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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #4b5563;
    background-color: #f3f4f6;
    background-image:
        repeating-conic-gradient(#e5e7eb 0% 25%, transparent 0% 50%) 0 0 / 4px 4px,
        repeating-conic-gradient(#ebedf0 0% 25%, transparent 0% 50%) 2px 2px / 4px 4px;
    overflow-x: hidden;
    position: relative;
}

/* Paper 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(#paper-noise);
    background: #d4c5a9;
    mix-blend-mode: multiply;
}

/* Warm ochre trace at 4% opacity */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #d4c5a9;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* === Hero Section === */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.site-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1.1;
    color: #374151;
}

.site-title .letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.subtitle {
    font-family: 'Source Serif 4', serif;
    font-weight: 600;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: #6b7280;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.6s ease;
    letter-spacing: 0.02em;
}

.bauhaus-shapes {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
    align-items: center;
}

.shape {
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shape.visible {
    transform: scale(1);
}

/* === Timeline === */
.timeline {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem 6rem;
}

.timeline-axis {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 0;
    background: #8a8f94;
    transform: translateX(-50%);
    transition: height 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 0;
}

.timeline-axis.drawn {
    height: 100%;
}

/* === Axis Markers === */
.axis-marker {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    padding: 1.5rem 0;
}

.axis-marker svg {
    animation: marker-rotate 12s linear infinite;
}

@keyframes marker-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === Section Divider === */
.section-divider {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 3rem 0;
    position: relative;
    z-index: 2;
}

/* === Article Modules === */
.module {
    position: relative;
    z-index: 2;
    width: 38.2%;
    margin-bottom: 0;
    padding: 0;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.module.visible {
    opacity: 1;
    transform: scale(1);
}

.module-left {
    margin-left: calc(50% - 38.2% - 6.18%);
    margin-right: auto;
}

.module-right {
    margin-right: calc(50% - 38.2% - 6.18%);
    margin-left: auto;
}

.module-inner {
    background: #e5e7eb;
    border: 1px solid #c4c8cc;
    padding: 2rem 1.8rem;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.25, 0.1, 0.25, 1), border-color 0.25s ease;
}

.module:hover .module-inner {
    transform: scale(1.03);
    border-color: #4b5563;
}

/* Stitch Lines */
.stitch-line {
    position: absolute;
    top: 50%;
    height: 0;
    border-top: 2px dashed #9ca3af;
    z-index: 1;
    width: 0;
    transition: width 0.35s ease-out 0.2s, border-top-style 0.25s ease;
}

.module-left .stitch-right {
    right: -6.18vw;
    width: 0;
}

.module-right .stitch-left {
    left: -6.18vw;
    width: 0;
}

.module.visible .stitch-right {
    width: calc(6.18vw + 1px);
}

.module.visible .stitch-left {
    width: calc(6.18vw + 1px);
}

.module:hover .stitch-line {
    border-top-style: solid;
}

/* Module Typography */
.module-meta {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.82rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9ca3af;
    display: block;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed #c4c8cc;
    padding-bottom: 0.5rem;
}

.meta-sep {
    margin: 0 0.4em;
    font-size: 0.6em;
    vertical-align: middle;
}

.module-headline {
    font-family: 'Source Serif 4', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.2vw, 2rem);
    line-height: 1.28;
    letter-spacing: -0.01em;
    color: #1f2937;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 0.5px #1f2937;
    transition: color 0.25s ease;
}

.module:hover .module-headline {
    color: #374151;
}

.module-body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #4b5563;
    max-width: 52ch;
}

/* Fold Mark (every 3rd article) */
.fold-mark {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 0.5px;
    background: #e5e7eb;
    pointer-events: none;
}

/* === Footer === */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 4rem 2rem 3rem;
}

.footer-divider {
    width: 100%;
    height: 0;
    border-top: 1px dashed #c4c8cc;
    margin-bottom: 2.5rem;
}

.footer-shapes {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9ca3af;
}

/* === Responsive === */
@media (max-width: 768px) {
    .timeline-axis {
        left: 8%;
    }

    .module {
        width: 84%;
        margin-left: 14% !important;
        margin-right: 2% !important;
    }

    .module .stitch-line {
        left: calc(-6vw) !important;
        right: auto !important;
    }

    .module.visible .stitch-line {
        width: calc(6vw) !important;
    }

    .axis-marker {
        justify-content: flex-start;
        padding-left: calc(8% - 5px);
    }

    .section-divider {
        justify-content: flex-start;
        padding-left: calc(8% - 16px);
    }

    .bauhaus-shapes {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .bauhaus-shapes {
        display: none;
    }

    .timeline-axis {
        display: none;
    }

    .axis-marker {
        display: none;
    }

    .section-divider {
        display: none;
    }

    .module {
        width: 92%;
        margin-left: 4% !important;
        margin-right: 4% !important;
        border-left: 1px solid #8a8f94;
        padding-left: 0.5rem;
    }

    .module .stitch-line {
        display: none;
    }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .site-title .letter {
        opacity: 1 !important;
        transition: none !important;
    }
    .subtitle {
        opacity: 1 !important;
        transition: none !important;
    }
    .shape {
        transform: scale(1) !important;
        transition: none !important;
    }
    .module {
        opacity: 1 !important;
        transform: scale(1) !important;
        transition: none !important;
    }
    .timeline-axis {
        height: 100% !important;
        transition: none !important;
    }
    .axis-marker svg {
        animation: none !important;
    }
    .stitch-line {
        transition: none !important;
    }
    .module.visible .stitch-right,
    .module.visible .stitch-left {
        width: calc(6.18vw + 1px) !important;
    }
}
