@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-base: #f4f4f6;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --accent-blue: #0D4D8B;
    --accent-gradient: linear-gradient(135deg, #0D4D8B, #82b1ff);
    --pill-border: rgba(0, 0, 0, 0.1);
    
    /* Liquid Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.35);
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-shadow: inset 0 0 20px rgba(255, 255, 255, 0.4), 0 20px 40px rgba(0, 0, 0, 0.05);
    
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at top left, rgba(13, 77, 139, 0.12) 0%, transparent 40%),
        radial-gradient(circle at bottom right, rgba(13, 77, 139, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Glass Navbar (Dark) */
.glass-nav {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    z-index: 1000;
    box-shadow: var(--glass-shadow);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.nav-right {
    justify-content: flex-end;
}

.icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.icon-link:hover {
    transform: translateY(-2px);
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

.icon-link svg {
    width: 18px;
    height: 18px;
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    transition: color 0.3s ease;
}

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

.nav-name {
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Portfolio Container */
.portfolio-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 150px 40px 60px; /* Top padding for fixed nav */
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    min-height: 70vh;
    margin-bottom: 100px;
}

.hero-text-col {
    padding-right: 40px;
}

.overline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.overline .dot {
    width: 6px;
    height: 6px;
    background: var(--accent-blue);
    border-radius: 50%;
}

.hero-title {
    font-family: var(--font-body);
    font-size: clamp(3.5rem, 6vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: -2px;
    margin-bottom: 25px;
}

.title-solid {
    color: var(--text-main);
    font-weight: 900;
}

.title-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.hero-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.dot-sep {
    color: #444;
    margin: 0 8px;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 95%;
    margin-bottom: 20px;
    line-height: 1.7;
    text-align: justify;
}

/* Hero Image (Arched Shape & Hover Effects) */
.hero-image-col {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-col img {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 250px 250px 20px 20px; /* Modern arched window shape */
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    filter: none; /* No shadow by default */
}

.hero-image-col img:hover {
    transform: translateY(-15px) scale(1.02);
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.15)); /* Shadow appears on hover */
    border-radius: 20px 20px 250px 250px; /* Shape flips upside down on hover for a cool dynamic effect! */
}

/* Filter Pills */
.portfolio-grid-header {
    margin-bottom: 40px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pill {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-body);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.pill:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.pill.active {
    background: var(--text-main);
    border-color: var(--text-main);
    color: #fff;
}

.outline-pill {
    background: transparent;
}
.outline-pill:hover {
    background: var(--text-main);
    color: #000;
}

/* Works Grid */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Exactly 3 columns per row on desktop */
    gap: 40px;
}

.work-card {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #fff;
    cursor: pointer;
    border: 1px solid var(--pill-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.work-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 5;
}

.work-card img, .work-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card:hover::after {
    opacity: 1;
}

.work-card:hover img, .work-card:hover video {
    transform: scale(1.05);
}

.card-label {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
    border: 1px solid var(--glass-border);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--glass-shadow);
}

.work-card:hover .card-label {
    opacity: 1;
    transform: translateY(0);
}

/* Detail View */
.detail-header {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #222;
}

.detail-header h2 {
    font-family: var(--font-body);
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -1px;
}

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

.masonry-item {
    break-inside: avoid;
    margin-bottom: 30px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #222;
    position: relative;
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.masonry-item img, .masonry-item video {
    width: 100%;
    display: block;
    border-radius: 20px;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Overrides for ALL platforms (iOS, Android, Mac, Windows) */

/* Large Tablets & Small Laptops (Max: 1024px) */
@media (max-width: 1024px) {
    .glass-nav {
        width: 95%;
        padding: 0 20px;
    }
    .nav-center {
        display: none; /* Hide links for clean tablet/mobile view */
    }
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
        margin-bottom: 60px;
    }
    .hero-text-col {
        padding-right: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .overline {
        justify-content: center;
    }
    .hero-desc {
        max-width: 90%;
    }
    .masonry-grid { 
        column-count: 2; 
        column-gap: 20px;
    }
    .works-grid {
        grid-template-columns: repeat(2, 1fr); /* Exactly 2 columns on tablet */
        gap: 30px;
    }
}

/* Mobile Devices (Phones - Max: 768px) */
@media (max-width: 768px) {
    .portfolio-container {
        padding: 120px 20px 40px; /* Reduced side padding for mobile */
    }
    .glass-nav {
        top: 20px;
        height: 60px;
        width: calc(100% - 40px);
    }
    .nav-name {
        font-size: 0.8rem;
    }
    .icon-link {
        width: 36px;
        height: 36px;
    }
    .hero-title { 
        font-size: clamp(2.5rem, 12vw, 4rem); /* Dynamic scale for tiny phones */
        letter-spacing: -1px;
    }
    .hero-subtitle {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }
    .hero-desc {
        font-size: 1rem;
        max-width: 100%;
    }
    .btn-primary {
        padding: 14px 28px;
        font-size: 0.8rem;
    }
    .hero-glow-backdrop {
        width: 100%;
        height: 100%;
        filter: blur(60px);
    }
    .filter-pills {
        gap: 8px;
        justify-content: center;
    }
    .pill {
        padding: 10px 18px;
        font-size: 0.7rem;
    }
    .works-grid {
        grid-template-columns: 1fr; /* Full width on mobile */
        gap: 20px;
    }
    .card-label {
        /* Always show labels on mobile (no hover needed) */
        opacity: 1;
        transform: translateY(0);
        bottom: 20px;
        left: 20px;
        right: 20px; /* Stretch label */
        text-align: center;
        padding: 10px;
    }
    .work-card::after {
        opacity: 1; /* Always show gradient overlay so label is readable */
    }
    .masonry-grid { 
        column-count: 1; 
        column-gap: 0;
    }
    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 30px;
    }
    .detail-header h2 {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }
}

/* Extra Small Phones (Max: 375px) */
@media (max-width: 375px) {
    .hero-title {
        font-size: clamp(2rem, 10vw, 2.5rem);
    }
    .nav-name {
        display: none; /* Hide name on super tiny screens to fit icons */
    }
    .nav-left {
        flex: 0;
    }
}
