:root {
    /* Dark Mode (Default) */
    --bg-green-dark: #1e392a;
    --bg-green-gradient: linear-gradient(135deg, #2d553f 0%, #1e392a 100%);
    --text-mint: #a5ffce;
    --text-white: #ffffff;
    --text-dim: #8b9d93;

    --card-purple-bg: #d8a4eb;
    --card-teal-bg: #9ce0d6;
    --text-dark: #1a202c;

    --nav-bg: rgba(30, 57, 42, 0.6);
    --nav-border: rgba(165, 255, 206, 0.1);

    --footer-bg: #15291f;

    --sparkle-color: #ffffff;
    --tick-bg: rgba(255, 255, 255, 0.1);
    --tick-bg-tall: rgba(255, 255, 255, 0.25);

    --font-heading: 'Orelo SemiWide', serif;
    --font-body: 'DM Sans', sans-serif;
}

[data-theme="light"] {
    --bg-green-dark: #f0fdf4;
    --bg-green-gradient: linear-gradient(135deg, #ffffff 0%, #dcfce7 100%);
    --text-mint: #15803d;
    --text-white: #1a2a22;
    --text-dim: #374151;

    --card-purple-bg: #e9d5ff;
    --card-teal-bg: #ccfbf1;

    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-border: rgba(21, 128, 61, 0.2);

    --footer-bg: #dcfce7;

    --sparkle-color: #166534;
    --tick-bg: rgba(22, 101, 52, 0.2);
    --tick-bg-tall: rgba(22, 101, 52, 0.4);
}

body {
    transition: background-color 0.5s ease, color 0.5s ease;
}

.sparkle {
    color: var(--sparkle-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-green-dark);
    color: var(--text-white);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Nav */
.floating-nav {
    position: fixed;
    top: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 100;
}

.nav-pill-container {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--nav-border);
    padding: 8px 12px;
    border-radius: 50px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-item {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: 0.2s;
}

.nav-item:hover {
    color: var(--text-mint);
}


.nav-item.active {
    background: rgba(165, 255, 206, 0.15);
    /* Slightly more subtle background */
    color: var(--text-mint);
    font-weight: 500;
}

.nav-item .slash {
    opacity: 0.8;
    margin-left: 5px;
    color: var(--text-white);
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.5);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Nav Active Override for Light Mode */
[data-theme="light"] .nav-item.active {
    background: rgba(21, 128, 61, 0.15);
    color: #15803d;
    box-shadow: none;
    border: 1px solid rgba(21, 128, 61, 0.2);
}

[data-theme="light"] .nav-item .slash {
    color: #1a2a22;
    opacity: 0.6;
}

/* Hero */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--bg-green-gradient);
    text-align: center;
    padding: 160px 20px 100px;
    /* Increased to 160px top padding */
}

.hero-content {
    position: relative;
    max-width: 1000px;
    z-index: 10;
}

.hero-content h1 {
    font-family: var(--font-body);
    font-size: clamp(3rem, 10vw, 5rem);
    /* Responsive scaling */
    line-height: 1;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-white);
    /* Changed from mint to white */
    letter-spacing: -3px;
}

.hero-content h1 .highlight-text {
    display: block;
    color: var(--text-mint);
    /* Same color, just big block */
}

/* Sparkles */
.sparkle {
    position: absolute;
    width: 80px;
    height: 80px;
    color: var(--sparkle-color);
    animation: spin 10s linear infinite;
    z-index: 1;
    pointer-events: none;
}

.s-left {
    top: -40px;
    left: -120px;
}

.s-right {
    bottom: -40px;
    right: -120px;
    width: 60px;
    height: 60px;
}

@media (max-width: 1200px) {
    .s-left {
        left: -40px;
        opacity: 0.5;
    }

    .s-right {
        right: -40px;
        opacity: 0.5;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-white);
    max-width: 500px;
    margin: 0 auto 40px;
    /* Added spacing for button */
    line-height: 1.6;
    opacity: 0.9;
}

.hero-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(165, 255, 206, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(165, 255, 206, 0.03) 0%, transparent 50%);
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
}

/* Interactive Resume Button */
.hero-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.resume-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 16px 32px;
    background: var(--text-mint);
    color: var(--bg-green-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.resume-btn:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 30px rgba(165, 255, 206, 0.3);
    background: #ffffff;
    color: #1e392a;
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.resume-btn:hover .btn-icon {
    transform: translateY(3px);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease;
    z-index: -1;
}

.resume-btn:hover .btn-glow {
    transform: translate(-50%, -50%) scale(1);
}

/* Smooth Parallax Transition Classes */
body {
    transition: background-color 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.parallax-item {
    transition: transform 0.15s cubic-bezier(0.2, 0.49, 0.32, 0.99), filter 0.6s ease, opacity 0.6s ease;
    will-change: transform, filter, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Cards Section */
.work-section {
    padding: 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.card {
    border-radius: 30px;
    overflow: hidden;
    height: 600px;
    position: relative;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
}

.card-purple {
    background-color: var(--card-purple-bg);
}

.card-teal {
    background-color: var(--card-teal-bg);
}

.card-header {
    padding: 40px;
    color: var(--text-dark);
}

.company-label {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.6;
    display: block;
    margin-bottom: 10px;
}

.card-header h2 {
    font-family: serif;
    /* Trying to match the 'Articles' serif font in Ref */
    font-size: 3rem;
    font-weight: 400;
}

/* Visuals inside Cards */
.card-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Optimized for scrollable content */
    padding: 0 40px 40px;
    min-height: 0;
    /* Necessary for flexbox scrolling */
}

/* Mockup Window */
.mockup-window {
    background: #0f172a;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    font-family: monospace;
}

.window-header {
    background: #1e293b;
    padding: 10px 15px;
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.window-content {
    padding: 20px;
    color: #abb2bf;
    line-height: 1.6;
}

.keyword {
    color: #c678dd;
}

.class-name {
    color: #e5c07b;
}

.var {
    color: #e06c75;
}

.string {
    color: #98c379;
}

.ai-assist-badge {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 0.9rem;
}

/* Cert Stack */
.cert-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.cert-item {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.cert-item i {
    font-size: 2rem;
}

.cert-azure i {
    color: #00a4ef;
}

.cert-aws i {
    color: #ff9900;
}

.cert-item h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.cert-item .status {
    background: #d1fae5;
    color: #047857;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}


/* About Section */
.details-section {
    padding: 80px 20px;
    background: var(--bg-green-dark);
}

.section-heading {
    font-size: 2.5rem;
    color: var(--text-white);
    margin-bottom: 50px;
    font-family: var(--font-heading);
    position: relative;
    display: inline-block;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--text-mint);
    border-radius: 2px;
}

.section-heading.centered {
    display: block;
    text-align: center;
}

.section-heading.centered::after {
    left: 50%;
    transform: translateX(-50%);
}

.about-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Parallax Utilities */
.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-item {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.about-text {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(165, 255, 206, 0.05);
    padding: 60px;
    border-radius: 40px;
    text-align: left;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}


.about-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-white);
    margin-bottom: 25px;
    opacity: 0.85;
    font-weight: 400;
}

.about-text p strong {
    color: var(--text-mint);
    font-weight: 600;
}

.skills-marquee {
    overflow: hidden;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 15px 0;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.skills-track {
    display: flex;
    gap: 25px;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.skills-track.reverse {
    animation: scroll-reverse 40s linear infinite;
}

.skills-track:hover {
    animation-play-state: paused;
}

.skill-pill {
    background: rgba(165, 255, 206, 0.05);
    border: 1px solid rgba(165, 255, 206, 0.1);
    color: var(--text-white);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    /* Stronger shadow */
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 12.5px));
    }
}

@keyframes scroll-reverse {
    0% {
        transform: translateX(calc(-50% - 12.5px));
    }

    100% {
        transform: translateX(0);
    }
}

.skill-pill i {
    font-size: 1.4rem;
    color: var(--text-mint);
    filter: drop-shadow(0 0 5px rgba(165, 255, 206, 0.3));
}

.skill-pill:hover {
    background: rgba(165, 255, 206, 0.15);
    border-color: var(--text-mint);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}


/* Footer */
footer {
    background: var(--bg-green-dark);
    /* Uniform background */
    padding: 120px 40px 60px;
    /* More breathing room top */
    color: var(--text-dim);
    transition: background-color 0.5s ease;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto 60px;
    align-items: flex-start;
}

.footer-left {
    display: flex;
    align-items: center;
}

.copyright {
    font-size: 1.1rem;
    color: var(--text-white);
    opacity: 0.9;
}

.bullet {
    margin: 0 10px;
    color: var(--text-mint);
}

.footer-right {
    display: flex;
    gap: 100px;
    /* Space between Elsewhere and Contact */
}

.footer-column h4 {
    color: var(--text-mint);
    margin-bottom: 20px;
    font-size: 0.95rem;
    /* Smaller like reference */
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.footer-column a {
    display: block;
    color: var(--text-white);
    opacity: 0.6;
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 1rem;
    transition: 0.2s ease;
}

[data-theme="light"] .footer-column a {
    opacity: 0.95;
    font-weight: 500;
}

[data-theme="light"] .copyright {
    opacity: 1;
}

.footer-column a:hover {
    opacity: 1;
    color: var(--text-mint);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.theme-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--text-mint);
    border: none;
    color: var(--bg-green-dark);
    font-size: 1.5rem;
    cursor: pointer;
    margin-bottom: 40px;
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

.ruler-line {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid rgba(165, 255, 206, 0.1);
}

[data-theme="light"] .ruler-line {
    border-bottom: 1px solid rgba(21, 128, 61, 0.1);
}

/* Scrollable Window Content */
.window-content.scrollable {
    overflow-y: auto;
    max-height: 400px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.job-entry {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.job-entry:last-child {
    border-bottom: none;
}

.job-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #e5c07b;
}

.highlight-purple {
    color: #c678dd;
}

.job-date {
    font-size: 0.85rem;
    color: #5c6370;
    margin-bottom: 10px;
    font-family: monospace;
}

.job-entry ul {
    list-style: none;
    padding-left: 10px;
}

.job-entry li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 8px;
    color: #abb2bf;
    font-size: 0.95rem;
}

.job-entry li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #98c379;
}

/* Cert Chips & Projects */
.combined-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 100%;
    /* Use all available space in the card */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px;
    /* More space for scrollbar */
}

.combined-stack::-webkit-scrollbar {
    width: 4px;
}

.combined-stack::-webkit-scrollbar-track {
    background: transparent;
}

.combined-stack::-webkit-scrollbar-thumb {
    background: rgba(165, 255, 206, 0.2);
    border-radius: 10px;
}

.combined-stack::-webkit-scrollbar-thumb:hover {
    background: rgba(165, 255, 206, 0.4);
}

.combined-stack {
    scrollbar-width: thin;
    scrollbar-color: rgba(165, 255, 206, 0.2) transparent;
}

.cert-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 10px;
}

.certification-card {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.certification-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.cert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.certification-card i {
    font-size: 1.8rem;
}

.p-azure i {
    color: #00a4ef;
}

.p-aws i {
    color: #ff9900;
}

.cert-status {
    font-size: 0.6rem;
    font-weight: 800;
    color: #047857;
    background: #d1fae5;
    padding: 4px 10px;
    border-radius: 50px;
    letter-spacing: 1px;
}

.certification-card h3 {
    font-size: 1.1rem;
    color: #1a202c;
    margin-bottom: 4px;
    font-weight: 700;
}

.certification-card p {
    font-size: 0.85rem;
    color: #718096;
    margin: 0;
}

.project-mini-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-item {
    background: rgba(255, 255, 255, 0.4);
    padding: 15px;
    border-radius: 12px;
    transition: 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(5px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.project-item h4 {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: #1a202c;
    font-weight: 700;
}

.badge {
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 40px;
    text-transform: uppercase;
    font-weight: 700;
    color: #1a202c;
}

.project-item p {
    font-size: 0.8rem;
    color: #2d3748;
    line-height: 1.4;
}

/* Competencies Section */
.competencies-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.comp-box {
    background: rgba(0, 0, 0, 0.03);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.comp-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #1a202c;
    opacity: 0.5;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

.comp-box p {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.tick {
    width: 1.5px;
    background: var(--tick-bg);
    transform-origin: bottom;
    transition: 0.2s;
}

.tick:hover {
    background: var(--text-mint);
    transform: scaleY(1.5);
}

.tick.tall {
    height: 25px;
    background: var(--tick-bg-tall);
}

.tick.short {
    height: 12px;
}

/* --- Mobile Responsiveness & Performance Optimizations --- */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: 1fr;
        padding: 40px 20px;
        gap: 30px;
    }

    .card {
        height: auto;
        min-height: 550px;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 3.2rem;
        letter-spacing: -1.5px;
        padding: 0 15px;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        padding: 0 20px;
        margin-bottom: 30px;
    }

    .resume-btn {
        padding: 14px 28px;
        font-size: 1rem;
    }

    .section-heading {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .about-text {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .about-text p {
        font-size: 1.05rem;
    }

    .skills-marquee {
        padding: 10px 0;
        mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    }

    .skill-pill {
        padding: 10px 20px;
        font-size: 0.9rem;
        gap: 8px;
    }

    .footer-content {
        flex-direction: column;
        gap: 50px;
        text-align: center;
        align-items: center;
    }

    .footer-right {
        justify-content: center;
        width: 100%;
        gap: 40px;
    }

    .floating-nav {
        top: auto;
        bottom: 15px;
        width: 92%;
        left: 50%;
        transform: translateX(-50%);
    }

    .nav-pill-container {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .sparkle {
        width: 32px;
        height: 32px;
        opacity: 0.6;
    }

    .s-left {
        top: -20px;
        left: 10px;
    }

    .s-right {
        bottom: -20px;
        right: 10px;
    }

    .theme-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 25px;
        margin-right: 15px;
    }

    .ruler-line {
        display: none;
    }

    /* Prevent overflow issues */
    body,
    html {
        overflow-x: hidden;
    }
}

/* Performance: Disable complex hover animations on touch devices */
@media (hover: none) {

    .card:hover,
    .skill-pill:hover,
    .resume-btn:hover,
    .certification-card:hover,
    .project-item:hover {
        transform: none !important;
        box-shadow: inherit !important;
        background: inherit !important;
    }
}