/* --- POLYMORPHIC LAYOUT SYSTEM --- */
:root {
    --fluid-padding: clamp(1rem, 5vw, 4rem);
    --h1-size: clamp(3.5rem, 15vw, 8rem);
    --h2-size: clamp(2rem, 6vw, 4rem);
    --text-base: clamp(0.9rem, 2vw, 1.1rem);
    --neon-passion: #ff2d55;
    --neon-blue: #007aff;
    --neon-circuit: #00f0ff;
    --neon-energy: #bd00ff;
    --neon-green: #00ff88;
    --deep-space: #05050a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--deep-space);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    /* High-end font fallback */
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(255, 45, 85, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(0, 122, 255, 0.05) 0%, transparent 40%);
}

.interface-wrap {
    max-width: 900px;
    width: 95%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
}

/* --- THE CINEMATIC SCREEN HERO --- */
.cinematic-hero {
    width: 100%;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: #000;
}

.hero-screen-frame {
    width: clamp(320px, 85%, 1400px);
    height: 65vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    border-radius: 40px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 60px 120px rgba(0, 0, 0, 1);
    z-index: 1;
}

.hero-image-layer {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4) contrast(1.2);
}

.hero-overlay {
    position: relative;
    z-index: 10;
    text-align: center;
}

/* 3-Line Vertical Logo Identity */
.hero-separator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    font-size: var(--h1-size);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.8;
}

.hero-dot {
    color: var(--neon-passion);
    font-size: 1em;
    height: 0.4em;
    display: flex;
    align-items: center;
    text-shadow: 0 0 30px var(--neon-passion);
}

.hero-subtitle {
    font-size: var(--text-base);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 3rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* FIXED AVANTI TICKER */
.avanti-pulse-track {
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 20;
    overflow: hidden;
}

.avanti-ticker {
    display: flex;
    gap: 5rem;
    white-space: nowrap;
    animation: ticker 40s linear infinite;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ticker-item {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-weight: 800;
    transition: color 0.3s;
    text-transform: uppercase;
}

.ticker-item:hover {
    color: var(--neon-passion);
}

.ticker-item.active {
    color: var(--neon-passion);
    text-shadow: 0 0 15px var(--neon-passion);
}

/* --- SOCIAL CONTENT MODULES --- */
.pulse-stream {
    width: 100%;
}

.hud-panel {
    width: 100%;
    order: -1;
    /* Place HUD modules at the top as requested */
}

@media (max-width: 1100px) {
    .interface-wrap {
        width: 100%;
        padding: 0 1rem;
    }
}

.glass-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 2rem;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    height: fit-content;
}

.social-discovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.citizen-node {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.citizen-node:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--neon-passion);
}

.citizen-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    border: 3px solid #fff;
    background: linear-gradient(45deg, var(--neon-passion), var(--neon-blue));
}

.pulse-banner {
    width: 100%;
    border-radius: 24px;
    margin: 1.5rem 0;
    aspect-ratio: 1/1;
    /* Shifted to square for high-fidelity narrative focus */
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- COLLAPSIBLE SYSTEM --- */
.collapsible-trigger {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.collapsible-trigger:hover {
    color: var(--neon-passion);
    letter-spacing: 3px;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.collapsible-content.active {
    max-height: 800px;
    opacity: 1;
    margin-top: 1.5rem;
}

.avanti-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 1rem;
}

.avanti-chip {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
}

.avanti-chip:hover {
    background: rgba(255, 45, 85, 0.1);
    border-color: var(--neon-passion);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 45, 85, 0.2);
}

.avanti-chip.featured {
    border-color: var(--neon-passion);
    color: var(--neon-passion);
}

/* --- CITIZEN LEGACY GRID --- */
.profile-legacy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 2rem;
}

.legacy-node {
    aspect-ratio: 1/1;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, filter 0.3s;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.legacy-node:hover {
    transform: scale(0.98);
    filter: brightness(1.2);
}

.legacy-node::after {
    content: "VIEW_PULSE";
    position: absolute;
    inset: 0;
    background: rgba(255, 45, 85, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    opacity: 0;
    transition: opacity 0.3s;
}

.legacy-node:hover::after {
    opacity: 1;
}

.neighbor-stat {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    justify-content: center;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
}

.stat-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- AUTH PANEL OVERHAUL --- */
.auth-panel {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(50px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4rem;
    border-radius: 60px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 60px 120px rgba(0, 0, 0, 1);
    border-bottom: 4px solid var(--neon-passion);
}

/* --- NAVIGATION --- */
.city-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem var(--fluid-padding);
    backdrop-filter: blur(20px);
    background: rgba(5, 5, 10, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 45, 85, 0.4);
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    transition: 0.3s;
}

.nav-links a:hover {
    color: #fff;
}

.btn-cta {
    padding: 0.8rem 2rem;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--neon-passion), #ff6b81);
    color: #fff !important;
    text-decoration: none;
    font-weight: 800;
}

/* Twemoji Sticker System */
img.emoji {
    height: 1.3em;
    width: 1.3em;
    margin: 0 .2em;
    vertical-align: -0.2em;
    background: #fff;
    border: 2px solid #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s;
}

img.emoji:hover {
    transform: scale(1.4) rotate(10deg);
}

.sticker-core {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="5" y="5" width="90" height="90" rx="15" fill="%230a0a0f" stroke="%2300f0ff" stroke-width="5"/><circle cx="50" cy="50" r="12" fill="none" stroke="%23bd00ff" stroke-width="6"/><path d="M50 5 L50 25 M50 75 L50 95 M5 50 L25 50 M75 50 L95 50 M20 20 L35 35 M80 20 L65 35 M20 80 L35 65 M80 80 L65 65" stroke="%2300f0ff" stroke-width="4" stroke-linecap="round"/></svg>');
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.6));
}

.gi-sticker-wrap {
    display: inline-flex;
    align-items: center;
}

.gi-sticker {
    display: block;
    width: 1.5em;
    height: 1.5em;
    background-size: contain;
    background-repeat: no-repeat;
    transition: 0.3s;
}

.sticker-pulse {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="white" stroke="%23ff2d55" stroke-width="6"/><path d="M25 50 L40 50 L45 30 L55 70 L60 50 L75 50" fill="none" stroke="%23ff2d55" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}

.sticker-zap {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 10 L30 55 L50 55 L40 90 L70 45 L50 45 L60 10 Z" fill="white" stroke="%2300ff88" stroke-width="5" stroke-linejoin="round"/></svg>');
}