/* ============================================================
   JokeDR — Cinematic Scroll FX  (Apple-style)
   ============================================================ */

/* ── Cinematic sections ──────────────────────────────────── */
.cinema-section {
    position: relative;
    overflow: hidden;
}

/* ── Video Hero Override ─────────────────────────────────── */
#hero.has-video .hero-bg-image { display: none; }
.hero-video-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.hero-video-wrap video {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: .28;
    filter: brightness(.6) saturate(1.2);
}
.hero-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(13,13,13,.3) 0%,
        rgba(13,13,13,.1) 40%,
        rgba(13,13,13,.7) 85%,
        rgba(13,13,13,.98) 100%
    );
}

/* ── Scroll Reveal Base ──────────────────────────────────── */
[data-sr] {
    opacity: 0;
    transition-property: opacity, transform, filter;
    transition-timing-function: cubic-bezier(.22, .61, .36, 1);
    transition-duration: .9s;
    will-change: opacity, transform;
}
[data-sr="up"]    { transform: translateY(56px); }
[data-sr="down"]  { transform: translateY(-40px); }
[data-sr="left"]  { transform: translateX(56px); }
[data-sr="right"] { transform: translateX(-56px); }
[data-sr="zoom"]  { transform: scale(.88); filter: blur(4px); }
[data-sr="flip"]  { transform: rotateX(20deg) translateY(40px); transform-origin: bottom; }
[data-sr].sr-done { opacity: 1; transform: none; filter: none; }

/* ── Sticky Pin Section ──────────────────────────────────── */
.pin-container {
    position: relative;
}
.pin-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.pin-steps {
    /* scroll-driven steps sit behind sticky */
}
.pin-step {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Feature Showcase (Apple-style sticky) ───────────────── */
.showcase-section {
    background: var(--dark);
}
.showcase-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: stretch;
}
.showcase-visual {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-2);
    overflow: hidden;
}
.showcase-visual-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Big decorative number behind visual */
.showcase-visual-bg-num {
    position: absolute;
    font-size: clamp(8rem, 18vw, 20rem);
    font-weight: 900;
    color: rgba(224,38,38,.04);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    letter-spacing: -.04em;
}
.showcase-icon-display {
    width: clamp(140px, 20vw, 220px);
    height: clamp(140px, 20vw, 220px);
    border-radius: 28%;
    background: linear-gradient(135deg, rgba(224,38,38,.15) 0%, rgba(224,38,38,.04) 100%);
    border: 1px solid rgba(224,38,38,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .5s cubic-bezier(.22,.61,.36,1);
    position: relative;
    z-index: 1;
}
.showcase-icon-display i {
    font-size: clamp(3rem, 5vw, 5.5rem);
    color: var(--primary);
    transition: all .5s cubic-bezier(.22,.61,.36,1);
}
.showcase-icon-display::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 30%;
    border: 1px solid rgba(224,38,38,.08);
    animation: iconPulse 3s ease-in-out infinite;
}
.showcase-icon-display::before {
    content: '';
    position: absolute;
    inset: -40px;
    border-radius: 30%;
    border: 1px solid rgba(224,38,38,.04);
    animation: iconPulse 3s ease-in-out infinite .8s;
}

.showcase-steps {
    padding: 0;
}
.showcase-step {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px clamp(32px, 6vw, 80px);
    border-bottom: 1px solid rgba(255,255,255,.04);
    opacity: .3;
    transition: opacity .5s ease;
    position: relative;
}
.showcase-step::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .6s cubic-bezier(.22,.61,.36,1);
}
.showcase-step.active { opacity: 1; }
.showcase-step.active::before { transform: scaleY(1); }
.showcase-step-num {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.showcase-step-num::before {
    content: '';
    display: inline-block;
    width: 24px; height: 1px;
    background: var(--primary);
}
.showcase-step h3 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 20px;
    letter-spacing: -.02em;
    line-height: 1.15;
}
.showcase-step h3 em {
    font-style: normal;
    color: var(--primary);
}
.showcase-step p {
    font-size: clamp(.95rem, 1.4vw, 1.1rem);
    color: #9ca3af;
    line-height: 1.8;
    max-width: 480px;
    margin-bottom: 28px;
}
.showcase-step-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.showcase-step-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: .78rem;
    font-weight: 600;
    background: rgba(224,38,38,.08);
    border: 1px solid rgba(224,38,38,.15);
    color: var(--primary);
    letter-spacing: .04em;
}
.showcase-step-tag i { font-size: .72rem; }

/* ── Parallax Band ───────────────────────────────────────── */
.parallax-band {
    position: relative;
    overflow: hidden;
    padding: 120px 0;
    background: var(--dark-2);
}
.parallax-band-bg {
    position: absolute;
    inset: -30%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: .06;
    filter: blur(2px);
}
.parallax-band-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}
.parallax-band h2 {
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -.03em;
    line-height: 1.05;
    max-width: 900px;
    margin: 0 auto 32px;
}
.parallax-band h2 .highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}
.parallax-band h2 .highlight::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .8s cubic-bezier(.22,.61,.36,1) .2s;
}
.parallax-band h2 .highlight.sr-done::after { transform: scaleX(1); }
.parallax-band p {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto 40px;
}
.parallax-numbers {
    display: flex;
    justify-content: center;
    gap: clamp(32px, 6vw, 80px);
    flex-wrap: wrap;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.parallax-num-item { text-align: center; }
.parallax-num-value {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--white);
    line-height: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
}
.parallax-num-value span { color: var(--primary); font-size: .65em; margin-top: .1em; }
.parallax-num-label {
    font-size: .78rem;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-top: 8px;
}

/* ── Text Cinema (big scrolling text) ────────────────────── */
.text-cinema {
    padding: 80px 0;
    overflow: hidden;
    background: var(--dark);
    position: relative;
}
.text-cinema-track {
    display: flex;
    gap: 60px;
    white-space: nowrap;
    animation: tickerScroll 30s linear infinite;
    width: max-content;
}
.text-cinema-track:nth-child(2) {
    animation-direction: reverse;
    animation-duration: 22s;
}
.text-cinema-item {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -.02em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255,255,255,.12);
    white-space: nowrap;
    padding-right: 60px;
    border-right: 2px solid rgba(224,38,38,.2);
}
.text-cinema-item.accent {
    -webkit-text-stroke: 1px var(--primary);
    color: transparent;
}

/* ── Scroll Progress Bar ─────────────────────────────────── */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #ff6b6b);
    z-index: 9999;
    width: 0%;
    transition: width .1s linear;
    box-shadow: 0 0 8px rgba(224,38,38,.6);
}

/* ── Section Transition Gradients ───────────────────────── */
.section-fade-top::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(to bottom, var(--dark) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}
.section-fade-bottom::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--dark) 0%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

/* ── Glow Orbs ───────────────────────────────────────────── */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: .25;
}
.glow-orb-1 {
    width: 500px; height: 500px;
    background: var(--primary);
    top: -150px; right: -100px;
    animation: orbFloat 8s ease-in-out infinite;
}
.glow-orb-2 {
    width: 300px; height: 300px;
    background: #ff6b35;
    bottom: -80px; left: 10%;
    animation: orbFloat 10s ease-in-out infinite 2s;
}

/* ── Line Reveal ─────────────────────────────────────────── */
.line-reveal {
    overflow: hidden;
    display: block;
}
.line-reveal-inner {
    transform: translateY(110%);
    display: block;
    transition: transform .8s cubic-bezier(.22,.61,.36,1);
}
.line-reveal.sr-done .line-reveal-inner { transform: none; }

/* ── Cursor Glow (desktop only) ──────────────────────────── */
@media (hover: hover) {
    #cursor-glow {
        position: fixed;
        width: 400px; height: 400px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(224,38,38,.06) 0%, transparent 70%);
        transform: translate(-50%, -50%);
        pointer-events: none;
        z-index: 0;
        transition: opacity .3s;
        will-change: transform;
    }
}

/* ── PWA Install Banner ──────────────────────────────────── */
#pwa-install {
    position: fixed;
    bottom: 80px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 22px;
    display: none;
    align-items: center;
    gap: 14px;
    z-index: 8000;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
    max-width: 380px;
    width: calc(100% - 40px);
    animation: slideUpIn .4s cubic-bezier(.22,.61,.36,1) forwards;
}
#pwa-install.show { display: flex; }
#pwa-install img { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
#pwa-install-text strong { display: block; color: var(--white); font-size: .9rem; }
#pwa-install-text span   { color: #9ca3af; font-size: .78rem; }
#pwa-install-actions { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }
#pwa-install-dismiss { background: transparent; border: 1px solid var(--border); color: #9ca3af; padding: 7px 14px; border-radius: 6px; font-size: .8rem; cursor: pointer; font-family: inherit; transition: all .2s; }
#pwa-install-dismiss:hover { border-color: var(--primary); color: var(--primary); }
#pwa-install-confirm { background: var(--primary); border: none; color: #fff; padding: 7px 16px; border-radius: 6px; font-size: .8rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: all .2s; }
#pwa-install-confirm:hover { background: var(--primary-dark); }

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes iconPulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(1.06); }
}
@keyframes orbFloat {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    33%     { transform: translate(30px,-20px) rotate(5deg); }
    66%     { transform: translate(-20px,15px) rotate(-3deg); }
}
@keyframes tickerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@keyframes slideUpIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .showcase-wrap { grid-template-columns: 1fr; }
    .showcase-visual { display: none; }
    .showcase-step { min-height: auto; padding: 60px 24px; opacity: 1; }
    .showcase-step.active::before { display: none; }
    .text-cinema-item { font-size: clamp(1.5rem, 6vw, 2.5rem); }
    .parallax-band-bg { background-attachment: scroll; }
}
