:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #38bdf8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(56, 189, 248, 0.15) 0%, transparent 40%),
        #0f172a;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2v-4h4v-2h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2v-4h4v-2H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
}

#templatemo_wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
header {
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

nav a:hover,
nav a.current {
    color: var(--text-main);
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 2rem;
    padding: 3rem 2rem;
    background:
        linear-gradient(to bottom, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.8)),
        url('images/hero_bg.png') center/cover no-repeat;
    backdrop-filter: blur(4px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    z-index: -1;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.email-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.email-link:hover {
    color: var(--text-main);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    cursor: pointer;
}

.card-link {
    position: absolute;
    inset: 0;
    z-index: 10;
}

.project-card:nth-child(1) {
    animation-delay: 0.1s;
}

.project-card:nth-child(2) {
    animation-delay: 0.2s;
}

.project-card:nth-child(3) {
    animation-delay: 0.3s;
}

.project-card:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: rgba(30, 41, 59, 0.9);
}

.project-card:active {
    transform: translateY(-4px) scale(0.98);
    transition: all 0.1s;
}

.image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .image-container img {
    transform: scale(1.05);
}

.project-content {
    padding: 1rem;
    flex-grow: 1;
}

.project-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.engine-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.view-link {
    display: block;
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-link::after {
    content: '→';
    transition: var(--transition);
}

.view-link:hover::after {
    transform: translateX(4px);
}

/* Footer */
footer {
    padding: 3rem 0;
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 2;
    margin-top: 2rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent-color), transparent);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

footer div {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
    opacity: 0.8;
}

footer a:hover {
    color: var(--text-main);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2.2rem;
    }

    header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}