:root {
    --bg-dark: #050507;
    --bg-panel: rgba(15, 15, 20, 0.4);
    --border-color: rgba(255, 255, 255, 0.15);
    --border-glow: rgba(99, 102, 241, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #a0a0ab;
    --accent-color: #6366f1;
    --accent-hover: #818cf8;
    --accent-neon: #0ff;
    --success: #10b981;
    --error: #ef4444;
    --glass-blur: blur(20px);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(0, 255, 255, 0.05), transparent 40%);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    perspective: 1200px; /* Enable 3D depth */
}

#scene-3d {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    transform-style: preserve-3d;
}

#app-3d-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Typography */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }

/* Buttons */
.btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-secondary:hover {
    border-color: var(--accent-color);
    background: rgba(99, 102, 241, 0.12);
}
.w-100 { width: 100%; }

/* Utilities */
.hidden { display: none !important; }

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    backdrop-filter: var(--glass-blur);
    background: rgba(10, 10, 12, 0.8);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #a0a0ab);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

/* Main Content */
#main-content {
    flex: 1;
    margin-top: 70px;
    display: flex;
    flex-direction: column;
}
.page-section {
    display: none;
    flex: 1;
    animation: fadeIn 0.4s ease-out forwards;
}
.page-section.active { display: flex; flex-direction: column; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Home Section */
.hero {
    max-width: 1200px;
    margin: auto;
    padding: 4rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}
.hero-content { flex: 1; }
.hero-content p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 500px;
}
.hero-visual {
    flex: 1;
    position: relative;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.abstract-shape {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent-color), var(--accent-neon));
    filter: blur(80px);
    opacity: 0.5;
    animation: pulse3d 8s infinite alternate ease-in-out;
    transform: translateZ(-100px);
}
.shape-2 {
    position: absolute;
    width: 250px;
    height: 250px;
    background: linear-gradient(45deg, #ec4899, var(--accent-color));
    top: 30%;
    left: 10%;
    animation-delay: -4s;
    transform: translateZ(50px);
}

.hero-3d-image {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 40px var(--border-glow);
    animation: float3d 6s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes float3d {
    0% { transform: translateY(0) rotateX(5deg) rotateY(-5deg); }
    50% { transform: translateY(-20px) rotateX(-5deg) rotateY(10deg); }
    100% { transform: translateY(0) rotateX(5deg) rotateY(-5deg); }
}

@keyframes pulse3d {
    0% { transform: scale(1) translate3d(0, 0, -100px) rotate(0deg); }
    100% { transform: scale(1.2) translate3d(30px, -30px, 0px) rotate(45deg); }
}

/* Demo Section */
.demo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}
.demo-header {
    text-align: center;
    margin-bottom: 3rem;
}
.demo-header p { color: var(--text-secondary); }

.demo-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Upload Area */
.upload-area {
    background: var(--bg-panel);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent-color);
    background: rgba(99, 102, 241, 0.05);
}
.upload-prompt {
    text-align: center;
    pointer-events: none;
}
.upload-icon {
    color: var(--accent-color);
    margin-bottom: 1rem;
}
.upload-prompt p { color: var(--text-secondary); font-size: 0.9rem; }

#image-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results Area */
.results-placeholder {
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
    background: var(--bg-panel);
}
.results-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Result Cards */
.face-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    animation: slideIn 0.4s ease-out forwards;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 0 20px rgba(255,255,255,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.face-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.2), inset 0 0 30px rgba(255,255,255,0.05);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.face-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}
.face-title { font-weight: 600; color: var(--accent-color); }
.face-conf { font-size: 0.85rem; color: var(--text-secondary); }

.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.data-item {
    display: flex;
    flex-direction: column;
}
.data-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.data-value {
    font-size: 1.1rem;
    font-weight: 600;
}
.value-conf {
    font-size: 0.75rem;
    color: var(--success);
    margin-left: 0.5rem;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out forwards;
}
.modal-content {
    background: #18181b;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-close:hover { color: var(--text-primary); }
.modal-body { padding: 1.5rem; }
.modal-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}
.form-group input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}
.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.form-actions { margin-top: 2rem; }

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}
.toast {
    background: #27272a;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.toast.error { border-left-color: var(--error); }
.toast.success { border-left-color: var(--success); }

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    width: min(920px, calc(100% - 2rem));
    z-index: 1900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem;
    background: rgba(18, 18, 24, 0.94);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: var(--glass-blur);
}
.cookie-copy h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}
.cookie-copy p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 640px;
}
.cookie-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* Responsive */
@media (max-width: 768px) {
    .hero { flex-direction: column; text-align: center; gap: 2rem; }
    .hero-content p { margin: 1.5rem auto; }
    .demo-workspace { grid-template-columns: 1fr; }
    .cookie-consent {
        align-items: stretch;
        flex-direction: column;
    }
    .cookie-actions {
        justify-content: flex-end;
    }
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    background: var(--bg-panel);
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: var(--transition);
}
.footer-links a:hover {
    color: var(--accent-color);
}

/* Legal Content */
.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}
.legal-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}
.legal-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

