:root {
    --bg-color: #0a0b0d;
    --terminal-bg: #111418;
    --primary-color: #00ff66; /* Matrix Green */
    --accent-color: #00e5ff;  /* Cyber Cyan */
    --text-color: #e0e6ed;
    --border-color: #263238;
    --muted-color: #607d8b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
}

/* Terminal Wrapper */
.terminal-container {
    width: 100%;
    max-width: 900px;
    background-color: var(--terminal-bg);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 255, 102, 0.15);
    border-radius: 6px;
    overflow: hidden;
}

/* Top Bar Windows Style */
.terminal-header {
    background-color: #1a1f26;
    padding: 10px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.close { background-color: #ff5f56; }
.minimize { background-color: #ffbd2e; }
.maximize { background-color: #27c93f; }

.terminal-title {
    margin-left: 20px;
    color: var(--muted-color);
    font-size: 0.85rem;
}

/* Tab Navigation */
.terminal-nav {
    display: flex;
    background: #14181f;
    border-bottom: 1px solid var(--border-color);
}

.nav-btn {
    background: none;
    border: none;
    color: var(--muted-color);
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.nav-btn:hover, .nav-btn.active {
    color: var(--primary-color);
    background-color: var(--terminal-bg);
    text-shadow: 0 0 8px rgba(0, 255, 102, 0.5);
}

/* Screen Content Content Area */
.terminal-body {
    padding: 25px;
    min-height: 450px;
    line-height: 1.6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Typography Elements */
.glitch-text {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.5);
}

.prompt-line::before {
    content: "josh@core:~$ ";
    color: var(--accent-color);
}

.prompt-line {
    margin-bottom: 25px;
}

h3 {
    color: var(--accent-color);
    margin: 20px 0 10px 0;
    text-transform: uppercase;
}

/* Lists and Grids */
.skills-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    color: var(--text-color);
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-card {
    border: 1px dashed var(--border-color);
    padding: 15px;
    border-radius: 4px;
}

.project-card h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

/* Dynamic Blog Styling */
.blog-post-summary {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.blog-post-summary h2 a {
    color: var(--primary-color);
    text-decoration: none;
}

.blog-post-summary h2 a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

.post-meta {
    font-size: 0.8rem;
    color: var(--muted-color);
    margin-bottom: 8px;
}

.terminal-link {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 1rem;
    text-decoration: underline;
    margin-bottom: 20px;
}

/* Single Full Post Elements */
.single-post-view h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.single-post-view div {
    margin-top: 15px;
}

.hidden { display: none; }
.loading { color: var(--muted-color); animation: blink 1s infinite; }

/* System Footer */
.terminal-footer {
    background-color: #14181f;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted-color);
    border-top: 1px solid var(--border-color);
}

.status-indicator {
    color: var(--primary-color);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Profile Grid Formatting */
.profile-layout {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.profile-frame {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.3);
    overflow: hidden;
}

/* Gritty Cyberpunk Image Processing */
.cyber-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(140%) brightness(90%);
    mix-blend-mode: luminosity;
    display: block;
}

/* Scanline and Green Tint Matrix Effect Layer */
.profile-frame::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%), rgba(0, 255, 102, 0.15);
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

.profile-bio {
    flex-grow: 1;
}

.profile-bio p {
    margin-bottom: 12px;
}

/* Responsive adjustment for small mobile displays */
@media (max-width: 600px) {
    .profile-layout {
        flex-direction: column;
        align-items: center;
        text-align: left;
    }
    .profile-frame {
        width: 130px;
        height: 130px;
    }
}

/* Resume Tab Structural Layout */
.resume-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    margin-top: 15px;
}

.resume-sidebar, .resume-main {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Tool Inventory Text Layout blocks */
.skill-group {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.skill-category {
    color: var(--accent-color);
    font-weight: bold;
    display: block;
}

.skill-group p {
    color: var(--text-color);
}

/* Certifications Data Listing */
.cert-list {
    list-style: none;
    font-size: 0.9rem;
}

.cert-list li {
    margin-bottom: 6px;
    display: flex;
    gap: 15px;
}

.cert-list li span {
    color: var(--muted-color);
    font-weight: bold;
}

/* Experience Deployment Timeline Formatting */
.timeline {
    border-left: 2px dashed var(--border-color);
    padding-left: 15px;
    margin-left: 5px;
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-item::before {
    content: "■";
    position: absolute;
    left: -21px;
    top: 2px;
    background: var(--terminal-bg);
    color: var(--primary-color);
    font-size: 0.7rem;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--muted-color);
    font-weight: bold;
}

.timeline-title {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.timeline-org {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 6px;
}

.timeline-item p {
    font-size: 0.9rem;
    color: var(--text-color);
}

.education-block {
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 4px;
}

/* Responsive Overrides for Compact Viewports */
@media (max-width: 768px) {
    .resume-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.hidden {
    display: none !important;
}

/* Featured Post Image Styling */
.blog-featured-frame {
    position: relative;
    width: 100%;
    /* Max-height is now a ceiling, not a rigid boundary */
    max-height: 450px; 
    margin-bottom: 20px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.2);
    overflow: hidden;
    border-radius: 4px;
    background-color: #0d1013; /* Dark background to fill any letterboxing if needed */
}

.blog-featured-img {
    width: 100%;
    height: auto;
    max-height: 450px;
    /* Instructs the browser to preserve natural aspect ratios entirely */
    object-fit: contain; 
    filter: grayscale(100%) contrast(130%) brightness(85%);
    mix-blend-mode: luminosity;
    display: block;
    margin: 0 auto; /* Centers the image if it's narrower than the terminal window */
}

/* Gritty overlay filter mapped cleanly over the fluid image display boundary */
.blog-featured-frame::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%), rgba(0, 255, 102, 0.1);
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

/* Contact bar at the top of the resume */
.resume-contact-bar {
    background-color: #161b22;
    border: 1px dashed var(--border-color);
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    margin-bottom: 25px;
    color: var(--accent-color);
}

/* Timeline specific updates */
.timeline-summary {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin: 5px 0 10px 0;
    line-height: 1.4;
}

/* Styling for the core technical bullet points */
.mission-bullets {
    padding-left: 20px;
    list-style-type: "▪ ";
    font-size: 0.85rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.mission-bullets li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.mission-bullets strong {
    color: var(--accent-color);
}

/* Compact historical timeline entries with no bullets */
.legacy-node {
    margin-bottom: 12px;
}

.org-inline {
    font-size: 0.85rem;
    color: var(--muted-color);
    font-weight: normal;
    font-style: italic;
}

/* Education styling */
.edu-institution {
    color: var(--accent-color);
    display: block;
    font-size: 0.85rem;
}

/* Credentials Tab Badge Grid Layout */
.credentials-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Individual Badge Blueprint Border Frames */
.badge-card {
    background-color: #14181f;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.25s ease-in-out;
}

.badge-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 255, 102, 0.25);
    transform: translateY(-2px);
}

/* Container defining badge sizes and scan overlay boundaries */
.badge-glow-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 12px;
}

/* Formats the raw imagery assets pulled directly from the API */
.credely-badge-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Keeps images adhering to a gritty, high-contrast, security system style feed */
    filter: grayscale(100%) contrast(120%) brightness(95%);
    mix-blend-mode: luminosity;
    display: block;
}

.badge-card:hover .credely-badge-img {
    filter: none; /* Restore original vibrant colors instantly on explicit user hovering action */
    mix-blend-mode: normal;
}

/* Details and identification text formatting blocks */
.badge-details h4 {
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.badge-card:hover .badge-details h4 {
    color: var(--primary-color);
}

.badge-id {
    display: block;
    font-size: 0.75rem;
    color: var(--muted-color);
    margin-bottom: 12px;
}

/* High-visibility Action Command Buttons */
.terminal-link-btn {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent-color);
    text-decoration: none;
    border: 1px solid var(--accent-color);
    padding: 5px 10px;
    border-radius: 3px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.terminal-link-btn:hover {
    background-color: var(--accent-color);
    color: #0a0b0d;
    box-shadow: 0 0 8px var(--accent-color);
}

/* Placeholder styling for non-Credely cards */
.local-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--muted-color);
    border-radius: 50%;
    background: rgba(22, 27, 34, 0.6);
}

/* Green monospace code string representing missing badge iconography */
.matrix-symbol {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: bold;
    letter-spacing: 1px;
}

/* Static confirmation status text for agency tokens */
.terminal-status-tag {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--muted-color);
    letter-spacing: 0.5px;
    border: 1px dashed #30363d;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

/* Optional variance tweak to subtly differentiate agency logs */
.local-token:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.15); /* Soft Amber/Cyan highlight instead of pure green */
}