/* ============================================
   PORTFOLIO — Nazmul Haque Jowel
   Eye-Soothing Mint & Gold Theme
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f1923;
    --bg-panel: #162433;
    --bg-card: #1c3040;
    --green: #64d2a3;
    --green-dim: #4db38a;
    --green-glow: rgba(100, 210, 163, 0.1);
    --green-glow-strong: rgba(100, 210, 163, 0.25);
    --cyan: #d4a06a;
    --cyan-glow: rgba(212, 160, 106, 0.15);
    --text: #c8d3de;
    --text-dim: #6b7f8e;
    --red: #e07070;
    --yellow: #e0c476;
    --green-dot: #64d2a3;
    --border: #243545;
    --font-mono: 'Fira Code', 'Courier New', monospace;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

::selection {
    background: var(--green);
    color: var(--bg);
}

/* --- Matrix Canvas --- */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.5;
    pointer-events: none;
}

/* --- Scanline Overlay --- */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(100, 210, 163, 0.006) 2px,
            rgba(100, 210, 163, 0.006) 4px);
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green);
    text-decoration: none;
    letter-spacing: 2px;
}

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

.nav-cmd {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-cmd .prompt {
    color: var(--green);
    margin-right: 2px;
}

.nav-cmd:hover,
.nav-cmd.active {
    color: var(--green);
    background: var(--green-glow);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--green);
    transition: all 0.3s ease;
}

/* --- Glitch Text --- */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.glitch-text::before {
    color: var(--green);
    animation: glitch-1 2.5s infinite linear alternate-reverse;
    clip-path: inset(0 0 80% 0);
}

.glitch-text::after {
    color: var(--cyan);
    animation: glitch-2 2.5s infinite linear alternate-reverse;
    clip-path: inset(80% 0 0 0);
}

@keyframes glitch-1 {

    0%,
    90%,
    100% {
        transform: translate(0);
    }

    92% {
        transform: translate(-3px, 1px);
    }

    94% {
        transform: translate(3px, -1px);
    }

    96% {
        transform: translate(-2px, 2px);
    }
}

@keyframes glitch-2 {

    0%,
    90%,
    100% {
        transform: translate(0);
    }

    91% {
        transform: translate(2px, -1px);
    }

    93% {
        transform: translate(-3px, 1px);
    }

    95% {
        transform: translate(1px, 2px);
    }
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 6rem 1.5rem 4rem;
    text-align: center;
}

.hero-content {
    max-width: 700px;
}

/* --- Profile Photo --- */
.profile-photo-wrapper {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    position: relative;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--green), var(--cyan), var(--green));
    box-shadow: 0 0 25px var(--green-glow-strong), 0 0 50px var(--green-glow);
    animation: photo-glow 4s ease-in-out infinite alternate;
}

@keyframes photo-glow {
    0% {
        box-shadow: 0 0 20px var(--green-glow-strong), 0 0 40px var(--green-glow);
    }

    100% {
        box-shadow: 0 0 30px var(--green-glow-strong), 0 0 60px var(--green-glow);
    }
}

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

.profile-photo-wrapper:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.hero-prefix {
    color: var(--green);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--green) 0%, #a8e6cf 40%, var(--cyan) 70%, var(--green) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite;
    margin-bottom: 1rem;
    line-height: 1.1;
    filter: drop-shadow(0 0 20px var(--green-glow-strong));
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.monetary-label {
    color: var(--green);
    font-size: 2.2rem;
    text-shadow: 0 0 10px var(--green-glow);
}

.typed-container {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--text-dim);
    margin-bottom: 2rem;
    min-height: 1.8em;
}

.typed-prefix {
    color: var(--green);
}

#typed-text {
    color: var(--text);
}

.cursor-blink {
    color: var(--green);
    animation: blink 1s step-end infinite;
}

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

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.badge {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text);
    transition: all 0.3s ease;
}

.badge:hover {
    border-color: var(--green);
    box-shadow: 0 0 12px var(--green-glow);
}

.cta-btn {
    display: inline-block;
    color: var(--green);
    border: 1px solid var(--green);
    padding: 0.7rem 1.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    background: var(--green);
    color: var(--bg);
    box-shadow: 0 0 20px var(--green-glow-strong);
}

/* --- Section Layout --- */
.section {
    position: relative;
    z-index: 2;
    padding: 5rem 1.5rem;
}

.section-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    font-size: 1.8rem;
    color: var(--green);
    margin-bottom: 2.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.section-title .prompt {
    opacity: 0.5;
    margin-right: 0.4rem;
}

.sub-title {
    font-size: 1.1rem;
    color: var(--green);
    margin-top: 3rem;
    margin-bottom: 1.2rem;
}

.sub-title .prompt {
    opacity: 0.6;
}

/* --- Terminal Window --- */
.terminal-window {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.terminal-window:hover {
    border-color: var(--green-dim);
    box-shadow: 0 0 20px var(--green-glow);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

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

.dot.red {
    background: var(--red);
}

.dot.yellow {
    background: var(--yellow);
}

.dot.green {
    background: var(--green-dot);
}

.terminal-title {
    margin-left: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.terminal-body {
    padding: 1.2rem 1.4rem;
}

.terminal-line {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
    line-height: 1.8;
}

.line-num {
    color: var(--text-dim);
    margin-right: 1rem;
    user-select: none;
    font-size: 0.75rem;
}

.highlight-line {
    background: rgba(100, 210, 163, 0.05);
    margin-left: -1.4rem;
    margin-right: -1.4rem;
    padding-left: 1.4rem;
    padding-right: 1.4rem;
    border-left: 2px solid var(--green);
}

.accent {
    color: var(--green);
    font-weight: 500;
}

.line-comment {
    color: var(--text-dim);
    font-style: italic;
}

.string-val {
    color: #a5d6ff;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    text-align: center;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--green-dim);
    box-shadow: 0 0 15px var(--green-glow);
}

.stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--green);
    text-shadow: 0 0 10px var(--green-glow);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.3rem;
    display: block;
}

/* --- Info Grid (JSON-like) --- */
.info-grid {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
}

.info-item {
    font-size: 0.85rem;
    padding: 0.3rem 0;
    color: var(--text);
}

.info-key {
    color: #ff7b72;
}

.info-val {
    color: #a5d6ff;
}

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

.skill-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.skill-name {
    font-size: 0.8rem;
    color: var(--text);
    min-width: 100px;
    flex-shrink: 0;
}

.skill-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.skill-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--green-dim), var(--green));
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 0 8px var(--green-glow);
}

.skill-pct {
    font-size: 0.75rem;
    color: var(--green);
    min-width: 35px;
    text-align: right;
}

/* --- Tools Grid --- */
.tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tool-chip {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text);
    transition: all 0.3s ease;
    cursor: default;
}

.tool-chip:hover {
    color: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 10px var(--green-glow);
    transform: translateY(-2px);
}

/* --- Projects List --- */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-entry {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-entry:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.08);
}

.project-name {
    font-family: 'Share Tech Mono', 'Fira Code', monospace;
    font-size: 1.3rem;
    color: var(--green);
    margin-bottom: 0.6rem;
    letter-spacing: 0.5px;
}

.project-desc {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    max-width: 700px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tag {
    font-family: 'Share Tech Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    background: rgba(0, 255, 170, 0.04);
    letter-spacing: 0.5px;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.project-entry:hover .project-tag {
    border-color: var(--green);
    color: var(--green);
}

.project-link {
    font-family: 'Share Tech Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--green);
    text-decoration: none;
    display: inline-block;
    transition: letter-spacing 0.3s ease, color 0.3s ease;
}

.project-link:hover {
    letter-spacing: 1.5px;
    color: var(--accent-gold);
    text-decoration: none;
}

.project-entry:hover .achievement-overlay {
    opacity: 1;
}

.project-entry:hover .achievement-img-wrap img {
    transform: scale(1.05);
}

/* --- Certifications --- */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    font-size: 0.82rem;
    transition: all 0.3s ease;
}

.cert-card:hover {
    border-color: var(--green-dim);
    box-shadow: 0 0 12px var(--green-glow);
    transform: translateY(-2px);
}

.cert-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.cert-name {
    color: var(--text);
}

/* --- Achievement Gallery --- */
.achievement-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.achievement-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.achievement-card:hover {
    border-color: var(--green-dim);
    box-shadow: 0 0 20px var(--green-glow);
    transform: translateY(-4px);
}

.achievement-img-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.achievement-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s ease;
}

.achievement-card:hover .achievement-img-wrap img {
    transform: scale(1.05);
}

.achievement-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 25, 35, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.achievement-card:hover .achievement-overlay {
    opacity: 1;
}

.view-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px var(--green-glow-strong));
}

.achievement-info {
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.achievement-org {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--green);
}

.achievement-type {
    font-size: 0.75rem;
    color: var(--text);
}

.achievement-year {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* --- Lightbox --- */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(100, 210, 163, 0.2);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2.5rem;
    color: var(--text);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1001;
}

.lightbox-close:hover {
    color: var(--green);
}

.bracket {
    color: var(--yellow);
    font-weight: 600;
}

/* --- Contact --- */
.contact-terminal .terminal-line {
    margin-bottom: 0.1rem;
}

.output-line {
    padding-left: 1rem;
}

.contact-link {
    color: var(--green);
    text-decoration: none;
    border-bottom: 1px dashed var(--green-dim);
    transition: all 0.2s ease;
}

.contact-link:hover {
    text-shadow: 0 0 8px var(--green-glow);
}

/* --- Hero CTA Group --- */
.hero-cta-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- CV Download Button --- */
.cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bg);
    background: linear-gradient(135deg, var(--green), var(--green-dim));
    padding: 0.7rem 1.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--green);
}

.cv-btn:hover {
    background: transparent;
    color: var(--green);
    box-shadow: 0 0 20px var(--green-glow-strong);
    transform: translateY(-2px);
}

.cv-icon {
    font-size: 1.1rem;
}

/* --- Education Timeline --- */
.education-timeline {
    position: relative;
    padding-left: 2rem;
}

.edu-entry {
    position: relative;
    margin-bottom: 2rem;
}

.edu-entry:last-child {
    margin-bottom: 0;
}

.edu-dot {
    position: absolute;
    left: -2rem;
    top: 1.4rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--green);
    border: 3px solid var(--bg);
    box-shadow: 0 0 10px var(--green-glow-strong);
    z-index: 2;
    transform: translateX(-1px);
}

.edu-line {
    position: absolute;
    left: calc(-2rem + 5px);
    top: 2rem;
    bottom: -2rem;
    width: 2px;
    background: linear-gradient(180deg, var(--green-dim), var(--border));
}

.edu-entry:last-child .edu-line {
    display: none;
}

.edu-entry .terminal-window {
    margin-bottom: 0;
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer-sub {
    margin-top: 0.3rem;
    font-size: 0.75rem;
}

/* --- Scroll Reveal --- */
.reveal-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10, 10, 10, 0.96);
        flex-direction: column;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-cmd {
        padding: 0.6rem 1.5rem;
    }

    .mobile-toggle {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

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

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

    .hero-content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 3rem 1rem;
    }

    .terminal-body {
        padding: 1rem;
    }

    .skill-name {
        min-width: 75px;
        font-size: 0.72rem;
    }

    .hero-badges {
        gap: 0.4rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.7rem;
    }

    .achievement-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .achievement-gallery {
        grid-template-columns: 1fr;
    }
}