/* ============================================
   perso.news -- Kinetic Typography Design
   ============================================ */

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    overflow-x: hidden;
}

body {
    background-color: #1B1B2F;
    color: #D0D0DC;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Red Thread SVG --- */
#red-thread {
    position: fixed;
    top: 0;
    left: 0;
    width: 64px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

#thread-line {
    stroke: #F25C54;
    stroke-width: 1;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: none;
}

#thread-dot {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#thread-dot.visible {
    opacity: 1;
}

/* --- Sections (Acts) --- */
.act {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* --- Diagonal Clip Paths --- */
.act-article--left {
    clip-path: polygon(0 0, 100% 3%, 100% 97%, 0 100%);
}

.act-article--right {
    clip-path: polygon(0 3%, 100% 0, 100% 100%, 0 97%);
}

.act-interstitial {
    clip-path: polygon(0 0, 100% 4%, 100% 96%, 0 100%);
}

/* === ACT I: THE OVERTURE === */
.act-overture {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #1B1B2F;
    scroll-snap-align: start;
    position: relative;
    z-index: 2;
}

.overture-content {
    text-align: center;
    position: relative;
    perspective: 800px;
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(20vw, 25vw, 35vw);
    text-transform: uppercase;
    color: #F2F2F2;
    letter-spacing: -0.08em;
    line-height: 0.85;
    opacity: 0;
    transition: letter-spacing 2.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: letter-spacing, opacity, transform;
}

.hero-title.animate-in {
    opacity: 1;
    letter-spacing: 0.02em;
}

.hero-underline {
    width: 0;
    height: 1px;
    background-color: #F25C54;
    margin: 0.5rem auto 0;
    transition: width 1.8s cubic-bezier(0.16, 1, 0.3, 1) 1.2s;
}

.hero-underline.animate-in {
    width: 60%;
}

.hero-subtitle {
    display: block;
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(6vw, 7.5vw, 10.5vw);
    color: #A5A5B8;
    opacity: 0;
    margin-left: 40%;
    text-align: left;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-subtitle.animate-in {
    opacity: 1;
}

/* Scroll Chevron */
.scroll-chevron {
    position: absolute;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse-chevron 2s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

.chevron-arrow {
    display: block;
    width: 16px;
    height: 16px;
    border-right: 1.5px solid #6B6B80;
    border-bottom: 1.5px solid #6B6B80;
    transform: rotate(45deg);
}

@keyframes pulse-chevron {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(8px); }
}

/* Cursor-Reactive Tilt */
.overture-content.tilt {
    transition: transform 0.15s ease-out;
}

/* === ACT II & IV: ARTICLE SECTIONS === */
.act-article {
    min-height: 80vh;
    padding: 12vh 0;
    background-color: #1B1B2F;
    scroll-snap-align: start;
    position: relative;
    z-index: 1;
}

/* Ghost Word */
.ghost-word {
    position: absolute;
    top: -5vh;
    left: -3vw;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: 18vw;
    text-transform: uppercase;
    color: #F2F2F2;
    opacity: 0.04;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.ghost-word--right {
    left: auto;
    right: -5vw;
    top: -8vh;
}

/* Article Column Layout */
.article-column {
    position: relative;
    z-index: 1;
    max-width: 38rem;
}

.article-column--left {
    margin-left: 8vw;
}

.article-column--right {
    margin-left: auto;
    margin-right: 8vw;
}

/* Meta Line */
.meta-line {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dateline {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6B6B80;
}

.divider-ornament {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 1em;
    color: #6B6B80;
}

/* Article Headlines */
.article-headline {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 4rem);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #F2F2F2;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Fragment headline animation */
.fragment-headline {
    opacity: 0;
    transition: opacity 0.01s;
}

.fragment-headline.animate-in {
    opacity: 1;
}

.fragment-headline .char-wrap {
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.fragment-headline .char-top,
.fragment-headline .char-bottom {
    display: block;
    position: relative;
}

.fragment-headline .char-top {
    clip-path: inset(0 0 50% 0);
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fragment-headline .char-bottom {
    clip-path: inset(50% 0 0 0);
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    top: 0;
    left: 0;
}

.fragment-headline.animate-in .char-top,
.fragment-headline.animate-in .char-bottom {
    transform: translateX(0);
}

/* Blinds headline animation */
.blinds-headline {
    opacity: 0;
    transition: opacity 0.01s;
}

.blinds-headline.animate-in {
    opacity: 1;
}

.blinds-headline .blind-slice {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.blinds-headline.animate-in .blind-slice {
    opacity: 1;
}

/* Article Deck */
.article-deck {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #A5A5B8;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s,
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.article-deck.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Article Body */
.article-body {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s,
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

.article-body.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.article-body p {
    margin-bottom: 1.5rem;
    color: #D0D0DC;
}

.article-body p:last-child {
    margin-bottom: 0;
}

.article-body em {
    font-style: italic;
    font-weight: 600;
    color: #F2A07B;
}

/* Link and hover styles */
.article-body a {
    color: #F25C54;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-body a:hover {
    color: #D4683A;
    border-bottom-color: #D4683A;
}

/* Interstitial text on light (uses Deep Plum-Gray) */
.interstitial-inner .dateline-light {
    color: #2A2A3D;
}

/* === ACT III: INTERSTITIAL === */
.act-interstitial {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F25C54;
    scroll-snap-align: start;
    position: relative;
    z-index: 2;
    padding: 10vh 8vw;
}

.interstitial-inner {
    max-width: 48rem;
    text-align: center;
}

.pull-quote {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #1B1B2F;
    line-height: 1.35;
    margin-bottom: 2rem;
}

.quote-text {
    display: inline;
}

.interstitial-rule {
    width: 0;
    height: 1px;
    background-color: #1B1B2F;
    margin: 0 auto;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.interstitial-rule.animate-in {
    width: 40%;
}

/* === ACT V: EPILOGUE === */
.act-epilogue {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #14142A;
    scroll-snap-align: start;
    position: relative;
    z-index: 1;
    padding: 10vh 8vw;
}

.epilogue-content {
    max-width: 42rem;
    text-align: center;
}

.manifesto {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: #F2F2F2;
    line-height: 1.6;
    margin-bottom: 4rem;
}

.manifesto-word {
    opacity: 0;
    display: inline-block;
    margin-right: 0.3em;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.manifesto-word.animate-in {
    opacity: 1;
}

.epilogue-url {
    margin-top: 3rem;
}

.url-text {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: #F2F2F2;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.url-text.animate-in {
    opacity: 0.4;
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-title {
        opacity: 1;
        letter-spacing: 0.02em;
    }

    .hero-underline {
        width: 60%;
    }

    .hero-subtitle {
        opacity: 1;
    }

    .fragment-headline,
    .blinds-headline,
    .article-deck,
    .article-body {
        opacity: 1;
        transform: none;
    }

    .manifesto-word {
        opacity: 1;
    }

    .url-text {
        opacity: 0.4;
    }

    .scroll-chevron {
        animation: none;
        opacity: 0.5;
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .article-column--left {
        margin-left: 5vw;
        margin-right: 5vw;
    }

    .article-column--right {
        margin-right: 5vw;
        margin-left: 5vw;
    }

    .hero-subtitle {
        margin-left: 20%;
    }

    .ghost-word {
        font-size: 30vw;
        opacity: 0.03;
    }

    #red-thread {
        display: none;
    }

    .act-article--left,
    .act-article--right {
        clip-path: polygon(0 0, 100% 1.5%, 100% 98.5%, 0 100%);
    }

    .act-interstitial {
        clip-path: polygon(0 0, 100% 2%, 100% 98%, 0 100%);
    }

    .meta-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28vw;
    }

    .hero-subtitle {
        font-size: 9vw;
        margin-left: 15%;
    }

    .article-headline {
        font-size: clamp(1.8rem, 8vw, 2.8rem);
    }
}
