:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-page);
    margin: 0;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

/* Main container styled as a sheet/card */
body > header, 
body > section {
    max-width: 900px;
    background: var(--bg-card);
    margin: 0 auto 30px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

/* Specific Header Styling */
header { 
    text-align: center;
    border-bottom: none !important; /* Overriding previous style */
}

h1 { 
    margin: 0; 
    font-size: clamp(2rem, 5vw, 3rem); 
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.subtitle { 
    color: var(--accent); 
    font-weight: 600; 
    font-size: clamp(1.1rem, 3vw, 1.25rem); 
    margin-top: 8px;
    margin-bottom: 16px;
}

.contact { 
    font-size: 0.95rem; 
    color: var(--text-secondary); 
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
    list-style: none;
    padding: 0;
}

.contact > * {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border-right: 1px solid var(--border-color);
    line-height: 1.2;
}

.contact > *:last-child {
    border-right: none;
}

.contact a { 
    color: var(--text-secondary); 
    text-decoration: none; 
    transition: color 0.2s;
}

.contact a:hover { 
    color: var(--accent); 
}

/* Typography Headings */
h2 { 
    border-left: none; /* Removing the border accent */
    padding-left: 0; 
    font-size: 1.75rem; 
    font-weight: 700;
    margin-bottom: 24px; 
    margin-top: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

h2::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: var(--accent);
    border-radius: 4px;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
}

/* Projects Layout */
.project { 
    background: #ffffff; 
    padding: 24px; 
    border: 1px solid var(--border-color);
    border-radius: 12px; 
    margin-bottom: 24px; 
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.project:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-hover);
}

.project-title { 
    font-weight: 700; 
    font-size: 1.25rem; 
    display: flex; 
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    width: 100%;
}

.project-title > span:first-child {
    color: var(--text-primary);
}

.tech-stack { 
    font-family: 'Inter', sans-serif; /* Moving away from monospace for a cleaner look */
    color: var(--accent); 
    font-size: 0.85rem; 
    font-weight: 600;
    margin: 8px 0 16px; 
    background: #eff6ff;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
}

.status { 
    font-size: 0.7rem; 
    background: #10b981; 
    color: white; 
    padding: 4px 8px; 
    border-radius: 9999px; /* Pill shape */
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    vertical-align: middle;
}

.status.wip { background: #f59e0b; }

.links { 
    display: flex; 
    gap: 12px; 
    font-size: 0.9rem;
}

.links a { 
    color: var(--text-secondary);
    text-decoration: none; 
    font-weight: 500;
    transition: color 0.2s;
}

.links a:hover { 
    color: var(--accent); 
    text-decoration: underline;
}

.project-desc ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.project-desc li {
    margin-bottom: 8px;
}

.note { 
    font-size: 0.85rem; 
    color: var(--text-secondary); 
    font-style: italic; 
    margin-top: 16px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 6px;
}

/* Skills Grid Improved */
.skills-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px; 
}

.skills-grid div {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.skills-grid div:hover {
    border-color: var(--accent);
}

.skills-grid strong {
    display: block;
    color: var(--accent);
    margin-bottom: 4px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Button Styling */
.view-screenshots {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
    width: auto;
}

.view-screenshots:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.view-screenshots:active {
    transform: translateY(0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.9); /* Darker backdrop */
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 40px auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-primary);
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.screenshot-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.screenshot-item:hover {
    box-shadow: var(--shadow-md);
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.screenshot-item img:hover {
    transform: scale(1.02);
}

.screenshot-caption {
    padding: 12px;
    background: #f8fafc;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Mobile optimizations */
@media (max-width: 640px) {
    body {
        padding: 10px;
    }
    
    body > header, 
    body > section {
        padding: 24px 16px;
        margin-bottom: 20px;
    }
    
    .project {
        padding: 16px;
    }
    
    .project-title {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    .project-title div.links {
        margin-top: 4px;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .contact {
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin-top: 10px;
    }

    .contact > * {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 12px 0;
        justify-content: center;
    }

    .contact > *:last-child {
        border-bottom: none;
    }
    
    h2::before {
        height: 20px;
    }
}

@media print {
    body { 
        padding: 0; 
        background: white;
    }
    
    body > header, 
    body > section {
        box-shadow: none;
        padding: 0;
        margin: 20px 0;
        max-width: none;
    }

    .project { 
        background: none; 
        border: 1px solid #000; 
        page-break-inside: avoid; 
    }
    
    .status, .view-screenshots, .modal, .tech-stack { 
       /* Simplified view for print if needed, keeping tech stack visible though */
    }
    
    .view-screenshots, .modal { display: none; }
}