/* ==== 1. CSS Variables & Reset ==== */
:root {
    /* Colors - Deep Dark Premium Aesthetic */
    --bg-main: #0a0a0a;
    --bg-secondary: #121212;
    --bg-card: rgba(23, 23, 23, 0.7);
    --border-card: rgba(255, 255, 255, 0.05);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Global Accent Gradients */
    --accent-primary: #6366f1; /* Indigo */
    --accent-secondary: #ec4899; /* Pink */
    --gradient-primary: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    
    /* Specific section accents */
    --grad-pink: linear-gradient(135deg, #f43f5e, #db2777);
    --grad-purple: linear-gradient(135deg, #a855f7, #6366f1);
    --grad-blue: linear-gradient(135deg, #3b82f6, #06b6d4);
    --grad-green: linear-gradient(135deg, #10b981, #3b82f6);
    --grad-orange: linear-gradient(135deg, #f97316, #eab308);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing & Borders */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==== 2. Utilities ==== */
.mt-2 { margin-top: 10px; }
.mt-4 { margin-top: 20px; }

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.text-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.text-link:hover {
    color: var(--accent-primary);
}

/* Background Glow Orbs */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: var(--accent-secondary);
    bottom: -200px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(50px) scale(1.05); }
}

/* ==== 3. Layout & Structure ==== */
.section {
    padding: 50px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.profile-images-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.profile-account {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50%;
    max-width: 500px; /* Constrain size on large screens */
}

.profile-img {
    width: 100%;                  /* Take up full width of the account container */
    aspect-ratio: 1132 / 388;     /* Maintain the exact original dimension ratio */
    border-radius: var(--radius-md); /* Use standard rounded corners instead of full circle */
    object-fit: cover;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.profile-account .btn {
    width: 100%;
}

.grid {
    display: grid;
    gap: 30px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ==== 4. Navigation ==== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 5%;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ==== 5. Hero Section ==== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 120px; /* Offset for nav */
}

.hero-content {
    max-width: 800px;
    z-index: 2;
    margin-bottom: 80px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-intro {
    margin-bottom: 15px;
}

.hero-intro h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

.hero-intro h3 {
    font-size: clamp(1.25rem, 3vw, 2rem);
    color: var(--accent-primary);
    font-weight: 500;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 40px;
}

.hero-ctas {
    display: flex;
    gap: 16px;
}

.hero-visuals {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

.hero-card-stack {
    position: relative;
    width: 300px;
    height: 400px;
}

.hero-card-item {
    position: absolute;
    width: 250px;
    height: 160px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: float-card 6s ease-in-out infinite;
}

.hero-card-item.card-1 {
    top: 0;
    left: 0;
    color: #ec4899;
    transform: rotate(-5deg);
    z-index: 3;
}

.hero-card-item.card-2 {
    top: 100px;
    right: -20px;
    color: #10b981;
    transform: rotate(5deg);
    z-index: 2;
    animation-delay: 1s;
}

.hero-card-item.card-3 {
    top: 200px;
    left: 20px;
    color: #3b82f6;
    transform: rotate(-2deg);
    z-index: 1;
    animation-delay: 2s;
}

@keyframes float-card {
    0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
    50% { transform: translateY(-15px) rotate(var(--rot, 0deg)); }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.mouse .wheel {
    width: 4px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 4px;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(15px); opacity: 0; }
}

/* ==== 6. Portfolio Items & Cards ==== */
.portfolio-item {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
    cursor: pointer;
}

.interactive-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.media-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    /* Remove fixed heights/aspect-ratios so it relies on the inner media */
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.3); /* dark backdrop if media doesn't fill completely */
}

/* Ensure images and videos scale nicely inside an auto-height container */
.media-container img, 
.media-container video {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    /* Optional: max-height constraint so very tall portrait media doesn't break flow */
    max-height: 80vh; 
}

/* Provide fallbacks for empty placeholder divs so layout doesn't collapse */
.video-card .placeholder-gradient,
.large-card .placeholder-gradient {
    min-height: 400px; /* Fallback height when no media exists */
}

/* Placeholder Styling */
.placeholder-gradient {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.placeholder-pattern {
    background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.accent-pink { background: var(--grad-pink); }
.accent-purple { background: var(--grad-purple); }
.accent-blue { background: var(--grad-blue); }
.accent-green { background: var(--grad-green); }
.accent-orange { background: var(--grad-orange); }

.media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
}

.play-icon, .game-icon {
    font-size: 3rem;
    color: white;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
    transition: transform var(--transition-normal);
}

.interactive-card:hover .play-icon {
    transform: scale(1.1);
}

.stats {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-pill);
}

.status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255,255,255,0.2);
}

.item-info {
    padding: 24px;
}

.item-info h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.item-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* Stacked Video Columns (Landscape to Portrait hack) */
.stacked-videos-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: 100%;
}

.video-card.compact .item-info {
    padding: 16px;
}

.video-card.compact h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.video-card.compact p {
    margin-bottom: 0px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 3D Masonry Grid */
.masonry-grid {
    column-count: 2;
    column-gap: 30px;
}

.render-card {
    break-inside: avoid;
    margin-bottom: 30px;
    position: relative;
    border-radius: var(--radius-md);
    /* Remove height to allow content to define card height natively */
}

/* Provide fallback minimal heights for the placeholder divs if no image/video is present */
.render-card .placeholder-pattern.tall { min-height: 600px; }
.render-card .placeholder-pattern.medium { min-height: 400px; }
.render-card .placeholder-pattern.short { min-height: 300px; }

.render-card .media-container {
    height: 100%;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.render-card:hover .card-overlay {
    opacity: 1;
}

/* App Cards */
.app-card {
    padding: 24px;
}

.flex-row {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

/* ==== 7. Contact & Footer ==== */
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
}

.contact-card h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 30px;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.social-icons {
    display: flex;
    gap: 16px;
}

.social-icons a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icons a:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

footer {
    padding: 40px 5%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 50px;
}

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==== 8. Responsive Design ==== */
@media (max-width: 1024px) {
    .hero-visuals { display: none; }
    .hero-content { margin: 0 auto; text-align: center; }
    .hero-ctas { justify-content: center; }
    .badge { margin: 0 auto 24px; }
}

@media (max-width: 900px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .masonry-grid { column-count: 1; }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 30px;
        clip-path: circle(0 at 90% -10%);
        transition: all var(--transition-normal);
    }
    .nav-links.active {
        clip-path: circle(150% at 90% -10%);
    }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .section-header h2 { font-size: 2.25rem; }
    .flex-row { flex-direction: column; }
    .app-icon { width: 60px; height: 60px; font-size: 1.5rem; }
}
