/* --- GLOBAL SETTINGS --- */
:root {
    --bg: #ffffff;
    --text: #333;
    --card-bg: #ffffff;
    --desc-color: #666;
    --glass: rgba(255, 255, 255, 0.6);
    --shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    --primary: #4facfe;
    --gradient: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --text: #f1f5f9;
    --card-bg: #1e293b;
    --desc-color: #cbd5e1;
    --glass: rgba(15, 23, 42, 0.6);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ෆෝන් එකෙන් ඔබද්දි වැටෙන නිල්/අළු කොටුව අයින් කරනවා */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* PC එකෙන් ඔබද්දි වැටෙන Outline එක අයින් කරනවා */
a:focus, button:focus, input:focus { outline: none; }

body { 
    font-family: 'Poppins', sans-serif; 
    background: var(--bg); color: var(--text); 
    transition: background 0.3s, color 0.3s; 
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* --- NAVBAR --- */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; position: sticky; top: 0; z-index: 1000;
    background: var(--glass); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
    border-bottom: 1px solid rgba(128, 128, 128, 0.2); 
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05); 
}
.logo { font-weight: 800; font-size: 1.5rem; }
.logo span { color: #4facfe; }
.nav-links a { margin: 0 15px; font-weight: 500; transition: 0.3s; }
.nav-links a:hover, .nav-links a.active { color: #4facfe; }
#themeToggle { background: none; border: none; font-size: 1.2rem; color: var(--text); cursor: pointer; }

/* --- HERO SECTION (About Section) --- */
.hero {
    display: flex; align-items: center; justify-content: space-between;
    padding: 50px 10%; min-height: 90vh;
    background: radial-gradient(circle at top right, rgba(79, 172, 254, 0.1), transparent 40%);
    text-align: left;
}

.hero-content { flex: 0.8; animation: slideUp 0.8s ease; z-index: 2; }

.tag { 
    background: rgba(79, 172, 254, 0.1); color: #4facfe; 
    padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; 
    display: inline-block; margin-bottom: 15px;
}

.hero h1 { font-size: 3.5rem; margin: 10px 0 20px; line-height: 1.1; font-weight: 800; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.hero p { color: var(--desc-color); line-height: 1.6; max-width: 500px; }

.hero-btns { display: flex; gap: 15px; margin-top: 25px; }

.btn { 
    padding: 12px 30px; border-radius: 50px; font-weight: 600; 
    transition: 0.3s; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
}
.btn-primary { background: var(--gradient); color: white; box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3); border: none; }
.btn-primary:hover { transform: translateY(-5px); box-shadow: 0 15px 25px rgba(79, 172, 254, 0.4); }

.btn-outline { border: 2px solid #ddd; color: var(--text); background: transparent; }
.btn-outline:hover { border-color: #4facfe; color: #4facfe; }

/* Hero Image (Cinematic Reveal + Float) */
.hero-img { 
    flex: 1.2; display: flex; justify-content: flex-end; position: relative;
}
.hero-img img { 
    width: 900px; 
    max-width: 100%;
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    
    /* මුලින්ම හංගනවා, ඊට පස්සේ Reveal වෙලා පාවෙන්න ගන්නවා */
    opacity: 0;
    animation: cinematicReveal 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, float 6s ease-in-out 1.5s infinite;
}

/* --- CARDS & GRID (The 4 Pages Boxes) --- */
.container { padding: 80px 10%; }
.section-title { text-align: center; margin-bottom: 50px; font-size: 2.2rem; font-weight: 700; }

.resource-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px;
}

.portfolio-box {
    background: var(--card-bg); 
    border-radius: 20px; 
    padding: 40px 30px;
    box-shadow: var(--shadow); 
    transition: 0.4s; 
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.portfolio-box:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 15px 30px rgba(79, 172, 254, 0.2); 
    border-color: rgba(79, 172, 254, 0.5);
}

.box-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s;
}

.portfolio-box:hover .box-icon {
    transform: scale(1.1);
}

.portfolio-box h3 { 
    font-size: 1.3rem; 
    margin-bottom: 15px; 
    color: var(--text); 
    font-weight: 700; 
}

.portfolio-box p { 
    font-size: 0.95rem; 
    color: var(--desc-color); 
    line-height: 1.6; 
}

/* --- MOBILE RESPONSIVE FIX (Stacking Center) --- */
@media (max-width: 900px) {
    .navbar { padding: 15px 20px; }
    .nav-links { display: none; }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 5% 40px;
        justify-content: center;
        gap: 30px;
    }

    .hero-content { width: 100%; order: 2; }
    .hero-img { width: 100%; order: 1; display: flex; justify-content: center; margin-bottom: 20px; }

    .hero-img img { width: 90%; max-width: 400px; height: auto; object-fit: contain; }

    .hero h1 { 
        font-size: 2.2rem; 
        margin-bottom: 15px; 
        line-height: 1.3; 
        padding: 0 10px;  
    }
    
    .hero p { 
        font-size: 0.95rem; 
        margin-bottom: 20px; 
        margin-left: auto; 
        margin-right: auto; 
        line-height: 1.6; 
        padding: 0 15px; 
    }
    
    .hero-btns { 
        justify-content: center; 
        flex-direction: column; 
        width: 100%; gap: 10px;
    }
    .btn { width: 100%; justify-content: center; }
}

/* ==========================================
   ANIMATIONS
========================================== */
@keyframes slideUp { 
    from { opacity: 0; transform: translateY(30px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes siteFadeIn {
    0% { opacity: 0; visibility: hidden; }
    100% { opacity: 1; visibility: visible; }
}

@keyframes cinematicReveal {
    0% {
        opacity: 0;
        transform: scale(1.1) translateY(30px);
        filter: blur(20px) drop-shadow(0 0 0 transparent);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0px) drop-shadow(0 20px 30px rgba(0, 0, 0, 0.15));
    }
}

@keyframes float { 
    0%, 100% { transform: translateY(0); filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.15)); } 
    50% { transform: translateY(-20px); filter: drop-shadow(0 30px 40px rgba(79, 172, 254, 0.25)); } 
}