:root {
    --bg: #0a0a0a;
    --green: #00ff41;
    --green-dim: #007a1f;
    --green-dark: #002a0a;
    --border: rgba(0, 255, 65, 0.15);
    --card-bg: rgba(0, 255, 65, 0.03);
    --glow: 0 0 10px rgba(0, 255, 65, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--green);
    font-family: 'Share Tech Mono', 'Fira Code', 'Courier New', monospace;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

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

/* ── CRT Scanlines ── */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 998;
}

/* ── Hero Header ── */
header {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.glitch {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 15px var(--green), 0 0 30px rgba(0, 255, 65, 0.3);
    position: relative;
    cursor: default;
    transition: text-shadow 0.3s;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.2s;
}

.glitch:hover::before {
    color: #ff0055;
    text-shadow: -2px 0 #ff0055;
    animation: glitch-before 0.3s infinite;
    opacity: 0.8;
    z-index: -1;
}

.glitch:hover::after {
    color: #00ffff;
    text-shadow: 2px 0 #00ffff;
    animation: glitch-after 0.25s infinite;
    opacity: 0.8;
    z-index: -2;
}

.glitch:hover {
    text-shadow: none;
}

@keyframes glitch-before {
    0%   { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 0); }
    20%  { clip-path: inset(40% 0 20% 0); transform: translate(3px, -1px); }
    40%  { clip-path: inset(80% 0 0 0);   transform: translate(-2px, 2px); }
    60%  { clip-path: inset(10% 0 70% 0); transform: translate(2px, 0); }
    80%  { clip-path: inset(60% 0 10% 0); transform: translate(-1px, -2px); }
    100% { clip-path: inset(30% 0 50% 0); transform: translate(3px, 1px); }
}

@keyframes glitch-after {
    0%   { clip-path: inset(60% 0 20% 0); transform: translate(3px, 0); }
    20%  { clip-path: inset(10% 0 70% 0); transform: translate(-3px, 1px); }
    40%  { clip-path: inset(30% 0 40% 0); transform: translate(2px, -1px); }
    60%  { clip-path: inset(70% 0 5% 0);  transform: translate(-2px, -2px); }
    80%  { clip-path: inset(0 0 80% 0);   transform: translate(1px, 2px); }
    100% { clip-path: inset(50% 0 30% 0); transform: translate(-3px, -1px); }
}

.typewriter {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--green);
    min-height: 2em;
}

.prompt-symbol {
    color: var(--green-dim);
}

#typing-text {
    color: var(--green-dim);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    color: var(--green-dim);
    font-size: 0.8rem;
    animation: bounce 2s infinite;
}

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

/* ── Navigation ── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

nav a {
    color: var(--green-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0.3rem 0;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--green);
    transition: width 0.3s ease;
}

nav a:hover,
nav a.active {
    color: var(--green);
    text-shadow: 0 0 8px var(--green);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

/* ── Sections ── */
section,
article {
    position: relative;
    z-index: 1;
    padding: 5rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

section h2,
article h1 {
    font-size: 1.8rem;
    margin-bottom: 2.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.05em;
}

article h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.05em;
}

.hash {
    color: var(--green-dim);
    margin-right: 0.3rem;
}

/* ── Terminal Box ── */
.terminal-box {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.05);
    transition: box-shadow 0.3s;
}

.terminal-box:hover {
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.1);
}

.terminal-header {
    background: rgba(0, 255, 65, 0.04);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

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

.dot.red    { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.grn    { background: #27c93f; }

.terminal-title {
    margin-left: 0.8rem;
    color: var(--green-dim);
    font-size: 0.8rem;
    opacity: 0.7;
}

.terminal-body {
    padding: 1.5rem;
    font-size: 0.95rem;
}

.terminal-body .prompt {
    color: var(--green);
    margin-right: 0.5rem;
}

.terminal-body .bio {
    margin: 1rem 0;
    line-height: 1.8;
    color: rgba(0, 255, 65, 0.85);
}

.terminal-body .bio + .bio {
    margin-top: 0.5rem;
}

.highlight {
    color: var(--green);
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
}

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

.cert-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.cert-card:hover {
    border-color: var(--green);
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.15);
    transform: translateY(-5px);
}

.cert-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.4);
    position: relative;
}

.cert-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

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

.cert-img-wrap.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    color: var(--green-dim);
    opacity: 0.5;
}

.placeholder-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.cert-info {
    padding: 1.2rem 1.5rem;
    text-align: center;
}

.cert-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
    letter-spacing: 0.05em;
}

.cert-org {
    display: block;
    color: var(--green-dim);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cert-desc {
    font-size: 0.85rem;
    color: rgba(0, 255, 65, 0.6);
    margin: 0;
}

.cert-card.coming-soon {
    opacity: 0.65;
    cursor: default;
    border-style: dashed;
}

.cert-card.coming-soon:hover {
    transform: none;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.05);
}

/* ── Skills ── */
.skill-category {
    margin-bottom: 2.5rem;
}

.skill-category h3 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: var(--green);
}

.arrow {
    color: var(--green-dim);
    margin-right: 0.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: rgba(0, 255, 65, 0.04);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
}

.skill-tag:hover {
    border-color: var(--green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.1);
    background: rgba(0, 255, 65, 0.08);
    transform: translateY(-2px);
}

/* ── Contact ── */
.contact-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    transition: box-shadow 0.3s;
}

.contact-box:hover {
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.08);
}

.contact-box a {
    color: var(--green);
    text-decoration: none;
    transition: all 0.3s;
}

.contact-box a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px var(--green);
}

.label {
    color: var(--green-dim);
    margin-right: 0.8rem;
    font-size: 0.9rem;
}

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

.footer-line {
    width: 60px;
    height: 2px;
    background: var(--green);
    margin: 0 auto 1.5rem;
    opacity: 0.3;
}

.footer-tagline {
    margin-top: 0.5rem;
    opacity: 0.6;
}

/* ── Animations ── */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

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

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    header {
        min-height: 80vh;
        padding: 1.5rem;
    }

    nav ul {
        gap: 0.8rem;
    }

    nav a {
        font-size: 0.78rem;
    }

    section {
        padding: 3rem 1.2rem;
    }

    section h2 {
        font-size: 1.4rem;
    }

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

    .terminal-body {
        font-size: 0.85rem;
        padding: 1rem;
    }

    .skill-tags {
        gap: 0.5rem;
    }

    .skill-tag {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
    }
}

/* ── Post Grid (List Pages) ── */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.post-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    overflow: hidden;
}

.post-card:hover {
    border-color: var(--green);
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.15);
    transform: translateY(-4px);
}

.post-card-body {
    padding: 1.5rem;
}

.post-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    color: var(--green);
}

.post-date {
    display: block;
    color: var(--green-dim);
    font-size: 0.78rem;
    margin-bottom: 0.8rem;
    opacity: 0.7;
}

.post-summary {
    font-size: 0.88rem;
    color: rgba(0, 255, 65, 0.65);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.post-tags .skill-tag {
    font-size: 0.72rem;
    padding: 0.3rem 0.7rem;
}

/* ── Single Post ── */
.post-header {
    margin-bottom: 2rem;
}

.post-header .post-date {
    font-size: 0.85rem;
}

.post-header h1 {
    font-size: 2rem;
    margin: 0.5rem 0 1rem;
    color: var(--green);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-content .terminal-body {
    font-size: 0.95rem;
    line-height: 1.8;
}

.post-content .terminal-body h2 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

.post-content .terminal-body h3 {
    font-size: 1.15rem;
    margin: 1.5rem 0 0.8rem;
    color: var(--green);
}

.post-content .terminal-body h4 {
    font-size: 1rem;
    margin: 1.2rem 0 0.6rem;
    color: var(--green-dim);
}

.post-content .terminal-body p {
    margin-bottom: 1rem;
    color: rgba(0, 255, 65, 0.85);
}

.post-content .terminal-body ul,
.post-content .terminal-body ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: rgba(0, 255, 65, 0.8);
}

.post-content .terminal-body li {
    margin-bottom: 0.4rem;
}

.post-content .terminal-body code {
    background: rgba(0, 255, 65, 0.06);
    border: 1px solid var(--border);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: 'Share Tech Mono', 'Fira Code', monospace;
    font-size: 0.88em;
    color: var(--green);
}

.post-content .terminal-body pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 1.2rem 0;
}

.post-content .terminal-body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85em;
    line-height: 1.6;
}

.post-content .terminal-body blockquote {
    border-left: 3px solid var(--green);
    margin: 1.2rem 0;
    padding: 0.5rem 1rem;
    background: rgba(0, 255, 65, 0.03);
    color: rgba(0, 255, 65, 0.7);
    font-style: italic;
}

.post-content .terminal-body a {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: text-shadow 0.3s;
}

.post-content .terminal-body a:hover {
    text-shadow: 0 0 8px var(--green);
}

.post-content .terminal-body img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin: 1rem 0;
}

.post-content .terminal-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.post-content .terminal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.post-content .terminal-body th,
.post-content .terminal-body td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.8rem;
    text-align: left;
    font-size: 0.9rem;
}

.post-content .terminal-body th {
    background: rgba(0, 255, 65, 0.06);
}

/* ── Post Navigation ── */
.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.post-nav a {
    color: var(--green-dim);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.post-nav a:hover {
    color: var(--green);
    text-shadow: 0 0 8px var(--green);
}

/* ── Responsive for Posts ── */
@media (max-width: 768px) {
    .post-grid {
        grid-template-columns: 1fr;
    }

    .post-header h1 {
        font-size: 1.5rem;
    }

    .post-content .terminal-body {
        font-size: 0.85rem;
    }

    .post-nav {
        flex-direction: column;
        gap: 0.8rem;
    }
}
