:root {
    /* Color Palette - Dark Agentic AI */
    --bg-color: #020617;
    /* Deep Slate 950 */
    --bg-secondary: #0f172a;
    /* Slate 900 */
    --card-bg: rgba(2, 6, 23, 0.7);
    /* Darker Glassmorphism */
    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */

    /* Vibrancy & Accents - Electric AI */
    --accent-primary: #3b82f6;
    /* Blue 500 */
    --accent-cyan: #06b6d4;
    /* Cyan 500 */
    --accent-magenta: #ec4899;
    /* Pink 500 */
    --accent-secondary: #8b5cf6;
    /* Violet 500 */

    /* Gradients & Glows */
    --gradient-primary: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan), var(--accent-magenta));
    --gradient-text: linear-gradient(to right, #60a5fa, #22d3ee, #f472b6);
    --gradient-border: linear-gradient(45deg, var(--accent-primary), var(--accent-magenta));
    --neon-glow: 0 0 10px rgba(6, 182, 212, 0.5), 0 0 20px rgba(236, 72, 153, 0.3);

    /* Typography */
    --font-heading: 'Clash Display', 'Cabinet Grotesk', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Layout */
    --nav-height: 80px;
    --border-radius: 16px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08), transparent 25%);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    perspective: 1000px;
}

/* Canvas Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

/* Typography & Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-weight: 600;
}

h1 {
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(2, 6, 23, 0.85);
    /* Darker, fuller opacity */
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    padding: 0;
    /* Reset previous padding if any */
}

.navbar.scrolled {
    background: rgba(2, 6, 23, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    position: relative;
}

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

.logo span {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
    position: relative;
}

.nav-links li a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
    font-family: var(--font-body);
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Active Line Indicator */
.nav-active-line {
    position: absolute;
    bottom: -2px;
    left: 0;
    height: 2px;
    background: var(--gradient-primary);
    box-shadow: var(--neon-glow);
    transition: var(--transition);
    border-radius: 2px;
    pointer-events: none;
}

/* AI Icon Button */
.ai-assistant-btn {
    background: transparent;
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-cyan);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.ai-assistant-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    box-shadow: var(--neon-glow);
    border-color: var(--accent-primary);
    transform: rotate(15deg);
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 1001;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: var(--neon-glow);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 0;
    /* Centered vertically */
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 6rem;
    align-items: center;
}

.greeting {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: inline-block;
    color: var(--accent-primary);
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
}

.greeting::after {
    content: '|';
    color: var(--accent-cyan);
    animation: blink 1s step-end infinite;
    margin-left: 4px;
}

.greeting.typing-done::after {
    content: '';
    /* Remove cursor after typing is done, or animate it out */
    animation: blink 1s step-end 3 forwards;
    /* Actually better to just hide it or keep blinking? User said: "blink a few times and disappear" */
    display: none;
    /* Simple hiding */
}

/* Better approach for "blink a few times and disappear" */
@keyframes blinkAndVanish {

    0%,
    20%,
    40%,
    60%,
    80% {
        opacity: 1;
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        opacity: 0;
    }

    100% {
        opacity: 0;
        display: none;
    }
}

.greeting.typing-done::after {
    animation: blinkAndVanish 2s linear forwards;
    display: inline-block;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.name {
    font-size: 5.5rem;
    /* Larger */
    line-height: 1;
    margin-bottom: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 50%, #94a3b8 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.04em;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.headline {
    font-size: 1.6rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 300;
    max-width: 90%;
}

.bio {
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 1.8;
}

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

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
    border-radius: 50%;
}

.social-btn:hover {
    color: white;
    transform: translateY(-5px);
    border-color: transparent;
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.4);
}

.social-btn:hover::before {
    opacity: 1;
}

.hero-image {
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.img-wrapper {
    width: 420px;
    height: 420px;
    border-radius: 40px;
    /* Softer radius */
    overflow: hidden;
    position: relative;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Subtle border ring */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
}

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

.img-wrapper:hover img {
    transform: scale(1.03);
}

/* Floating Animation */
.floating {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.02);
        /* Breathing effect */
    }
}

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

.achievement-card {
    position: relative;
    /* For tilt effect context */
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 20px;
    background: var(--card-bg);
    border: none;
    /* No border for minimalism */
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.achievement-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(139, 92, 246, 0.15);
    /* Violet glow */
    background: rgba(30, 41, 59, 0.5);
}

.achievement-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
}

.achievement-card:hover .achievement-icon {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.achievement-info h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-family: var(--font-heading);
}

.achievement-info .subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.achievement-info .year {
    font-size: 0.8rem;
    color: var(--accent-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-top: 0.6rem;
}

/* Cards & Sections */
section {
    padding: 10rem 0;
    /* More breathing room */
    position: relative;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    /* Center titles for elegance */
}

/* Base Card Style */
.card {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 24px;
    border: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card:hover {
    transform: translateY(-8px);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

/* Subtle gradient borders using ::before */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Timeline & Education */
.timeline {
    border-left: 2px dashed rgba(139, 92, 246, 0.2);
    padding-left: 3rem;
    position: relative;
    margin-left: 1rem;
}

.timeline::before {
    display: none;
}

/* Remove old gradient line if present */

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

.timeline-dot {
    position: absolute;
    left: -3.8rem;
    /* Adjusted for new padding/border */
    top: 0.2rem;
    width: 24px;
    height: 24px;
    background: var(--bg-color);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    transition: var(--transition);
    z-index: 2;
}

.timeline-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.15);
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.timeline-item:hover .timeline-dot::after {
    opacity: 1;
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.education-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.education-card:hover {
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

.education-card h3 {
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

/* Projects & Skills */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    /* Wider cards */
    gap: 3rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Usage of base .card styles expected in HTML, specific overrides here */
    background: rgba(15, 23, 42, 0.4);
    /* Slightly improved transparency */
    backdrop-filter: blur(12px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
}

.project-icon {
    font-size: 2.8rem;
    color: var(--accent-primary);
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
    transition: var(--transition);
}

.project-card:hover .project-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.5));
}

.project-card h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

.project-meta {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.language {
    color: var(--accent-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-body);
}

.skills-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.skill-tag {
    padding: 0.8rem 1.6rem;
    border-radius: 100px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: default;
    font-weight: 400;
    position: relative;
    overflow: hidden;
    /* Floating effect base */
    animation: float-tag 6s ease-in-out infinite;
}

/* Randomize float duration for cloud effect - using nth-child would be ideal if supported, 
   but simplistic approach is to just have the base animation and maybe JS offsets */
@keyframes float-tag {

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

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

.skill-tag:nth-child(even) {
    animation-duration: 5s;
    animation-delay: 0.5s;
}

.skill-tag:nth-child(3n) {
    animation-duration: 4s;
    animation-delay: 1s;
}

.skill-tag:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
    transform: translateY(-8px) scale(1.05);
    animation-play-state: paused;
}

/* Footer */
footer {
    padding: 6rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.95rem;
    background: var(--bg-color);
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-content {
        order: 2;
    }

    .hero-image {
        order: 1;
        display: flex;
        justify-content: center;
    }

    .name {
        font-size: 3rem;
    }

    .nav-links {
        display: none;
    }

    /* Mobile menu simplified for now */
    .timeline {
        border-left: none;
        padding-left: 0;
    }

    .timeline-dot {
        display: none;
    }

    .timeline-item {
        margin-bottom: 3rem;
    }
}

/* Animations Triggered by JS */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

/* 3D Tilt Class */
.tilt-card {
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

/* =========================================
   Phase 1: Global Polish & New Components
   ========================================= */

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

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

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 5px;
}

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

/* Text Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

/* Accessibility: Focus States */
:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 4px;
}

/* Back To Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: var(--glass-border);
    color: var(--accent-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 900;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--accent-primary);
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

/* Active Navigation State */
.nav-links a {
    position: relative;
}

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

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-primary);
}

/* =========================================
   Phase 2: Hero & Immersive Effects
   ========================================= */

/* Typewriter Cursor */
#typewriter {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: inline-block;
    color: var(--accent-secondary);
    border-right: 2px solid var(--accent-primary);
    white-space: nowrap;
    overflow: hidden;
    animation: blink-caret 0.75s step-end infinite;
}

#typewriter.typing-done {
    border-right: none;
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent-primary)
    }
}

/* Social Tooltips */
.social-btn[data-tooltip] {
    position: relative;
}

.social-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.social-btn[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Parallax Wrapper Override */
.parallax-target {
    /* Ensure transitions don't conflict with mousemove parallax */
    transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    /* Slightly faster/smoother for mouse following */
}

/* =========================================
   Phase 2: Components (Flip Cards & Glows)
   ========================================= */

/* Icon Pulse Glow */
.pulse-glow {
    animation: icon-pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
}

@keyframes icon-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Flip Card - Achievements */
.flip-card {
    background-color: transparent !important;
    perspective: 1000px;
    height: 320px;
    /* Increased height even more for descriptions */
    padding: 0;
    border: none;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 16px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

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

/* Front & Back Common */
.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: var(--glass-border);
    background: var(--bg-card);
    /* Ensure background is set */
}

/* Front Specific */
.card-front {
    background: rgba(15, 23, 42, 0.6);
    justify-content: flex-start;
    /* Align top for better spacing with subtitle */
    padding-top: 2rem;
}

.card-front h3 {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-front .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    padding: 0 1rem;
}

/* Back Specific */
.card-back {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
    /* Refined gradient background */
    transform: rotateY(180deg);
    gap: 1rem;
    justify-content: center;
    border: 1px solid rgba(59, 130, 246, 0.3);
    /* Subtle blue glow border */
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

.achievement-desc {
    font-size: 0.95rem;
    /* Slightly larger */
    color: #ffffff;
    /* pure white for maximum contrast */
    line-height: 1.6;
    margin-bottom: 0.8rem;
    padding: 0 1.2rem;
    text-align: center;
}

.achievement-desc b {
    color: var(--accent-secondary);
    font-weight: 600;
}

.card-back .year {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    font-weight: 600;
}

/* View Button */
.view-btn {
    margin-top: auto;
    padding: 0.5rem 1.2rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.view-btn:hover {
    background: var(--accent-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* =========================================
   Phase 3: Page Specifics
   ========================================= */

/* Certification Controls */
.cert-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    align-items: center;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-wrapper i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#cert-search {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 50px;
    background: var(--bg-card);
    border: var(--glass-border);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

#cert-search:focus {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

/* Contact Specifics */
.email-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.contact-link {
    margin-top: 0 !important;
    /* Override default margin */
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 50%;
}

.copy-btn:hover {
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.copy-btn.copied {
    color: var(--accent-secondary);
}

/* Timeline Pulse */
.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -1px;
    /* Center on border-left width */
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-primary), transparent);
    background-size: 100% 200px;
    background-repeat: no-repeat;
    animation: timeline-flow 3s linear infinite;
    opacity: 0.5;
}

@keyframes timeline-flow {
    0% {
        background-position: 0 -200px;
    }

    100% {
        background-position: 0 100%;
    }
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-secondary);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: width 0.3s, height 0.3s, background 0.3s, opacity 0.3s;
    mix-blend-mode: exclusion;
    opacity: 0;
    /* Hidden initially or on touch devices */
}

@media (pointer: fine) {
    .custom-cursor {
        opacity: 1;
    }

    /* body {
        cursor: none; 
    } Remove to ensure usability */
}

.custom-cursor.hover {
    width: 50px;
    height: 50px;
    background: rgba(6, 182, 212, 0.1);
    border-color: transparent;
}

/* =========================================
   12. Page Loader & Transitions
   ========================================= */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
    text-align: center;
    color: var(--accent-cyan);
    font-family: var(--font-heading);
}

.loader-content p {
    margin-top: 1rem;
    letter-spacing: 0.1em;
    animation: blink 1.5s infinite;
}

body.loaded #page-loader {
    opacity: 0;
    visibility: hidden;
}

/* Cert Search Focus Gradient */
#cert-search {
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    /* Flat bottom for underline effect */
}

#cert-search:focus {
    outline: none;
    border-bottom-color: var(--accent-cyan);
    box-shadow: 0 10px 20px -10px rgba(6, 182, 212, 0.2);
    background: linear-gradient(to right, rgba(6, 182, 212, 0.1), transparent);
}

/* =========================================
   13. Case Study & Writing Styles
   ========================================= */

/* Project Actions */
.project-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.case-study-btn {
    font-size: 0.85rem;
    color: var(--accent-cyan);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    transition: var(--transition);
}

.case-study-btn:hover {
    background: var(--accent-cyan);
    color: #0f172a;
    /* Dark text for contrast */
}

/* Learning & Writing Grid */
.writing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.writing-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    opacity: 1 !important;
    /* Force visibility */
    transform: none !important;
    visibility: visible !important;
    z-index: 10 !important;
    color: #ffffff !important;
}

.writing-card:hover {
    transform: translateY(-5px);
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--accent-secondary);
}

.writing-date {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-magenta);
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
}

.writing-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    font-family: var(--font-heading);
}

.writing-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.read-more {
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.read-more:hover {
    gap: 0.8rem;
    color: var(--accent-cyan);
}

/* Footer Status */
.footer-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    /* Green for active */
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* =========================================
   14. Project Detail Page Styles
   ========================================= */
.project-detail-page {
    padding-top: calc(var(--nav-height) + 2rem);
    padding-bottom: 4rem;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.1), transparent 40%);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

.back-link:hover {
    color: var(--accent-primary);
    transform: translateX(-5px);
}

.project-hero {
    text-align: center;
    margin-bottom: 4rem;
}

.project-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.4rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-title {
    font-size: 3.5rem;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.project-tagline {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

.project-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.glow-btn {
    padding: 0.8rem 2rem;
    background: var(--accent-primary);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    transition: var(--transition);
}

.glow-btn:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}

.outline-btn {
    padding: 0.8rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.outline-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.showcase-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    gap: 1rem;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.showcase-placeholder i {
    font-size: 4rem;
    color: var(--accent-secondary);
    opacity: 0.5;
}

.context-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.context-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    border-left: 3px solid var(--accent-primary);
}

.context-card h3 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.context-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.text-accent {
    color: var(--accent-magenta);
}

.text-success {
    color: var(--accent-cyan);
}

.architecture-diagram {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    text-align: center;
}

.diagram-placeholder {
    padding: 4rem 0;
    color: var(--text-secondary);
}

.diagram-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.stack-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.feature-list {
    list-style: none;
    max-width: 800px;
    margin: 2rem auto;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.feature-list li i {
    color: var(--accent-cyan);
    margin-top: 0.3rem;
}

/* Responsive adjustments for project detail */
@media (max-width: 768px) {
    .project-header h1 {
        font-size: 2.5rem;
    }

    .context-grid {
        grid-template-columns: 1fr;
    }

    .project-links {
        flex-direction: column;
        align-items: stretch;
    }

    .project-links a {
        text-align: center;
    }
}

/* =========================================
   13. Engineering Showcase Components
   ========================================= */

/* Grouped Skills Grid */
.skills-grid-grouped {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skill-group-card {
    padding: 2rem;
    height: 100%;
}

.skill-group-card h3 {
    font-family: var(--font-heading);
    color: var(--accent-primary);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    padding-bottom: 0.5rem;
}

/* Learning / Lab Card */
.learning-card {
    border: 1px solid rgba(6, 182, 212, 0.2);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(2, 6, 23, 0.9));
}

.learning-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.learning-content b {
    color: var(--accent-cyan);
}

/* Case Study Labels & Buttons */
.case-study-label {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(6, 182, 212, 0.3);
    margin-left: 1rem;
}

/* Footer Status & Pulse */
.footer-status {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.2rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    /* Emerald 500 */
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #10b981;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Project Detail Page Overrides */
.project-detail-page .project-header-hero {
    padding: 8rem 0 4rem;
    text-align: center;
}

.project-detail-page .name {
    margin-bottom: 2rem;
}

.project-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.case-study-content {
    margin: 4rem 0;
}

.mermaid {
    background: rgba(2, 6, 23, 0.5);
    padding: 2rem;
    border-radius: 16px;
    margin: 2rem 0;
    overflow-x: auto;
}

/* =========================================
   12. Liquid Glass & Article Enhancements
   ========================================= */
.article-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
}

.article-header {
    text-align: center;
    margin-bottom: 4rem;
}

.article-title {
    font-family: 'Cabinet Grotesk', sans-serif;
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.article-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.05em;
}

.liquid-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.liquid-card h2 {
    font-family: 'Cabinet Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.liquid-glass {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-container {
    width: 100%;
    margin: 3rem 0;
    aspect-ratio: 16/9;
}

.media-container iframe,
.media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.styled-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.styled-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.styled-list i {
    color: var(--accent-primary);
    width: 20px;
}

.awards-section.liquid-glass-accent {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    margin: 4rem 0;
    text-align: center;
}

.awards-section h3 {
    font-family: 'Cabinet Grotesk', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.awards-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.tech-stack-minimal {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 3rem;
    justify-content: center;
}

.tech-badge-glow {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.tech-badge-glow:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.article-footer {
    text-align: center;
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #86868b;
    font-size: 0.9rem;
}