@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

/* Palette */
:root {
    --bg-color: #1a1c1e;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --primary-color: #8da9c4;
    --card-bg: #22252a;
    --border-color: #2d3139;
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'JetBrains Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 30px 30px;
    background-attachment: fixed;
}

h1,
h2,
h3 {
    margin-bottom: 1rem;
}

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

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: var(--primary-color);
    color: #1a1c1e;
    font-weight: bold;
    border-radius: 8px;
    transition: opacity 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
}

.btn:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--primary-color);
}

.btn-secondary i,
.icon-svg {
    margin-right: 8px;
    vertical-align: -2px;
}

.icon-svg {
    width: 16px;
    height: 16px;
}

header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.75rem;
}

.nav-links a {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: rgba(141, 169, 196, 0.08);
}

section {
    padding: 5rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

#detailed-about,
#education,
#skills,
#projects,
#contact {
    scroll-margin-top: 90px;
}

/* Hero */
.hero {
    min-height: calc(100vh - 73px);
    min-height: calc(100dvh - 73px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 5%;
}

.hero-inner {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

.hero-photo-wrap {
    flex-shrink: 0;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--border-color));
}

.hero-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--bg-color);
}

.hero-content {
    max-width: 100%;
}

.hero h1 {
    font-size: clamp(1.1rem, 4.6vw, 3rem);
    white-space: nowrap;
}

.hero p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 700px) {
    .hero-inner {
        flex-direction: row;
        align-items: center;
        gap: 3.5rem;
    }

    .hero-photo-wrap {
        width: 220px;
        height: 220px;
    }

    .hero-content {
        text-align: left;
    }

    .hero p {
        margin: 0;
    }

    .hero-buttons {
        justify-content: flex-start;
    }
}

/* About */
.about-section {
    max-width: 1000px;
    margin: 3rem auto 0 auto;
    padding: 0 5%;
}

.about-content h2,
.projects-section h2,
.education-column h2,
.skills-column h2 {
    font-size: 2.2rem;
    color: #ffffff;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

/* Primary-color underline beneath the heading */
.about-content h2::after,
.projects-section h2::after,
.education-column h2::after,
.skills-column h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-text p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0;
    text-align: justify;
}

.about-text strong {
    color: #ffffff;
    font-weight: 600;
}

.about-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 3rem;
    justify-content: center
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    transition: transform 0.2s ease, border-color 0.2s;
}

.highlight-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.highlight-text {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Resume: side-by-side education & skills grid */
.resume-wrapper {
    max-width: 1300px;
    margin: 0 auto;
}

.resume-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: start;
}

.education-column,
.skills-column {
    width: 100%;
}

.education-column h2,
.skills-column h2 {
    margin-bottom: 3.5rem;
}

/* Education timeline */
.compact-timeline {
    position: relative;
    padding-left: 32px;
    text-align: left;
}

.compact-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-node {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-node:last-child {
    margin-bottom: 0;
}

.node-dot {
    position: absolute;
    left: -32px;
    top: 6px;
    width: 14px;
    height: 14px;
    background-color: var(--primary-color);
    border-radius: 50%;
    opacity: 0.8;
}

.node-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.degree-type {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.node-content h3 {
    font-size: 1.15rem;
    color: #ffffff;
    margin: 0;
}

.timeline-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.timeline-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.timeline-badges span {
    font-size: 0.75rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}


/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.project-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.project-card h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #ffffff;
    flex: 1;
    min-width: 0;
}

.status-badge {
    font-size: 0.75rem;
    background: rgba(141, 169, 196, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(141, 169, 196, 0.2);
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-badge.status-ongoing {
    background: rgba(50, 215, 75, 0.1);
    color: #32d74b;
    border-color: rgba(50, 215, 75, 0.25);
}

.status-badge.status-completed {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border-color: rgba(148, 163, 184, 0.2);
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.tags span {
    background: #2d3139;
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid #373c47;
}

.project-link {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    display: inline-block;
    transition: color 0.2s;
}

.project-link:hover {
    color: var(--text-color);
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

/* Contact */
.contact-section h2 {
    margin-bottom: 1.5rem;
}

.contact-section p {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

#copyEmailBtn.copied {
    border-color: #32d74b;
    color: #32d74b;
}

.contact-form {
    max-width: 500px;
    margin: 3rem auto 0 auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
    min-height: 120px;
}

.contact-form .btn {
    align-self: flex-start;
}

#form-status {
    font-size: 0.9rem;
    min-height: 1.2em;
}

.form-status-success {
    color: #32d74b;
}

.form-status-error {
    color: #ff6b6b;
}

/* Focus states */
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(141, 169, 196, 0.2);
}

.btn:focus-visible,
.nav-links a:focus-visible,
.project-link:focus-visible,
.back-to-top:focus-visible,
.nav-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-bg);
}

/* Tablet and up (768px+) */
@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Snaps project cards to 2 columns */
    }
}

/* Mobile (below 768px): collapse nav into a hamburger menu */
@media (max-width: 767px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background-color: var(--card-bg);
        border-top: 1px solid var(--border-color);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-links.open {
        max-height: 300px;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 1rem 5%;
        border: none;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links a:hover {
        background-color: transparent;
    }
}

/* Desktop and up (992px+) */
@media (min-width: 992px) {
    .resume-container {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        gap: 6rem;
    }
}

/* Scroll-triggered fade-in */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Back to top */
.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #1a1c1e;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 90;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    opacity: 0.9;
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}
