:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent-color: #0f0;
    /* Neon Green */
    --secondary-accent: #00ffcc;
    /* Cyan */
    --font-mono: 'Fira Code', monospace;
    --scanline-color: rgba(0, 255, 0, 0.05);
}

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

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

/* Scanline Effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 50%,
            var(--scanline-color) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
}

/* Typography */
h1,
h2,
h3 {
    color: var(--accent-color);
    text-transform: uppercase;
}

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

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

/* Header */
header {
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(10, 10, 10, 0.9);
    z-index: 100;
    border-bottom: 1px solid #333;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.hamburger {
    display: none;
    cursor: pointer;
    background: transparent;
    border: none;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--accent-color);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 60px;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    position: relative;
}

.terminal-text {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    20% {
        clip: rect(80px, 9999px, 100px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 140px, 0);
    }

    60% {
        clip: rect(50px, 9999px, 60px, 0);
    }

    80% {
        clip: rect(20px, 9999px, 80px, 0);
    }

    100% {
        clip: rect(90px, 9999px, 10px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(120px, 9999px, 140px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    40% {
        clip: rect(50px, 9999px, 70px, 0);
    }

    60% {
        clip: rect(90px, 9999px, 110px, 0);
    }

    80% {
        clip: rect(20px, 9999px, 40px, 0);
    }

    100% {
        clip: rect(60px, 9999px, 80px, 0);
    }
}

/* Sections */
section {
    padding: 100px 50px;
    max-width: 1200px;
    margin: 0 auto;
    scroll-margin-top: 100px;
    /* Account for fixed header */
}

.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    display: inline-block;
}

/* Matrix Background */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    /* Subtle effect */
}

/* Typography Enhancements */
h1,
h2,
h3 {
    color: var(--accent-color);
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

/* Button Enhancements */
.btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(0, 255, 0, 0.05);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--accent-color);
    text-shadow: none;
}

/* Card Enhancements */
.skill-card,
.project-card,
.hobby-card,
.education-card,
.cert-card {
    border: 1px solid #333;
    padding: 25px;
    transition: all 0.3s ease;
    background: rgba(17, 17, 17, 0.8);
    position: relative;
    overflow: hidden;
}

.skill-card:hover,
.project-card:hover,
.hobby-card:hover,
.education-card:hover,
.cert-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
}

.skill-card::before,
.project-card::before,
.hobby-card::before,
.education-card::before,
.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.skill-card:hover::before,
.project-card:hover::before,
.hobby-card:hover::before,
.education-card:hover::before,
.cert-card:hover::before {
    left: 100%;
}

/* Blog section title line and hover/shine behavior for blog sections */
#blog .section-title {
    display: inline-block;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    position: relative;
}

/* Small accent bar under the section title (matches main page style) */
#blog .section-title::after {
    content: '';
    display: block;
    height: 3px;
    width: 56px;
    background: linear-gradient(90deg, rgba(0, 255, 170, 0.95), rgba(0, 255, 170, 0.55));
    margin-top: 8px;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(0, 255, 170, 0.06);
}

/* Make project-card match main page .project-card hover sheen and lift */
#blog .project-card,
#blog .post-card {
    border: 1px solid #333;
    background: rgba(17, 17, 17, 0.8);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    position: relative;
    overflow: hidden;
}

/* Sheen effect like other cards */
#blog .project-card::before,
#blog .post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 120%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 170, 0.06), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

#blog .project-card:hover::before,
#blog .post-card:hover::before,
#blog .project-card:focus::before,
#blog .post-card:focus::before {
    left: 100%;
}

/* Hover lift, border color and glow to match main site cards */
#blog .project-card:hover,
#blog .post-card:hover,
#blog .project-card:focus,
#blog .post-card:focus {
    transform: translateY(-6px);
    border-color: var(--accent-color);
    box-shadow: 0 18px 60px rgba(0, 255, 170, 0.06);
    outline: none;
}

/* Ensure title + content remain above sheen */
#blog .project-card,
#blog .post-card,
#blog .section-title {
    z-index: 1;
    position: relative;
}

/* Whoami: image left, content right */
.about-row {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.profile-container {
    flex: 0 0 220px;
    /* fixed column for image */
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-frame {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-block;
    box-shadow:
        0 8px 30px rgba(0, 255, 170, 0.06),
        inset 0 0 30px rgba(0, 255, 170, 0.02);
    /* use the whoami/accent color for the inner border */
    border: 4px solid var(--accent-color);
}

/* outer ring for a crisp cyber border/glow */
.profile-frame::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    /* match whoami color for the outer ring with subtle glow */
    border: 2px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 0 28px color-mix(in srgb, var(--accent-color) 55%, transparent);
    pointer-events: none;
    z-index: 0;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 28%;
    display: block;
    /* made brighter and slightly higher contrast */
    filter: brightness(1.06) contrast(1.06);
    transform: translateZ(0);
}

.profile-overlay {
    position: absolute;
    inset: 0;
    /* lighter overlay so face appears brighter */
    background: radial-gradient(circle at 30% 20%, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.18));
    pointer-events: none;
}

/* text column: take remaining width */
.about-content {
    flex: 1 1 360px;
    min-width: 260px;
    color: rgba(191, 255, 232, 0.95);
}

/* tags as plain hash labels */
.tags {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.tags span {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Responsive: stack image above content on small screens */
@media (max-width: 760px) {
    .about-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-container {
        flex: 0 0 auto;
    }

    .about-content {
        min-width: 0;
    }

    .profile-frame {
        width: 180px;
        height: 180px;
    }

    .profile-image {
        object-position: center 30%;
    }
}

/* Responsive */
@media (max-width: 720px) {
    .post-card {
        grid-template-columns: 120px 1fr;
        gap: 12px;
        padding: 14px;
    }

    .post-thumb {
        width: 120px;
        height: 120px;
    }

    .modal-panel {
        margin: 30px 16px;
        padding: 16px;
    }
}

/* Footer / system status */
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px;
    background: transparent;
    z-index: 2;
}

.system-status {
    color: rgba(191, 255, 232, 0.9);
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.4px;
}

.system-status strong {
    color: var(--accent-color);
    /* whoami color */
    text-shadow: 0 0 8px rgba(0, 255, 170, 0.18);
    margin-left: 6px;
}

.site-footer {
    margin: 0;
    color: rgba(191, 255, 232, 0.6);
    font-size: 0.95rem;
}

/* Ensure footer stays visually at the bottom when page is short */
html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Add vertical gap between experience subsections */
.achievements h4 {
    margin: 0;
    /* reset if needed */
    padding: 0;
    font-weight: 700;
}

/* Apply a top gap for every subsection heading except the first one */
.achievements h4:not(:first-of-type) {
    margin-top: 20px;
}

/* Ensure lists under headings have comfortable spacing */
.achievements ul {
    margin: 8px 0 12px 1.1rem;
    padding-left: 0;
}

/* blog post grid and modal (add / adjust as needed) */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}

/* square thumbnail + body layout */
.post-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    align-items: start;
    background: linear-gradient(180deg, rgba(6, 10, 12, 0.6), rgba(4, 6, 8, 0.6));
    border: 1px solid rgba(0, 255, 170, 0.06);
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.post-card:focus,
.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 255, 170, 0.04);
    outline: none;
}

.post-thumb {
    width: 180px;
    height: 180px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(0, 255, 170, 0.04);
    box-shadow: inset 0 0 30px rgba(0, 255, 170, 0.02);
    flex-shrink: 0;
}

.post-body {
    color: rgba(191, 255, 232, 0.95);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-title {
    margin: 0;
    font-size: 1.05rem;
    color: #bfffe8;
}

.post-excerpt {
    margin: 0;
    color: rgba(191, 255, 232, 0.85);
    line-height: 1.4;
}

.post-meta {
    margin-top: auto;
    color: rgba(191, 255, 232, 0.55);
    font-size: 0.9rem;
}

/* modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow-y: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.modal-panel {
    position: relative;
    max-width: 900px;
    margin: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(6, 10, 12, 0.98), rgba(4, 6, 8, 0.98));
    border: 1px solid rgba(0, 255, 170, 0.06);
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    z-index: 2;
    outline: none;
}

.modal-close {
    position: absolute;
    right: 14px;
    top: 10px;
    background: transparent;
    border: none;
    color: rgba(191, 255, 232, 0.8);
    font-size: 26px;
    cursor: pointer;
}

.modal-header {
    text-align: center;
}

.modal-header .modal-title {
    margin: 0 0 6px 0;
    color: #bfffe8;
}

.modal-meta {
    margin: 0 0 12px 0;
    color: rgba(191, 255, 232, 0.5);
    font-size: 0.88rem;
}

.modal-content {
    color: rgba(191, 255, 232, 0.95);
    line-height: 1.6;
    overflow-y: auto;
}

/* responsive adjustments */
@media (max-width:720px) {
    .post-card {
        grid-template-columns: 120px 1fr;
        gap: 12px;
        padding: 12px;
    }

    .post-thumb {
        width: 120px;
        height: 120px;
    }

    .modal-panel {
        margin: auto;
        padding: 16px;
        width: 90%;
        max-height: 85vh;
    }
}

/* Mobile Responsiveness Enhancements */
@media (max-width: 768px) {

    /* Global Adjustments */
    section {
        padding: 60px 20px;
    }

    header {
        padding: 20px 20px;
    }

    /* Hero Section */
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .terminal-text {
        font-size: 1rem;
    }

    /* Navigation */
    .nav-links {
        gap: 15px;
        font-size: 0.9rem;
    }

    /* Cards */
    .project-card,
    .skill-card,
    .post-card {
        padding: 15px;
    }

    /* Blog Post Grid */
    .post-grid {
        grid-template-columns: 1fr;
    }

    .post-card {
        grid-template-columns: 1fr;
        /* Stack image and content */
        gap: 10px;
    }

    .post-thumb {
        width: 100%;
        height: 200px;
        /* Larger touch target/view */
    }

    /* Mobile Menu */
    .hamburger {
        display: block;
        z-index: 101;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 0;
        gap: 0;
        flex-direction: column;
        background-color: rgba(10, 10, 10, 0.98);
        width: 100%;
        height: 100vh;
        /* Fallback */
        height: 100dvh;
        text-align: center;
        transition: 0.3s;
        padding-top: 80px;
        z-index: 100;
        backdrop-filter: blur(10px);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 16px 0;
    }

    .nav-links li a {
        font-size: 1.5rem;
    }

    /* Grids to single column */
    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skill-card,
    .project-card {
        margin-bottom: 20px;
    }

    /* Contact buttons wrap */
    #contact div[style*="display: flex"] {
        flex-wrap: wrap;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .site-footer {
        text-align: center;
    }

    #contact {
        text-align: center;
    }
}