/* ─── Reset & Base ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-alt: #f9fafb;
    --text: #111827;
    --text-muted: #6b7280;
    --text-soft: #9ca3af;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.08);
    --border: #e5e7eb;
    --border-strong: rgba(15, 23, 42, 0.14);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
    --transition: 160ms ease;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

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

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

/* ─── Navigation ─── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 24px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo-img {
    height: 32px;
    width: auto;
}

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

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
}

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

.apps-trigger {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.apps-trigger:hover,
.apps-trigger[aria-expanded="true"] {
    color: var(--text);
    background: var(--surface-alt);
    border-color: var(--accent);
}

.nav-signin {
    background: var(--accent);
    color: white !important;
    border-radius: var(--radius-sm);
    padding: 8px 20px !important;
}

.nav-signin:hover {
    background: var(--accent-hover) !important;
}

/* ─── Logged In Controls ─── */
.logged-in-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-trigger {
    background: none;
    border: 2px solid var(--border);
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    overflow: hidden;
    transition: var(--transition);
}

.avatar-trigger:hover {
    border-color: var(--accent);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ─── Dropdowns (shared) ─── */
.dropdown {
    position: absolute;
    top: 56px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 200;
}

.dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px 10px;
}

.dropdown-divider {
    border-top: 1px solid var(--border);
    margin: 6px 0;
}

.dropdown-item {
    display: block;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-muted);
    border-radius: 6px;
    transition: var(--transition);
}

.dropdown-item:hover {
    color: var(--text);
    background: var(--surface-alt);
}

.dropdown-signout {
    color: #dc2626;
}

.dropdown-signout:hover {
    background: rgba(220, 38, 38, 0.06);
    color: #dc2626;
}

/* ─── Apps Dropdown ─── */
.apps-dropdown {
    min-width: 240px;
}

/* ─── Profile Dropdown ─── */
.profile-dropdown {
    min-width: 280px;
    right: 24px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 12px;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.profile-email {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-uid {
    font-size: 10px;
    color: var(--text-soft);
    font-family: monospace;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-align: center;
}

.app-card:hover {
    background: var(--surface-alt);
}

.app-icon {
    font-size: 24px;
    line-height: 1;
}

.app-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.app-card:hover .app-name {
    color: var(--text);
}

/* ─── Hero ─── */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

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

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    color: var(--text);
}

.gradient-text {
    color: var(--accent);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

/* ─── Sections ─── */
.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--surface);
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 48px;
}

/* ─── App Showcase Cards ─── */
.apps-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.showcase-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.showcase-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.showcase-icon {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--accent);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
}

.showcase-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.showcase-card p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 14px;
}

.card-link {
    color: var(--accent);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.card-link:hover {
    color: var(--accent-hover);
}

/* ─── Features Grid ─── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.feature {
    padding: 28px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.feature:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    font-size: 18px;
    margin-bottom: 14px;
    color: var(--accent);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
}

.feature h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.feature p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ─── Footer ─── */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-brand p {
    color: var(--text-soft);
    font-size: 13px;
}

.footer-logo {
    height: 24px;
    width: auto;
    opacity: 0.6;
}

.footer-links {
    display: flex;
    gap: 24px;
}

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

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

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero {
        padding: 100px 20px 60px;
        min-height: auto;
    }

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

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