/* Sayub Shakya - Pro Max CV Design System */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Premium Clean */
    --bg-body: #ffffff;
    --bg-paper: #ffffff;
    --text-primary: #09090B;
    --text-secondary: #3D3F43;
    /* Requested dark gray tone */
    --text-tertiary: #71717A;
    --accent-primary: #2563EB;
    --accent-primary-rgb: 37, 99, 235;
    --accent-hover: #1D4ED8;
    --accent-soft: #EFF6FF;
    --border-light: #E4E4E7;

    /* Spacing System */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;

    /* Typography */
    --font-heading: 'Archivo', sans-serif;
    --font-body: 'Poppins', serif;
    --font-sans: 'Poppins', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Effects */
    --shadow-sm: none;
    --shadow-md: none;
    --radius-sm: 4px;
    --radius-md: 6px;

    /* Animation Timing */
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides - Unified Neutral Charcoal */
body.dark-mode {
    --bg-body: rgb(18, 18, 18);
    --bg-paper: rgb(18, 18, 18);
    --text-primary: rgb(245, 245, 245);
    /* Brighter white for impact */
    --text-secondary: rgb(200, 200, 200);
    /* Brighter gray for readability */
    --text-tertiary: rgb(160, 160, 160);
    /* Brighter slate for section titles */
    --border-light: rgba(255, 255, 255, 0.15);
    --accent-primary: #60a5fa;
    /* Brighter blue for dark mode visibility */
    --accent-hover: #3b82f6;
    --accent-soft: rgba(96, 165, 250, 0.1);
}

/* Scroll Reveal Initial State */
section,
.section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.visible,
.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Top-Right Unified Controls */
.floating-controls {
    position: fixed;
    top: 25px;
    right: 30px;
    display: flex;
    flex-direction: row;
    /* Grouped together as requested */
    gap: 12px;
    z-index: 10000;
}

.control-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #2563EB;
    /* Premium blue from screenshot */
    color: white;
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#theme-toggle i {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#theme-toggle:active i {
    transform: scale(0.8) rotate(-90deg);
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
}

/* Specific icon animation for theme toggle */
body.dark-mode #theme-toggle i {
    transform: rotate(360deg);
}

@media print {
    .floating-controls {
        display: none;
    }
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    font-weight: 400;
    text-align: justify;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* The Container - Clean Document Aesthetic */
.container {
    max-width: 1080px;
    margin: 0 auto;
    background: var(--bg-paper);
    padding: var(--space-8) var(--space-4);
    border-radius: 0;
    box-shadow: none;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: var(--space-8);
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .container {
        padding: var(--space-12) 0;
    }
}

/* =========================================
   HEADER SECTION - The "Hook"
   ========================================= */
.cv-header {
    border-bottom: 2px solid var(--border-light);
    padding-bottom: var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-left {
    flex: 2;
    padding-right: var(--space-8);
}

/* Name - Massive Design Statement */
.cv-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

/* Job Title - Code Aesthetic */
.job-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
    display: inline-block;
    background: var(--accent-soft);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

/* The "10-Second Scan" Bar */
.core-tech-bar {
    display: flex;
    gap: var(--space-4);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.core-tech-item {
    position: relative;
    padding-right: var(--space-4);
}

/* Separator dot trick */
.core-tech-item:not(:last-child)::after {
    content: "•";
    position: absolute;
    right: 0;
    color: var(--accent-primary);
}

.summary {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 650px;
    line-height: 1.7;
}

.header-right {
    text-align: left;
    /* Text aligns left relative to itself */
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-end;
    /* Align the block to the right side of header */
}

/* Ensure individual items are flex containers to align icon and text */
.header-right a,
.header-right span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    justify-content: flex-start;
    /* Ensure items start from left */
    width: 100%;
    /* Take full width for consistent alignment */
}

.header-right a:hover {
    color: var(--accent-primary);
}

.contact-icon {
    width: 20px;
    text-align: center;
    color: var(--accent-primary);
    margin-right: 4px;
    /* Space between icon and text */
    margin-left: 0;
}


/* =========================================
   MAIN LAYOUT - Grid System
   ========================================= */
.main-content {
    display: block;
    /* Section wrapping */
}

/* Two-column layout wrapper */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

/* Ensure Projects Grid spans correctly */
.projects-section {
    margin-top: var(--space-8);
}

/* Generic Section Styling */
.section {
    margin-bottom: var(--space-8);
}

.section-title {
    font-family: var(--font-heading) !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.12em !important;
    font-weight: 700 !important;
    color: var(--text-tertiary) !important;
    /* Unified Slate Gray */
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}


.section-title i {
    color: var(--accent-primary);
}

/* Horizontal line under section title as seen in reference */
.content-separator {
    width: 100%;
    height: 1.5px;
    background-color: var(--text-primary);
    margin-top: 4px;
    /* Fix: Remove negative margin that caused clumping glitches */
    margin-bottom: var(--space-6);
    opacity: 0.1;
}


/* =========================================
   SIDEBAR (Skills, Education)
   ========================================= */
.skill-category {
    margin-bottom: var(--space-6);
}

.skill-category h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.skills-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.skill-tag {
    font-size: 0.8rem;
    padding: 5px 14px;
    border-radius: 99px;
    background: var(--bg-paper);
    border: 1.5px solid var(--text-primary);
    color: var(--text-secondary);
    font-weight: 700;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.skill-tag:hover {
    background: var(--accent-primary);
    color: white !important;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.skill-tag.highlight {
    border-color: var(--accent-primary);
}

/* Hover Effect - Lift */
.skill-tag:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

/* Highlight Skills - The "Must sees" */
.skill-tag.highlight {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

.skill-tag.highlight:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}


/* =========================================
   MAIN COLUMN (Experience, Projects)
   ========================================= */


/* Timeline - Modern Vertical Line */
.timeline {
    border-left: 2px solid var(--border-light);
    padding-left: var(--space-6);
    margin-left: var(--space-2);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-6);
}

/* Custom Node */
.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(var(--space-6) * -1 - 6px);
    /* Align perfectly on line */
    top: 6px;
    /* Align with Role text cap-height roughly */
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    /* Dark dot as in reference */
    border-radius: 50%;
    z-index: 2;
    transition: transform 0.2s;
}

.timeline-item:hover::before {
    transform: scale(1.4);
    background: var(--accent-primary);
}

/* Experience Typography - Stacked Visual Hierarchy */
.role {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 2px;
}

.company {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    /* Dark grey */
    margin-bottom: 2px;
}

.date {
    font-family: var(--font-sans);
    /* Use main font, italicized */
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    /* Lighter grey */
}


/* Experience Bullet Points */
.experience-bullets {
    list-style: none;
    margin-top: var(--space-3);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.experience-bullets li {
    position: relative;
    padding-left: var(--space-4);
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    transition: var(--transition-base);
}

.experience-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 5px;
    height: 5px;
    background: var(--accent-primary);
    border-radius: 1px;
    transform: rotate(45deg);
    opacity: 0.7;
}

.experience-bullets li:hover {
    color: var(--text-primary);
    transform: translateX(3px);
}

.experience-bullets li strong {
    color: var(--text-primary);
    font-weight: 600;
}

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

/* Professional Summary - Compact Modern Design */
.summary-list ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-2) var(--space-8);
    list-style-type: none;
    padding: var(--space-2) 0;
}

.summary-list li {
    position: relative;
    padding: var(--space-1) var(--space-2);
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.4;
    border-radius: 4px;
    background: transparent;
    transition: var(--transition-base);
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
}

/* Premium Indicator Bullet */
.summary-list li::before {
    content: '';
    min-width: 6px;
    height: 6px;
    margin-top: 6px;
    background: var(--accent-primary);
    border-radius: 1px;
    transform: rotate(45deg);
    flex-shrink: 0;
    opacity: 0.7;
}

.summary-list li:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
    transform: translateX(4px);
}

@media (max-width: 1024px) {
    .summary-list ul {
        grid-template-columns: 1fr;
    }
}



.desc strong {
    color: var(--text-primary);
    font-weight: 600;
}


/* =========================================
   PROJECTS - "Card" Design
   ========================================= */
/* Key Projects - Exact Image Replica + Pro Max Polish */
.projects-section .section-title {
    display: block;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-tertiary);
    /* Unified Slate Gray */
    margin-bottom: 8px;
    font-family: var(--font-heading);
    letter-spacing: 0.1em;
}

.projects-section .content-separator {
    height: 1.5px;
    background: var(--text-primary);
    margin-top: 0;
    /* Fix: Remove the inherited negative margin causing the strikethrough glitch */
    margin-bottom: 30px;
    opacity: 1;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-paper);
    border: 2px solid var(--text-primary);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    height: 100%;
}

.project-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 25px -5px rgba(var(--accent-primary-rgb), 0.1);
    transform: translateY(-4px);
}

.description.text-sm {
    font-family: 'Poppins', serif;
    font-size: 14px;
    color: var(--text-secondary);
}

.project-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    gap: 8px;
    background: var(--bg-paper);
    border-bottom: 2px solid var(--text-primary);
}

.project-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.title-separator {
    width: 60%;
    height: 1px;
    background: var(--border-light);
}

.project-subtitle {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-tertiary);
    text-align: center;
}

.project-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-desc {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-secondary);
    /* #3D3F43 */
    line-height: 1.6;
    text-align: justify;
}

.project-stack {
    display: flex;
    gap: 12px 8px;
    /* Fix: Vertical row-gap for wrapped tags to prevent clumping */
    flex-wrap: wrap;
    justify-content: flex-start;
}

.mini-tag {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-body);
    padding: 4px 14px;
    border-radius: 50px;
    border: 2px solid var(--text-primary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mini-tag:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}


/* =========================================
   PRINT OPTIMIZATION - Clean & One Page if possible
   ========================================= */
@media print {
    body {
        background: white;
        font-size: 13px;
    }

    .container {
        box-shadow: none;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: none;
    }

    .main-content {
        gap: 30px;
    }

    .timeline {
        border-color: #ccc;
    }

    .project-card {
        border: 1px solid #eee;
        break-inside: avoid;
    }

    .no-print {
        display: none;
    }
}

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .container {
        padding: var(--space-6);
        margin: 0;
        border-radius: 0;
    }

    .cv-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .cv-header h1 {
        font-size: 2.2rem;
    }

    .header-left {
        padding-right: 0;
        margin-bottom: var(--space-4);
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .header-right {
        text-align: center;
        align-items: center;
        width: 100%;
    }

    .header-right a,
    .header-right span {
        justify-content: center;
    }

    /* Stack the split layout on mobile */
    .split-layout {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Grouped buttons to bottom-right for thumb reach */
    .floating-controls {
        top: auto;
        bottom: 25px;
        right: 25px;
        background: var(--bg-paper);
        padding: 4px;
        border-radius: 30px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        border: 1px solid var(--border-light);
    }

    .control-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}