@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100;300;400;600;700;900&display=swap');

:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --midnight: #0F172A;
    --slate: #1E293B;
    --text-main: #334155;
    --text-muted: #64748B;
    --bg-light: #F8FAFC;
    --white: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.03);
    --shadow-premium: 0 20px 50px rgba(15, 23, 42, 0.1);
}

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

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--white);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    /* Important: Use % to match html height */
}

main {
    flex: 1 0 auto;
    /* This pushes the footer down */
}

footer {
    flex-shrink: 0;
    /* Ensures footer doesn't squash */
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 900;
    line-height: 1.1;
    color: var(--midnight);
    letter-spacing: -0.03em;
}

p {
    font-weight: 300;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.sub-title {
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 12px;
}

/* Navigation */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 35px 0;
    z-index: 1000;
    transition: var(--transition);
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(25px);
    padding: 18px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    text-decoration: none;
    color: var(--midnight);
    letter-spacing: -0.01em;
}

.logo span {
    color: var(--primary);
    font-weight: 300;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 45px;
}

.nav-links a {
    text-decoration: none;
    color: var(--midnight);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    opacity: 0.7;
}

/* Universal White Navbar on Dark Hero Headers */
#navbar:not(.scrolled) .logo {
    color: var(--white);
}

#navbar:not(.scrolled) .nav-links a {
    color: var(--white);
    opacity: 0.8;
}

#navbar:not(.scrolled) .nav-links a.active {
    color: var(--primary);
    opacity: 1;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: var(--primary);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: url('hero-bg.jpg') no-repeat center center/cover;
    color: var(--white);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.3) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero h1 {
    font-size: clamp(3.5rem, 9vw, 6.5rem);
    color: var(--white);
    margin-bottom: 25px;
    line-height: 0.95;
}

.hero h1 span {
    font-weight: 100;
    display: block;
    color: rgba(255, 255, 255, 0.8);
}

.hero p {
    font-size: 1.3rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    max-width: 650px;
    margin-bottom: 45px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 40px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--midnight);
    border-color: var(--white);
    transform: translateY(-5px);
}

.hero-btns {
    display: flex;
    gap: 20px;
}

/* Sections - Optimized Padding */
section {
    padding: 120px 0;
    /* Reduced as requested */
}

.section-header {
    margin-bottom: 80px;
}

.section-header h2 {
    font-size: 4rem;
    margin-top: 15px;
}

/* Teaser Grid */
.teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 50px;
}

.teaser-card {
    padding: 60px;
    background: var(--bg-light);
    border-radius: 30px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.teaser-card:hover {
    background: var(--white);
    box-shadow: var(--shadow-premium);
    transform: translateY(-15px);
    border-color: rgba(59, 130, 246, 0.1);
}

.teaser-card .icon {
    font-size: 4rem;
    margin-bottom: 35px;
    display: block;
}

.teaser-card h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

/* Projects Showcase */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.project-card {
    position: relative;
    height: 600px;
    border-radius: 40px;
    overflow: hidden;
    background: var(--midnight);
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 60px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
    color: var(--white);
    transform: translateY(30px);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    transform: translateY(0);
    opacity: 1;
}

.project-overlay h4 {
    color: var(--white) !important;
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 900;
}

.project-overlay p {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 25px;
}

/* Footer Styling - Definitive Fix */
footer {
    background: var(--midnight);
    color: var(--white);
    padding: 120px 0 0;
    border-radius: 80px 80px 0 0;
    position: relative;
    overflow: hidden;
    margin-top: 0;
    /* No margin above, fixed by main:flex:1 */
}

/* Ensure a big elegant gap above footer on long scrolls */
main>*:last-child {
    margin-bottom: 120px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 60px;
    padding-bottom: 80px;
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 25px;
    display: inline-block;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.5);
    max-width: 300px;
    font-size: 1rem;
    line-height: 1.6;
}

.footer-nav h4,
.footer-contact h4 {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-contact p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.footer-social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile */
@media (max-width: 768px) {
    .section-header h2 {
        font-size: 2.8rem;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .container {
        width: 92%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}