/* =============================================
   PRIVY — Layout: Navbar, Background, Sections
   ============================================= */

/* Typography Balancers */
h1,
h2,
h3,
h4,
.title-balance {
    text-wrap: balance;
}

p.subtitle,
.text-pretty {
    text-wrap: pretty;
}

/* Cinematic Background */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-layer::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: url('https://i.imgur.com/X25wN1d.jpeg') center/cover no-repeat;
    filter: blur(5px) brightness(0.28) saturate(0);
}

.bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(4, 4, 11, .12) 0%, rgba(4, 4, 11, .5) 30%, rgba(4, 4, 11, .94) 100%),
        radial-gradient(ellipse at 50% 10%, rgba(168, 85, 247, .07) 0%, transparent 55%),
        radial-gradient(ellipse at 25% 75%, rgba(236, 72, 153, .04) 0%, transparent 40%),
        radial-gradient(ellipse at 75% 40%, rgba(99, 50, 200, .04) 0%, transparent 35%);
}

/* Particles */
.particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--purple);
    opacity: 0;
    animation: particleDrift 16s ease-in-out infinite;
}

.particle:nth-child(1) {
    left: 14%;
    top: 20%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    left: 76%;
    top: 30%;
    animation-delay: 3.5s;
    background: var(--pink);
}

.particle:nth-child(3) {
    left: 24%;
    top: 60%;
    animation-delay: 7s;
}

.particle:nth-child(4) {
    left: 68%;
    top: 76%;
    animation-delay: 10s;
    background: var(--pink);
}

.particle:nth-child(5) {
    left: 44%;
    top: 44%;
    animation-delay: 5s;
    background: var(--gold);
    width: 1.5px;
    height: 1.5px;
}

.particle:nth-child(6) {
    left: 86%;
    top: 52%;
    animation-delay: 8s;
}

/* Glass Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(4, 4, 11, 0.5);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border-bottom: 1px solid rgba(168, 85, 247, 0.05);
    box-shadow: 0 1px 24px rgba(0, 0, 0, .25);
    z-index: 1000;
    transition: transform .4s var(--ease-out), opacity .4s var(--ease-out);
}

.navbar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, .15), rgba(236, 72, 153, .1), transparent);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    font-style: italic;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: .03em;
    flex-shrink: 0;
}

.nav-logo-img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(168, 85, 247, .2);
    box-shadow: 0 0 6px rgba(168, 85, 247, .12);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    position: relative;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    transition: color .25s var(--ease);
    padding: 4px 0;
}

.nav-link:hover {
    color: var(--text);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--grad);
    border-radius: 1px;
    transition: width .3s var(--ease-out);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta-btn {
    padding: 8px 18px;
    background: var(--grad);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .08em;
    transition: box-shadow .3s var(--ease), transform .25s var(--ease);
}

.nav-cta-btn:hover {
    box-shadow: 0 0 14px rgba(168, 85, 247, .3);
    transform: translateY(-1px);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 26px;
    height: 26px;
    background: none;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, .65);
    border-radius: 2px;
    transition: all .3s var(--ease);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 13, .96);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    opacity: 0;
    transition: opacity .35s var(--ease);
}

.mobile-menu.open {
    display: flex;
    opacity: 1;
}

.mobile-menu a {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .1em;
    transition: color .2s;
}

.mobile-menu a:hover {
    color: #fff;
}

@media (max-width: 767px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .navbar {
        padding: 0 18px;
    }
}

/* Page Wrapper */
.page-content {
    position: relative;
    z-index: 2;
    padding-top: var(--nav-h);
    padding-bottom: 64px;
}

/* Section */
.section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 120%;
    background: radial-gradient(ellipse at center, rgba(168, 85, 247, .03) 0%, transparent 65%);
    pointer-events: none;
    z-index: -1;
}

/* Section Separators */
.section-sep {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 2%, rgba(168, 85, 247, .14) 25%, rgba(236, 72, 153, .10) 50%, rgba(168, 85, 247, .14) 75%, transparent 98%);
    margin: var(--section-gap) auto;
    max-width: 900px;
    position: relative;
}

.section-sep::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 20%;
    right: 20%;
    height: 16px;
    background: radial-gradient(ellipse at center, rgba(168, 85, 247, .06) 0%, transparent 70%);
    pointer-events: none;
}

.gradient-divider {
    height: 1px;
    width: 100%;
    margin: 32px auto;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0.6;
}

/* Bottom Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(90deg, var(--purple), var(--pink), var(--purple));
    background-size: 200% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
    font-size: 11px;
    font-weight: 700;
    z-index: 200;
    box-shadow: 0 -2px 14px rgba(168, 85, 247, .25);
    animation: barSlide 6s linear infinite;
}

.timer-box {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 6px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* FOMO Toast */
.fomo-toast {
    position: fixed;
    bottom: 65px;
    left: 12px;
    max-width: 280px;
    background: rgba(12, 8, 24, .92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(34, 197, 94, .12);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    z-index: 300;
    transform: translateX(-120%);
    transition: transform .4s var(--ease-spring);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}

.fomo-toast.show {
    transform: translateX(0);
}

.fomo-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.fomo-name {
    font-weight: 700;
    font-size: 11px;
    color: var(--green);
}

.fomo-action {
    font-size: 10px;
    color: var(--text-muted);
}

.fomo-time {
    font-size: 9px;
    color: rgba(255, 255, 255, .22);
    margin-top: 1px;
}

/* Flow Arrows */
.flow-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    opacity: .35;
}

.flow-arrow-icon {
    font-size: 14px;
    color: var(--purple);
    text-shadow: 0 0 8px rgba(168, 85, 247, .35);
    animation: arrowDrift 3s ease-in-out infinite;
}

.flow-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: rgba(255, 255, 255, .25);
    margin-top: 3px;
    font-weight: 600;
}

/* Mobile Overrides */
@media (max-width: 767px) {
    .bottom-bar {
        font-size: 10px;
        padding: 8px 10px;
    }

    .timer-box {
        font-size: 10px;
    }

    .glass,
    .navbar,
    .model-card,
    .profile-card,
    .quiz-card {
        backdrop-filter: blur(8px) saturate(110%);
        -webkit-backdrop-filter: blur(8px) saturate(110%);
    }

    /* Disable heavy animations on mobile for performance */
    .floating-subtle {
        animation: none !important;
    }

    .particles .particle:nth-child(n+4) {
        display: none;
    }
}