/* concurrent.day -- kinetic typography split-flap experience */
/* Palette: #0F1923, #1B2838, #E2E8F0, #C5CED6, #8FAABE, #F6AD55, #68D391, #FC8181, #4A5568 */

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

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

body {
    background-color: #0F1923;
    color: #C5CED6;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* 24-column temporal grid overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.02;
    background: repeating-linear-gradient(
        90deg,
        #8FAABE 0px,
        #8FAABE 1px,
        transparent 1px,
        transparent calc(100% / 24)
    );
}

/* Tickers */
.ticker {
    position: fixed;
    left: 0;
    width: 100%;
    z-index: 100;
    background: #1B2838;
    border-bottom: 1px solid #4A5568;
    overflow: hidden;
    height: 28px;
    display: flex;
    align-items: center;
}

.ticker-top {
    top: 0;
}

.ticker-bottom {
    top: auto;
    bottom: 0;
    border-bottom: none;
    border-top: 1px solid #4A5568;
}

.ticker-track {
    display: flex;
    gap: 4rem;
    white-space: nowrap;
    animation: ticker-scroll 60s linear infinite;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    color: #8FAABE;
}

.ticker-track span::before {
    content: '\2022';
    margin-right: 1rem;
    color: #68D391;
}

.ticker-track-reverse {
    animation-direction: reverse;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Clock navigation */
.clock-nav {
    position: fixed;
    top: 40px;
    left: 1rem;
    z-index: 90;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.clock-nav:hover {
    opacity: 1;
}

/* Lane dividers */
.lane-divider {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #4A5568;
    z-index: 1;
    opacity: 0.3;
}

.lane-divider-left {
    left: 25%;
}

.lane-divider-right {
    right: 25%;
}

/* Zones (sections) */
.zone {
    min-height: 100vh;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.zone-center {
    text-align: center;
    width: 100%;
}

/* Timestamp watermarks */
.timestamp-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 15vw;
    color: #8FAABE;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
}

/* Counter display */
.counter-display {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 10vw, 10rem);
    color: #E2E8F0;
    letter-spacing: 0.08em;
    line-height: 0.95;
    margin-bottom: 2rem;
}

/* Split-flap cells */
.split-flap-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0.5rem;
    perspective: 800px;
}

.flap-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(2rem, 5vw, 4rem);
    height: clamp(3.2rem, 8vw, 6.4rem);
    background: #1B2838;
    border: 1px solid #4A5568;
    border-radius: 3px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 5vw, 4.5rem);
    color: #E2E8F0;
    letter-spacing: 0.08em;
    position: relative;
    opacity: 0;
    transform: rotateX(-90deg);
    animation: flap-in 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.flap-cell::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(15, 25, 35, 0.5);
}

.flap-cell:nth-child(1) { animation-delay: 0.8s; }
.flap-cell:nth-child(2) { animation-delay: 0.85s; }
.flap-cell:nth-child(3) { animation-delay: 0.9s; }
.flap-cell:nth-child(4) { animation-delay: 0.95s; }
.flap-cell:nth-child(5) { animation-delay: 1.0s; }
.flap-cell:nth-child(6) { animation-delay: 1.05s; }
.flap-cell:nth-child(7) { animation-delay: 1.1s; }
.flap-cell:nth-child(8) { animation-delay: 1.15s; }
.flap-cell:nth-child(9) { animation-delay: 1.2s; }
.flap-cell:nth-child(10) { animation-delay: 1.25s; }

.split-flap-day .flap-cell:nth-child(1) { animation-delay: 1.5s; }
.split-flap-day .flap-cell:nth-child(2) { animation-delay: 1.55s; }
.split-flap-day .flap-cell:nth-child(3) { animation-delay: 1.6s; }
.split-flap-day .flap-cell:nth-child(4) { animation-delay: 1.65s; }

.flap-amber {
    color: #F6AD55;
}

@keyframes flap-in {
    from {
        opacity: 0;
        transform: rotateX(-90deg);
    }
    to {
        opacity: 1;
        transform: rotateX(0deg);
    }
}

/* Flap transitions (between zones) */
.flap-transition {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    background: #0F1923;
}

.flap-large .flap-cell {
    width: clamp(3rem, 10vw, 8rem);
    height: clamp(4.8rem, 16vw, 12.8rem);
    font-size: clamp(3rem, 10vw, 9rem);
    animation: none;
    opacity: 0;
    transform: rotateX(-90deg);
}

.flap-large .flap-cell.flap-visible {
    animation: flap-in 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* Three-lane layout */
.three-lanes {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.lane {
    padding: 1rem 1.5rem;
}

.lane-left,
.lane-right {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9rem;
    color: #8FAABE;
    line-height: 1.6;
}

.lane-center {
    padding: 0 2rem;
    border-left: 1px solid rgba(74, 85, 104, 0.3);
    border-right: 1px solid rgba(74, 85, 104, 0.3);
}

.lane-fragment {
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.lane-fragment.revealed {
    opacity: 1;
    transform: translateY(0);
}

.mono-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: #8FAABE;
}

/* Zone headings */
.zone-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #E2E8F0;
    letter-spacing: 0.08em;
    line-height: 0.95;
    margin-bottom: 1.5rem;
}

/* Prose blocks */
.prose-block p {
    margin-bottom: 1.25rem;
    color: #C5CED6;
}

.reveal-lines p {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.reveal-lines.revealed p { opacity: 1; transform: translateY(0); }
.reveal-lines.revealed p:nth-child(2) { transition-delay: 0.2s; }
.reveal-lines.revealed p:nth-child(3) { transition-delay: 0.4s; }
.reveal-lines.revealed p:nth-child(4) { transition-delay: 0.6s; }

/* Mini counters */
.mini-counter {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: #F6AD55;
    letter-spacing: 0.08em;
    display: block;
}

.mini-counter::before {
    content: attr(data-label) ': ';
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: #4A5568;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: block;
}

/* Process thread lines */
.process-lines {
    width: 100%;
    height: 60px;
    position: relative;
    z-index: 3;
    opacity: 0.3;
    margin-top: 2rem;
}

.proc-line {
    stroke-width: 2;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 3s linear;
}

.proc-line.animate {
    stroke-dashoffset: 0;
}

.proc-green { stroke: #68D391; }
.proc-amber { stroke: #F6AD55; }
.proc-red { stroke: #FC8181; }

/* Countdown display */
.countdown-display {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 8rem);
    color: #E2E8F0;
    letter-spacing: 0.08em;
    margin-bottom: 2rem;
}

.loop-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #F6AD55;
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.loop-domain {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #E2E8F0;
    letter-spacing: 0.08em;
}

/* Responsive */
@media (max-width: 768px) {
    .three-lanes {
        grid-template-columns: 1fr;
    }

    .lane-left,
    .lane-right {
        display: none;
    }

    .lane-center {
        border: none;
        padding: 0 1rem;
    }

    .lane-divider {
        display: none;
    }

    .ticker {
        font-size: 0.7rem;
    }
}
