/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --bg: #050505;
    --bg-light: #464646;
    --text-main: #f4f4f5;
    --text-dim: #9c9898;
    --accent-primary: #ff4d00;
    --accent-secondary: #fbbf24;
    --accent-tertiary: #3b82f6;
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
    line-height: 1.4;
}

/* Navbar scrolling offset */
.section-header[id], .footer-left[id] { scroll-margin-top: 5rem; }

/* Shared Typography Utilities */
.font-mono, .meta-tag, .project-meta-tag, .nav-links a, .stat-item span, 
.section-header, .project-info, .skill-list li, 
.footer-info, .footer-links, .media-caption, .resume-role, .resume-date {
    font-family: var(--font-mono);
}

h1 {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}

a { text-decoration: none; color: inherit; }

/* =========================================
   2. VISUAL EFFECTS (BACKGROUND)
   ========================================= */
.overlay-grid {
    position: fixed; inset: 0;
    background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.03) 1px, transparent 0);
    background-size: 40px 40px;
    pointer-events: none; z-index: 10;
}

.background-blur {
    position: fixed; inset: 0;
    z-index: -1; overflow: hidden;
    filter: blur(80px); opacity: 0.4;
}

.gradient-blob {
    position: absolute; border-radius: 50%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    animation-name: float;
    animation-duration: 25s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-timing-function: var(--ease-smooth);
}

.gradient-blob:nth-child(2) {
    background: radial-gradient(circle, var(--accent-tertiary) 0%, transparent 70%);
    right: -10%; top: 20%;
    width: 50vw; height: 50vw;
    animation-duration: 35s;
}

@keyframes float {
    from { transform: translate(-10%, -10%) scale(1); }
    to { transform: translate(10%, 15%) scale(1.1); }
}

/* =========================================
   3. NAVIGATION
   ========================================= */
nav {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 2rem 4rem;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-family: var(--font-mono); font-weight: 500;
    letter-spacing: -1px; font-size: 0.9rem;
    display: flex; align-items: center; gap: 15px;
}

.logo-icon {
    width: 50px; height: 50px; object-fit: contain;
    display: block; flex-shrink: 0;
    margin: -20px 0;
}

.nav-links { display: flex; gap: 3rem; }
.nav-links a {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px;
    color: var(--text-dim); transition: color 0.4s var(--ease-smooth);
}
.nav-links a:hover { color: var(--accent-secondary); }

/* =========================================
   4. HERO SECTIONS
   ========================================= */
/* Main Home Hero */
.hero {
    height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 0 10%; position: relative;
}

.section-intro {
    font-family: var(--font-mono); color: var(--accent-primary);
    font-size: 0.9rem; margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 1rem; overflow: hidden;
}
.section-intro::before { content: ''; width: 40px; height: 1px; background: var(--accent-primary); }

.hero-footer {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 2rem;
}
.hero-description { max-width: 500px; color: var(--text-dim); font-size: 1.1rem; margin-right: 2rem; }

.info-stats { display: flex; justify-content: flex-end; gap: 4rem; }
.stat-item span { display: block; }
.stat-value { font-size: 1.5rem; color: var(--text-main); }
.stat-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; margin-top: 0.5rem; }

/* Project & Resume Hero (Shared Base) */
.project-hero {
    height: 100vh; padding: 0 10%;
    display: flex; flex-direction: column; justify-content: center;
    position: relative;
}

/* Resume Hero Variant */
.project-hero.resume-mode {
    min-height: 50vh; height: auto; padding-top: 8rem;
}

.project-hero .section-header {
    padding: 0 0 2rem 0; margin-bottom: 2rem; width: 100%;
}
.project-h1 {
    font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 800; line-height: 1.1;
    margin-bottom: 3rem;
}
/* Reduce gap specifically for Resume */
.resume-mode .project-h1 { margin-bottom: 1rem; }

/* Scroll Indicator */
.scroll-indicator {
    position: absolute; bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    z-index: 10; opacity: 0.7; transition: opacity 0.3s var(--ease-smooth);
}
.scroll-indicator.hidden { opacity: 0; pointer-events: none; }
.scroll-indicator span {
    font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em; color: var(--text-dim);
}
.scroll-line {
    width: 1px; height: 60px; background: rgba(255, 255, 255, 0.1);
    position: relative; overflow: hidden;
}
.scroll-line::after {
    content: ''; position: absolute; inset: 0;
    background: var(--accent-primary);
    animation: scroll-drop 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}
@keyframes scroll-drop {
    0% { transform: translateY(-101%); }
    50%, 51% { transform: translateY(0); }
    100% { transform: translateY(101%); }
}

/* =========================================
   5. SECTIONS & GRIDS
   ========================================= */
.section-header {
    padding: 4rem 10% 2rem;
    color: var(--text-dim); font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tighten section-header spacing on resume page */
.resume-page .section-header { padding-top: 2.5rem; }

.grid-section, .visual-log {
    display: grid; grid-template-columns: repeat(12, 1fr);
    padding: 4rem 10%; gap: 2rem;
}

/* Consolidated Meta Tag Styles */
.meta-tag, .project-meta-tag {
    font-size: 0.7rem;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
}

.meta-tag.mb-large { margin-bottom: 1.5rem; }

/* =========================================
   6. CARDS & INTERACTIVE ELEMENTS
   ========================================= */
.card, .gallery-item {
    position: relative; background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05); padding: 3rem;
    overflow: hidden; cursor: pointer; display: block;
    transition: transform 0.6s var(--ease-smooth), border-color 0.6s var(--ease-smooth);
}

/* Static (non-interactive) card variant */
.card--static { cursor: default; }
.card--static::before { display: none; }

/* Hover Effects */
.card:hover, .gallery-item:hover { border-color: var(--accent-primary); }
/*
.card::before, .gallery-item::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 77, 0, 0.05));
    opacity: 0; transition: opacity 0.6s var(--ease-smooth);
}
.card:hover::before, .gallery-item:hover::before { opacity: 1; }
*/
.accent-line {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--accent-tertiary), var(--accent-primary));
    transform: scaleX(0); transform-origin: left; transition: transform 0.8s var(--ease-smooth);
}
/*  .card:hover .accent-line, .gallery-item:hover .accent-line { transform: scaleX(1); } */

/* Card Modifiers */
.project-card { grid-column: span 6; }
.project-card.wide { grid-column: span 12; }
.project-card.tall { grid-row: span 2; }
.experience-card { grid-column: span 6; }

.card-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 1.5rem; }
.card-title.small { font-size: 2rem; }
.card-desc { color: var(--text-dim); font-size: 1.1rem; margin-bottom: 2rem; }

.project-info { font-size: 0.8rem; color: var(--text-dim); display: flex; gap: 2rem; }
.experience-link {
    font-family: var(--font-mono); font-size: 0.9rem;
    color: var(--text-dim);
    transition: color 0.4s var(--ease-smooth);
}
.experience-card:hover .experience-link { color: var(--accent-primary); }

/* =========================================
   7. PAGE SPECIFIC: PROJECTS & MEDIA
   ========================================= */
.brief-content { font-size: 1.2rem; color: var(--text-main); }
.brief-content p { margin-bottom: 1.5rem; color: var(--text-dim); }

/* Resume Education Block */
.education-grid {
    max-width: 100%; display: grid; grid-template-columns: repeat(12, 1fr);
    gap: 2rem; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 2rem;
}
.education-col { grid-column: span 12; }
.edu-label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-secondary); }
.brief-content .edu-text { color: var(--text-dim); margin-bottom: 0.8rem; }
.edu-text.bold { font-weight: bold; margin-bottom: 1.5rem; }

/* Gallery Items */
.gallery-item {
    grid-column: span 4;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-item.tall {
    grid-row: span 2;
    height: 100%;
}

.media-container {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #000;
    position: relative;
    margin-bottom: 15px;
    cursor: default;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Video containers are interactive */
.media-container.video-card { cursor: pointer; }

/* Tall Card Specifics */
.gallery-item.tall .media-container.tall {
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
}

.media-container img, .media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   VIDEO PLAY BUTTON (Minimalist)
   ========================================= */

/* The Minimal Top-Right Button */
.play-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: var(--accent-primary);
    font-size: 20px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

/* Hide button when playing */
.video-card.playing .play-btn {
    opacity: 0;
    transform: scale(0.8);
}

.media-caption { font-size: 0.8rem; color: var(--text-dim); display: flex; gap: 10px; align-items: center; }
.file-tag { color: var(--accent-primary); }
.file-tag--video { color: var(--accent-tertiary); }
.file-tag--model { color: var(--accent-secondary); }

/* =========================================
   8. PAGE SPECIFIC: RESUME & SKILLS
   ========================================= */
.resume-download-link {
    display: inline-block; width: fit-content;
    font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim);
    margin-bottom: 3rem; transition: color 0.4s var(--ease-smooth); cursor: pointer;
}
.resume-download-link:hover { color: var(--accent-primary); }

.resume-entry { display: flex; flex-direction: column; }
.resume-entry .meta-tag { margin-bottom: 0.5rem; }

.resume-company {
    font-family: var(--font-sans); font-size: 1.4rem; font-weight: 800;
    color: var(--text-main); margin-bottom: 2rem;
    text-transform: uppercase; letter-spacing: -0.02em; line-height: 1;
}

.resume-role-group { margin-bottom: 2.5rem; }
.resume-role-group:last-child { margin-bottom: 0; }

.resume-role-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem; margin-bottom: 1rem;
}
.resume-role { font-size: 1.1rem; font-weight: 500; color: var(--accent-primary); }
.resume-date { font-size: 0.85rem; color: var(--text-dim); text-align: right; margin-left: 2rem; white-space: nowrap; }

.resume-list, .skill-list { list-style: none; }
.resume-list li {
    position: relative; padding-left: 1.5rem; margin-bottom: 0.8rem;
    color: var(--text-dim); font-size: 1rem; line-height: 1.5;
}
.resume-list li::before {
    content: '>>'; position: absolute; left: 0; top: 0.2em;
    color: var(--accent-secondary); font-family: var(--font-mono); font-size: 0.7rem;
}

/* Skills */
.skill-column { grid-column: span 6; }
.skill-list li {
    font-size: 1.3rem; color: var(--text-dim); margin-bottom: 1.2rem; display: flex; align-items: center;
}
.skill-arrow { color: var(--accent-primary); margin-right: 1.5rem; font-weight: bold; }

/* =========================================
   9. FOOTER
   ========================================= */
footer {
    padding: 8rem 10% 4rem; border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; justify-content: space-between; align-items: flex-end;
}

.cta-contact {
    font-size: 4rem; font-weight: 800; letter-spacing: -0.04em;
    color: var(--text-main); transition: color 0.4s var(--ease-smooth);
}
.cta-contact:hover { color: var(--accent-primary); }

.footer-info { text-align: right; font-size: 0.8rem; color: var(--text-dim); }
.footer-left { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-links {
    display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start;
    font-size: 0.8rem; color: var(--text-dim);
}
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--accent-primary); }

/* =========================================
   10. MEDIA QUERIES
   ========================================= */
@media (max-width: 1280px) {
    .experience-card, .gallery-item { grid-column: span 12; }

    .gallery-item.tall .media-container {
        aspect-ratio: 3/4 !important;
        flex-grow: 0;
        height: auto;
    }
}

@media (max-width: 768px) {
    /* Layout Adjustments */
    #projects, #experience, #skills, #contact { scroll-margin-top: 4rem; }

    nav { padding: 1.5rem; }
    .nav-links { display: none; }

    .hero, .project-hero { padding: 0 5%; }
    .hero-footer { grid-template-columns: 1fr; gap: 2rem; }
    .info-stats { justify-content: flex-start; }

    .project-card, .skill-column { grid-column: span 12; }

    /* Typography Adjustments */
    h1, .project-h1 { font-size: 2.5rem; }
    .cta-contact { font-size: 2.5rem; }
    .skill-list li { font-size: 1.1rem; }
    .brief-content p { font-size: 1.1rem; }

    /* Resume specific mobile */
    .resume-role-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .resume-date { margin-left: 0; font-size: 0.8rem; }
}

@media (max-height: 700px) {
    .scroll-indicator { display: none; }
}

/* =========================================
   11. 3D MODEL VIEWER
   ========================================= */
.simple-model-border {
    grid-column: span 12;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    position: relative;
}

.simple-model-border model-viewer {
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.02);
    outline: none;
    cursor: grab;
}

.simple-model-border model-viewer:active {
    cursor: grabbing;
}

model-viewer::part(default-progress-bar) {
    background-color: var(--accent-primary);
}

@media (max-width: 768px) {
    .simple-model-border {
        aspect-ratio: 1 / 1;
    }
}

/* =========================================
   12. CARD-STYLE MODEL DROPDOWN
   ========================================= */
.minimal-dropdown {
    position: absolute; top: 1rem; right: 1rem; z-index: 20;
    width: 260px; 
    font-family: var(--font-mono); font-size: 0.8rem;
    color: var(--text-dim); text-align: left; user-select: none;
    
    
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    
    /* 1. REMOVED padding from here so the child elements can stretch to the edges */
}

.dropdown-active { 
    cursor: pointer; transition: color 0.3s var(--ease-smooth); 
    display: flex; justify-content: space-between; align-items: center; 
    
    /* 2. ADDED padding here so the entire top half of the box is the clickable trigger */
    padding: 0.75rem 1rem; 
}
.dropdown-active:hover { color: var(--accent-primary); }

.dropdown-list { 
    display: none; flex-direction: column; gap: 0.5rem; 
    
    /* 3. ADDED padding here to maintain the spacing for the options */
    padding: 0.75rem 1rem; 
    border-top: 1px dashed rgba(255, 255, 255, 0.15); 
}
.minimal-dropdown.open .dropdown-list { display: flex; }

.dropdown-list span { cursor: pointer; transition: color 0.3s var(--ease-smooth); }
.dropdown-list span:hover { color: var(--accent-primary); }
.dropdown-list span.hidden { display: none; }