:root {
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Removed default margin to prevent scrollbar issues */
    margin: 0;
}

/* Background Animated Orbs */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #38bdf8;
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #818cf8;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: #c084fc;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Glassmorphism utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Header */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    z-index: 100;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent);
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.btn-classic {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-classic:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 600;
    transition: color 0.3s, text-shadow 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 140px 5% 50px;
}

.hero {
    text-align: center;
    margin-bottom: 5rem;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: min(5vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-title span {
    color: #38bdf8;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

/* Anti-gravity Card */
.ag-card-wrapper {
    perspective: 1000px;
    height: 480px;
    /* Antigravity hover effect */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ag-card-wrapper:hover {
    transform: translateY(-15px) scale(1.02);
}

.ag-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.ag-card-wrapper:hover .ag-card-inner {
    transform: rotateY(180deg);
}

.ag-card-front,
.ag-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ag-card-front {
    /* Front is visible initially */
}

.card-image-wrapper {
    height: 45%;
    overflow: hidden;
    position: relative;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.ag-card-wrapper:hover .card-image-wrapper img {
    transform: scale(1.1);
}

.card-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(15, 23, 42, 1), transparent);
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h2 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    line-height: 1.2;
}

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

.card-meta {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ag-card-back {
    transform: rotateY(180deg);
    padding: 2.5rem;
    background: rgba(15, 23, 42, 0.95);
    /* Darker for better text readability */
    justify-content: center;
}

.ag-card-back h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.ag-card-back ul {
    list-style: none;
}

.ag-card-back li {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 1.5rem;
    line-height: 1.4;
}

.ag-card-back li::before {
    content: '→';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
}

.ag-card-back strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 0.25rem;
}

/* Footer */
.glass-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.5);
}

.glass-footer p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.glass-footer a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s;
}

.glass-footer a:hover {
    color: var(--accent);
}

/* Animation Delays for cards */
.project-grid>div:nth-child(1) {
    animation-delay: 0.1s;
}

.project-grid>div:nth-child(2) {
    animation-delay: 0.2s;
}

.project-grid>div:nth-child(3) {
    animation-delay: 0.3s;
}

.project-grid>div:nth-child(4) {
    animation-delay: 0.4s;
}

.project-grid>div:nth-child(5) {
    animation-delay: 0.5s;
}

.project-grid>div:nth-child(6) {
    animation-delay: 0.6s;
}

.project-grid>div:nth-child(7) {
    animation-delay: 0.7s;
}

.project-grid>div:nth-child(8) {
    animation-delay: 0.8s;
}

.project-grid>div:nth-child(9) {
    animation-delay: 0.9s;
}

.project-grid>div:nth-child(10) {
    animation-delay: 1.0s;
}

.project-grid>div {
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Smooth Scrollbar for that extra premium feel */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
    }

    nav a {
        margin-left: 1rem;
        margin-right: 1rem;
    }
}