:root {
    /* Color Palette - Arcane Formal (Navy & Gold) */
    --bg-primary: #f8f9fa;
    /* Cultured White (Cooler, clean) */
    --bg-secondary: #e9ecef;
    /* Light Grey/Blue Tint */
    --bg-tertiary: #ffffff;
    /* Pure White */

    --accent-gold: #b08d55;
    /* Antique Gold (Muted, formal) */
    --accent-gold-dim: #d4af37;
    /* Brighter gold for highlights */
    --accent-primary: #1a252f;
    /* Deep Navy (The new formal dark) */
    --accent-primary-light: #2c3e50;
    /* Slate Blue */

    --text-primary: #1a252f;
    /* Dark Navy Text */
    --text-secondary: #546e7a;
    /* Blue Grey */
    --text-muted: #78909c;

    --glow-gold: 0 0 15px rgba(176, 141, 85, 0.2);
    --glow-blue: 0 0 15px rgba(44, 62, 80, 0.1);

    /* Fonts */
    --font-heading: 'Cinzel', serif;
    --font-subheading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;

    /* Spacing */
    --section-padding: 5rem 2rem;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    /* "Snappy" scrolling */
}

/* Ensure sections snap to start */
section,
footer {
    scroll-snap-align: start;
    scroll-margin-top: 2rem;
    /* Little buffer */
}

body {
    /* Base: Light Theme Gradient */
    background: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s ease;
}

/* Layer 1: Navy Curtain (Hidden by default) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    /* Behind particles (-1) */
    background-color: #0d1b2a;
    /* Navy Color */
    opacity: 0;
    transition: opacity 0.5s ease;
    /* Smooth Fade In */
    pointer-events: none;
}

/* Layer 1 Active: Fade In Navy Curtain (JS Triggered) */
body.blue-mode::before {
    opacity: 1;
}

/* --- VISUAL EFFECTS --- */

/* 1. Technical Skills Glow on Hover */
.tech-stack span {
    transition: all 0.3s ease;
    cursor: default;
}

.tech-stack span:hover {
    background: rgba(176, 141, 85, 0.2) !important;
    box-shadow: 0 0 15px var(--accent-gold);
    transform: translateY(-2px);
    border-color: var(--accent-gold) !important;
    color: var(--accent-gold) !important;
}

/* 2. Dramatic Name Hover (Blue Mode) - Handled above for Background */
/* Make the name OUTSHINE everything */

/* Make the name OUTSHINE everything */
.hero-content h1:hover {
    color: var(--accent-gold);
    /* Gold Color */
    text-shadow:
        0 0 10px var(--accent-gold),
        0 0 20px var(--accent-gold),
        0 0 40px var(--accent-gold-dim);
    transform: scale(1.05);
    transition: all 0.3s ease;
    cursor: default;
}

/* Dim everything else to focus on the name */
body:has(.hero-content h1:hover) .subtitle,
body:has(.hero-content h1:hover) .tagline,
body:has(.hero-content h1:hover) .arcane-nav,
body:has(.hero-content h1:hover) .scroll-indicator {
    opacity: 0.2;
    filter: blur(2px);
    transition: all 0.5s ease;
}

#magic-cursor {
    display: none;
    /* Disabling redundant trail */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gold-dim);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* Typography Utilities */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.glow-text {
    text-shadow: var(--glow-gold);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

/* Generic Button */
.btn {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    /* Increased side padding for pill shape */
    border: none;
    /* No visible border */
    color: var(--accent-gold);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    transition: all 0.3s ease;
    background: transparent;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-radius: 50px;
    /* Rounded Edges */
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
    box-shadow: 0 0 15px var(--accent-gold), 0 0 30px rgba(176, 141, 85, 0.4);
    /* Strong Double Glow */
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #e5c14d;
    color: var(--bg-primary);
}

/* Navigation */
.arcane-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, var(--bg-primary), rgba(255, 255, 255, 0));
    z-index: 1000;
    transition: background 0.3s ease;
}

.arcane-nav.scrolled {
    background: var(--bg-primary);
    border-bottom: 1px solid rgba(176, 141, 85, 0.2);
}

.nav-logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    /* Dark Navy for max contrast */
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    /* Slightly larger */
    font-weight: 700;
    /* Bolder */
    position: relative;
    transition: color 0.3s ease;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.nav-links a:hover {
    color: var(--accent-gold);
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 2rem;
}

/* Expandable Projects */
.project-hidden {
    display: none;
}

.project-card.fade-in {
    animation: fadeInProject 0.6s ease forwards;
}

@keyframes fadeInProject {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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


#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    z-index: -1;
    /* Background moved to body::before for smooth transition */
}



.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1.5s ease-out;
    transition: all 0.5s ease;
    /* Smooth return from hover */
}

.hero-content .subtitle {
    font-size: 1.2rem;
    font-family: var(--font-subheading);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1.5s ease-out 0.5s backwards;
}

.hero-divider {
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    margin: 0 auto 1.5rem;
}

.tagline {
    font-style: italic;
    color: var(--accent-gold);
    margin-bottom: 3rem;
    opacity: 0.8;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    animation: fadeInUp 1.5s ease-out 1s backwards;
}

/* Section Container */
.section-container {
    padding: var(--section-padding);
    max-width: 1200px;
    margin: 0 auto;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.skills-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.skills-list li {
    background: var(--bg-tertiary);
    padding: 0.8rem 1.2rem;
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.skills-list li:hover {
    border-color: var(--accent-gold);
    transform: translateX(5px);
}

.skills-list i {
    color: var(--accent-gold);
}

.profile-container {
    position: relative;
    width: 450px;
    max-width: 100%;
    /* Prevent overflow */
    aspect-ratio: 1 / 1;
    /* Crucial: maintain square shape */
    margin: 0 auto;
    display: grid;
    place-items: center;
    overflow: visible;
}

.profile-img {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    /* Double insurance for square shape */
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-gold-dim);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
    position: relative;
    z-index: 2;
}

.rune-circle-overlay {
    grid-area: 1 / 1;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    z-index: 3;
    /* ABOVE image so rings are visible */
    pointer-events: none;
    position: relative;
    /* Context for pseudo-elements */
}

/* Outer Gold Orbit */
.rune-circle-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Fill container */
    border: 2px solid rgba(176, 141, 85, 0.7);
    border-bottom-color: transparent;
    /* Gap to make rotation visible */
    border-left-color: rgba(176, 141, 85, 0.3);
    /* Fade effect */
    border-radius: 50%;

    /* A single glowing "electron" on the ring */
    box-shadow: 4px 0 15px rgba(176, 141, 85, 0.8);

    animation: spin 60s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-tertiary);
    height: 350px;
    perspective: 1000px;
    cursor: default;
    /* Handle click in JS or keep hover */
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    border: 1px solid rgba(184, 134, 11, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.project-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.card-front {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid transparent;
}

.card-front h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.card-tech {
    color: var(--accent-gold-dim);
    font-family: var(--font-subheading);
    font-style: italic;
}

.card-back {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    /* Deep Royal/Teal Blue Gradient */
    /* Actually let's go with a cleaner Royal Blue as requested */
    background: linear-gradient(135deg, #141E30, #243B55);
    /* Royal Navy */
    transform: rotateY(180deg);
    border: 1px solid var(--accent-gold);
    box-shadow: 0 0 15px rgba(176, 141, 85, 0.1);
}

.card-back p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    color: var(--accent-gold);
    /* Golden Words */
    font-weight: 500;
}

.tech-stack {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tech-stack span {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    /* White text on pills for contrast against blue */
    /* Or stick to gold? User said "Golden Words". */
    color: var(--accent-gold);
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.cert-preview {
    border: 1px solid rgba(212, 175, 55, 0.5);
    padding: 1rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    /* Keep preview light/white for the image visibility */
    width: 80%;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-small {
    padding: 0.5rem 1rem;
    background: var(--accent-gold);
    /* Solid Gold for visibility */
    color: #fff;
    /* White text */
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.btn-small:hover {
    background: var(--accent-gold-dim);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(176, 141, 85, 0.4);
}


/* AI Assistant */
.chat-interface-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chat-window {
    height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    /* Card White */
    border-radius: 4px;
}

.chat-message {
    padding: 0.8rem 1.2rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border-radius: 8px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.bot-message {
    background: #e9ecef;
    /* Light Grey */
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
    align-self: flex-start;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-message {
    background: var(--accent-primary);
    color: #fff;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
    box-shadow: 0 2px 5px rgba(26, 37, 47, 0.2);
}

.typing-indicator {
    align-self: flex-start;
    background: #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    animation: pulse 1.5s infinite;
    margin-bottom: 1rem;
    display: none;
    /* Hidden by default */
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border: 1px solid rgba(26, 37, 47, 0.1);
    border-radius: 30px;
    /* Pill shape container */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.8rem 1.2rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
}

#user-input:focus {
    outline: none;
}

#send-btn {
    background: var(--accent-gold);
    color: #fff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#send-btn:hover {
    background: var(--accent-gold-dim);
    transform: scale(1.05);
}

.example-prompts {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.prompt-chip {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-chip:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.05);
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.achievement-card {
    text-align: center;
    background: var(--bg-tertiary);
    padding: 2rem;
    border: 1px solid rgba(212, 175, 55, 0.1);
    transition: transform 0.3s;
}

.achievement-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
}

.achievement-icon {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
}

.achievement-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

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

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 4rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.footer-content h2 {
    margin-bottom: 1rem;
}

.social-links {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-btn {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.social-btn:hover {
    color: var(--accent-gold);
}

.download-resume {
    display: inline-block;
    color: var(--accent-gold);
    text-decoration: none;
    border: 1px solid var(--accent-gold);
    padding: 0.8rem 2rem;
    font-family: var(--font-heading);
    margin-bottom: 3rem;
    transition: all 0.3s;
}

.download-resume:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Experience Section Enhancements */
.experience-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* Reusing achievement-card styles but specific tweaks */
.experience-card {
    text-align: left;
    /* Override center alignment from achievement-card */
    padding: 2rem;
    border-left: 3px solid var(--accent-gold);
    position: relative;
    background: var(--bg-tertiary);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.exp-header h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 0px;
}

.exp-role {
    color: var(--accent-gold);
    font-family: var(--font-subheading);
    font-style: italic;
    font-weight: 700;
}

.exp-location {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
}

.exp-details {
    list-style: none;
    margin-top: 1rem;
}

.exp-details li {
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.exp-details li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-gold);
}

.skills-grid-container {
    background: rgba(44, 62, 80, 0.05);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    border-left: 2px solid var(--accent-primary);
}

/* Mobile tweak for experience header */
@media (max-width: 600px) {
    .exp-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .exp-role {
        margin-top: 0.5rem;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-container {
        width: 200px;
        /* Height auto + aspect-ratio from main CSS handles the circle shape */
        margin-top: 2rem;
    }

    /* Removed fixed rune-circle-overlay rules to allow dynamic % sizing from main CSS */

    .arcane-nav {
        flex-direction: column;
        padding: 1rem;
        background-color: #ffffff !important;
        background-image: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-links {
        display: flex;
        gap: 1rem;
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .target-nav-link {
        font-size: 0.8rem;
    }

    .profile-container {
        width: 200px;
        height: 200px;
        margin-top: 2rem;
    }
}

/* Image Modal (Lightbox) */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-gold);
    text-decoration: none;
    cursor: pointer;
}

.cert-preview img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cert-preview img:hover {
    transform: scale(1.02);
}