/* ==========================================================================
   Sans.uz - Master Stylesheet (BMW / Apple / Discord Inspired Cinematic UI)
   ========================================================================== */

:root {
    --bg-main: #050505;
    --card-bg: rgba(13, 13, 13, 0.7);
    --card-border: rgba(255, 255, 255, 0.06);
    --accent-blue: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --glass-blur: blur(24px);
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Document Optimization */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

p {
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-secondary);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.4s var(--transition-smooth);
}

/* Premium Navbar Layout (Apple-Inspired Blur) */
.sans-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 72px;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    transition: background 0.4s var(--transition-smooth);
}

.nav-container {
    max-width: 1600px;
    height: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.15em;
}

.nav-logo span {
    color: var(--accent-blue);
    font-weight: 300;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-item {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
}

.nav-btn-secondary {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 20px;
    background: #ffffff;
    color: #050505;
    transition: transform 0.3s var(--transition-smooth), opacity 0.3s var(--transition-smooth);
}

.nav-btn-secondary:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

/* Mobile Hamburger Toggle button */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.mobile-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.4s var(--transition-smooth);
    transform-origin: left center;
}

/* Fullscreen Cinematic Hero Layout */
.hero-viewport {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(5,5,5,0.4) 0%, rgba(5,5,5,0.95) 100%);
    z-index: 2;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom procedural SVG placeholder if video stream asset isn't ready */
.hero-video-fallback {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #111827 0%, #050505 100%);
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
    padding: 0 24px;
    transform: translateY(30px);
    opacity: 0;
    animation: heroFadeIn 1.4s var(--transition-smooth) forwards 0.2s;
}

@keyframes heroFadeIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero-content h1 {
    font-size: clamp(40px, 6vw, 84px);
    font-weight: 200;
    margin-bottom: 24px;
    letter-spacing: -0.04em;
}

.hero-content p {
    font-size: clamp(16px, 1.5vw, 20px);
    margin-bottom: 40px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta-btn {
    display: inline-block;
    padding: 16px 40px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    background: linear-gradient(135deg, #1e40af 0%, var(--accent-blue) 100%);
    border-radius: 30px;
    box-shadow: 0 10px 30px var(--accent-glow);
    transition: transform 0.4s var(--transition-smooth), box-shadow 0.4s var(--transition-smooth);
}

.hero-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.4);
}

/* Standard Section Layouts */
.section-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 120px 40px;
}

.section-header {
    margin-bottom: 60px;
}

.section-title {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Premium Card Grids (Communities & Marketplace) */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 32px;
}

.cinematic-card {
    position: relative;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    transition: border-color 0.4s var(--transition-smooth), transform 0.4s var(--transition-smooth);
    cursor: pointer;
}

.cinematic-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.card-media-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--transition-smooth);
}

.cinematic-card:hover .card-img {
    transform: scale(1.04);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(5,5,5,0.9) 0%, rgba(5,5,5,0.2) 70%, rgba(5,5,5,0.4) 100%);
    z-index: 2;
}

.card-body {
    position: relative;
    z-index: 3;
}

.card-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.card-title {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.card-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Marketplace Specialized Interface Modifications */
.product-card {
    aspect-ratio: auto;
    justify-content: flex-start;
    padding: 0;
}

.product-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0f0f0f;
    border-bottom: 1px solid var(--card-border);
}

.product-details {
    padding: 24px;
    background: rgba(10, 10, 10, 0.5);
    width: 100%;
}

.product-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.product-price {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
}

.product-action-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 6px;
    transition: all 0.3s var(--transition-smooth);
}

.product-card:hover .product-action-btn {
    background: var(--text-primary);
    color: var(--bg-main);
}

/* Authentication Center Framework (Glassmorphism Deep Matrix) */
.auth-viewport {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px;
    position: relative;
}

.auth-blur-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    background: rgba(10, 10, 10, 0.45);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.auth-back-link:hover {
    color: var(--text-primary);
}

.auth-title {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Unified Provider OAuth Infrastructure */
.oauth-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.oauth-btn {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.oauth-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 24px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--card-border);
}

.auth-divider:not(:empty)::before { margin-right: .75em; }
.auth-divider:not(:empty)::after { margin-left: .75em; }

/* Hidden Dynamic Context Forms */
.sliding-form-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s var(--transition-smooth);
}

.sliding-form-container.revealed {
    max-height: 400px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    height: 48px;
    background: rgba(5, 5, 5, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue);
}

.form-submit-btn {
    width: 100%;
    height: 48px;
    background: var(--text-primary);
    color: var(--bg-main);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s var(--transition-smooth);
}

.form-submit-btn:hover {
    opacity: 0.9;
}

.form-error-fallback {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-size: 13px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

/* Premium Footer Layout */
.sans-footer {
    background: #090909;
    border-top: 1px solid var(--card-border);
    padding: 80px 40px 40px 40px;
    margin-top: auto;
}

.footer-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 48px;
}

.footer-brand {
    max-width: 360px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 16px;
}

.footer-logo span { color: var(--accent-blue); font-weight: 300; }
.footer-tagline { font-size: 14px; color: var(--text-secondary); }

.footer-links-group {
    display: flex;
    gap: 80px;
    flex-wrap: wrap;
}

.footer-column h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.footer-column a {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.footer-column a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    max-width: 1600px;
    margin: 40px auto 0 auto;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.03);
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   Responsive Layout Engineering (Ultrawide -> Phones)
   ========================================================================== */

@media (min-width: 2000px) {
    .nav-container, .section-wrapper, .footer-container, .footer-bottom {
        max-width: 1800px;
    }
    .content-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .section-wrapper { padding: 80px 24px; }
    .nav-container { padding: 0 24px; }
    .content-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* Mobile Navigation Architecture Transformation */
    .mobile-toggle { display: flex; }
    
    .nav-links {
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        height: calc(100vh - 72px);
        background: #050505;
        flex-direction: column;
        align-items: flex-start;
        padding: 40px 24px;
        gap: 28px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.5s;
        z-index: 999;
    }
    
    .nav-links.mobile-active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-item {
        font-size: 20px;
        font-weight: 300;
        width: 100%;
    }

    .nav-btn-secondary {
        width: 100%;
        text-align: center;
        padding: 14px;
        font-size: 16px;
    }

    /* Hamburger Active Transformations */
    .mobile-toggle.active .bar:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
    .mobile-toggle.active .bar:nth-child(2) { opacity: 0; }
    .mobile-toggle.active .bar:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

    .content-grid { grid-template-columns: 1fr; }
    .footer-links-group { gap: 40px; }
    .auth-card { padding: 32px 24px; }
}