:root {
    --bg-color: #09090b;
    --surface: rgba(24, 24, 27, 0.75);
    --surface-hover: rgba(39, 39, 42, 0.85);
    --border: rgba(255, 255, 255, 0.15);
    --text: #f4f4f5;
    --text2: #a1a1aa;
    --primary: #f59e0b;
    --primary-hover: #d97706;
    --accent: #10b981;
    --warning: #fbbf24;
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Scale down overall site view by 20% to mimic 80% zoom on desktop */
html {
    font-size: 80%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ── Starfield canvas ── */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
}

.hero-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(circle, rgba(245,158,11,0.1) 0%, rgba(9,9,11,0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: spotlightMove 10s ease-in-out infinite alternate;
}

.global-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.05) 0%, rgba(139, 92, 246, 0.04) 40%, rgba(9, 9, 11, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

@keyframes spotlightMove {
    0% { transform: translate(-50%, 0) scale(1); opacity: 0.8; }
    50% { transform: translate(-45%, 5%) scale(1.05); opacity: 1; }
    100% { transform: translate(-55%, -5%) scale(0.95); opacity: 0.8; }
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text2); }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.p-5 { padding: 3rem; }
.w-100 { width: 100%; }

/* Navbar */
.navbar {
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-menu {
    display: flex;
    align-items: center;
}
.nav-links a {
    font-weight: 500;
    transition: color 0.3s;
    margin: 0 15px;
    color: var(--text2);
}
.nav-links a:hover { 
    color: var(--text); 
}
.nav-actions { display: flex; gap: 10px; margin-left: 20px; }
.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(9, 9, 11, 0.95);
        backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
    }
    .nav-links a {
        margin: 0;
        font-size: 1.1rem;
    }
    .nav-actions {
        margin-left: 0;
        margin-top: 20px;
        width: 100%;
        justify-content: center;
    }
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: #000;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.btn-outline:hover {
    background: var(--surface-hover);
    border-color: var(--text2);
}
.btn-lg { padding: 15px 30px; font-size: 1.1rem; }

/* Hero */
.hero {
    padding: 80px 0 30px;
    text-align: center;
    position: relative;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245,158,11,0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(245,158,11,0.3);
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 4px 15px rgba(245,158,11,0.1);
}
.hero-badge .badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.hero-title {
    font-size: 3.8rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}
.gradient-text {
    background: linear-gradient(135deg, #f59e0b, #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text2);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* Feature Cards (Apps) */
.section-label {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 40px;
    line-height: 1.2;
}

/* App Detail */
.app-detail-container {
    padding-top: 60px;
    padding-bottom: 60px;
}
.home-app-card {
    padding-top: 0;
    padding-bottom: 0;
}
.app-header {
    background: var(--surface);
    backdrop-filter: blur(80px) saturate(200%);
    -webkit-backdrop-filter: blur(80px) saturate(200%);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.app-detail-icon {
    width: 200px;
    height: 200px;
    border-radius: 40px;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 80px rgba(245, 158, 11, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2px; /* slight padding to show glass border */
}
.app-header-info { flex: 1; min-width: 300px; }
.app-header-info h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 10px; }
.app-desc { font-size: 1.1rem; color: var(--text2); line-height: 1.7; }

.app-screenshots {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
}
.screenshot-gallery {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}
.screenshot-img {
    height: 400px;
    border-radius: 16px;
    border: 1px solid var(--border);
}
.screenshot-gallery::-webkit-scrollbar { height: 8px; }
.screenshot-gallery::-webkit-scrollbar-track { background: var(--bg-color); border-radius: 10px; }
.screenshot-gallery::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.app-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

/* Legal Pages */
.legal-container {
    background: var(--surface);
    backdrop-filter: blur(80px) saturate(200%);
    -webkit-backdrop-filter: blur(80px) saturate(200%);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 50px;
    margin: 40px 0;
}
.legal-container h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 30px; }
.legal-content {
    color: var(--text2);
    line-height: 1.8;
    font-size: 1.1rem;
    word-break: break-word;
    overflow-wrap: break-word;
}
.legal-content p { margin-bottom: 15px; }
.legal-content h1, .legal-content h2, .legal-content h3, .legal-content h4, .legal-content h5 { color: var(--text); margin-top: 25px; margin-bottom: 15px; font-weight: 700; }
.legal-content ul, .legal-content ol { margin-left: 25px; margin-bottom: 20px; }
.legal-content a { color: var(--primary); text-decoration: underline; }
.legal-content a:hover { color: var(--primary-hover); }

/* Responsive adjustments */
@media (max-width: 768px) {
    .container.legal-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 20px 0 !important;
        border-radius: 0;
        border-left: none;
        border-right: none;
        max-width: 100% !important;
    }
    .legal-container h2, .legal-content {
        padding-left: 20px;
        padding-right: 20px;
    }
    .legal-container h2 { font-size: 1.8rem; margin-top: 20px; }
    .legal-content img, .legal-content iframe { max-width: 100% !important; height: auto; }
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 60px 0 30px;
    margin-top: 60px;
    background: var(--bg-color);
}
.footer-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-mini-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.footer-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    align-items: center;
}
.footer-links a {
    color: var(--text2);
    font-size: 0.95rem;
    transition: color 0.3s;
    text-decoration: none;
    font-weight: 500;
}
.footer-links a:hover {
    color: var(--primary);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--accent);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.show {
    transform: translateX(0);
    animation: toastPulse 2s infinite;
}

@keyframes toastPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Animations */
.fade-in { animation: fadeIn 0.8s ease forwards; opacity: 0; transform: scale(0.98); }
.delay-1 { animation-delay: 0.2s; }
@keyframes fadeIn { to { opacity: 1; transform: scale(1); } }

/* Skeleton Loader */
.skeleton-wrapper {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}
.skeleton-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    z-index: 1;
}
.skeleton-wrapper.skeleton-loaded::after {
    display: none;
}
@keyframes skeleton-loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-live { background: rgba(16, 185, 129, 0.2); color: var(--accent); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-draft { background: rgba(245, 158, 11, 0.2); color: var(--primary); border: 1px solid rgba(245, 158, 11, 0.3); }

/* Forms & Admin */
.form-control {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text2); }
.form-group { margin-bottom: 24px; }

/* Sortable logic */
.sortable-ghost { opacity: 0.4; }
.drag-handle { cursor: grab; color: var(--text2); padding: 10px; }
.drag-handle:active { cursor: grabbing; }

.app-long-desc-section {
    background: var(--surface);
    backdrop-filter: blur(80px) saturate(200%);
    -webkit-backdrop-filter: blur(80px) saturate(200%);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border);
}

/* Expandable App Description */
.expandable-text-content {
    font-size: 1.05rem;
}
.expandable-text-container {
    position: relative;
    max-height: 250px; /* Collapsed height */
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}
.expandable-text-container.expanded {
    max-height: 5000px; /* Large enough to hold content */
}
.expandable-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, rgba(24,24,27,0), rgba(24,24,27,1));
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.expandable-text-container.expanded .expandable-gradient {
    opacity: 0;
}

.app-links { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 20px; display: flex; gap: 15px; }
.app-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

@media(max-width: 1024px) {
    .container { padding: 0 40px; }
}

@media(max-width: 768px) {
    html { font-size: 100%; } /* Reset scale on mobile */
    .container { padding: 0 24px; }
    .hero-title { font-size: 2.2rem; word-wrap: break-word; padding: 0 10px; }
    .hero-subtitle { font-size: 1rem; }
    .hero-glow { width: 100vw; height: 400px; }
    
    .expandable-text-content { font-size: 0.95rem; line-height: 1.6; }
    
    .app-header { flex-direction: column; text-align: center !important; }
    .app-header h2 { font-size: 1.8rem; }
    .app-detail-icon { margin: 0 auto; width: 120px; height: 120px; }
    .app-detail-container { padding-top: 20px; padding-bottom: 20px; margin: 20px 0; box-sizing: border-box; width: 100%; max-width: 100%; overflow: hidden; }
    .home-app-card { padding-top: 0; padding-bottom: 0; margin: 0; }
    .app-header-info { padding: 0; min-width: 0; width: 100%; box-sizing: border-box; }
    .stars { justify-content: center; }
    .app-links { flex-direction: column; }
    .app-links a { width: 100%; justify-content: center; text-align: center; }
    .app-actions { flex-direction: column; width: 100%; }
    .app-actions a { width: 100%; justify-content: center; text-align: center; box-sizing: border-box; }
    
    .footer-mini { flex-direction: column; text-align: center; gap: 15px; }
    .footer-mini-left { align-items: center; }
    .footer-links { justify-content: center; gap: 15px; }
}
