:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #0f1626;
    --accent: #2196f3;
    --accent-hover: #1976d2;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --card-hover-bg: rgba(255, 255, 255, 0.08);
}

body.light-mode {
    --bg-primary: #f8fafc;
    --bg-secondary: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.9);
    --card-hover-bg: rgba(255, 255, 255, 1);
}

body.light-mode .header h1 {
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .watermark {
    opacity: 0.1; /* slightly more visible in light mode */
    filter: drop-shadow(0 0 50px rgba(0,0,0,0.1));
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-main);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    background: var(--card-hover-bg);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: radial-gradient(circle at top right, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.03;
    width: 70%;
    max-width: 900px;
    z-index: -1;
    pointer-events: none;
    filter: drop-shadow(0 0 50px rgba(0,0,0,0.5));
}

.portal-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInDown 0.8s ease-out;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.header p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    perspective: 1000px;
}

.app-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: zoomIn 0.6s ease-out backwards;
}

/* Stagger animations */
.app-card:nth-child(1) { animation-delay: 0.1s; border-top: 2px solid rgba(59, 130, 246, 0.3); }
.app-card:nth-child(2) { animation-delay: 0.2s; border-top: 2px solid rgba(16, 185, 129, 0.3); }
.app-card:nth-child(3) { animation-delay: 0.3s; border-top: 2px solid rgba(139, 92, 246, 0.3); }
.app-card:nth-child(4) { animation-delay: 0.4s; border-top: 2px solid rgba(245, 158, 11, 0.3); }
.app-card:nth-child(5) { animation-delay: 0.5s; border-top: 2px solid rgba(236, 72, 153, 0.3); }

.app-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: var(--card-hover-bg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.app-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.15) rotate(5deg);
}

.app-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.app-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.footer {
    padding: 2rem;
    width: 100%;
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.weather-widget {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-muted);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.weather-widget:hover {
    background: var(--card-hover-bg);
    color: var(--text-main);
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.weather-widget .icon {
    font-size: 1.5rem;
    font-style: normal;
}

.weather-info {
    display: flex;
    flex-direction: column;
}

.weather-info #temp {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}

.weather-info #city {
    font-size: 0.8rem;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .header h1 { font-size: 2.5rem; }
    .portal-container { padding: 2rem 1rem; }
}
