@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    /* Engineering Theme - Professional Blueprint Aesthetic */
    --primary: #1b4d89;
    /* Deeper Technical Blue */
    --primary-hover: #133a6b;
    --secondary: #2d8a63;
    /* Refined Engineering Green */
    --bg-main: #f0f4f8;
    /* Light Slate Gray */
    --bg-surface: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --text-main: #1a202c;
    --text-muted: #4a5568;
    --border: #d1d9e6;
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    --gradient: linear-gradient(135deg, var(--primary), #2c5282);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-blueprint: url('../assets/blueprint-bg-sharp.png');
}

[data-theme="dark"] {
    --bg-main: #1a202c;
    --bg-surface: #2d3748;
    --bg-glass: rgba(26, 32, 44, 0.9);
    --text-main: #f7fafc;
    --text-muted: #a0aec0;
    --border: #4a5568;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    --primary: #4299e1;
    --gradient: linear-gradient(135deg, #4299e1, #3182ce);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    background-image: var(--bg-blueprint);
    background-attachment: fixed;
    background-size: 800px;
    /* Larger size for sharper detail */
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
    position: relative;
}

main {
    padding-top: 140px;
    transition: var(--transition);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    opacity: 0.88;
    /* Balanced for clarity and readability */
    z-index: -1;
    transition: background-color var(--transition);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

h1,
h2,
h3,
h4,
.brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 8rem 0;
}

/* Glassmorphism Utility */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.8rem 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

header .logo img {
    height: 90px;
    image-rendering: -webkit-optimize-contrast;
}

footer .logo img {
    height: 120px;
    margin-bottom: 1.5rem;
    image-rendering: -webkit-optimize-contrast;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    background: linear-gradient(rgba(243, 242, 239, 0.9), rgba(243, 242, 239, 0.8)), url('../assets/hero-bg.png');
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .hero {
    background: linear-gradient(rgba(29, 34, 38, 0.9), rgba(29, 34, 38, 0.8)), url('../assets/hero-bg.png');
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15rem;
    background: linear-gradient(to top, var(--bg-main), transparent);
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.hero-btns .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Grid & Cards */
.section-title {
    margin-bottom: 4rem;
    text-align: center;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: none;
    /* Corporate sites usually don't lift cards and instead use shadow changes */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Tools Section Specific */
.tool-card .badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    margin-bottom: 1rem;
}

.tool-features {
    margin: 1.5rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tool-features li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-features li::before {
    content: '✓';
    color: var(--secondary);
    font-weight: bold;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Dynamic Persona Frame */
.dynamic-frame {
    position: relative;
    padding: 15px;
    display: inline-block;
    animation: float-profile 6s ease-in-out infinite;
    max-width: 400px;
    background: var(--bg-glass);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.dynamic-frame::before,
.dynamic-frame::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 4px solid var(--primary);
    z-index: 2;
    transition: var(--transition);
}

.dynamic-frame::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 12px 0 0 0;
}

.dynamic-frame::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 12px 0;
}

.dynamic-frame:hover::before,
.dynamic-frame:hover::after {
    width: calc(100% - 10px);
    height: calc(100% - 10px);
}

@keyframes float-profile {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.tag {
    background: var(--bg-surface);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

/* Contact Form */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

input,
textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Video Section */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.video-card {
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-btn {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Footer */
footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    section {
        padding: 5rem 0;
    }

    .hero h1 {
        font-size: 3rem;
    }
}