/* economics.day - Engraving-inspired economics narrative */
/* Colors: #0B0E11, #8B2D2D, #C9A84C, #B87333, #3A3D42, #2D6A4F, #1A1A1A, #E8DCCA */
/* Fonts: Playfair Display, Anybody, Inconsolata */

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

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: #3A3D42 #0B0E11;
}

body {
    background: #0B0E11;
    color: #1A1A1A;
    font-family: 'Anybody', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Hidden SVG defs */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===================== */
/* Scroll Container      */
/* ===================== */
.scroll-container {
    width: 100%;
}

/* ===================== */
/* Sections              */
/* ===================== */
.section {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.section-odd {
    background: #0B0E11;
}

.section-even {
    background: #0B0E11;
}

/* ===================== */
/* Watermark ghosts      */
/* ===================== */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    font-family: 'Playfair Display', serif;
    font-size: 400px;
    font-weight: 900;
    color: #B87333;
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
    animation: watermarkRotate 120s linear infinite;
    user-select: none;
}

@keyframes watermarkRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===================== */
/* Split layout          */
/* ===================== */
.split-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.section-odd .split-wrapper {
    flex-direction: row;
}

.section-even .split-wrapper {
    flex-direction: row;
}

/* Statement panel */
.statement-panel {
    flex: 0 0 62%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
}

.section-odd .statement-panel {
    background: #E8DCCA;
}

.section-even .statement-panel {
    background: #E8DCCA;
}

.statement-content {
    max-width: 700px;
    position: relative;
}

/* ===================== */
/* Headlines (kinetic)   */
/* ===================== */
.headline {
    font-family: 'Playfair Display', serif;
    font-size: clamp(42px, 6vw, 100px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #1A1A1A;
    margin-bottom: 30px;
    overflow: hidden;
}

.headline .letter {
    display: inline-block;
    font-weight: 100;
    opacity: 0;
    letter-spacing: 0.1em;
    transition: font-weight 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                letter-spacing 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s ease;
}

.headline .letter.space {
    width: 0.3em;
}

.headline .letter.revealed {
    font-weight: 900;
    opacity: 1;
    letter-spacing: -0.03em;
}

/* Annotation */
.annotation {
    display: block;
    font-family: 'Inconsolata', monospace;
    font-size: 14px;
    font-weight: 400;
    color: #3A3D42;
    opacity: 0.7;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ===================== */
/* Divider SVG           */
/* ===================== */
.divider-svg {
    flex: 0 0 60px;
    height: 100%;
    position: relative;
    z-index: 2;
}

.divider-svg svg {
    width: 100%;
    height: 100%;
}

.divider-path {
    vector-effect: non-scaling-stroke;
}

/* ===================== */
/* Evidence panel        */
/* ===================== */
.evidence-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    background: #0B0E11;
}

/* ===================== */
/* Engraving SVGs        */
/* ===================== */
.engraving {
    width: 80%;
    max-width: 360px;
    height: auto;
    opacity: 0.9;
}

.engraving-lines path,
.engraving-lines circle {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.05s linear;
}

.section.in-view .engraving-lines path,
.section.in-view .engraving-lines circle {
    stroke-dashoffset: 0;
}

/* ===================== */
/* Data streams          */
/* ===================== */
.data-stream {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.data-point {
    font-family: 'Inconsolata', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #3A3D42;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.in-view .data-point {
    opacity: 0.3;
    transform: translateY(0);
}

.section.in-view .data-point:nth-child(1) { transition-delay: 0.8s; }
.section.in-view .data-point:nth-child(2) { transition-delay: 1.0s; }
.section.in-view .data-point:nth-child(3) { transition-delay: 1.2s; }
.section.in-view .data-point:nth-child(4) { transition-delay: 1.4s; }
.section.in-view .data-point:nth-child(5) { transition-delay: 1.6s; }

/* ===================== */
/* Pip Navigation        */
/* ===================== */
.pip-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 100;
}

.pip {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-direction: row-reverse;
}

.pip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid #3A3D42;
    background: transparent;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.pip.active .pip-dot {
    background: #C9A84C;
    border-color: #C9A84C;
}

.pip-label {
    font-family: 'Inconsolata', monospace;
    font-size: 11px;
    color: #3A3D42;
    opacity: 0;
    transform: translateX(5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.pip:hover .pip-label {
    opacity: 0.7;
    transform: translateX(0);
}

.pip.active .pip-label {
    opacity: 1;
    color: #C9A84C;
    transform: translateX(0);
}

/* ===================== */
/* Sound Toggle          */
/* ===================== */
.sound-toggle {
    position: fixed;
    right: 22px;
    bottom: 30px;
    z-index: 100;
    background: none;
    border: 1px solid #3A3D42;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s ease;
    padding: 0;
}

.sound-toggle:hover {
    border-color: #C9A84C;
}

.sound-toggle svg {
    transition: stroke 0.3s ease;
}

.sound-toggle:hover svg {
    stroke: #C9A84C;
}

.sound-toggle.active {
    border-color: #C9A84C;
}

.sound-toggle.active svg {
    stroke: #C9A84C;
}

.sound-wave {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.sound-toggle.active .sound-wave {
    opacity: 1;
}

/* ===================== */
/* Flowing data ticker   */
/* ===================== */
.flow-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    overflow: hidden;
    z-index: 50;
    pointer-events: none;
}

.flow-ticker-inner {
    display: flex;
    gap: 60px;
    font-family: 'Inconsolata', monospace;
    font-size: 10px;
    color: #3A3D42;
    opacity: 0.3;
    white-space: nowrap;
    animation: tickerScroll 60s linear infinite;
    padding-top: 8px;
}

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

/* ===================== */
/* Section transition    */
/* ===================== */
.section .statement-panel,
.section .evidence-panel {
    opacity: 0;
    transition: opacity 0.6s ease 0.1s;
}

.section.in-view .statement-panel,
.section.in-view .evidence-panel {
    opacity: 1;
}

/* ===================== */
/* Cross-hatch shimmer   */
/* ===================== */
@keyframes hatchShimmer {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 16; }
}

.divider-path {
    stroke-dasharray: none;
}

.section.in-view .divider-path {
    animation: hatchShimmer 4s linear infinite;
}

/* ===================== */
/* Scrollbar styling     */
/* ===================== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #0B0E11;
}

::-webkit-scrollbar-thumb {
    background: #3A3D42;
    border-radius: 2px;
}

/* ===================== */
/* Responsive            */
/* ===================== */
@media (max-width: 900px) {
    .split-wrapper {
        flex-direction: column !important;
    }

    .statement-panel {
        flex: 0 0 50%;
        padding: 30px;
    }

    .evidence-panel {
        flex: 1;
        padding: 20px;
    }

    .divider-svg {
        flex: 0 0 30px;
        height: 30px;
        width: 100%;
    }

    .divider-svg svg {
        width: 100%;
        height: 100%;
    }

    .headline {
        font-size: clamp(32px, 8vw, 56px);
    }

    .watermark {
        font-size: 200px;
    }

    .pip-nav {
        right: 12px;
        gap: 14px;
    }

    .pip-label {
        display: none;
    }

    .engraving {
        max-width: 200px;
    }
}

@media (max-width: 600px) {
    .statement-panel {
        padding: 20px;
    }

    .headline {
        font-size: clamp(28px, 9vw, 42px);
    }

    .pip-dot {
        width: 8px;
        height: 8px;
    }

    .data-stream {
        gap: 12px;
    }

    .annotation {
        font-size: 12px;
    }
}

/* ===================== */
/* Gilt emphasis         */
/* ===================== */
.gilt {
    color: #C9A84C;
}

/* Deficit red */
.deficit {
    color: #8B2D2D;
}
