/* ============================================
   FUNN — Clientes Scrollytelling Page
   Cinematic · Immersive · Dark · Premium
   ============================================ */

/* --- RESET & BASE --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #0B0D10;
    --black-light: #111318;
    --gray-dark: #1F1F1F;
    --gray-mid: #2A2A2E;
    --gray-text: #8A8A8F;
    --gray-light: #B0B0B5;
    --white: #FFFFFF;
    --accent: #7C3AED;
    --accent-dim: #6326C4;
    --accent-glow: rgba(124, 58, 237, 0.15);
    --accent-glow-strong: rgba(124, 58, 237, 0.25);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 8px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background-color: var(--black);
    color: var(--white);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- ACCENT --- */
.cn-accent {
    color: var(--accent);
}

/* ===========================================
   NAVIGATION
   =========================================== */
.cn-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    transition: background 0.4s ease, padding 0.3s ease;
    background: transparent;
}

.cn-nav--scrolled {
    background: rgba(11, 13, 16, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cn-nav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cn-nav__logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--white);
}

.cn-nav__back {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-light);
    transition: var(--transition);
}

.cn-nav__back:hover {
    color: var(--white);
}

/* ===========================================
   GLOBAL PROGRESS BAR
   =========================================== */
.cn-global-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 200;
    background: rgba(255, 255, 255, 0.04);
}

.cn-global-progress__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #a855f7, var(--accent));
    background-size: 200% 100%;
    animation: progressShimmer 3s ease infinite;
    transition: width 0.15s linear;
    box-shadow: 0 0 20px var(--accent-glow-strong);
}

@keyframes progressShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===========================================
   SECTION DOTS
   =========================================== */
.cn-dots {
    position: fixed;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cn-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-mid);
    background: transparent;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0;
}

.cn-dot--active {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow-strong);
    transform: scale(1.3);
}

/* ===========================================
   OVERLINE
   =========================================== */
.cn-overline {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

/* ===========================================
   SCENE BASE
   =========================================== */
.cn-scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cn-scene__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ===========================================
   SCENE 1: HERO
   =========================================== */
.cn-scene--hero {
    min-height: 100vh;
    justify-content: center;
}

.cn-scene__bg-gradient {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 50% at 70% 20%, var(--accent-glow-strong) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
    opacity: 0.7;
    pointer-events: none;
}

.cn-hero-text {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.cn-hero-title {
    font-size: clamp(42px, 8vw, 96px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 32px;
}

.cn-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotateX(10deg);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--i) * 0.12s + 0.3s);
}

.cn-word--accent {
    color: var(--accent);
    text-shadow: 0 0 60px var(--accent-glow-strong);
}

body.cn-loaded .cn-word {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

.cn-hero-sub {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--gray-light);
    line-height: 1.7;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.9s, transform 1s ease 0.9s;
}

body.cn-loaded .cn-hero-sub {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll hint */
.cn-scroll-hint {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeInHint 1s ease 1.8s forwards;
}

.cn-scroll-hint span {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-text);
}

.cn-scroll-hint__line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scaleY(0.6);
    }

    50% {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes fadeInHint {
    to {
        opacity: 1;
    }
}

/* ===========================================
   SCENE 2: MANIFESTO
   =========================================== */
.cn-scene--manifesto {
    min-height: 100vh;
    background: var(--black);
}

.cn-manifesto {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cn-manifesto__line {
    font-size: clamp(22px, 3.5vw, 36px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--white);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cn-manifesto__line.cn-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================================
   SCENE 3: CLIENT BLOCKS
   =========================================== */
.cn-scene--clients {
    display: block;
    min-height: auto;
    padding: 0;
}

.cn-clients-sequence {
    position: relative;
}

.cn-client-block {
    height: 250vh;
    position: relative;
}

.cn-client-block__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cn-client-block__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s ease;
    background:
        radial-gradient(ellipse 50% 50% at 50% 50%,
            hsla(var(--accent-hue), 60%, 50%, 0.14) 0%,
            transparent 70%);
}

.cn-client-block.cn-in-view .cn-client-block__bg {
    opacity: 1;
}

.cn-client-block__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 60px;
    align-items: start;
    max-width: 900px;
    width: 100%;
    padding: 0 32px;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.cn-client-block.cn-in-view .cn-client-block__content {
    opacity: 1;
    transform: translateY(0);
}

/* Exit animation — fade out & scale down as block leaves */
.cn-client-block.cn-exiting .cn-client-block__content {
    opacity: 0;
    transform: translateY(-40px) scale(0.96);
}

.cn-client-block.cn-exiting .cn-client-block__bg {
    opacity: 0;
}

.cn-client-block.cn-exiting .cn-client-block__number {
    opacity: 0;
    transform: scale(0.8) translateY(-30px);
}

.cn-client-block__number {
    font-size: clamp(72px, 10vw, 120px);
    font-weight: 900;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--accent);
    line-height: 1;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.7s ease 0.2s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.cn-client-block.cn-in-view .cn-client-block__number {
    opacity: 1;
    transform: scale(1);
}

.cn-client-block__title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--white);
}

/* Client category icon */
.cn-client-block__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: hsla(var(--accent-hue), 60%, 50%, 0.1);
    border: 1px solid hsla(var(--accent-hue), 60%, 50%, 0.25);
    color: hsla(var(--accent-hue), 60%, 70%, 1);
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(16px) scale(0.9);
    transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

.cn-client-block.cn-in-view .cn-client-block__icon {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.cn-client-block__icon svg {
    width: 28px;
    height: 28px;
}

.cn-client-block__desc {
    font-size: 17px;
    color: var(--gray-light);
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 480px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease 0.3s, transform 0.7s ease 0.3s;
}

.cn-client-block.cn-in-view .cn-client-block__desc {
    opacity: 1;
    transform: translateY(0);
}

.cn-client-block__tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease 0.45s, transform 0.6s ease 0.45s;
}

.cn-client-block.cn-in-view .cn-client-block__tags {
    opacity: 1;
    transform: translateY(0);
}

.cn-client-block__tags span {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gray-light);
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 100px;
    transition: all 0.4s ease;
}

.cn-client-block.cn-in-view .cn-client-block__tags span {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.35);
    color: var(--white);
}

/* Metric highlight */
.cn-client-block__metric {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-mid);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease 0.55s, transform 0.6s ease 0.55s;
}

.cn-client-block.cn-in-view .cn-client-block__metric {
    opacity: 1;
    transform: translateY(0);
}

.cn-client-block__metric-value {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
}

.cn-client-block__metric-label {
    font-size: 14px;
    color: var(--gray-text);
    line-height: 1.4;
}

/* ===========================================
   SCENE 4: COMMON THREAD
   =========================================== */
.cn-scene--common {
    min-height: 100vh;
    background: var(--black-light);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cn-common {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.cn-common__title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cn-common__title span {
    display: block;
    font-size: clamp(24px, 3.5vw, 40px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.cn-common__title span.cn-visible {
    opacity: 1;
    transform: translateY(0);
}

.cn-strikethrough {
    font-style: normal;
    position: relative;
    color: var(--gray-text);
}

.cn-strikethrough::after {
    content: '';
    position: absolute;
    left: -4px;
    right: -4px;
    top: 50%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cn-visible .cn-strikethrough::after {
    transform: scaleX(1);
}

/* ===========================================
   SCENE 5: STATS
   =========================================== */
.cn-scene--stats {
    min-height: 60vh;
    background: var(--black);
}

.cn-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.cn-stat-item {
    text-align: center;
    padding: 48px 24px;
    background: var(--black-light);
    border: 1px solid var(--gray-mid);
    border-radius: var(--radius-lg);
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.7s ease, transform 0.7s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.cn-stat-item.cn-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.cn-stat-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 50px var(--accent-glow);
}

.cn-stat-item__value {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent);
}

.cn-stat-item__suffix {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

.cn-stat-item__label {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    color: var(--gray-text);
    line-height: 1.5;
}

/* ===========================================
   SCENE 6: FINAL CTA
   =========================================== */
.cn-scene--cta {
    min-height: 100vh;
}

.cn-scene__bg-gradient--cta {
    background:
        radial-gradient(ellipse 50% 50% at 50% 60%, var(--accent-glow-strong) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 30% 30%, rgba(124, 58, 237, 0.06) 0%, transparent 50%);
}

.cn-final-cta {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.cn-final-cta__title {
    font-size: clamp(30px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.cn-final-cta__sub {
    font-size: 18px;
    color: var(--gray-light);
    line-height: 1.7;
    margin-bottom: 40px;
}

/* --- BUTTONS --- */
.cn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--accent);
    color: var(--white);
    letter-spacing: 0.01em;
    margin: 0 8px;
}

.cn-btn:hover {
    background-color: var(--accent-dim);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--accent-glow-strong);
}

.cn-btn--ghost {
    background: transparent;
    border: 1px solid var(--gray-mid);
    color: var(--gray-light);
}

.cn-btn--ghost:hover {
    border-color: var(--accent);
    color: var(--white);
    background: transparent;
    box-shadow: none;
}

/* ===========================================
   GRAIN OVERLAY
   =========================================== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px 128px;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 1024px) {
    .cn-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .cn-client-block__content {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }

    .cn-client-block__number {
        justify-self: center;
    }

    .cn-client-block__desc {
        max-width: 100%;
    }

    .cn-client-block__tags {
        justify-content: center;
    }

    .cn-client-block__metric {
        justify-content: center;
        flex-wrap: wrap;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .cn-dots {
        display: none;
    }

    .cn-hero-title {
        font-size: clamp(32px, 10vw, 60px);
    }

    .cn-client-block {
        height: 180vh;
    }

    .cn-client-block__number {
        font-size: 64px;
    }

    .cn-client-block__title {
        font-size: clamp(28px, 7vw, 40px);
    }

    .cn-stats-row {
        grid-template-columns: 1fr;
    }

    .cn-stat-item__value {
        font-size: 36px;
    }

    .cn-final-cta .cn-btn {
        display: block;
        margin: 0 auto 12px;
        width: 100%;
        max-width: 300px;
    }

    .cn-manifesto__line {
        font-size: clamp(18px, 5vw, 28px);
    }

    .cn-common__title span {
        font-size: clamp(20px, 5vw, 32px);
    }

    .cn-nav__back span {
        display: none;
    }
}