/* Custom properties for easy color management */
:root {
    --primary-color: #f75d59; /* Accent color kept for highlights */
    --text-color: #dcdcdc; /* light text on dark bg */
    --muted-color: #9a9a9a; /* secondary text */
    --dot-color: rgba(255,255,255,0.12); /* dotted grid color on dark bg - increased visibility */
    --background-color: #060606; /* dark background */
    --font-family: 'Consolas', 'Courier New', monospace; /* Monospace font like in the image */
    --cursor-color: #ffffff; /* small dot cursor color */
    --card-shadow: 0 6px 18px rgba(0,0,0,0.45);
    --card-border: 1px solid rgba(255,255,255,0.03);
    --button-bg: #ffffff;
    --button-color: #111111;
    --button-border: 1px solid rgba(0,0,0,0.06);
}

/* Global Styles and Dotted Background */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
    /* Creates the large dotted grid background pattern */
    background-image: radial-gradient(var(--dot-color) 0.9px, transparent 0.9px);
    background-size: 20px 20px;
    min-height: 100vh;
    cursor: none; /* hide native cursor — custom dot will be used */
}

a {
    color: inherit;
    text-decoration: none;
}

.spacer {
    color: var(--primary-color);
}

.container {
    width: 85%;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 20px; /* reduced top padding */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

/* Right-side navigation container with mobile hamburger */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    width: 100%;
}

.nav-container .logo {
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    min-width: 50px;
}

.nav-menu {
    display: flex;
    gap: 18px;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.nav-link { 
    color: inherit; 
    text-decoration: none; 
    padding: 6px 8px;
    white-space: nowrap;
}

.hamburger {
    display: none;
    flex-direction: column;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: all 0.18s ease;
}

.hamburger.open span:nth-child(1) { 
    transform: translateY(8px) rotate(45deg);
}
.hamburger.open span:nth-child(2) { 
    opacity: 0;
    width: 0;
}
.hamburger.open span:nth-child(3) { 
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 900px) {
    /* Hamburger fixed in the top-right for mobile */
    .hamburger {
        display: flex;
        order: 2;
        position: fixed;
        top: 18px;
        right: 18px;
        z-index: 1100;
        background: transparent;
        padding: 8px;
    }

    /* Full-height right-side overlay panel */
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(46%, 420px);
        /* Use theme-aware background color so light theme shows a light panel */
        background: var(--background-color);
        transform: translateX(100%);
        transition: transform 280ms ease, opacity 200ms ease;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 28px;
        padding: 40px 36px;
        border-left: var(--card-border);
        z-index: 1050;
        box-shadow: -6px 0 20px rgba(0,0,0,0.6);
        backdrop-filter: blur(2px);
    }

    /* Slide in when opened */
    .nav-menu.open {
        transform: translateX(0);
    }

    /* Prevent body scroll and add a subtle backdrop while menu opened */
    body.menu-open {
        overflow: hidden;
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1020;
    }

    /* Lighter backdrop for light theme so the overlay doesn't appear dark */
    .light-theme body.menu-open::before {
        background: rgba(255,255,255,0.45);
    }

    .nav-link {
        width: 100%;
        padding: 12px 8px;
        font-size: 1.05rem;
        text-align: center;
        display: block;
    }

    .nav-link i {
        font-size: 1.4rem;
    }
}

    border-radius: 50%;
    /* You'll need an actual image file named 'avatar.png' */
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link i {
    font-size: 1.2rem;
}

/* --- Content Styling --- */
.page-title, .section-title {
    position: relative;
    font-weight: 900;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: inline-block;
}

.page-title {
    font-size: 2rem;
    font-weight: 900;
}

.page-title::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
}

.section-title {
    margin-top: 40px;
    font-size: 1rem;
    color: var(--muted-color);
}

/* --- Home Page Specific Layout (index.html) --- */
.home-content {
    display: grid;
    grid-template-columns: 1fr; /* single column layout for index */
    gap: 40px;
    padding-top: 60px;
}

.left-section {
    max-width: 700px;
}

.profile-header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
}

.profile-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 5px 0 30px 0;
    color: var(--muted-color);
}

.dot-marker {
    display: none; /* remove the old static orange dot */
}

.milestones-grid, .cert-item {
    padding-left: 20px;
    border-left: 2px solid var(--dot-color);
    margin-bottom: 15px;
}

.milestone-item {
    display: flex;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.milestone-year {
    font-weight: bold;
    width: 70px; /* Align the descriptions */
    flex-shrink: 0;
    color: var(--primary-color);
}

.milestone-description {
    color: var(--text-color);
}

.tech-list {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
}

.tech-badge {
    height: 40px;
    width: 50px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.tech-badge:hover {
    opacity: 1;
}

.cert-title {
    font-weight: bold;
    margin: 0;
}

.cert-details {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin: 5px 0 0 0;
}

.cert-badges {
    border-left: none; /* No vertical line for badges */
    padding-left: 0;
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 40px; /* add space at bottom on mobile so it doesn't stick to the page edge */
}


/* Right Image Section with Dotted Border */
.right-image-section {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.profile-picture-container {
    width: 100%;
    max-width: 300px; /* Max size for the image/placeholder box */
    height: 350px;
    background-image: url('profile_placeholder.jpg'); /* You need an image file */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.dotted-overlay-right {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background-image: radial-gradient(var(--primary-color) 1px, transparent 1px);
    background-size: 10px 10px;
    clip-path: polygon(100% 0, 0% 100%, 100% 100%);
    opacity: 0.5;
}

/* --- About Page Specific Layout (about.html) --- */
.about-page-content {
    padding-top: 50px;
    max-width: 600px;
}

.about-text-container p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.about-title {
    margin-bottom: 50px;
}

.cert-section-alt {
    margin-top: 50px;
}

/* --- Projects Page Specific Layout (projects.html) --- */
.projects-page-content {
    padding-top: 50px;
}

.projects-title {
    margin-bottom: 50px;
}

.project-list-section {
    margin-bottom: 50px;
}

.project-table-container {
    border: 1px solid var(--dot-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
    max-width: 900px;
}

.project-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.project-table th {
    text-align: left;
    padding: 15px 20px;
    background-color: rgba(255,255,255,0.03);
    color: var(--text-color);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.project-table td {
    padding: 15px 20px;
    vertical-align: top;
    border-bottom: 1px dotted var(--dot-color);
}

.project-table tbody tr:last-child td {
    border-bottom: none;
}

.project-name {
    font-weight: bold;
    width: 25%;
    color: var(--primary-color);
}

.project-description {
    color: var(--muted-color);
    line-height: 1.4;
}

/* Custom dot cursor element */
.cursor-dot {
    position: fixed;
    left: 0;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cursor-color);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 99999;
    box-shadow: 0 0 8px rgba(0,0,0,0.6);
    transition: transform 0.04s linear, opacity 0.12s linear;
}

.cursor-dot.hover {
    transform: translate(-50%, -50%) scale(1.9);
    background: var(--primary-color);
}

/* Keep pointer visible on small touch devices by disabling custom cursor */
@media (hover: none) {
    body { cursor: auto; }
    .cursor-dot { display: none; }
}

.project-badges {
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Projects card grid */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 20px;
}

.project-card {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 24px;
    background: var(--background-color); /* use theme-aware background: dark in dark mode, white in light mode */
    border: var(--card-border);
    border-radius: 8px;
    padding: 18px;
    align-items: stretch;
    box-shadow: var(--card-shadow);
    overflow: visible; /* allow decorative accents to show outside the card bounds */
}

.project-thumb {
    min-height: 160px;
    background-color: transparent; /* show dotted page bg through edges */
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.project-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-title {
    margin: 0 0 12px 0;
    font-size: 1.05rem;
    color: var(--text-color);
    position: relative;
    padding-left: 14px;
    z-index: 4; /* ensure title (and its pseudo) render above thumbnail/backdrops */
}

.project-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 2px;
    height: calc(100% - 12px);
    background: var(--primary-color);
    border-radius: 2px;
}

/* Make the first project use a small circular dot for contrast (like the design) */
.projects-grid .project-card:first-child {
    /* slight left padding so the title's accent has room */
    padding-left: 18px;
    position: relative;
}

/* Add colored dot shadow accent on the upper-right (behind the card) of the first project */
.projects-grid .project-card:first-child::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    left: 120px;
    bottom: 40px;
    background-image: radial-gradient(var(--primary-color) 1px, transparent 1px);
    background-size: 6px 6px;
    pointer-events: none;
    z-index: -1;
}

/* Use a slim vertical line attached to the title for the first project (like the screenshot) */
.projects-grid .project-card:first-child .project-title {
    padding-left: 14px; /* ensure spacing between the line and the text */
}
.projects-grid .project-card:first-child .project-title::before {
    /* Use the default slim line (same as other project titles) */
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 2px;
    height: calc(100% - 12px);
    background: var(--primary-color);
    border-radius: 2px;
    z-index: 5; /* bring the line above other elements */
}

.project-excerpt {
    color: var(--muted-color);
    margin: 0 0 18px 0;
    line-height: 1.5;
}

.project-meta {
    display: flex;
    justify-content: flex-end; /* no tags, align CTA to the right */
    align-items: center;
    gap: 12px;
}

/* project-tags and .tag removed — tech stack no longer displayed on cards */

.project-cta {
    background: var(--button-bg);
    color: var(--button-color);
    border: var(--button-border);
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.project-cta:hover { transform: translateY(-1px); }

@media (max-width: 900px) {
    .project-card { 
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px;
        max-width: 320px;
        margin: 0 auto 20px;
    }
    .project-thumb { 
        height: 100px;
        order: -1; /* place image above content on mobile */
    }
    .project-title {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    .project-excerpt {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .home-content {
        grid-template-columns: 1fr;
        padding-top: 50px;
    }
    
    .right-image-section {
        order: -1; /* Move image to the top on mobile */
        margin-bottom: 40px;
    }
    
    .profile-picture-container {
        max-width: 100%;
        height: 250px;
    }

    .header-contact-bar {
        position: static;
        flex-direction: column;
        align-items: flex-end;
        padding: 20px;
        gap: 5px;
    }
    
    .spacer {
        display: none;
    }

    .container {
        padding-top: 20px;
        width: 90%;
    }
    
    .project-table th:last-child, .project-table td:last-child {
        display: none; /* Hide Description column on smaller screens */
    }
    
    .project-table th:first-child, .project-table td:first-child {
        width: 100%;
    }
}

/* Light theme variables applied when class `light-theme` is set on the root element (html) */
.light-theme {
    --primary-color: #f75d59;
    --text-color: #111111;
    --muted-color: #777777;
    --dot-color: rgba(0,0,0,0.12);
    --background-color: #ffffff;
    --cursor-color: #111111;
    --card-shadow: 0 6px 18px rgba(0,0,0,0.06);
    --card-border: 1px solid rgba(0,0,0,0.06);
    --button-bg: #ffffff;
    --button-color: #111111;
    --button-border: 1px solid rgba(0,0,0,0.12);
}