/* ==========================================================================
   Flavor Scroll Collage v16.1
   Grid-based cinemascope collage with independent tile cycling
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

:root {
    --fsc-accent:    #ff9f27;
    --fsc-accent-gl: rgba(255, 159, 39, 0.35);
    --fsc-bg:        #0e0e0e;
    --fsc-text:      #f0ede8;
    --fsc-muted:     rgba(240, 237, 232, 0.62);
    --fsc-dim:       rgba(240, 237, 232, 0.22);
    --fsc-line:      rgba(255, 159, 39, 0.12);
    --fsc-gap:       12px;
    --fsc-radius:    8px;
    --fsc-collage-pad: 20px;
}

/* Reset */
.fsc-section *, .fsc-section *::before, .fsc-section *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- Section: scroll runway ---- */
.fsc-section {
    position: relative;
    width: 100%;
    background: var(--fsc-bg);
}

/* ---- Pinned viewport ---- */
.fsc-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* ==========================================================================
   LEFT — step track
   ========================================================================== */

.fsc-left {
    width: 42%;
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.fsc-left::before,
.fsc-left::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    z-index: 3;
    pointer-events: none;
}
.fsc-left::before {
    top: 0;
    height: 200px;
    background: linear-gradient(to bottom, var(--fsc-bg) 20%, transparent 100%);
}
.fsc-left::after {
    bottom: 0;
    height: 200px;
    background: linear-gradient(to top, var(--fsc-bg) 20%, transparent 100%);
}

.fsc-track {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    will-change: transform;
    padding: 0 5% 0 7%;
}

.fsc-progress-line {
    position: absolute;
    left: calc(7% + 22px);
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--fsc-line);
    z-index: 0;
}
.fsc-progress-fill {
    position: absolute;
    left: calc(7% + 22px);
    top: 0;
    width: 2px;
    height: 0%;
    background: var(--fsc-accent);
    z-index: 0;
    will-change: height;
    transition: height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 0 8px var(--fsc-accent-gl);
}

.fsc-step {
    width: 100%;
    display: flex;
    align-items: flex-start;
    padding: 20px 0 100px 0;
    position: relative;
}

.fsc-step-inner {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.fsc-step .fsc-text,
.fsc-step .fsc-circle {
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fsc-step .fsc-text {
    opacity: 0.25;
    transform: translateY(4px);
}
.fsc-step .fsc-circle {
    opacity: 0.35;
    transform: scale(0.85);
}

.fsc-step.is-active .fsc-text {
    opacity: 1;
    transform: translateY(0);
}
.fsc-step.is-active .fsc-circle {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 28px var(--fsc-accent-gl), 0 0 6px var(--fsc-accent-gl);
}

.fsc-step.is-adjacent .fsc-text {
    opacity: 0.45;
    transform: translateY(2px);
}
.fsc-step.is-adjacent .fsc-circle {
    opacity: 0.55;
    transform: scale(0.92);
}

.fsc-circle {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--fsc-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.fsc-num {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #111;
    line-height: 1;
}

.fsc-text h3 {
    font-family: inherit;
    font-size: clamp(2.5, 2.2vw, 1.85rem)!important;
    font-weight: 500;
    color: var(--fsc-text);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 10px 0;
}

.fsc-text p {
    font-family: inherit;
    font-size: clamp(1rem, 1.1vw, 1.08rem);
    font-weight: 300;
    color: var(--fsc-muted);
    line-height: 1.8;
    margin: 0;
    max-width: 340px;
}

/* ==========================================================================
   RIGHT — Grid collage
   
   CSS Grid fills 100% of available height. Three rows:
   Row 1 (2 tiles):  ~1fr   — short cinematic strip
   Row 2 (1 tile):   ~2fr   — hero, spans both columns
   Row 3 (2 tiles):  ~1fr   — short cinematic strip
   
   This guarantees the grid ALWAYS fills the viewport regardless of
   screen aspect ratio. Images use object-fit:cover.
   ========================================================================== */

.fsc-right {
    width: 58%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.fsc-right::before { display: none; }
.fsc-right::after  { display: none; }

.fsc-collage {
    position: absolute;
    inset: 0;
    padding: var(--fsc-collage-pad);
    display: grid;
    grid-template-rows: 1fr 2fr 1fr;
    grid-template-columns: 1fr 1fr;
    gap: var(--fsc-gap);
}

/* Row 2 center tile spans both columns */
.fsc-tile[data-slot="2"] {
    grid-column: 1 / -1;
}

/* Each tile */
.fsc-tile {
    position: relative;
    border-radius: var(--fsc-radius);
    overflow: hidden;
    background: rgba(255,255,255,0.025);
    min-height: 0; /* prevent grid blowout */
    min-width: 0;
}

/* Image layers inside each tile (two for crossfade) */
.fsc-tile-img {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0.93);
    transition: opacity 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.fsc-tile-img.is-visible {
    opacity: 1;
    transform: scale(1);
}

.fsc-tile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fsc-no-images {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.15);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .fsc-wrapper {
        flex-direction: column;
    }

    .fsc-right {
        width: 100%;
        height: 35vh;
        order: 1;
    }

    .fsc-collage {
        padding: 10px;
        gap: 8px;
        grid-template-rows: 1fr 1.5fr 1fr;
    }

    .fsc-left {
        width: 100%;
        height: 65vh;
        order: 2;
    }

    .fsc-left::before {
        height: 60px;
        background: linear-gradient(to bottom, var(--fsc-bg) 30%, transparent 100%);
    }
    .fsc-left::after { height: 120px; }

    .fsc-track { padding: 0 5% 0 6%; }
    .fsc-progress-line,
    .fsc-progress-fill { left: calc(6% + 18px); }

    .fsc-step { padding: 16px 0 70px 0; }
    .fsc-step-inner { gap: 18px; }

    .fsc-circle { width: 38px; height: 38px; }
    .fsc-num { font-size: 0.85rem; }

    .fsc-text p { max-width: none; }
    .fsc-text h3 { font-size: clamp(1.15rem, 3.5vw, 1.45rem) !important; }
    .fsc-text p  { font-size: clamp(0.88rem, 2.5vw, 1rem); line-height: 1.65; }

    .fsc-tile { border-radius: 5px; }
}

@media (max-width: 480px) {
    :root {
        --fsc-collage-pad: 8px;
        --fsc-gap: 6px;
    }

    .fsc-right { height: 32vh; }
    .fsc-left  { height: 68vh; }

    .fsc-left::before { height: 70px; }
    .fsc-left::after  { height: 90px; }

    .fsc-step { padding: 12px 0 55px 0; }
    .fsc-step-inner { gap: 14px; }
    .fsc-circle { width: 34px; height: 34px; }
    .fsc-num { font-size: 0.8rem; }

    .fsc-track { padding: 0 4% 0 5%; }
    .fsc-progress-line,
    .fsc-progress-fill { left: calc(5% + 17px); }

    .fsc-tile { border-radius: 4px; }

    .fsc-collage {
        grid-template-rows: 1fr 1.5fr 1fr;
    }
}
