/* --- System Variables --- */
:root {
    --bg-primary: #08080a;
    --bg-secondary: #0d0d10;
    --bg-tertiary: #141418;
    --accent-primary: #3a86ff;
    --text-main: #e1e1e6;
    --text-muted: #9494a5;
    --border: rgba(255, 255, 255, 0.08);
    --font-mono: 'JetBrains Mono', monospace;
}

/* --- Base Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    background-color: var(--bg-primary); 
    color: var(--text-main); 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden; 
    line-height: 1.6; 
}

/* --- Layout Utilities --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.section { padding: 4rem 0; }

/* --- Fixed Header --- */
header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: 70px;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    background: rgba(8, 8, 10, 0.8);
    backdrop-filter: blur(10px);
}

.header-scrolled {
    background: rgba(8, 8, 10, 0.95);
    border-bottom: 1px solid var(--border);
}

.logo-container { display: flex; flex-direction: column; text-align: left; }
.logo { font-weight: 700; font-size: 1.1rem; line-height: 1; text-decoration: none; color: white; }
.brand { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; margin-top: 3px; }

.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.85rem; transition: 0.3s; }
.nav-links a:hover { color: var(--accent-primary); }

/* --- COMPACT HERO SECTION --- */
.hero { 
    min-height: 60vh;
    display: flex; 
    align-items: center; 
    padding-top: 100px; 
    padding-bottom: 40px;
}
.hero-content { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 3rem; align-items: center; width: 100%; }
.hero h1 { font-size: 2.8rem; line-height: 1.1; margin-bottom: 1rem; }
.accent { color: var(--accent-primary); }
.hero p { max-width: 500px; font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; }

/* Profile Circle */
.profile-frame { position: relative; width: 220px; height: 220px; display: flex; justify-content: center; align-items: center; }
.profile-img-container { width: 180px; height: 180px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); z-index: 2; background: var(--bg-primary); }
.profile-img { width: 100%; height: 100%; object-fit: cover; }
.profile-glow { position: absolute; width: 200px; height: 200px; border-radius: 50%; background: linear-gradient(45deg, var(--accent-primary), transparent, var(--accent-primary)); animation: rotateGlow 5s linear infinite; filter: blur(10px); opacity: 0.3; }
@keyframes rotateGlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* --- HOMEPAGE PROJECT GRID --- */
.projects-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 2rem; 
    width: 100%;
}

.project-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    position: relative;
    transition: 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.project-card .project-image { 
    width: 100%; 
    height: 180px; 
    overflow: hidden; 
    border-bottom: 1px solid var(--border); 
}

/* Updated to support Video and Image tags */
.project-card .project-image img,
.project-card .project-image video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    filter: grayscale(100%) brightness(0.6); 
    transition: 0.6s cubic-bezier(0.33, 1, 0.68, 1); 
}

/* Hover effects for Video and Image */
.project-card:hover .project-image img,
.project-card:hover .project-image video { 
    filter: grayscale(0%) brightness(1); 
    transform: scale(1.05); 
}

/* Spotlight Effect */
.project-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), rgba(58, 134, 255, 0.1), transparent 40%);
    border-radius: inherit; z-index: 0; pointer-events: none;
}

.project-card:hover { transform: translateY(-5px); border-color: var(--accent-primary); }

.project-header { padding: 1.2rem; border-bottom: 1px solid var(--border); position: relative; z-index: 1; }
.project-header h3 { font-size: 1.1rem; }
.project-body { 
    padding: 1.2rem; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    position: relative; 
    z-index: 1; 
}

.project-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tag { font-family: var(--font-mono); font-size: 0.65rem; color: var(--accent-primary); background: #1a1a20; padding: 2px 8px; border-radius: 4px; margin-right: 4px; }

/* --- DEEP DIVE / PROJECT PAGE STYLES --- */
.deep-dive-page { padding-top: 100px; }
.project-hero h1 { font-size: 3rem; margin-bottom: 0.5rem; }
.project-meta-large { margin-bottom: 2rem; display: flex; gap: 8px; }

.hero-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
    height: 300px;
}
.hero-item { border-radius: 8px; overflow: hidden; border: 1px solid var(--border); transition: 0.4s; }
.hero-item img { width: 100%; height: 100%; object-fit: cover; }

/* Video Handling */
.video-container { 
    position: relative; 
    width: 100%; 
    max-width: 850px; 
    margin: 0 auto 3rem auto; 
    padding-bottom: 48%; 
    height: 0; 
    border-radius: 12px; 
    overflow: hidden; 
    background: var(--bg-tertiary); 
    border: 1px solid var(--border); 
}

.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.video-caption { text-align: center; max-width: 850px; margin: -2rem auto 3rem auto; font-size: 0.85rem; color: var(--text-muted); }

.project-gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0; }
.gallery-item { background: var(--bg-tertiary); border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.gallery-item img { width: 100%; height: auto; max-height: 300px; object-fit: cover; }
.gallery-item .caption { padding: 0.8rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

.content-grid { display: grid; grid-template-columns: 2fr 1.1fr; gap: 3rem; margin-bottom: 4rem; }
.main-content h2 { margin-top: 2rem; color: var(--text-main); font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 1rem; }
.main-content p { font-size: 0.95rem; margin-bottom: 1.2rem; color: var(--text-muted); }

.sticky-box { position: sticky; top: 100px; background: var(--bg-secondary); padding: 1.5rem; border-radius: 10px; border: 1px solid var(--border); }
.spec-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.spec-list li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 0.85rem; }
.spec-list li strong { color: var(--accent-primary); font-family: var(--font-mono); }

/* --- COMMON UI --- */
.btn { font-family: var(--font-mono); text-decoration: none; display: inline-block; padding: 0.7rem 1.4rem; border-radius: 5px; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; transition: 0.3s; text-align: center; border: none; cursor: pointer; }
.btn-primary { background: var(--accent-primary); color: white; box-shadow: 0 4px 10px rgba(58, 134, 255, 0.2); }
.btn-secondary { border: 1px solid var(--border); color: var(--text-main); background: transparent; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.7rem; background-color: #ffffff; color: #000000; border: 1px solid #ffffff; width: fit-content; margin-top: 0.5rem; }
.btn-sm:hover { background-color: var(--accent-primary); border-color: var(--accent-primary); color: #000000; }

/* Animations */
.reveal-on-scroll { opacity: 0; transform: translateY(20px); transition: all 0.6s ease-out; }
.is-visible { opacity: 1; transform: translateY(0); }

/* Mobile */
@media (max-width: 1024px) {
    .hero { min-height: auto; }
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-visual { order: -1; display: flex; justify-content: center; }
    .hero p { margin: 0 auto 1.5rem; }
    .btn-group { justify-content: center; }
    .content-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .hero-image-grid { grid-template-columns: 1fr; height: auto; }
    .video-container { max-width: 100%; padding-bottom: 56.25%; }
}