:root {
    --bg-color: #000000;
    --card-bg: #111111;
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --accent-red: #ff3333;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --border-radius-lg: 32px;
    --border-radius-md: 20px;
    --border-radius-sm: 12px;
}

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

/* Hide scrollbars across all browsers but keep scroll functionality */
::-webkit-scrollbar {
    display: none; /* Chrome, Safari, and Opera */
}

html, body {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
}

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

/* Base Utilities */
.portfolio-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    perspective: 1000px; /* Enable 3D depth for tilt effects */
}

/* Bento Card Style */
.bento-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease-out, border-color 0.3s ease; /* Faster transform for tilt */
    transform-style: preserve-3d;
}

.bento-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* --- Hero Section --- */
.hero {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -2;
    background: radial-gradient(circle at center, rgba(255, 0, 0, 0.4) 0%, var(--bg-color) 70%);
    animation: huerotate 15s linear infinite;
    pointer-events: none;
}

.navbar, .hero-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 999;
}

.logo path {
    stroke: var(--text-primary);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-transform: lowercase;
}

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

.menu-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Interactive Background Glow --- */
.bg-glow {
    position: fixed;
    top: 0; left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 51, 51, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -2;
    filter: blur(80px);
    mix-blend-mode: screen;
    animation: huerotate 15s linear infinite;
    transform: translate(-50%, -50%); /* Handle center positioning in JS */
    will-change: transform;
    opacity: 0;
    transition: opacity 1s ease;
}

.loader.fade-out ~ .bg-glow {
    opacity: 1; /* Fade in only after loading is done */
}

@media (max-width: 768px) {
    .bg-glow { display: none; } /* Hide on touch devices */
}

/* --- Loader --- */
.loader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.8s cubic-bezier(0.85, 0, 0.15, 1), visibility 0.8s;
}

.loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.loader-bar {
    width: 150px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loader-progress {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-red);
    transform: translateX(-100%);
    animation: loading-bar 2s cubic-bezier(0.85, 0, 0.15, 1) forwards;
}

@keyframes loading-bar {
    100% { transform: translateX(0); }
}

/* --- Full-Screen Menu Overlay --- */
.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 998;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    visibility: hidden;
}

.fullscreen-menu.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.menu-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.menu-link {
    font-size: 3.5rem;
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

.fullscreen-menu.active .menu-link {
    transform: translateY(0);
    opacity: 1;
}

/* Staggered animation for links */
.fullscreen-menu.active .menu-link:nth-child(1) { transition-delay: 0.1s; }
.fullscreen-menu.active .menu-link:nth-child(2) { transition-delay: 0.2s; }
.fullscreen-menu.active .menu-link:nth-child(3) { transition-delay: 0.3s; }
.fullscreen-menu.active .menu-link:nth-child(4) { transition-delay: 0.4s; }

.menu-link:hover {
    color: var(--text-primary);
    transform: scale(1.05) !important;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.hero-text-left {
    flex: 1;
    max-width: 300px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    align-self: flex-end;
    margin-bottom: 2rem;
}

.hero-center {
    flex: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Central Red Glow Effect behind text */
.red-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: var(--accent-red);
    border-radius: 50%;
    z-index: -1;
    animation: glow-pulse 15s linear infinite;
}

@keyframes huerotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes glow-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        filter: blur(100px) hue-rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.4);
        filter: blur(120px) hue-rotate(180deg);
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        filter: blur(100px) hue-rotate(360deg);
        opacity: 0.6;
    }
}

.hello-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    height: 40px; /* Fixed height to prevent jumping */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    transition: width 0.6s cubic-bezier(0.76, 0, 0.24, 1), padding 0.6s ease;
}

#greeting-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.6s ease;
    white-space: nowrap;
}

.flag-icon {
    width: 24px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slide-out {
    transform: translateY(-100%);
    opacity: 0;
}

.slide-in {
    animation: slide-in-bottom 0.6s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes slide-in-bottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero-center h1 {
    font-size: 4.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.hero-scroll-btn-wrapper {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-self: flex-end;
    margin-bottom: 2rem;
}

.scroll-btn {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
}

.scroll-text-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: rotate 15s linear infinite;
}

.scroll-text-svg text {
    fill: var(--text-secondary);
    font-size: 15px;
    font-family: monospace;
    letter-spacing: 2px;
}

.scroll-arrow {
    font-size: 1.5rem;
    font-weight: 300;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}


/* --- Grid Below Hero --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 1.5rem;
    grid-auto-rows: minmax(300px, auto);
    margin: 4rem 0;
}

/* About Me Section */
.about-card {
    grid-column: span 3;
    background: linear-gradient(135deg, #111111 20%, #200000 100%);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    overflow: hidden; /* Ensure bottom image doesn't overflow rounded card borders */
}

.about-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.about-content .subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.about-text-column {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.about-photo {
    width: 320px;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: -2rem; /* Pull down exactly to parent edge */
    margin-right: -1rem;  /* Nudge closer to right edge */
    display: flex;
    align-items: flex-end;
    z-index: 2;
}

.about-photo img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    object-position: bottom;
    transition: transform 0.3s ease;
}

.about-card:hover .about-photo img {
    transform: scale(1.05);
}

/* Certificates Card */
.certificates-card {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
}

.certificates-card h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.cert-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cert-list li {
    display: flex;
    flex-direction: column;
}

.cert-list .year {
    font-size: 0.8rem;
    color: var(--accent-red);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.cert-list p {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.3;
}


/* Projects Section Wrapper */
.projects-wrapper {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.section-title {
    font-size: 2.5rem;
    padding-left: 0.5rem;
}

.projects-inner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1.5rem;
}

/* Project Cards */
.project-card {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    cursor: pointer;
    overflow: hidden;
}

.project-mockup {
    background: #2a2a2a;
    border-radius: var(--border-radius-md);
    height: 200px;
    margin-bottom: 1rem;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* Relaxo mockup styling */
.relaxo-mockup {
    background: #e0f2e9; 
}
.relaxo-mockup img {
    width: 80%;
    height: auto;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}

/* Sync/Kinnect phone mockup */
.synchealth-mockup, .kinnect-mockup {
    background: #f0f0f0;
    align-items: center;
}

.phone-mockup {
    height: 80%;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.project-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.project-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.project-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}


/* Experience / Timeline Card */
.experience-card {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
}

.experience-card h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 4px;
    width: 2px;
    height: 100%;
    background: var(--card-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-primary);
    border: 2px solid var(--card-bg);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--accent-red);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.timeline-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.timeline-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}


/* Contact Call to Action */
.contact-card {
    grid-column: span 4;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(255, 51, 51, 0.1) 0%, var(--card-bg) 100%);
    gap: 2rem;
}

.contact-content {
    flex: 2;
}

.contact-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.contact-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.contact-action {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.primary-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--text-primary);
    color: var(--bg-color);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 3rem;
    transition: transform 0.3s ease, background 0.3s ease;
}

.primary-btn:hover {
    transform: scale(1.05);
    background: var(--accent-red);
    color: var(--text-primary);
}


/* Media Queries */
@media (max-width: 1024px) {
    .hero-center h1 {
        font-size: 3.5rem;
    }
    
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-card, .experience-card, .projects-wrapper {
        grid-column: span 2;
    }
    
    .projects-inner-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-text-left, .hero-scroll-btn-wrapper {
        align-self: center;
        text-align: center;
        max-width: 100%;
    }
    
    .hero-center h1 {
        font-size: 2.5rem;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .about-card {
        flex-direction: column;
        text-align: center;
    }
    
    .about-photo {
        width: 100%;
        margin-bottom: -2rem; /* Still touch bottom on mobile */
        margin-right: 0;
    }

    .about-photo img {
        max-height: 250px;
        margin: 0 auto;
    }

    .about-card, .certificates-card, .project-card, .experience-card, .projects-wrapper {
        grid-column: span 1;
    }
    
    .projects-inner-grid {
        grid-template-columns: 1fr;
    }

    .contact-card {
        flex-direction: column;
        text-align: center;
        padding: 3rem 1.5rem;
    }
    
    .contact-content h2 {
        font-size: 2.2rem;
    }

    .contact-action {
        justify-content: center;
        width: 100%;
        margin-top: 1rem;
    }
}

/* Footer Styling */
.site-footer {
    width: 100%;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: center;
}

.footer-content {
    max-width: 1400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-left p {
    font-size: 0.8rem;
    opacity: 0.6;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 2rem;
        align-items: flex-end;
    }

    .footer-left {
        align-items: flex-start;
    }
}
