/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
    --color-bg: #0a0a0f;
    --color-bg-secondary: #12121a;
    --color-bg-tertiary: #1a1a25;
    --color-surface: #1e1e2a;
    --color-surface-hover: #252535;
    --color-border: #2a2a3a;
    --color-border-light: #3a3a4a;

    --color-text: #ffffff;
    --color-text-secondary: #a0a0b0;
    --color-text-muted: #606070;

    --color-primary: #6366f1;
    --color-primary-hover: #818cf8;
    --color-primary-glow: rgba(99, 102, 241, 0.4);

    --color-accent: #22d3ee;
    --color-accent-glow: rgba(34, 211, 238, 0.3);

    --color-success: #10b981;
    --color-warning: #f59e0b;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-glow: 0 0 40px var(--color-primary-glow);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ===========================
   Utility Classes
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    color: white;
    box-shadow: 0 4px 20px var(--color-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--color-primary-glow);
}

.btn-outline {
    border: 1px solid var(--color-border-light);
    color: var(--color-text);
    background: transparent;
}

.btn-outline:hover {
    background: var(--color-surface);
    border-color: var(--color-primary);
}

.btn-large {
    padding: 16px 36px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

/* ===========================
   Header
   =========================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--color-primary);
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: var(--transition-fast);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 24px 80px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

/* ===========================
   Simulator Section
   =========================== */
.simulator-section {
    padding: 40px 24px 100px;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-secondary) 100%);
}

.simulator-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Slide Navigation */
.slide-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.slide-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    min-width: 100px;
}

.slide-btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-light);
}

.slide-btn.active {
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.slide-icon {
    font-size: 24px;
}

.slide-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.slide-btn.active .slide-label {
    color: var(--color-text);
}

/* Simulator Main Area */
.simulator {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
    min-height: 500px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* Source Cloud */
.source-cloud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.cloud-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.photo-pile {
    position: relative;
    /* width & height set dynamically by JS based on grid layout */
}

.pile-photo {
    position: absolute;
    /* width & height set by JS */
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: opacity var(--transition-base);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.pile-photo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%
    );
}

.pile-photo:hover {
    transform: scale(1.1) !important;
    z-index: 10 !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}


.pile-photo-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--color-text-muted);
    text-align: center;
}

.pile-photo-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

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

.photo-count span {
    font-weight: 700;
    color: var(--color-accent);
}

/* Processing Hub */
.processing-hub {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.hub-outer {
    position: relative;
    width: 160px;
    height: 160px;
}

.hub-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    opacity: 0.3;
}

.ring-1 {
    inset: 0;
    animation: pulse-ring 2s ease-out infinite;
}

.ring-2 {
    inset: 20px;
    animation: pulse-ring 2s ease-out infinite 0.5s;
}

.ring-3 {
    inset: 40px;
    animation: pulse-ring 2s ease-out infinite 1s;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.hub-core {
    position: absolute;
    inset: 40px;
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 40px var(--color-primary-glow),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: core-pulse 2s ease-in-out infinite;
}

@keyframes core-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 40px var(--color-primary-glow),
            inset 0 0 20px rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow:
            0 0 60px var(--color-primary-glow),
            inset 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

/* Hub burst — fires when all photos arrive */
.hub-core.hub-burst {
    animation: hub-burst-anim 0.28s ease-out forwards;
}

@keyframes hub-burst-anim {
    0%   { transform: scale(1);   box-shadow: 0 0 40px var(--color-primary-glow); }
    45%  { transform: scale(1.5); box-shadow: 0 0 120px var(--color-primary-glow), 0 0 60px rgba(139,92,246,0.6); }
    100% { transform: scale(1);   box-shadow: 0 0 40px var(--color-primary-glow); }
}

.hub-icon {
    width: 40px;
    height: 40px;
    color: white;
    animation: rotate-slow 10s linear infinite;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.processing-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-accent);
}

.status-dots span {
    animation: dot-pulse 1.4s ease-in-out infinite;
}

.status-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.status-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-pulse {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Destination Folders */
.destination-folders {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.folders-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.folders-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 220px;
}

.folder {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.folder::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.folder:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-light);
}

.folder:hover::before {
    opacity: 1;
}

.folder.grayed {
    opacity: 0.4;
}

.folder.grayed .folder-icon {
    background: var(--color-border);
}

.folder.receiving {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px var(--color-primary-glow);
}

.folder.receiving::before {
    opacity: 1;
}

.folder-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.folder-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.folder-info {
    flex: 1;
    min-width: 0;
}

.folder-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-count {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* Flying Photos */
.flying-photos {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.flying-photo {
    position: absolute;
    /* width & height match PHOTO_W/H set in JS */
    background: var(--color-surface);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 24px var(--color-primary-glow);
    z-index: 50;
    overflow: hidden;
}

.flying-photo .pile-photo-inner {
    width: 100%;
    height: 100%;
}

/* ===========================
   Solutions Section
   =========================== */
.solutions-section {
    padding: 100px 24px;
    background: var(--color-bg-secondary);
}

.solutions-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: -0.02em;
}

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.solution-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all var(--transition-base);
}

.solution-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-border-light);
    box-shadow: var(--shadow-card);
}

.solution-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.solution-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.solution-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.solution-card p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* ===========================
   CTA Section
   =========================== */
.cta-section {
    padding: 120px 24px;
    background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
    text-align: center;
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, var(--color-primary-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.cta-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.cta-subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
    margin-bottom: 40px;
}

.social-proof {
    margin-top: 32px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.social-proof strong {
    color: var(--color-text-secondary);
}

/* ===========================
   Footer
   =========================== */
.footer {
    padding: 40px 24px;
    border-top: 1px solid var(--color-border);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-brand .logo-icon {
    width: 28px;
    height: 28px;
}

.footer-brand .logo-text {
    font-size: 18px;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

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

.footer-divider {
    color: var(--color-border);
}

.footer-copyright {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .simulator {
        grid-template-columns: 1fr;
        gap: 60px;
        padding: 30px;
    }

    .source-cloud,
    .processing-hub,
    .destination-folders {
        width: 100%;
    }

    .photo-pile {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .folders-grid {
        width: 100%;
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        min-height: 60vh;
        padding: 120px 20px 60px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .slide-nav {
        gap: 6px;
    }

    .slide-btn {
        padding: 12px 16px;
        min-width: auto;
    }

    .slide-label {
        display: none;
    }

    .slide-icon {
        font-size: 20px;
    }

    .simulator {
        padding: 20px;
        min-height: auto;
    }

    .photo-pile {
        height: 240px;
    }

    .pile-photo {
        width: 60px;
        height: 45px;
    }

    .hub-outer {
        width: 120px;
        height: 120px;
    }

    .ring-2 {
        inset: 15px;
    }

    .ring-3 {
        inset: 30px;
    }

    .hub-core {
        inset: 30px;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .btn-large {
        padding: 14px 28px;
        font-size: 14px;
    }

    .section-title {
        font-size: 28px;
    }

    .solutions-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   Demo Request Modal
   =========================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modal-fade-in 0.2s ease;
}

.modal-overlay[hidden] {
    display: none;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    position: relative;
    animation: modal-slide-up 0.25s ease;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

@keyframes modal-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    color: var(--color-text-muted);
    line-height: 1;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-text);
    background: var(--color-surface);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 28px;
}

/* Form */
.demo-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.form-group input,
.form-group textarea {
    font-family: var(--font-family);
    font-size: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    resize: vertical;
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.btn-full {
    width: 100%;
}

.form-error {
    font-size: 13px;
    color: #f87171;
    text-align: center;
    margin-top: -8px;
}

/* Success state */
.modal-card--success {
    text-align: center;
    max-width: 380px;
}

.success-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-success), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin: 0 auto 20px;
}

.modal-card--success h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-card--success p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

@media (max-width: 480px) {
    .modal-card {
        padding: 28px 20px;
    }
}
