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

html {
    font-size: 100%;
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

/* Dark-mode variables */
:root {
    --bg-page: #0b1a2a;
    --bg-panel: #12263f;
    --bg-header: #091622;
    --text-primary: #e6f1ff;
    --text-muted: #a3b1c2;
    --accent: #58a6ff;
}

/* Page & Global */
body {
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 80%;
    margin: 2em auto;
    padding: 0 1em;
}

body .resume {
    max-width: 1100px;
    margin: auto auto;
}

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

a:hover {
    color: #79c0ff;
    text-decoration: underline;
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Nav */
/* ─── Navbar ───────────────────────────────────────────── */
nav {
    background: var(--bg-panel);
    box-shadow: rgba(0, 0, 0, 0.3) 0px 2px 4px;
    border-radius: 0.5em;
    padding: 0.5em 1em;
    margin-bottom: 2em;
    margin-top: 0.5em;
    display: flex;
    gap: 1em;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    padding: 0.5em 1em;
    border-radius: 0.3em;
    transition: background-color 0.2s, color 0.2s;
}

nav a:hover,
nav a.active {
    background: var(--accent);
    color: rgb(255, 255, 255);
    text-decoration: none;
}

@media(max-width:768px) {
    nav {
        justify-content: center;
    }
}

/* Hero */
.hero {
    background: var(--bg-panel);
    /* Optional: Add a subtle background to the hero */
    padding: 4rem 2rem;
    /* Responsive padding */
    margin-bottom: 3rem;
    /* Space below hero */
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Softer shadow */
}

.hero-content {
    max-width: 700px;
    /* Limit width for readability */
    margin: 0 auto;
    /* Center content */
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    /* Responsive font size */
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    /* Responsive font size */
    color: var(--text-muted);
    line-height: 1.7;
}


/* Section Titles */
.section-title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    /* Responsive font size */
    color: var(--text-primary);
    margin-bottom: 2rem;
    /* Space below title */
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    /* To make border only as wide as text */
}

/* Center section titles if they are direct children of sections */
section>.section-title {
    display: block;
    /* Allow text-align center to work */
    border-bottom: none;
    /* Remove border for centered titles or style differently */
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 1rem;
    /* Adjust spacing */
}


/* Grid helpers */
.grid {
    display: grid;
    gap: 1.5rem;
}

.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Slightly larger minmax */
}

/* Cards */
.card {
    background: var(--bg-panel);
    border-radius: 12px;
    /* Slightly more rounded */
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    /* Standard shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    /* For better internal alignment */
    flex-direction: column;
    /* Stack image and text vertically */
    overflow: hidden;
    /* Ensures border-radius clips image */
}

.card-img {
    width: 100%;
    height: 200px;
    /* Fixed height for consistency */
    object-fit: cover;
    /* border-radius: 8px 8px 0 0; Removed as overflow:hidden on .card handles it */
}

.card-title {
    padding: 1rem;
    /* Padding around the title */
    font-size: 1.1rem;
    color: var(--text-primary);
    text-align: center;
    margin-top: auto;
    /* Pushes title to bottom if card heights vary due to text */
}

.card:hover {
    transform: translateY(-6px) scale(1.02);
    /* More noticeable hover */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Popup overlay */
.popup {
    display: none;
    /* Initially hidden */
    position: fixed;
    inset: 0;
    /* Replaces top, left, width, height */
    background: rgba(0, 0, 0, 0.88);
    /* Slightly darker overlay */
    /* display: flex; Will be set by JS when opened */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    /* Padding for smaller screens */
}

.popup-content {
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 2rem;
    /* Increased padding */
    border-radius: 12px;
    /* Consistent with cards */
    width: 90vw;
    /* Relative width */
    max-width: 700px;
    /* Max width */
    max-height: 90vh;
    /* Relative height */
    overflow-y: auto;
    /* Scroll for content overflow */
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.popup-nav {
    position: fixed;
    /* Fixed position relative to viewport */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(40, 58, 80, 0.7);
    /* Darker, less transparent */
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    /* Slightly larger */
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    /* Adjusted icon size */
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease;
    z-index: 1001;
    /* Above popup content if it overflows */
}

.popup-nav:hover {
    background: rgba(50, 72, 99, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.popup-nav:active {
    transform: translateY(-50%) scale(0.95);
}

#popup-prev {
    left: 1rem;
    /* Consistent spacing from edge */
}

#popup-next {
    right: 1rem;
    /* Consistent spacing from edge */
}

/* Media query for positioning nav buttons outside content on larger screens */
@media (min-width: 800px) {

    /* Adjust breakpoint as needed */
    #popup-prev {
        left: calc(50% - 350px - 4rem);
        /* Half of max-width (700px/2) - button_width */
    }

    #popup-next {
        right: calc(50% - 350px - 4rem);
    }
}


.popup-img {
    width: 100%;
    /* Responsive image */
    max-height: 60vh;
    /* Limit image height */
    object-fit: contain;
    /* Show full image, might leave space */
    display: block;
    margin: 0 auto 1rem auto;
    /* Center and space below */
    border-radius: 8px;
}

.popup-text {
    margin-top: 1rem;
    color: var(--text-muted);
    /* Softer text color for description */
    line-height: 1.7;
}

.popup-text h3 {
    color: var(--text-primary);
    /* Ensure heading in description is primary color */
    margin-bottom: 0.75rem;
}

.popup-content .close {
    width: 2rem;
    /* Larger clickable area */
    height: 2rem;
    line-height: 2rem;
    text-align: center;
    font-size: 1.2rem;
    /* Larger icon */
    transform-origin: center center;
    position: absolute;
    top: 1rem;
    /* Adjusted position */
    right: 1rem;
    /* Adjusted position */
    color: var(--text-muted);
    /* Muted color, accent on hover */
    cursor: pointer;
    transition: transform 0.25s ease, color 0.2s ease;
}

.popup-content .close:hover {
    transform: rotate(90deg) scale(1.2);
    color: var(--accent);
    /* Accent color on hover */
}

.popup-content .close:active {
    transform: rotate(90deg) scale(1.0);
}

/* Footer */
.site-footer {
    background: var(--bg-panel);
    box-shadow: rgba(0, 0, 0, 0.3) 0px 2px 4px;
    border-radius: 0.5rem;
    padding: 0.5em 1em;
    margin-top: 2em;
    margin-bottom: 0.5em;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5em 1em;
}

.social-icons a {
    margin-left: .5rem;
    color: var(--text-muted);
    font-size: 1.25rem;
}

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

/* About & Resume spacing */
.about h2,
.resume h3 {
    margin-bottom: 1rem;
}


/* Disable background scroll when popup is open */
body.no-scroll {
    overflow: hidden;
}

/* ─── Resume Page Styles ───────────────────────────────────── */
.resume-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1000px;
    margin: auto;
    border: 3px solid var(--accent);
    border-radius: 16px;
    padding: 1%;
}

.resume .sidebar {
    background: var(--bg-panel);
    padding: 1.5rem;
    border-radius: 8px;
}

.resume .sidebar h3 {
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.resume .sidebar ul {
    list-style: none;
}

.resume .sidebar li {
    margin-bottom: .75rem;
    font-size: .95rem;
}

.resume .sidebar a {
    color: var(--text-primary);
}

.resume .main-resume h3 {
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: .25rem;
    margin-top: 1.5rem;
    color: var(--text-primary);
}

.resume .main-resume p {
    margin-bottom: 1rem;
}

.resume .main-resume ul {
    list-style: none;
    padding-left: 0;
}

.resume .main-resume ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: .5rem;
}

.resume .main-resume ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.resume .job {
    margin-bottom: 1.5rem;
}

.resume .job h4 {
    margin-bottom: .25rem;
    color: var(--text-primary);
}

.resume .job time {
    display: block;
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

.resume .job .job-location {
    /* font-style: italic; */
    color: var(--text-muted);
    margin-bottom: .25rem;
}

.resume .job ul {
    margin-left: 1rem;
    list-style: disc;
}

/* Remove discs under Experience, keep only arrows */
.resume .job ul {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.resume .download {
    text-align: center;
    margin-top: 2rem;
}

.resume .download a {
    background: var(--accent);
    color: #fff;
    padding: .75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

.resume .download a:hover {
    background: #79c0ff;
}

.resume .school time {
    display: block;
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

/* ─── About Page ─────────────────────────────────────────── */

.about h2 {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.about .feature {
    background: var(--bg-panel);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.about .feature h3 {
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.about .feature p,
.about .feature ul {
    color: var(--text-muted);
    line-height: 1.5;
}

.about .feature ul {
    list-style: none;
    padding-left: 0;
}

.about .feature ul li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.about .feature ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ─── About Page Features Grid ─────────────────────────── */
.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1rem 0;
}

@media (min-width: 768px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
}

.features .feature {
    background: var(--bg-panel);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.features .feature h3 {
    margin-bottom: .75rem;
    color: var(--accent);
}

.features .feature p,
.features .feature ul {
    color: var(--text-muted);
    line-height: 1.5;
}

.features .feature ul {
    list-style: none;
    padding-left: 0;
}

.features .feature ul li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: .5rem;
}

.features .feature ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Mobile‑friendly resume layout */
@media (max-width: 768px) {
    body {
        max-width: 100%;
        margin: 1em;
        padding: 0;
    }

    .popup-nav {
        top: auto;
        bottom: 1rem;
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
    }

    #popup-prev {
        left: 1rem;
    }

    #popup-next {
        right: 1rem;
    }

    .resume-grid {
        /* switch to a single column */
        grid-template-columns: 1fr !important;
        gap: 1rem;
        border: none;
    }
}
