/* ============================
   continu.ax — styles.css
   Chrome-plated fairycore editorial
   ============================ */

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

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

body {
    background-color: #0e0d0b;
    color: #d8d3cc;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    line-height: 1.85;
    letter-spacing: 0.015em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
.chrome-text {
    font-family: 'Poiret One', sans-serif;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.body-text {
    color: #d8d3cc;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    line-height: 1.85;
    letter-spacing: 0.015em;
}

.body-text em {
    font-weight: 600;
    font-style: italic;
}

.caption {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a7570;
}

/* --- Scroll Progress Indicator --- */
#scroll-progress {
    position: fixed;
    bottom: 0;
    left: 24px;
    width: 2px;
    height: 100vh;
    background: #2a3028;
    z-index: 1000;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

#scroll-progress:hover {
    opacity: 1;
}

#scroll-progress-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, #a89279, #c5c5c5);
    transition: height 0.1s linear;
}

/* --- Opening Panel --- */
.opening-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

#opening-title {
    font-size: clamp(3rem, 10vw, 10rem);
    opacity: 0;
    animation: fadeInTitle 1.2s ease-out 0.8s forwards;
}

#opening-title.faded {
    animation: fadeOutTitle 1.5s ease-out forwards;
}

.chevron {
    font-family: 'Poiret One', sans-serif;
    font-size: 2rem;
    color: #c5c5c5;
    opacity: 0;
    animation: fadeInChevron 0.8s ease-out 2.5s forwards;
    position: absolute;
    bottom: 15vh;
}

.chevron.visible {
    animation: fadeInChevron 0.8s ease-out forwards, bobChevron 1.5s ease-in-out infinite;
}

@keyframes fadeInTitle {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOutTitle {
    from { opacity: 1; }
    to { opacity: 0.15; }
}

@keyframes fadeInChevron {
    from { opacity: 0; }
    to { opacity: 0.7; }
}

@keyframes bobChevron {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* --- Chrome Panels (Interruptions + Opening) --- */
.chrome-panel {
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #4a4a4a 0%, #c5c5c5 25%, #eaeaea 50%, #c5c5c5 75%, #4a4a4a 100%);
    background-size: 200% 200%;
    animation: chromeShift 8s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

@keyframes chromeShift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Scattered stars in chrome panels */
.chrome-panel-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Interruption Panels --- */
.interruption-panel {
    position: sticky;
    top: 0;
    z-index: 50;
}

.interruption-text {
    font-size: clamp(2.5rem, 8vw, 7rem);
    text-align: center;
    line-height: 1.1;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.interruption-text.visible {
    opacity: 1;
}

.interruption-text.shake {
    animation: shakeError 300ms ease-in-out;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.rust-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #c44d3f;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.4s ease;
}

.rust-flash.flash-active {
    opacity: 0.15;
}

/* --- Breath Gaps --- */
.breath-gap {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.breath-gap-final {
    min-height: 30vh;
}

/* --- Star Dividers --- */
.star-divider {
    font-size: 1.2rem;
    color: #c5c5c5;
    display: block;
    text-align: center;
    animation: starPulse 2s ease-in-out infinite;
    user-select: none;
}

.star-footer {
    font-size: 0.9rem;
    margin-top: 2rem;
}

@keyframes starPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* --- Editorial Sections --- */
.editorial-section {
    padding-left: 12%;
    padding-right: 10%;
    max-width: 100%;
    position: relative;
}

.editorial-column {
    max-width: 640px;
    margin-bottom: 2.5rem;
}

/* --- Fade-in animation for scroll --- */
.fade-in-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-block.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Pull Quotes --- */
.pull-quote {
    padding: 2rem 0 2rem 2rem;
    border-left: 2px solid #6b6b6b;
    background-color: #2a3028;
    padding: 2.5rem;
    margin: 1rem 0;
}

.pull-quote .body-text {
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    line-height: 1.9;
    color: #d8d3cc;
}

/* --- Image Clearings --- */
.clearing-image {
    width: 100%;
    padding-left: 12%;
    padding-right: 0;
    margin: 4rem 0;
    position: relative;
}

.chrome-image {
    width: calc(100% - 12%);
    max-width: 900px;
    height: 50vh;
    min-height: 300px;
    border: 1px solid #6b6b6b;
    box-shadow: 0 0 40px rgba(197, 197, 197, 0.06);
    overflow: hidden;
    position: relative;
}

.image-texture {
    width: 100%;
    height: 100%;
    filter: saturate(0) contrast(1.1);
    position: relative;
}

/* Bark texture — CSS-generated abstract pattern */
.texture-bark {
    background:
        repeating-linear-gradient(
            82deg,
            transparent,
            transparent 3px,
            rgba(168, 146, 121, 0.08) 3px,
            rgba(168, 146, 121, 0.08) 4px
        ),
        repeating-linear-gradient(
            175deg,
            transparent,
            transparent 8px,
            rgba(197, 197, 197, 0.05) 8px,
            rgba(197, 197, 197, 0.05) 9px
        ),
        linear-gradient(180deg, #1a1917 0%, #2a2825 30%, #1f1e1c 60%, #252320 100%);
}

.texture-bark::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(197, 197, 197, 0.03) 0%, transparent 50%, rgba(234, 234, 234, 0.02) 100%);
}

/* Frost texture — CSS-generated crystal pattern */
.texture-frost {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(234, 234, 234, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(197, 197, 197, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 40% 80%, rgba(160, 160, 160, 0.05) 0%, transparent 35%),
        repeating-conic-gradient(from 0deg at 30% 40%, transparent 0deg, rgba(197,197,197,0.04) 3deg, transparent 6deg),
        repeating-conic-gradient(from 30deg at 65% 55%, transparent 0deg, rgba(234,234,234,0.03) 2deg, transparent 5deg),
        linear-gradient(160deg, #181816 0%, #222220 40%, #1c1b19 70%, #201f1d 100%);
}

.texture-frost::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(234, 234, 234, 0.04) 0%, transparent 40%, rgba(197, 197, 197, 0.03) 80%);
}

/* Water texture — CSS-generated ripple pattern */
.texture-water {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(197, 197, 197, 0.06) 0%, transparent 60%),
        repeating-radial-gradient(ellipse at 45% 45%, transparent 0px, transparent 20px, rgba(197,197,197,0.03) 21px, transparent 22px),
        repeating-radial-gradient(ellipse at 55% 55%, transparent 0px, transparent 30px, rgba(234,234,234,0.02) 31px, transparent 32px),
        repeating-linear-gradient(
            2deg,
            transparent,
            transparent 12px,
            rgba(168, 146, 121, 0.03) 12px,
            rgba(168, 146, 121, 0.03) 13px
        ),
        linear-gradient(170deg, #1b1a18 0%, #1f1e1c 50%, #1a1917 100%);
}

.texture-water::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(197, 197, 197, 0.05) 0%, transparent 30%, transparent 70%, rgba(168, 146, 121, 0.03) 100%);
}

.clearing-image .caption {
    display: block;
    margin-top: 1rem;
    padding-left: 0;
}

/* --- Footer --- */
.editorial-footer {
    text-align: center;
    padding: 4rem 2rem 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Cursor Trail Stars (desktop) --- */
.cursor-star {
    position: fixed;
    pointer-events: none;
    font-size: 4px;
    color: #c5c5c5;
    z-index: 9999;
    user-select: none;
    opacity: 1;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.cursor-star.fading {
    opacity: 0;
    transform: scale(0.3) translateY(-8px);
}

/* --- Scattered Panel Stars --- */
.panel-star {
    position: absolute;
    font-size: 6px;
    color: #c5c5c5;
    pointer-events: none;
    user-select: none;
    animation: starPulse 2s ease-in-out infinite;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .editorial-section {
        padding-left: 24px;
        padding-right: 24px;
    }

    .clearing-image {
        padding-left: 24px;
        padding-right: 24px;
    }

    .chrome-image {
        width: 100%;
    }

    #opening-title {
        font-size: clamp(2rem, 12vw, 4rem);
    }

    .interruption-text {
        font-size: clamp(2rem, 7vw, 4rem);
    }

    .editorial-column {
        max-width: 100%;
    }

    #scroll-progress {
        left: 8px;
    }

    .breath-gap {
        min-height: 40vh;
    }
}
