/* ============================================================
   Gurgen Baghdasaryan — Portfolio
   Dark IDE-inspired theme with .NET purple accents
   ============================================================ */

:root {
    --accent: #8b5cf6;          /* .NET purple */
    --accent-2: #22d3ee;        /* cyan highlight */
    --accent-soft: rgba(139, 92, 246, 0.15);
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --bg-elevated: #1c2230;
    --text-light: #e6edf3;
    --text-dim: #9aa4b2;
    --border-color: #2d333b;
    --nav-height: 68px;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

    /* code syntax colors */
    --code-keyword: #c678dd;
    --code-type: #4ec9b0;
    --code-string: #98c379;
    --code-method: #61afef;
    --code-comment: #5c6370;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 12px);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

.mono {
    font-family: 'JetBrains Mono', Consolas, monospace;
}

.accent {
    color: var(--accent);
}

img {
    max-width: 100%;
}

a {
    color: var(--accent-2);
    text-decoration: none;
    transition: color 0.25s ease;
}

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

.container {
    width: min(92%, 1100px);
    margin: 0 auto;
    padding: clamp(48px, 8vw, 90px) 0;
}

.section-title {
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color), transparent);
    margin-left: 8px;
}

.section-title .mono {
    font-size: 0.8em;
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    z-index: 2000;
    transition: width 0.1s linear;
}

/* ---------- Navigation ---------- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    background: rgba(13, 17, 23, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

nav.scrolled {
    background: rgba(13, 17, 23, 0.92);
    border-bottom-color: var(--border-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(92%, 1100px);
    margin: 0 auto;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-light);
    letter-spacing: 1px;
}

.logo-bracket {
    color: var(--accent);
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 8px;
    position: relative;
}

.nav-link:hover {
    color: var(--text-light);
    background: var(--accent-soft);
}

.nav-link.active {
    color: var(--accent);
}

.nav-cta {
    border: 1px solid var(--accent);
    color: var(--accent);
    margin-left: 8px;
}

.nav-cta:hover {
    background: var(--accent);
    color: #fff;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    border-radius: 2px;
    background-color: var(--accent);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + 40px) 0 60px;
    overflow: hidden;
}

#particles-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: min(92%, 1100px);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: clamp(30px, 5vw, 60px);
}

.hero-text,
.hero-code {
    min-width: 0;
}

.hero-greeting {
    color: var(--accent-2);
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.hero-text h1 {
    font-size: clamp(2.1rem, 5.5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 8px;
}

.typed-wrapper {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.05rem, 2.6vw, 1.5rem);
    font-weight: 600;
    color: var(--text-dim);
    min-height: 1.6em;
    margin-bottom: 18px;
}

.typed-cursor {
    color: var(--accent);
    animation: blink 0.9s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-tagline {
    color: var(--text-dim);
    max-width: 480px;
    margin-bottom: 24px;
}

.hero-tagline strong {
    color: var(--text-light);
}

.hero-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.hero-tech-stack span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    color: var(--text-dim);
    background: rgba(22, 27, 34, 0.6);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.hero-tech-stack span:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.hero-tech-stack i {
    color: var(--accent);
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6d28d9);
    color: #fff;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(139, 92, 246, 0.5);
    color: #fff;
}

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

.btn-secondary:hover {
    background: var(--accent-soft);
    transform: translateY(-3px);
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 22px;
    font-size: 1.45rem;
}

.social-links a {
    color: var(--text-dim);
    transition: color 0.25s ease, transform 0.25s ease;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* ---------- Code window ---------- */
.code-window {
    max-width: 100%;
    background: #0b0e14;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transform: perspective(1200px) rotateY(-4deg);
    transition: transform 0.4s ease;
}

.code-window:hover {
    transform: perspective(1200px) rotateY(0deg);
}

.code-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-filename {
    margin-left: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.code-body {
    text-align: left;
    padding: 20px 22px;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.72rem, 1.35vw, 0.85rem);
    line-height: 1.75;
    color: var(--text-light);
    overflow-x: auto;
    min-height: 300px;
    white-space: pre;
}

.code-body .kw { color: var(--code-keyword); }
.code-body .ty { color: var(--code-type); }
.code-body .st { color: var(--code-string); }
.code-body .me { color: var(--code-method); }
.code-body .cm { color: var(--code-comment); font-style: italic; }

.code-line {
    display: block;
    opacity: 0;
    transform: translateX(-8px);
    animation: line-in 0.35s ease forwards;
}

@keyframes line-in {
    to { opacity: 1; transform: translateX(0); }
}

.scroll-hint {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-dim);
    font-size: 1.2rem;
    z-index: 1;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -8px); }
    60% { transform: translate(-50%, -4px); }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: clamp(30px, 5vw, 60px);
    align-items: center;
}

.photo-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.photo-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25);
    pointer-events: none;
}

.photo-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-frame:hover img {
    transform: scale(1.04);
}

.about-text p {
    color: var(--text-dim);
    margin-bottom: 18px;
}

.about-text strong {
    color: var(--text-light);
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(20px, 4vw, 48px);
    margin-top: 28px;
}

.stat-number,
.stat-plus {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    display: block;
    color: var(--text-dim);
    font-size: 0.88rem;
}

/* ---------- Timeline ---------- */
.education-title {
    margin-top: 60px;
}

.timeline {
    position: relative;
    border-left: 2px solid var(--border-color);
    margin-left: 8px;
    padding-left: 28px;
}

.timeline-item {
    margin-bottom: 28px;
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(6px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 28px;
    width: 12px;
    height: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--accent);
    border-radius: 50%;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover::before {
    background: var(--accent);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.8);
}

.timeline-item h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.company {
    color: var(--accent);
    font-weight: 600;
}

.timeline-item p {
    color: var(--text-dim);
}

.timeline-item strong {
    color: var(--text-light);
}

.date {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-2);
    margin-bottom: 12px;
}

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.skill-card {
    background: var(--bg-card);
    padding: 28px 24px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 14px 32px rgba(139, 92, 246, 0.15);
}

.skill-card i {
    font-size: 2.4rem;
    color: var(--accent);
    margin-bottom: 16px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.skill-card:hover i {
    transform: scale(1.15);
}

.skill-card h3 {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.skill-card p {
    color: var(--text-dim);
    font-size: 0.92rem;
}

.skill-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px 48px;
    max-width: 900px;
    margin: 0 auto;
}

.skill-bar-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.92rem;
}

.skill-bar-head .mono {
    color: var(--accent-2);
    font-size: 0.82rem;
}

.skill-bar-track {
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 6px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Projects ---------- */
.projects {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.projects li {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.projects li:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.project-image-wrap {
    position: relative;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 210px;
    object-fit: contain;
    background-color: #fff;
    padding: 10px;
    display: block;
    transition: transform 0.45s ease;
}

.project-image--small {
    padding: 55px;
}

.project-image--medium {
    padding: 31px;
}

.projects li:hover .project-image {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 17, 23, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.projects li:hover .project-overlay {
    opacity: 1;
}

.project-overlay a {
    color: #fff;
    font-size: 2.2rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.project-overlay a:hover {
    transform: scale(1.2);
    color: var(--accent);
}

.project-info {
    padding: 22px;
    flex: 1;
}

.project-info h3 a {
    color: var(--text-light);
    font-size: 1.15rem;
}

.project-info h3 a:hover {
    color: var(--accent);
}

.project-info h3 i {
    font-size: 0.75em;
    color: var(--accent-2);
    margin-left: 6px;
}

.project-info p {
    color: var(--text-dim);
    margin-top: 8px;
    font-size: 0.94rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tags span {
    font-family: 'JetBrains Mono', monospace;
    background: var(--accent-soft);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--accent);
}

/* ---------- Contact ---------- */
.contact-lead {
    text-align: center;
    color: var(--text-dim);
    max-width: 520px;
    margin: -20px auto 36px;
}

form {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

input, textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

textarea {
    resize: vertical;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input.invalid, textarea.invalid {
    border-color: #f87171;
}

.btn-submit {
    width: 100%;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.error-message {
    color: #f87171;
    font-size: 0.83rem;
    display: none;
    margin-top: 6px;
}

.contact-direct {
    text-align: center;
    margin-top: 34px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 40px;
}

.contact-direct i {
    color: var(--accent);
    margin-right: 8px;
}

.contact-direct a {
    color: var(--text-dim);
}

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

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 36px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-dim);
    font-size: 0.88rem;
}

footer .mono {
    color: var(--accent);
    margin-bottom: 6px;
    font-size: 0.8rem;
}

/* ---------- Back to top ---------- */
#back-to-top {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: var(--bg-card);
    color: var(--accent);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.3s ease, color 0.3s ease;
    z-index: 900;
}

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

#back-to-top:hover {
    background: var(--accent);
    color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-tech-stack,
    .hero-actions,
    .social-links {
        justify-content: center;
    }

    .hero-code {
        max-width: 560px;
        width: 100%;
        margin: 0 auto;
    }

    .code-window {
        transform: none;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-photo {
        width: min(340px, 100%);
        justify-self: center;
    }

    .stats-row {
        justify-content: center;
    }

    .skill-bars {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        right: 0;
        flex-direction: column;
        align-items: stretch;
        width: min(78vw, 320px);
        height: calc(100vh - var(--nav-height));
        background: rgba(13, 17, 23, 0.97);
        backdrop-filter: blur(14px);
        border-left: 1px solid var(--border-color);
        padding: 28px 22px;
        gap: 6px;
        transform: translateX(100%);
        transition: transform 0.35s ease;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-link {
        display: block;
        padding: 14px 16px;
        font-size: 1.05rem;
        text-align: center;
    }

    .nav-cta {
        margin: 12px 0 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .code-body {
        min-height: 260px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 94%;
    }

    .hero {
        padding-top: calc(var(--nav-height) + 24px);
        padding-bottom: 70px;
    }

    .hero-inner {
        width: 94%;
        gap: 30px;
    }

    .hero-tagline {
        font-size: 0.95rem;
    }

    .hero-tech-stack {
        gap: 8px;
    }

    .hero-tech-stack span {
        padding: 5px 12px;
        font-size: 0.8rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-actions {
        width: 100%;
    }

    .code-titlebar {
        padding: 10px 14px;
    }

    .code-body {
        padding: 14px;
        min-height: 0;
    }

    .section-title {
        gap: 8px;
        margin-bottom: 30px;
    }

    .stats-row {
        gap: 24px;
    }

    .stat-number,
    .stat-plus {
        font-size: 1.7rem;
    }

    .timeline {
        margin-left: 2px;
        padding-left: 20px;
    }

    .timeline-item {
        padding: 18px 16px;
    }

    .timeline-item::before {
        left: -27px;
        top: 24px;
        width: 10px;
        height: 10px;
    }

    .timeline-item:hover {
        transform: none;
    }

    .skill-card {
        padding: 22px 18px;
    }

    .project-image {
        height: 180px;
    }

    .project-image--small {
        padding: 47px;
    }

    .project-image--medium {
        padding: 28px;
    }

    .contact-direct {
        flex-direction: column;
        gap: 10px;
    }

    form {
        padding: 24px 18px;
    }

    #back-to-top {
        bottom: 18px;
        right: 18px;
        width: 42px;
        height: 42px;
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
