@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Space+Grotesk:wght@300;400;500;700&display=swap');

:root {
    --bg-base: #f0f4f8;
    --bg-membrane: rgba(255, 255, 255, 0.4);
    --primary-ethereal: #7fffd4;
    /* Aquamarine */
    --secondary-ethereal: #ff9a9e;
    /* Soft Pink */
    --accent-organic: #b2fefa;
    --text-deep: #2d3436;
    --text-soft: #636e72;

    /* Light Neumorphic Molding */
    --neu-light-outer: 8px 8px 16px #cbd5e0, -8px -8px 16px #ffffff;
    --neu-light-inner: inset 4px 4px 8px #cbd5e0, inset -4px -4px 8px #ffffff;
    --organic-glow: 0 0 20px rgba(127, 255, 212, 0.3);

    /* Typography */
    --font-headers: 'Syne', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

/* Global Focus States for Accessibility */
:focus-visible {
    outline: 2px solid var(--accent-organic);
    outline-offset: 4px;
    border-radius: 4px;
}

.btn:focus-visible,
.nav-links a:focus-visible,
.bio-orb:focus-visible {
    outline-offset: 8px;
}

/* volumetric shadow optimization for 60fps scrolling */
:root {
    --neu-light-outer: 10px 10px 30px rgba(0, 0, 0, 0.05),
        -10px -10px 30px rgba(255, 255, 255, 0.9);
    --neu-light-inner: inset 4px 4px 10px rgba(0, 0, 0, 0.05),
        inset -4px -4px 10px rgba(255, 255, 255, 0.8);
}

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

body {
    font-family: var(--font-body);
    color: var(--text-deep);
    background: var(--bg-base);
    background-image:
        radial-gradient(circle at 0% 0%, #e0f2f1 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, #fff1f0 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #f0f4f8 0%, transparent 100%);
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
.navbar a,
.btn,
.side-controls-content h3 {
    font-family: var(--font-headers);
    font-weight: 800;
}

/* Seamless Nav */
nav {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-membrane);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    border-radius: 60px 20px 60px 20px;
    z-index: 1000;
    display: flex;
    padding: 15px 50px;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

nav a {
    margin: 0 25px;
    text-decoration: none;
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 2px;
    transition: all 0.4s;
    text-transform: uppercase;
}

nav a:hover {
    color: var(--text-deep);
    transform: scale(1.1);
    text-shadow: var(--organic-glow);
}

/* Project Cards Refinement */
/* Consolidated Project Card styles moved to line 750 for organization */

.project-card.elite {
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.08),
        inset 0 0 20px rgba(127, 255, 212, 0.05);
    border: 1px solid rgba(127, 255, 212, 0.15);
    /* Removed redundant transition definition to respect base class optimization */
}

.project-card.elite:hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12),
        0 0 30px rgba(127, 255, 212, 0.1);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
    width: 100%;
}

.project-tech span {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
    color: var(--text-soft);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* High-Contrast CTAs */
.btn {
    background: var(--bg-base);
    box-shadow: var(--neu-light-outer);
    color: var(--text-soft);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#hero-cta,
.contact-nav-btn {
    font-weight: 700;
}

#hero-cta:hover,
.contact-nav-btn:hover {
    background: #5ffff0;
    /* Brighter version for active glow */
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(127, 255, 212, 0.5);
}

/* Bio-Orb Floating Contact Anchor */
.bio-orb {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--accent-organic);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--bg-base);
    text-decoration: none;
    box-shadow: 0 10px 40px rgba(127, 255, 212, 0.4);
    z-index: 1000;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    border: 3px solid rgba(255, 255, 255, 0.4);
}

.bio-orb:hover {
    transform: scale(1.15) rotate(15deg);
    box-shadow: 0 20px 50px rgba(127, 255, 212, 0.6);
    background: #5ffff0;
}

.bio-orb svg {
    width: 28px;
    height: 28px;
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.bio-orb:hover svg {
    transform: scale(1.2);
}

.project-card .btn {
    margin-top: auto;
}

/* Floating Hero */
header {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 60px 20px;
    /* Reduced from 100px to lift content slightly */
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

header .container {
    display: grid;
    place-items: center;
}

header h1 {
    font-size: 4.5rem;
    /* Reduced from 6rem */
    font-weight: 900;
    margin-bottom: 20px;
    letter-spacing: -3px;
    background: linear-gradient(135deg, #2d3436, #7fffd4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.05));
    text-align: center;
    transition: opacity 1.5s cubic-bezier(0.23, 1, 0.32, 1), transform 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Explicitly target H1 inside the container for transition matching */
.hero-text-wrapper {
    /* Using max-height for smooth layout slide */
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
    overflow: hidden;
    /* transition: replaced by animation for strict sequencing */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

@keyframes restoreHeroText {
    0% {
        max-height: 0;
        opacity: 0;
        margin-bottom: -20px;
        transform: translateY(-50px) scale(0.9);
    }

    75% {
        max-height: 0;
        opacity: 0;
        margin-bottom: -20px;
        transform: translateY(-50px) scale(0.9);
    }

    100% {
        max-height: 300px;
        opacity: 1;
        margin-bottom: 0;
        transform: translateY(0) scale(1);
    }
}

/* Base state with high specificity to ensure animation handoff */
#hero-intro-content h1,
#hero-intro-content .hero-tagline {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 1.2s cubic-bezier(0.19, 1, 0.22, 1), transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Apply sequencing animation ONLY when returning to Home explicitly */
#hero-intro-content.returning-home .hero-text-wrapper {
    animation: restoreHeroText 1.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

#hero-intro-content.show-about .hero-text-wrapper,
#hero-intro-content.show-projects .hero-text-wrapper {
    max-height: 0;
    opacity: 0;
    margin-bottom: -20px;
    transform: translateY(-50px) scale(0.9);
    pointer-events: none;
    animation: none;
    /* Kill animation to allow instant collapse */
}

header p {
    font-size: 1.3rem;
    /* Slightly smaller */
    color: var(--text-soft);
    max-width: 700px;
    margin: 0 auto 30px;
    /* Reduced margin */
    font-weight: 300;
    text-align: center;
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1) 0.1s;
    /* Slight delay for subtitle */
}

/* Transition States */
.hidden-transition {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(20px);
    transition: all 1.4s cubic-bezier(0.23, 1, 0.32, 1);
    /* Delays handled individually per element for sequencing */
    pointer-events: none;
    margin: 0 auto;
}

#about-text {
    /* Ensure structural consistency across states to prevent jumps */
    position: relative;
    display: grid;
    place-items: center;
}

/* REVERSE SEQUENCE (Going Home) */
/* 1. Video collapses first */
#hero-intro-content:not(.show-about) .video-placeholder.hidden-transition {
    transition-delay: 0s;
}

/* 2. About Text collapses second */
#hero-intro-content:not(.show-about) #about-text.hidden-transition {
    transition-delay: 0.8s;
}

#hero-intro-content.show-about .hidden-transition {
    opacity: 1;
    max-height: 1200px;
    transform: translateY(0);
    pointer-events: auto;
}

/* Staggered unfolding sequence */
#hero-intro-content.show-about #about-text {
    /* Container for shifting chapters */
    position: relative;
    max-width: 800px;
    margin: 0 auto 30px;
    display: grid;
    /* Grid-stacking chapters */
    place-items: center;
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1), transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    transition-delay: 0.2s;
}

.about-chapter {
    grid-area: 1 / 1;
    /* Occupy same cell */
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

.about-chapter.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.about-chapter h2 {
    margin-bottom: 15px;
}

#hero-intro-content.show-about .video-placeholder {
    transition-delay: 0.4s;
}

#hero-intro-content.show-about .btn {
    transition-delay: 0.1s;
}

#hero-intro-content.show-projects .video-placeholder {
    /* Shape-Shifting Morph: video becomes the card nucleus */
    max-width: 420px;
    aspect-ratio: 1 / 1.1;
    transform: translateY(0);
    /* Align with centered grid */
    opacity: 0;
    transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

#hero-intro-content.show-projects #about-text,
#hero-intro-content.show-projects .btn {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
    margin: 0;
    display: none;
    /* Fully remove from flow during projects */
    pointer-events: none;
}

/* Conflict removed: Duplicate hero exit rules deleted to allow smooth transition at line 241 to take effect */

#hero-intro-content,
#hero-projects {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    transition: all 1.8s cubic-bezier(0.23, 1, 0.32, 1);
    grid-area: 1/1;
}

#hero-intro-content.show-about {
    /* transform: translateY(-80px); */
    /* Removed lift to prevent "jumping" video on exit. The content flows naturally now. */
}

#hero-projects.show-projects {
    margin-top: 80px;
    /* Keep project section centered/lower */
}

#hero-projects h2,
#hero-about h2,
header h1 {
    margin: 0 0 40px 0;
    /* Standardized margin for all hero titles */
}

#hero-projects h2 {
    font-size: 3rem;
    letter-spacing: -1px;
}

#hero-about h2 {
    font-size: 2.5rem;
}

/* About Section Elements */
.video-placeholder {
    width: 85%;
    max-width: 750px;
    aspect-ratio: 16 / 9;
    background: var(--bg-base);
    border-radius: 40px 100px 40px 100px;
    box-shadow: var(--neu-light-outer);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    /* Force stacking context for perfect clipping */
    transition: all 1.8s cubic-bezier(0.23, 1, 0.32, 1);
    /* Slower, more organic expansion */
}

.video-stack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.about-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: inherit;
    pointer-events: none;
}

.about-video.active {
    opacity: 1;
    pointer-events: auto;
}

.video-placeholder:hover {
    box-shadow: var(--neu-light-inner);
    transform: scale(0.995);
}

/* Multi-Chapter Progress Indication */
.video-progress-container {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0 20px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    z-index: 100;
    height: 64px;
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
    transform: translateY(20px);
    cursor: pointer;
}

.video-skill-chips {
    display: flex;
    gap: 8px;
}

.pill-controls {
    position: relative;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
}

.pill-controls>svg {
    grid-area: 1/1;
}

.video-skill-chips .skill-chip {
    opacity: 1;
    transform: none;
    margin: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.65rem;
    padding: 4px 10px;
    white-space: nowrap;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeInUp 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.video-skill-chips .skill-chip:nth-child(2) {
    animation-delay: 0.1s;
}

.video-skill-chips .skill-chip:nth-child(3) {
    animation-delay: 0.2s;
}

.video-progress-container.ready-to-advance {
    pointer-events: auto;
    cursor: pointer;
    background: rgba(127, 255, 212, 0.2);
    border-color: var(--primary-ethereal);
    box-shadow: 0 10px 30px rgba(127, 255, 212, 0.2);
}

.video-progress-container.ready-to-advance:hover {
    transform: scale(1.05) translateY(0);
    background: rgba(127, 255, 212, 0.3);
}

.next-arrow {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--primary-ethereal);
}

.ready-to-advance .next-arrow {
    opacity: 1;
    transform: scale(1);
}

.check-icon {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #4CAF50;
    /* Success Green */
}

.story-complete .check-icon {
    opacity: 1;
    transform: scale(1);
}

.story-complete .progress-spinner,
.story-complete .next-arrow {
    opacity: 0;
    transform: scale(0.8);
}

.video-progress-container.story-complete {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4CAF50;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.1);
    pointer-events: none;
    /* No more clicking needed */
}

.ready-to-advance .progress-spinner {
    opacity: 0;
    transform: scale(0.8);
}

.video-placeholder.hidden-transition:not(.hidden)+#hero-cta+.video-progress-container,
#hero-intro-content.show-about .video-progress-container {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.2s;
}

.progress-spinner {
    transform: rotate(-90deg);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.progress-bg {
    fill: none;
    stroke: rgba(127, 255, 212, 0.1);
    stroke-width: 4;
}

.progress-bar {
    fill: none;
    stroke: var(--primary-ethereal);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 126;
    /* 2 * PI * r = 2 * 3.14 * 20 */
    stroke-dashoffset: 126;
}

.chapter-indicator {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-deep);
    letter-spacing: 1px;
    font-family: 'Space Grotesk', sans-serif;
    min-width: 35px;
    text-align: center;
}

.video-overlay {
    text-align: center;
    color: var(--text-soft);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* Sidebar - Living Membrane */
.side-controls {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-membrane);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--neu-light-outer);
    border-radius: 30% 70% 30% 70% / 50% 30% 70% 50%;
    z-index: 900;
    padding: 40px 25px;
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    width: 200px;
}

@keyframes sidebar-attention {

    0%,
    100% {
        transform: translateY(-50%) translateX(0);
    }

    50% {
        transform: translateY(-50%) translateX(25px);
    }
}

.side-controls.attention-bounce {
    animation: sidebar-attention 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.side-controls.collapsed {
    left: -170px;
    opacity: 0.6;
}

.side-controls.collapsed:hover {
    left: -150px;
    opacity: 1;
    box-shadow: 15px 0 40px rgba(127, 255, 212, 0.2);
}

.sidebar-toggle {
    position: absolute;
    right: -10px;
    top: 40px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.toggle-icon {
    width: 10px;
    height: 10px;
    border-top: 3px solid var(--primary-ethereal);
    border-right: 3px solid var(--primary-ethereal);
    transform: translate(-2px, 0) rotate(225deg);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.side-controls.collapsed .toggle-icon {
    transform: translate(2px, 0) rotate(45deg);
}

.side-controls-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: all 0.5s;
}

.side-controls.collapsed .side-controls-content {
    opacity: 0;
    filter: blur(5px);
    pointer-events: none;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Projects Layout - Flowing */
.project-layout {
    display: flex;
    width: 100%;
    position: relative;
}

.project-main {
    flex-grow: 1;
    padding-left: 0;
    /* Removed asymmetric padding for perfect horizontal centering */
    padding-bottom: 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
}

.project-card {
    background: var(--bg-membrane);
    border-radius: 40px 100px 40px 100px;
    padding: 60px 40px;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: var(--neu-light-outer);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 520px;
    /* Increased to accommodate content comfortably */
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
}

.project-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    min-height: 4.4rem;
    /* Standardizes space for 2 lines of title */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.project-card p {
    flex-grow: 1;
    /* This pushes the tech group to the bottom */
    margin-bottom: 30px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-card:nth-child(1) {
    transform: translateX(calc(100% + 40px)) scale(0.5);
}

.project-card:nth-child(3) {
    transform: translateX(calc(-100% - 40px)) scale(0.5);
}

#hero-projects.show-projects .project-card {
    opacity: 1;
    transform: scale(1) translate(0, 0);
}

#hero-projects.show-projects .project-card:nth-child(2) {
    transition-delay: 0.3s;
    transition-duration: 1s;
}

#hero-projects.show-projects .project-card:nth-child(1),
#hero-projects.show-projects .project-card:nth-child(3) {
    transition-delay: 1s;
    transition-duration: 1.2s;
}

/* Cell Absorption Logic - Reverse movement */
#hero-projects.absorbing .project-card {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

#hero-projects.absorbing .project-card:nth-child(1) {
    transform: translateX(calc(100% + 40px)) scale(0.5);
    transition-delay: 0s;
}

#hero-projects.absorbing .project-card:nth-child(3) {
    transform: translateX(calc(-100% - 40px)) scale(0.5);
    transition-delay: 0s;
}

#hero-projects.absorbing .project-card:nth-child(2) {
    transform: scale(0.6);
    transition-delay: 0.4s;
    /* Absorbs side cards first */
}

.project-card:hover {
    border-radius: 100px 40px 100px 40px;
    transform: scale(1.02);
    box-shadow: var(--organic-glow), 20px 20px 40px rgba(0, 0, 0, 0.05);
    background: white;
}

.project-card h3 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-weight: 800;
    background: linear-gradient(45deg, var(--text-deep), var(--primary-ethereal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-card p {
    color: var(--text-soft);
    line-height: 1.8;
}

.btn {
    display: inline-block;
    padding: 16px 36px;
    background: var(--bg-base);
    color: var(--text-deep);
    border: none;
    border-radius: 60px 20px 60px 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--neu-light-outer);
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    text-decoration: none;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#hero-intro-content.show-about .btn {
    margin-top: 40px;
}

.btn:hover {
    transform: translateY(2px);
    box-shadow: var(--neu-light-inner);
    color: var(--text-soft);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn:active {
    transform: translateY(4px) scale(0.98);
}

.btn-sm {
    padding: 10px 25px;
    font-size: 0.75rem;
}

.filter-btn {
    border-radius: 50px;
    width: 100%;
    text-align: center;
    padding: 12px 20px;
}

.filter-btn.active {
    box-shadow: var(--neu-light-inner);
    background: var(--primary-ethereal);
    color: white;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-top: 30px;
    padding-bottom: 20px;
}

.pagination-dots {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
}

.pagination-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.pagination-dots .dot:hover {
    background: rgba(127, 255, 212, 0.4);
    transform: scale(1.3);
}

.pagination-dots .dot.active {
    background: var(--accent-organic);
    width: 12px;
    border-radius: 4px;
    transform: scale(1.1);
}

.pagination-dots .dot.active:hover {
    transform: scale(1.2);
}

#page-info {
    font-family: var(--font-headers);
    font-weight: 800;
    color: var(--primary-ethereal);
    font-size: 1.2rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.animate-in h1 {
    animation: fadeInUp 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.animate-in .hero-tagline {
    animation: fadeInUp 1.2s cubic-bezier(0.19, 1, 0.22, 1) 0.3s forwards;
    opacity: 0;
    /* Start hidden for stagger */
}

/* Skill Biosphere */
.skill-biosphere {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
    justify-content: center;
}

.skill-chip {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
    transform: translateY(10px);
}

.about-chapter.active .skill-chip {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered entry for chips */
.about-chapter.active .skill-chip:nth-child(1) {
    transition-delay: 0.5s;
}

.about-chapter.active .skill-chip:nth-child(2) {
    transition-delay: 0.6s;
}

.about-chapter.active .skill-chip:nth-child(3) {
    transition-delay: 0.7s;
}

.skill-chip:hover {
    background: var(--accent-organic);
    color: var(--bg-base);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(127, 255, 212, 0.2);
}

/* Nav Link States */
.nav-links a {
    position: relative;
    color: var(--text-soft);
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-links a.active {
    color: var(--accent-organic);
    font-weight: 700;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: var(--accent-organic);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(127, 255, 212, 0.4);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-links a.active::after {
    transform: translateX(-50%) scaleX(1);
}

#contact {
    padding: 80px 20px;
    text-align: center;
    position: relative;
    z-index: 10;
    background: transparent;
}

.contact-card {
    background: var(--bg-base);
    border-radius: 40px 100px 40px 100px;
    padding: 80px 40px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.04), var(--neu-light-outer);
    border: 1px solid rgba(255, 255, 255, 0.8);
    max-width: 800px;
    margin: 40px auto;
    transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.contact-card h2 {
    font-size: 3.5rem;
    margin-bottom: 30px;
    letter-spacing: -2px;
}

.contact-info {
    margin-bottom: 50px;
    font-size: 1.2rem;
    color: var(--text-deep);
}

.contact-info p {
    margin: 15px 0;
}

.contact-info a {
    color: var(--primary-ethereal);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--accent-organic);
}

/* Project Section Footer & Contact Nav */
.project-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 40px;
    padding-bottom: 40px;
}

.contact-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 18px 40px;
}

.nav-arrow {
    display: inline-block;
    font-size: 1.4rem;
    animation: bounceDown 2s infinite;
    transition: transform 0.3s ease;
}

.contact-nav-btn:hover .nav-arrow {
    transform: translateY(5px);
}

@keyframes bounceDown {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(8px);
    }

    60% {
        transform: translateY(4px);
    }
}

footer {
    padding: 40px;
    text-align: center;
    color: var(--text-soft);
}

/* Project Portal - Immersive Viewer */
.project-portal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    /* Stack controls above frame */
    align-items: center;
    justify-content: center;
    gap: 30px;
    /* Symmetrical gap for the control deck */
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
    pointer-events: none;
}

.project-portal.open {
    opacity: 1;
    pointer-events: auto;
}

.portal-frame {
    width: 90%;
    max-width: 950px;
    height: 70vh;
    /* Slightly shorter to leave room for centered controls */
    max-height: 700px;
    background: var(--bg-membrane);
    border-radius: 40px 100px 40px 100px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2), var(--neu-light-outer);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transform: scale(0.85) translateY(30px);
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.project-portal.open .portal-frame {
    transform: scale(1) translateY(0);
}

.portal-controls {
    display: flex;
    gap: 15px;
    z-index: 2100;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), var(--neu-light-outer);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
}

.project-portal.open .portal-controls {
    transform: translateY(0);
    opacity: 1;
}

.portal-viewer {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    /* Ensure viewer respects parent shape */
    overflow: hidden;
}

#portal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    border-radius: inherit;
}

body.portal-open {
    overflow: hidden;
    /* Stop page scroll when portal is active */
}

@media (max-width: 1100px) {
    .projects-container.grid-view {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 3.5rem;
        letter-spacing: -2px;
    }

    .side-controls {
        position: relative;
        width: 100%;
        left: 0 !important;
        transform: none;
        margin-bottom: 50px;
        border-radius: 40px;
        opacity: 1 !important;
    }

    .project-main {
        padding-left: 0;
    }

    .projects-container.grid-view {
        grid-template-columns: 1fr;
    }
}