:root {
    --accent-pink: #ff3366;
    --accent-blue: #3366ff;
    --diffuse-pink: rgba(255, 51, 102, 0.4);
    --diffuse-blue: rgba(51, 102, 255, 0.4);
    --bg-main: #0a0a0c;
    --bg-glass: rgba(20, 20, 25, 0.4);
    --bg-glass-hover: rgba(30, 30, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --section-padding: 8vw;
    --nav-height: 70px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    height: 100%;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
    transition: background-color 0.8s ease, color 0.8s ease;
}

/* =========================================
   PAGE TRANSITIONS
   ========================================= */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: fade-out 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

::view-transition-new(root) {
    animation: fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =========================================
   PARALLAX & SLIDING DIFFUSE LAYERS
   ========================================= */
.parallax {
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    perspective: 1px;
    /* enables 3D space for parallax */
}

.parallax-layer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    /* Let clicks pass through layers */
}

.diffuse-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.6;
    animation: pulse 10s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    /* Set a low z-index so content like CTA is always above */
    z-index: 0;
}

.blue1 {
    width: 60vw;
    height: 60vw;
    background: var(--diffuse-blue);
    top: -10%;
    left: -10%;
    transform: translateZ(-2px) scale(3);
}

.pink1 {
    width: 50vw;
    height: 50vw;
    background: var(--diffuse-pink);
    top: 40%;
    right: -10%;
    transform: translateZ(-1.5px) scale(2.5);
    animation-delay: -3s;
}

.blue2 {
    width: 40vw;
    height: 40vw;
    background: var(--diffuse-blue);
    top: 90%;
    left: 20%;
    transform: translateZ(-1px) scale(2);
    animation-delay: -5s;
}

.pink2 {
    width: 55vw;
    height: 55vw;
    background: var(--diffuse-pink);
    top: 140%;
    left: -15%;
    transform: translateZ(-1.5px) scale(2.5);
    animation-delay: -2s;
}

.blue3 {
    width: 60vw;
    height: 60vw;
    background: var(--diffuse-blue);
    top: 190%;
    right: -20%;
    transform: translateZ(-2px) scale(3);
    animation-delay: -7s;
}

.pink3 {
    width: 45vw;
    height: 45vw;
    background: var(--diffuse-pink);
    top: 240%;
    left: 10%;
    transform: translateZ(-1.5px) scale(2.5);
    animation-delay: -1s;
}

.blue4 {
    width: 50vw;
    height: 50vw;
    background: var(--diffuse-blue);
    top: 290%;
    right: 15%;
    transform: translateZ(-1px) scale(2);
    animation-delay: -4s;
}

.pink4 {
    width: 65vw;
    height: 65vw;
    background: var(--diffuse-pink);
    top: 340%;
    left: -10%;
    transform: translateZ(-2px) scale(3.5);
    animation-delay: -8s;
}

/* =========================================
   LIGHT THEME (MODERN WHITE)
   ========================================= */
body.light-mode-active {
    --bg-main: #f5f5f7;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-hover: rgba(0, 0, 0, 0.15);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
}

body.light-mode-active .glass-panel {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

body.light-mode-active .glass-panel:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

/* Base override for gradient text in light theme */
body.light-mode-active .gradient-text {
    background: linear-gradient(135deg, #1d1d1f, #86868b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode-active .project-arrow img,
body.light-mode-active .project-arrow img {
    filter: grayscale(100%) brightness(0%);
    /* Black in light mode */
    opacity: 0.6;
}

body.light-mode-active .social-icon img {
    filter: none;
    opacity: 1;
}

body.light-mode-active .project-arrow:hover img {
    filter: grayscale(100%) brightness(0%);
    opacity: 1;
}

body.light-mode-active .social-icon:hover img {
    opacity: 1;
}

body.light-mode-active .stack-icon {
    background: rgba(0, 0, 0, 0.03);
}

body.light-mode-active .navbar {
    background: rgba(255, 255, 255, 0.6);
}

body.light-mode-active .cta-btn {
    background: #1d1d1f;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.light-mode-active .cta-btn:hover {
    background: #000;
}

@keyframes pulse {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1) translate(2vw, 2vw);
        opacity: 0.8;
    }
}

.grand_wrap {
    position: relative;
    padding-inline: max(5%, calc((100vw - 1200px) / 2));
    padding-bottom: 100px;
    padding-top: calc(var(--nav-height) + 40px);
    transform: translateZ(0);
    /* main content at z=0 */
    pointer-events: auto;
    /* allow interactions here */
}

/* =========================================
   RIGOROUS NAVIGATION BAR
   ========================================= */
.navbar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px max(5%, calc((100vw - 1200px) / 2));
    pointer-events: none;
    /* allow clicks outside navbar to pass */
    transition: all 0.3s ease;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    /* pill shape */
    padding: 10px 24px;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.nav-brand:hover {
    color: var(--accent-blue);
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-blue));
    color: white;
    padding: 8px 20px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(51, 102, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(51, 102, 255, 0.5);
    filter: brightness(1.1);
}

/* =========================================
   GLASSMORPHISM COMPONENTS
   ========================================= */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.8s ease, border-color 0.8s ease, box-shadow 0.8s ease;
    overflow: hidden;
}

.glass-panel:hover {
    transform: translateY(-4px);
    background: var(--bg-glass-hover);
    border-color: var(--glass-border-hover);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    min-height: 70vh;
    padding-top: 60px;
    padding-bottom: var(--section-padding);
}

.hero-content {
    flex: 1;
    min-width: 300px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(135deg, #fff, #a1a1a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.hero-image-wrapper {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 100%;
    max-width: 500px;
    border-radius: 32px;
    object-fit: cover;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
}

/* =========================================
   PROJECTS SECTION & TIMELINE
   ========================================= */
.section-header {
    margin-bottom: 48px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Custom styling for project pages content */
.content-block h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.content-block p {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: var(--section-padding);
}

.project-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    padding: 16px;
    position: relative;
}

.project-date-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto var(--section-padding);
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 24px;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item-link {
    text-decoration: none !important;
    display: block;
    margin-bottom: 3.5rem;
    /* Increased spacing between timeline boxes */
    color: var(--text-main) !important;
}

.timeline-item-link:link,
.timeline-item-link:visited,
.timeline-item-link:hover,
.timeline-item-link:active {
    color: var(--text-main) !important;
    text-decoration: none !important;
}

/* Force colors to prevent them turning blue/purple like standard hyperlinks */
.timeline-item-link .timeline-title,
.timeline-item-link h3 {
    color: var(--text-main) !important;
    text-decoration: none !important;
}

.timeline-item-link p,
.timeline-item-link .timeline-desc {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
}

.timeline-item-link .timeline-date {
    color: var(--accent-pink) !important;
    text-decoration: none !important;
}

.timeline-item {
    position: relative;
    padding-left: 3.5rem;
    transition: transform 0.3s ease;
    border-radius: 24px;
}

.timeline-item-link:hover .timeline-content {
    transform: translateX(10px);
}

.timeline-item-link:hover .timeline-dot {
    transform: scale(1.3);
}

.timeline-dot {
    position: absolute;
    left: 17px;
    top: 24px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    box-shadow: 0 0 0 4px var(--glass-border);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timeline-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.3s ease;
}

.timeline-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-pink);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.timeline-desc {
    color: var(--text-secondary);
    line-height: 1.5;
}

.project-image-wrapper {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #000;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-inline: 8px;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.project-arrow {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.project-arrow img {
    width: 20px;
    height: 20px;
    filter: invert(1) grayscale(100%) brightness(200%);
    /* White in dark mode */
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.project-card:hover .project-arrow {
    background: var(--accent-blue);
}

.project-card:hover .project-arrow img {
    transform: translateX(4px);
}

/* =========================================
   STACK SECTION (B2B SaaS Features Style)
   ========================================= */
.stack-section {
    margin-bottom: var(--section-padding);
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.stack-card {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stack-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
}

.stack-icon img {
    width: 32px;
    height: 32px;
}

.stack-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.stack-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* =========================================
   CALL TO ACTION & FOOTER
   ========================================= */
.cta-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6rem 0;
    margin-top: 2rem;
    position: relative;
    z-index: 10;
}

.cta-blur {
    position: absolute;
    width: 100vw;
    /* Full width blur like the background */
    height: 400px;
    background: radial-gradient(ellipse at bottom, rgba(236, 72, 153, 0.3) 0%, rgba(99, 102, 241, 0.3) 40%, rgba(0, 0, 0, 0) 70%);
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

.cta-content {
    /* Removing background: transparent and border: none so the .glass-panel class works properly */
    text-align: center;
    width: 100%;
    position: relative;
    padding: 80px 48px;
    border-radius: 32px;
    /* Smoother corner radius */
    box-sizing: border-box;
}

.cta-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    transition: color 0.8s ease;
}

.cta-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.04em;
    color: #fff;
    transition: color 0.8s ease;
}

body.light-mode-active .cta-subtitle {
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode-active .cta-title {
    color: #000;
}

body.light-mode-active .btn-primary {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-color: rgba(0, 0, 0, 0.9);
}

body.light-mode-active .btn-primary:hover {
    background: #000;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0;
    border-top: 1px solid var(--glass-border);
    gap: 20px;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-icon {
    width: 44px;
    height: 44px;
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-icon img {
    width: 20px;
    height: 20px;
    opacity: 1;
    /* Fully opaque on the white background */
    transition: transform 0.3s ease;
}

.social-icon:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.social-icon:hover img {
    opacity: 1;
}

/* =========================================
   GENERIC PAGE STYLES (For Projects/Contact)
   ========================================= */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding-top: var(--section-padding);
}

.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.content-block {
    margin-bottom: 40px;
}

.content-block h2 {
    font-size: 1.75rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.content-block p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-input,
.form-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.05);
}

/* =========================================
   SCROLL ANIMATIONS (Intersection Observer)
   ========================================= */
/* Base hidden state */
.reveal-on-scroll {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animation directions */
.reveal-up {
    transform: translateY(40px);
}

.reveal-left {
    transform: translateX(-40px);
}

.reveal-right {
    transform: translateX(40px);
}

.reveal-zoom {
    transform: scale(0.95);
}

/* Triggered State */
.reveal-on-scroll.is-revealed {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Delays */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

.reveal-delay-5 {
    transition-delay: 0.5s;
}

.reveal-delay-6 {
    transition-delay: 0.6s;
}

/* Hide scrollbar for parallax container but keep functionality */
.parallax::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* simple mobile approach */
    }

    .hero {
        padding-top: 40px;
    }

    .cta-title {
        font-size: 2.5rem;
    }
}