@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;700&family=Source+Sans+Pro:wght@300;400;600;700&display=swap');

:root {
    --header-bg: #2d3436;
    --accent: #d63031;
    --bg-gray: #f5f6fa;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;
}

* {
    box-sizing: border-box; /* Important for responsive padding */
}

body {
    background: #b2bec3;
    font-family: 'Source Sans Pro', sans-serif;
    margin: 0;
    padding: 40px 0;
    display: flex;
    justify-content: center;
}

.resume-sheet {
    /* Changed width to max-width to allow shrinking on mobile */
    max-width: 210mm;
    width: 100%; 
    min-height: 297mm;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- HEADER SECTION --- */
.header {
    background: var(--header-bg);
    color: white;
    padding: 35px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.identity h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 38pt;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 2px;
    line-height: 1;
}

.identity .role {
    font-size: 14pt;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: 1px;
}

.header-photo {
    width: 110px;
    height: 110px;
    border-radius: 5px;
    border: 4px solid var(--accent);
    object-fit: cover;
    flex-shrink: 0; /* Prevents image squishing */
}

/* --- CONTACT BAR --- */
.contact-bar {
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 40px;
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 15px;
    justify-content: space-between;
    font-size: 9.5pt;
    color: var(--text-main);
}

.contact-bar div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-bar i { color: var(--accent); }
.contact-bar a { color: var(--text-main); text-decoration: none; font-weight: 600; }

/* --- MAIN CONTENT LAYOUT --- */
.content-container {
    display: flex;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 32%;
    background: white;
    padding: 30px 20px 30px 40px;
    border-right: 1px solid var(--border-color);
}

/* Main Body */
.main-body {
    width: 68%;
    padding: 30px 40px 30px 30px;
}

/* --- TYPOGRAPHY --- */
h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 16pt;
    color: var(--header-bg);
    text-transform: uppercase;
    margin: 0 0 20px 0;
    border-left: 5px solid var(--accent);
    padding-left: 15px;
    line-height: 1.2;
}

/* Education & Skills */
.edu-item { margin-bottom: 25px; }
.edu-degree { font-weight: 700; font-size: 11pt; color: var(--text-main); }
.edu-school { font-size: 10pt; color: var(--accent); margin-top: 2px; font-weight: 600; }
.edu-year { font-size: 9pt; color: var(--text-muted); margin-top: 2px; font-style: italic; }

.skill-list { list-style: none; padding: 0; margin: 0; }
.skill-list li { margin-bottom: 8px; font-size: 10pt; border-bottom: 1px solid #f1f1f1; padding-bottom: 4px; }
.skill-list strong { display: block; color: var(--text-main); font-size: 10.5pt; }
.skill-list span { color: var(--text-muted); font-size: 9.5pt; }

/* Projects */
.project-block { margin-bottom: 30px; }
.project-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; flex-wrap: wrap; gap: 5px;}
.project-name { font-size: 14pt; font-weight: 700; color: var(--text-main); font-family: 'Oswald', sans-serif; }
.project-tech { font-size: 8.5pt; background: var(--text-main); color: white; padding: 3px 8px; border-radius: 2px; text-transform: uppercase; font-weight: 600; }
.project-desc ul { margin: 5px 0 0 0; padding-left: 18px; }
.project-desc li { margin-bottom: 5px; color: var(--text-muted); line-height: 1.6; }

/* Cert Grid */
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.cert-item { background: var(--bg-gray); padding: 10px 15px; border-left: 3px solid var(--accent); }
.cert-item strong { display: block; color: var(--text-main); font-size: 10pt; }
.cert-item span { font-size: 9pt; color: var(--text-muted); }

/* Print Button */
.print-btn {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--header-bg); color: white; border: none;
    padding: 15px 30px; font-weight: bold; font-family: 'Oswald', sans-serif;
    letter-spacing: 1px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-transform: uppercase; transition: background 0.3s; z-index: 1000;
}
.print-btn:hover { background: var(--accent); }


/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media screen and (max-width: 768px) {
    body {
        padding: 0;
        background: white; /* Seamless background on mobile */
    }

    .resume-sheet {
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        min-height: auto;
    }

    /* Stack Header */
    .header {
        flex-direction: column-reverse; /* Photo on top, text below */
        text-align: center;
        gap: 20px;
        padding: 30px 20px;
    }

    .identity h1 { font-size: 28pt; }
    .identity .role { font-size: 12pt; }

    /* Stack Contact Info */
    .contact-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 12px;
    }

    /* Stack Main Content */
    .content-container {
        flex-direction: column;
    }

    /* Sidebar adjusts to full width */
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 30px 20px;
    }

    /* Main Body adjusts to full width */
    .main-body {
        width: 100%;
        padding: 30px 20px;
    }

    /* Single column for Certs on small screens */
    .cert-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   PRINT LAYOUT (Ensure A4 stays perfect)
   ========================================= */
@media print {
    body { background: white; padding: 0; }
    .resume-sheet { width: 100%; max-width: 100%; box-shadow: none; min-height: auto; }
    .print-btn { display: none; }
    
    /* Force layout to stay side-by-side on print even if screen is small */
    .content-container { flex-direction: row !important; }
    .sidebar { width: 32% !important; border-right: 1px solid var(--border-color) !important; border-bottom: none !important; }
    .main-body { width: 68% !important; }
    .header { flex-direction: row !important; text-align: left !important; }
    .contact-bar { flex-direction: row !important; }
    
    .header, .project-tech, .cert-item { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}}
