/* -----------------------------------------------------------
   SWISS BENTO GRID RESUME
----------------------------------------------------------- */
:root {
    --accent-gold: #FFD700;
    --font-serif: 'Playfair Display', serif;
    --font-family: 'Outfit', sans-serif;
}

body {
    background-color: #FAFAFA;
    margin: 0;
    font-family: var(--font-family);
}

/* Navbar (Unified) */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    /* Fix it to top */
    top: 0;
    left: 0;
}

/* -----------------------------------------------------------
   LOADING SCREEN (Copied from styles.css)
----------------------------------------------------------- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000 !important;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.2s ease-out, visibility 0.2s;
    animation: forceHide 0.5s forwards 6s;
    /* Safety net */
}

@keyframes forceHide {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    animation: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Signature Loader */
.loader-signature {
    position: relative;
    width: 250px;
    max-width: 80vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-signature img {
    width: 100%;
    height: auto;
    filter: invert(1);
    mix-blend-mode: screen;

    /* Soft Edge Ink Reveal */
    -webkit-mask-image: linear-gradient(to right, black 50%, transparent 60%);
    mask-image: linear-gradient(to right, black 50%, transparent 60%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;

    animation: signInk 2.5s ease-out forwards;
}

@keyframes signInk {
    to {
        -webkit-mask-position: 0% 0;
        mask-position: 0% 0;
    }
}

.loader-bar {
    width: 150px;
    height: 3px;
    background: transparent !important;
    overflow: hidden;
    border-radius: 2px;
    margin-top: 10px;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: #FFD700;
    /* Yellow */
    animation: loaderProgress 1.5s ease-in-out forwards;
}

@keyframes fadeUpText {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loaderProgress {
    0% {
        width: 0%;
    }

    50% {
        width: 40%;
    }

    100% {
        width: 100%;
    }
}

.bento-section {
    background-color: #FAFAFA;
    /* Clean editorial white/grey */
    display: block;
    /* Changed from flex to block to allow natural flow */
    /* Removed align-items: center to prevent vertical centering clipping */
    /* Removed justify-content: center, using margin auto on container instead */
    padding: 120px 40px 60px 40px;
    /* Offset for navbar & bottom spacing */
    min-height: 100vh;
    /* Allow scrolling */
}

.bento-container {
    width: 100%;
    max-width: 1200px;
    height: auto;
    /* Remove fixed height */
    margin: 0 auto;
    /* Center the container */
    display: flex;
    flex-direction: column;
}

/* Header */
/* Header */
.bento-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #111;
}

.header-content {
    width: 100%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 10px;
}

.header-top h1 {
    font-family: var(--font-serif);
    font-size: 3rem;
    color: #111;
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.contact-line {
    font-family: monospace;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.contact-line a {
    color: #111;
    text-decoration: none;
    border-bottom: 1px dotted #111;
    transition: color 0.2s;
}

.contact-line a:hover {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.separator {
    color: var(--accent-gold);
    font-weight: bold;
}

.profile-summary {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0;
}

/* Download Button Animation */
/* Download Button Animation */
.btn-download {
    position: relative;
    background: #111;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    width: 160px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Entrance & Pulse */
    animation:
        btnFadeIn 0.6s ease-out 0.3s backwards,
        btnPulse 3s infinite 2s;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.btn-download:active {
    transform: translateY(-1px);
}

@keyframes btnFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes btnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.btn-download .btn-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent-gold);
    /* Gold fill */
    z-index: 1;
    transition: width 1s ease-in-out;
}

.btn-download .btn-label,
.btn-download .btn-icon,
.btn-download .btn-check {
    position: relative;
    z-index: 2;
    transition: transform 0.3s, opacity 0.3s, color 0.3s;
}

.btn-download.loading .btn-progress {
    width: 100%;
}

.btn-download.loading {
    color: #000;
    /* Make text black on yellow background */
}

.btn-download.success .btn-label,
.btn-download.success .btn-icon {
    opacity: 0;
    transform: translateY(-20px);
}

.btn-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
}

.btn-download.success .btn-check {
    transform: translate(-50%, -50%) scale(1.5);
    color: #000;
    /* Ensure check is black if background is yellow */
}


/* The Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    grid-template-rows: auto auto;
    /* Allow rows to size to content */
    gap: 20px;
    flex: 1;
    padding-bottom: 20px;
}

/* Specific Card Placements */
/* Specific Card Placements */
.card-experience {
    grid-column: 1 / 2;
    grid-row: 1 / 4;
}

/* Tall Left */
.card-skills {
    grid-column: 2 / 4;
    grid-row: 1 / 2;
}

/* Wide Top Right */
.card-education {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

/* Languages below Education */
.card-languages {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

/* Bottom Right - Projects spanning down */
.card-projects {
    grid-column: 3 / 4;
    grid-row: 2 / 4;
}

/* Language styling */
.lang-item {
    font-family: monospace;
    font-size: 1rem;
    color: #333;
}

/* Bottom Right */

/* Bottom Right */

/* Card Styling & Proximity Border */
.bento-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

/* The Glow Border (Pseudo-element managed by JS) */
.bento-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 2px;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 215, 0, 0.6), transparent 40%);
    -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;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 5;
}

/* Reveal glow on hover of the GRID container, not just card */
.bento-grid:hover .bento-card::before {
    opacity: 1;
}

.card-content {
    padding: 30px;
    height: 100%;
    position: relative;
    z-index: 2;
    overflow-y: auto;
    box-sizing: border-box;
}

.bento-card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 0;
    /* font-style: italic; Removed */
    color: #000;
}

/* Experience Accordion */
.job-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #f9f9f9;
    padding-bottom: 10px;
    cursor: pointer;
}

.job-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    font-family: var(--font-family);
    margin-bottom: 5px;
}

.job-header .role {
    font-weight: 700;
    color: #000;
    font-size: 1rem;
    line-height: 1.2;
}

.job-header .company {
    font-weight: 400;
    color: #333;
    /* Slightly darker */
    font-size: 0.95rem;
    margin-left: 0;
    /* Remove left margin since it might stack now or just be below */
    display: block;
    margin-bottom: 2px;
}

.job-header .date {
    font-family: monospace;
    font-size: 0.8rem;
    color: #666;
    margin-left: 0;
    background: none;
    padding: 0;
    border-radius: 0;
    display: block;
}

.job-details {
    /* max-height: 0; Removed to keep always open */
    /* overflow: hidden; Removed */
    list-style: none;
    padding: 0;
    margin: 0;
    /* transition: max-height 0.4s ease; Removed */
    opacity: 0.9;
    margin-top: 10px;
    /* Added spacing */
}

.job-details li {
    font-size: 0.85rem;
    margin-top: 5px;
    position: relative;
    padding-left: 10px;
    color: #444;
}

.job-details li::before {
    content: "-";
    position: absolute;
    left: 0;
}

/* Expand on Hover */
/* Expand on Hover - Removed, now always visible */
/* .job-item:hover .job-details {
    max-height: 500px;
} */

.job-item:hover .role {
    color: var(--accent-gold);
}


/* Hacker Skills */
.skill-group {
    margin-bottom: 20px;
}

.skill-group .label {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 5px;
}

.skill-group .value {
    font-family: monospace;
    font-size: 0.9rem;
    color: #111;
    display: block;
    min-height: 20px;
}

/* Projects & Edu Clean List */

.clean-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.clean-list li {
    margin-bottom: 10px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 5px;
    color: #444;
}

.clean-list strong {
    color: #000;
}

.edu-item {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.edu-item strong {
    display: block;
    color: #000;
    font-size: 1rem;
}

.edu-item span {
    display: block;
    color: #666;
    font-size: 0.85rem;
}

/* Dark Mode Overrides (Optional based on user preference, keeping consistent with site) */
body.dark-mode {
    background-color: #0e0e0e;
}

body.dark-mode .bento-section {
    background-color: #0e0e0e;
}

body.dark-mode .bento-card {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .bento-card h3,
body.dark-mode .clean-list strong,
body.dark-mode .job-header .role,
body.dark-mode .edu-item strong,
body.dark-mode .header-text h2,
body.dark-mode .skill-group .value {
    color: #fff;
}

body.dark-mode .job-details li,
body.dark-mode .clean-list li,
body.dark-mode .edu-item span,
body.dark-mode .job-header .company {
    color: #aaa;
}

body.dark-mode .job-item:hover .role {
    color: var(--accent-gold);
}


/* Mobile Responsive */
@media (max-width: 1024px) {
    .bento-section {
        height: auto;
        padding: 100px 20px 40px 20px;
    }

    .bento-container {
        height: auto;
    }

    .bento-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        height: auto;
    }

    .job-details {
        max-height: none;
    }

    /* Always show details on mobile */
    .bento-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .header-text h2 {
        font-size: 2rem;
    }
}



/* -----------------------------------------------------------
   PRINT OPTIMIZATION
----------------------------------------------------------- */
@media print {

    /* Set global margins for every page */
    @page {
        margin-top: 50px;
        margin-bottom: 30px;
        margin-left: 20px;
        margin-right: 20px;
    }

    /* Hide Navbar and UI elements */
    .navbar,
    #downloadBtn,
    .mobile-menu-btn,
    .nav-actions {
        display: none !important;
    }

    /* Reset Body/Container to generic document style */
    body,
    html,
    .app-container,
    .bento-section {
        background: #fff !important;
        height: auto !important;
        min-height: 0 !important;
        width: 100% !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }

    /* Linearize the Layout for Safety */
    /* Grid often breaks print pagination, Block is safer */
    .bento-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        display: block !important;
        padding: 0 40px !important;
    }

    .bento-grid {
        display: block !important;
        /* Stack cards vertically */
        width: 100% !important;
        margin-top: 20px;
    }

    /* Card Styling for Print */
    .bento-card {
        display: block !important;
        width: 100% !important;
        margin-bottom: 20px !important;
        border: none !important;
        border-bottom: 1px solid #ddd !important;
        box-shadow: none !important;
        background: transparent !important;

        /* ALLOW breaking across pages so it starts on pg 1 */
        page-break-inside: auto !important;
        break-inside: auto !important;

        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    /* But keep individual items together */
    .job-item,
    .edu-item,
    .skill-group {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 15px !important;
    }

    .card-border,
    .bento-card::before {
        display: none !important;
        /* Remove glow effects */
    }

    .card-content {
        padding: 0 !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* Typography fixes */
    h1,
    h2,
    h3,
    h4,
    .job-item,
    .skill-group,
    .clean-list,
    p,
    span,
    div {
        color: #000 !important;
        text-shadow: none !important;
    }

    /* Header adjustments */
    .bento-header {
        position: relative !important;
        display: block !important;
        border-bottom: 2px solid #000 !important;
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    /* Ensure links look like text */
    a {
        text-decoration: none !important;
        color: #000 !important;
    }

    /* Force visibility of job details */
    .job-details {
        display: block !important;
        max-height: none !important;
        opacity: 1 !important;
    }
}