@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg-yellow: #facc15;
    --bg-black: #000000;
    --text-black: #000000;
    --text-white: #ffffff;
    --border-color: #000000;
    --radius-main: 32px;
    --radius-card: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-yellow);
    color: var(--text-black);
    line-height: 1.5;
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
    scrollbar-color: var(--bg-black) var(--bg-yellow); /* Firefox support */
    scrollbar-width: thin;
}

/* The doodle wallpaper sits on its own fixed layer. (background-attachment: fixed makes the
   browser repaint the whole screen on every scroll step, which made scrolling lag.) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url("bg-pattern.svg") repeat;
    pointer-events: none;
    will-change: transform;
}

/* Custom Scrollbar Theme */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-yellow);
    border: 1px solid #000000;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #eab308;
}

body.loading {
    overflow: hidden;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-black);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease-in-out, visibility 0.6s;
}

.preloader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.preloader-content .spinner {
    width: 60px;
    height: 60px;
    border: 6px solid var(--bg-yellow);
    border-top: 6px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.preloader-content p {
    color: var(--bg-yellow);
    font-weight: 900;
    letter-spacing: 4px;
    font-size: 0.8rem;
    animation: pulse 1.5s infinite;
}

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

/* Skip Loader Styles */
.skip-loader #preloader {
    display: none !important;
}

.skip-loader body {
    opacity: 1 !important;
    overflow: auto !important;
}

body.loaded #preloader {
    opacity: 0;
    visibility: hidden;
}

body.loaded {
    opacity: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Restriction Overlay */
#mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #facc15; /* Force yellow background */
    background-image: url("bg-pattern.svg");
    z-index: 10001;
    display: none; /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    color: #000000;
    font-family: 'Inter', sans-serif;
}

.mobile-profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #000000;
    margin-bottom: -40px; /* Overlap with the box */
    z-index: 10004;
    background: white;
}

.mobile-profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-overlay-box {
    background: #facc15;
    border: 4px solid #000000;
    border-radius: 32px;
    padding: 60px 30px 30px 30px;
    z-index: 10003;
    max-width: 90%;
    position: relative;
}

.mobile-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.mobile-overlay-content i {
    font-size: 3rem;
    margin-bottom: 5px;
    color: #000000;
    animation: pulse 2s infinite;
}

.mobile-overlay-content h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 1;
    color: #000000;
}

.mobile-overlay-content p {
    font-size: 1rem;
    font-weight: 700;
    opacity: 0.9;
    line-height: 1.4;
    color: #000000;
}

.warning-stripes {
    width: 100%;
    height: 15px;
    background: repeating-linear-gradient(
        45deg,
        #000000,
        #000000 10px,
        #facc15 10px,
        #facc15 20px
    );
    background-size: 28.28px 28.28px; /* Perfect diagonal repeat for 20px stripe width */
    animation: stripe-slide 0.6s linear infinite;
    margin-top: 10px;
    border-radius: 10px;
}

@keyframes stripe-slide {
    from { background-position: 0 0; }
    to { background-position: 28.28px 0; }
}

.mobile-blog-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    padding: 12px 24px;
    background: #000000;
    color: #facc15;
    border: 2px solid #000000;
    border-radius: 12px;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
}

.mobile-blog-btn i {
    font-size: 1rem !important;
    margin: 0 !important;
    color: #facc15 !important;
    animation: none !important;
}

/* Pages with body.allow-mobile (the blog) stay readable on phones */
@media screen and (max-width: 600px) {
    body:not(.allow-mobile) #mobile-overlay {
        display: flex;
    }
    body:not(.allow-mobile) {
        overflow: hidden !important;
    }
    body:not(.allow-mobile) #preloader,
    body:not(.allow-mobile) header,
    body:not(.allow-mobile) .container,
    body:not(.allow-mobile) footer {
        display: none !important;
    }

    body.allow-mobile {
        padding: 10px;
    }
    body.allow-mobile header {
        padding: 12px 18px;
        border-radius: var(--radius-card);
    }
    body.allow-mobile .logo a {
        font-size: 1.1rem;
    }
    body.allow-mobile .container {
        padding: 18px;
        border-radius: 20px;
    }
}

/* The main nav is hidden below 768px; blog pages keep just the Blog link */
@media screen and (max-width: 768px) {
    body.allow-mobile .nav-links {
        display: flex !important;
    }
    body.allow-mobile .nav-links li:not(.nav-blog) {
        display: none;
    }
}

/* Floating Code Snippets */
.floating-code {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.05); /* Very low opacity */
    white-space: pre;
    pointer-events: none;
    z-index: -1;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.container, header {
    max-width: 1200px;
    margin: 0 auto 15px auto;
    background: var(--bg-yellow);
    border: 3px solid var(--bg-black); /* Matching contact section */
    border-radius: var(--radius-main);
    padding: 15px 30px;
    position: relative;
    z-index: 1;
}

header {
    /* Header specific styles if any */
}

.container {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Header & Nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-black);
}

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

.nav-links li a {
    text-decoration: none;
    color: var(--text-black);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 0.9;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 30px;
    text-align: justify;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 15px 30px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    display: inline-block;
}

.primary-btn {
    background: var(--bg-black);
    color: var(--bg-yellow);
}

.primary-btn:hover {
    transform: translate(-4px, -4px);
    box-shadow: 4px 4px 0 var(--border-color);
}

.secondary-btn {
    background: transparent;
    color: var(--text-black);
}

.secondary-btn:hover {
    background: rgba(0,0,0,0.05);
}

.hero-image img {
    width: 100%;
    border-radius: var(--radius-card);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.hero-image img:hover {
    transform: scale(1.02);
}

/* Stats Grid (The Blocks) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-block {
    background: var(--bg-black);
    color: var(--text-white);
    padding: 30px;
    border-radius: var(--radius-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
}

.stat-block:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bg-yellow);
}

.stat-label {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
/* Timeline Section */
/* Section Headers with View All Buttons */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    margin-bottom: 0 !important;
}

.view-all-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-black);
    color: var(--bg-yellow);
    padding: 8px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    border: 2px solid var(--bg-black);
}

.view-all-btn:hover {
    background: var(--bg-yellow);
    color: var(--bg-black);
    transform: translateY(-2px);
}

.view-all-btn i {
    font-size: 0.8rem;
}

.timeline-section h2 {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--bg-black);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 40px; /* Length of the horizontal connecting line */
    height: 4px; /* Thickness same as vertical line */
    background-color: var(--bg-black);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.left::after {
    right: 0; /* Sticks out to the right toward the center line */
}

.right::after {
    left: 0; /* Sticks out to the left toward the center line */
}

/* Status Indicators inside the cards */
.status-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid var(--bg-black);
}

/* Completed Status - Green Tick */
.status-completed {
    background-color: #22c55e;
    position: relative;
}

.status-completed::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 14px;
    color: white;
    width: auto !important; /* Resetting the line style */
    height: auto !important;
    background: transparent !important;
}

/* Active Status - Orange Blinking */
.status-active {
    background-color: #f97316;
    animation: pulse-orange 2s infinite;
}

@keyframes pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

.timeline-content {
    padding: 20px;
    background-color: var(--bg-black);
    color: var(--text-white);
    position: relative;
    border-radius: var(--radius-card);
    display: flex;
    align-items: center;
    gap: 20px;
}

.experience-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: white;
    padding: 5px;
    border-radius: 12px;
    flex-shrink: 0;
}

.experience-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.timeline-content h3 {
    color: var(--bg-yellow);
    font-weight: 900;
    margin-bottom: 2px;
    font-size: 1.1rem;
}

.timeline-content p {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.timeline-content .date {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    display: block;
    margin-top: 10px;
    opacity: 0.8;
}

.know-more {
    align-self: flex-start;
    margin-top: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bg-yellow);
    text-decoration: underline;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
}

.know-more:hover {
    color: var(--text-white);
    transform: translateX(5px);
}

@media screen and (max-width: 600px) {
    .timeline::after {
        left: 31px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        left: 0 !important; /* Force all items to start from left */
    }
    .timeline-item::after {
        left: 31px !important;
        width: 39px !important; /* Distance from 31px line to start of card (70px padding - 31px = 39px) */
        right: auto !important;
    }
    .right {
        left: 0%;
    }
}

/* Contact Section */
.contact-container {
    padding: 0;
    background: transparent;
    border: none;
}

.contact-wrapper {
    display: flex;
    gap: 40px;
    align-items: stretch;
    width: 100%;
    background: var(--bg-yellow); /* Yellow Box */
    color: var(--text-black);    /* Black Text */
    padding: 60px;
    border-radius: var(--radius-main);
    border: 3px solid var(--bg-black); /* Black Border */
}

.contact-left, .contact-right {
    flex: 1;
    min-width: 0;
}

.contact-form {
    background: transparent;
    padding: 0;
}

.contact-form h2 {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 40px;
    color: var(--text-black);
    text-align: left;
}

.contact-form form {
    width: 100%;
    display: grid;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text-black);
    letter-spacing: 1px;
}

.form-group input, .form-group textarea {
    width: 100%;
    background: white;
    border: 2px solid var(--bg-black);
    padding: 18px;
    color: var(--text-black);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 700; /* Making it bold to match theme */
    font-size: 1.1rem;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--bg-black);
}

.form-group textarea {
    min-height: 150px;
    resize: none; /* Removing the resize handle */
}

.contact-form .btn.primary-btn {
    background: var(--bg-black);
    color: var(--bg-yellow);
    width: auto;
    min-width: 200px;
    margin: 20px 0 0 0;
    border: none;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 30px;
}

.contact-form .btn.primary-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.quote-container {
    padding: 0 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 2px solid rgba(0, 0, 0, 0.1);
}

.quote-icon {
    font-size: 3rem;
    color: var(--bg-black);
    opacity: 0.8;
    margin-bottom: 20px;
}

.quote-text {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--text-black);
    margin-bottom: 20px;
    text-align: justify;
}

.quote-author {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-black);
    text-align: right;
}

@media (max-width: 992px) {
    .contact-wrapper {
        flex-direction: column;
        padding: 30px 20px; /* Reduced from 40px */
        gap: 20px; /* Reduced gap between quote and form */
    }
    .contact-right {
        order: -1; /* Keep quote on top */
    }
    .quote-container {
        border-left: none;
        border-top: none; /* Removed the line divider */
        padding: 0 0 10px 0; /* Minimal bottom padding */
        margin-top: 0; /* Removed top margin */
        text-align: center;
    }
    .quote-text {
        font-size: 1.5rem;
    }
}

/* Minimal Footer */
footer {
    max-width: 1200px;
    margin: 40px auto 20px auto;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid var(--bg-black);
    position: relative;
    z-index: 1;
}

.footer-left p {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-black);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-right {
    display: flex;
    gap: 20px;
}

.icon-link {
    font-size: 1.2rem;
    color: var(--text-black);
    transition: var(--transition);
}

.icon-link:hover {
    color: var(--bg-black);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    .hero {
        grid-template-columns: 1fr;
    }
    .hero-image {
        order: -1;
    }
    .nav-links {
        display: none; /* Add mobile menu later if needed */
    }
    .contact-form {
        max-width: 95%;
        padding: 40px 20px;
    }
}

/* Featured Projects Section */
.projects-section h2 {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
}

.featured-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.featured-project-card {
    background: white;
    border: 3px solid var(--bg-black);
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    width: 100%;
}

@media (max-width: 768px) {
    .featured-project-card {
        max-width: 100%;
    }
}

.featured-project-card:hover {
    transform: translate(-8px, -8px);
    box-shadow: 8px 8px 0px var(--bg-black);
}

.project-links .know-more {
    text-decoration: none !important;
    font-size: 0.85rem !important;
    transition: var(--transition);
}

.project-links .know-more:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.featured-project-card.coming-soon {
    border: 3px dashed #cbd5e1;
    background: #f8fafc;
    box-shadow: none;
    cursor: default;
}

.featured-project-card.coming-soon:hover {
    transform: none;
    box-shadow: none;
}

.project-image {
    width: 100%;
    height: 300px;
    border-bottom: 3px solid var(--bg-black);
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: var(--transition);
}

.featured-project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

.project-content h3 {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-black);
}

.project-content p {
    font-size: 1rem;
    color: var(--text-black);
    line-height: 1.4;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.project-tags span {
    background: var(--bg-black);
    color: var(--bg-yellow);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* GitHub Contributions Section */

.github-container {
    background: var(--bg-yellow);
    border: 3px solid var(--bg-black);
    border-radius: var(--radius-main);
    padding: 40px;
    margin-bottom: 15px;
}

.github-section h2 {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 30px;
}

/* GitHub Chart Styling */
.github-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.github-chart img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px; /* Soften the corners of the heatmap boxes slightly */
}

.chart-wrapper {
    background: white;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid var(--bg-black);
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    overflow: visible; /* Allow tooltips to float outside */
    position: relative;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
}

.github-stats {
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Custom GitHub Tooltip */
#github-tooltip {
    position: absolute;
    background: var(--bg-yellow);
    border: 2px solid var(--bg-black);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bg-black);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    white-space: nowrap;
    text-transform: uppercase;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.2);
}

/* Tooltip Arrow */
#github-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--bg-black);
}

.github-stats a {
    color: var(--bg-black);
    text-decoration: underline;
    transition: var(--transition);
}

.github-stats a:hover {
    color: #30a14e; /* GitHub Green */
}

@media (max-width: 768px) {
    .github-container {
        padding: 20px;
    }
}

/* Documentation Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border: 3px solid var(--bg-black);
    width: 80%;
    max-width: 900px;
    height: 80vh;
    border-radius: var(--radius-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlide {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 30px;
    background: var(--bg-black);
    color: var(--bg-yellow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 1px;
}

.close-modal {
    color: var(--bg-yellow);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    transform: scale(1.2) rotate(90deg);
}

.markdown-body {
    padding: 40px;
    overflow-y: auto;
    flex-grow: 1;
    background: #fff;
    color: #24292e;
}

/* Loader for modal */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--bg-black);
    border-radius: 50%;
    animation: spin-modal 1s linear infinite;
}

@keyframes spin-modal {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* ===== Top bar: sticky, brand, links with a current-page pill ===== */
html {
    scroll-padding-top: 110px;
}

header {
    max-width: 1280px;   /* only the bar is wider than the page boxes */
    position: sticky;
    top: 12px;
    z-index: 100;
    padding: 12px 28px;
    transition: padding 0.25s ease;
}

header nav {
    gap: 14px 16px;
    flex-wrap: nowrap;
    justify-content: flex-start;   /* the brand stays left; the links sit on the right */
}

.nav-links {
    margin-left: auto;
}

/* once pinned, a plain yellow band fills the gap above the bar so no page content shows through it */
header.is-scrolled::before {
    content: '';
    position: absolute;
    top: -100px;   /* measured from inside the 3px border, so 97px of height ends at the bar's outer top edge */
    height: 97px;
    left: -100vw;
    right: -100vw;
    background: var(--bg-yellow);
}

/* brand: photo + name + role */
.logo a.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: none;
    font-size: inherit;
    white-space: nowrap;
}

.brand-avatar {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    object-fit: cover;
    object-position: 50% 22%;
    background: white;
    border: 3px solid var(--bg-black);
    border-radius: 50%;
    transition: width 0.25s ease, height 0.25s ease;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
}

.brand-text small {
    font-family: 'Space Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.75;
    max-height: 1em;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.25s ease;
}

/* links, each with a small icon; the current page is a white pill */
.nav-links {
    gap: 4px;
    flex-wrap: nowrap;
}

.nav-links li a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 2px solid transparent;
    border-radius: 10px;
    white-space: nowrap;
}

.nav-links li a i {
    display: inline-block;
    width: 1.1em;
    text-align: center;
}

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

.nav-links li a.is-current {
    background: white;
    border-color: var(--bg-black);
    box-shadow: 2px 2px 0 var(--bg-black);
}

.nav-links li a:focus-visible,
.brand:focus-visible {
    outline: 3px solid var(--bg-black);
    outline-offset: 2px;
}

@media (max-width: 1180px) {
    .nav-links li a i {
        display: none;
    }
}

@media (max-width: 960px) {
    header nav {
        gap: 10px;
    }

    .nav-links li a {
        padding: 6px 6px;
    }
}

@media (max-width: 900px) {
    .brand-text {
        display: none;
    }
}

/* phones (only the blog is open there): just the brand, and the bar scrolls away with the page */
@media (max-width: 768px) {
    header {
        position: relative;
        top: auto;
        padding: 8px 14px;
    }

    header nav {
        gap: 10px;
    }

    .brand-text {
        display: flex;
    }

    .brand-text strong {
        font-size: 1rem;
    }

    .brand-text small {
        display: block;
        font-size: 0.56rem;
    }

    .brand-avatar {
        width: 40px;
        height: 40px;
    }

    body.allow-mobile header .nav-links {
        display: none !important;
    }

    /* the bar is not pinned here, so the yellow band is not needed */
    header.is-scrolled::before {
        display: none;
    }

}

@media (prefers-reduced-motion: reduce) {
    header,
    .brand-avatar,
    .brand-text small {
        transition: none;
    }
}

/* Inline code everywhere: a soft highlight, not a black box (pages may restyle code inside <pre>) */
code {
    font-family: 'Space Mono', monospace;
    font-size: 0.85em;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 1px 6px;
    border-radius: 4px;
}

pre code {
    background: none;
    border: none;
    color: inherit;
    padding: 0;
}
