/* ==========================================================================
   MILAN TIWARI PORTFOLIO — DESIGN SYSTEM & STYLESHEET
   Aesthetic: Neo-Brutalist Minimalist-Maximalism & Editorial Creative UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    /* Warm Paper Theme (Default Light) */
    --bg: #F7F2EC;
    --surface: #FFFFFF;
    --surface-alt: #EFE8DE;
    --card: #FFFDF9;
    --text: #121316;
    --muted: #5C6068;
    --border: #121316;
    --primary: #D4FF00;
    --primary-contrast: #121316;
    --accent: #FF3B30;
    --badge-bg: #121316;
    --badge-text: #D4FF00;
    --shadow: 4px 4px 0 0 #121316;
    --shadow-hover: 7px 7px 0 0 #121316;
    --shadow-active: 1px 1px 0 0 #121316;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-pill: 9999px;
    --font-serif: 'Instrument Serif', serif;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --transition-fast: 0.15s cubic-bezier(0.2, 0, 0, 1);
    --transition-normal: 0.25s cubic-bezier(0.2, 0, 0, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Utilities */
h1, h2, h3, h4 {
    color: var(--text);
    font-weight: 700;
    line-height: 1.1;
}

.serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
}

.mono {
    font-family: var(--font-mono);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: 2px 2px 0 0 var(--border);
}

.eyebrow-accent {
    background: var(--primary);
    color: var(--primary-contrast);
}

/* Layout Containers */
.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

section {
    padding: 5rem 0;
    border-bottom: 2px solid var(--border);
}

/* Buttons & Interactive Components */
.btn-neo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--primary);
    color: var(--primary-contrast);
    box-shadow: var(--shadow);
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn-neo:hover {
    transform: translate(-3px, -3px);
    box-shadow: var(--shadow-hover);
}

.btn-neo:active {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-active);
}

.btn-neo-secondary {
    background: var(--surface);
    color: var(--text);
}

.btn-neo-dark {
    background: var(--border);
    color: var(--bg);
}

/* Card Base */
.card-neo {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card-neo:hover {
    transform: translate(-3px, -3px);
    box-shadow: var(--shadow-hover);
}

/* Sticky Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    padding: 1rem 0;
    transition: background var(--transition-normal);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--primary);
    color: var(--primary-contrast);
    border: 2px solid var(--border);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    box-shadow: 2px 2px 0 0 var(--border);
}

.brand-title {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.brand-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: 2px 2px 0 0 var(--border);
    white-space: nowrap;
    flex-shrink: 0;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #22C55E;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle-btn {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 2px 2px 0 0 var(--border);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* Hero Section */
.hero-section {
    padding: 6rem 0 4rem 0;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 3rem;
    align-items: center;
}

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

.hero-headline {
    font-size: clamp(2.8rem, 5.5vw, 4.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.hero-headline span.highlight {
    background: var(--primary);
    color: var(--primary-contrast);
    padding: 0 0.4rem;
    border: 2px solid var(--border);
    display: inline-block;
    box-shadow: 3px 3px 0 0 var(--border);
}

.hero-sub {
    font-size: 1.18rem;
    color: var(--muted);
    max-width: 46ch;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.hero-visual {
    position: relative;
}

.badge-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.badge-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge-card-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-big {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    font-family: var(--font-sans);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

/* Marquee Section */
.marquee-container {
    background: var(--border);
    color: var(--bg);
    overflow: hidden;
    padding: 0.9rem 0;
    border-top: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    user-select: none;
}

.marquee-track {
    display: flex;
    white-space: nowrap;
    animation: marquee 25s linear infinite;
}

.marquee-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.marquee-star {
    color: var(--primary);
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}


/* About Section */
.about-content-grid {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 3.5rem;
    align-items: center;
    margin-top: 2rem;
}

.about-text-col {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.about-statement {
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    line-height: 1.25;
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--text);
}

.about-biography {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* React Bits TiltedCard Component Styles */
.tilted-card-figure {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: 380px;
    perspective: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    cursor: pointer;
}

.tilted-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid var(--border);
    box-shadow: 10px 10px 0px var(--border);
    background: var(--surface);
}

.tilted-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 13px;
    will-change: transform;
    transform: translateZ(0);
}

.tilted-card-overlay {
    position: absolute;
    bottom: 1.2rem;
    left: 1.2rem;
    z-index: 2;
    will-change: transform;
    transform: translateZ(30px);
}

.tilted-card-demo-text {
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(8px);
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tilted-card-caption {
    pointer-events: none;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 6px;
    background-color: var(--accent);
    color: #000;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    z-index: 10;
    white-space: nowrap;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -120%);
}

/* Section Header */
.section-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.section-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.section-title {
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    letter-spacing: -0.02em;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 60ch;
}

/* Project Filter Tabs */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 2px 2px 0 0 var(--border);
    transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--border);
    color: var(--bg);
}

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    background: var(--card);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.project-type-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    background: var(--primary);
    color: var(--primary-contrast);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
}

.project-title {
    font-size: 1.55rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.project-desc {
    font-size: 0.98rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tech-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.8rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    background: var(--surface-alt);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
}

/* Skills Grid (No artificial levels) */
.skills-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-category-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.skill-category-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.skill-pill {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 2px 2px 0 0 var(--border);
    color: var(--text);
}

/* Experience & Certifications Timeline */
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.timeline-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.timeline-title {
    font-size: 1.35rem;
    font-weight: 800;
}

.timeline-org {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    background: var(--text);
    color: #FFFFFF;
    border: 2px solid var(--border);
    border-radius: var(--radius-pill);
    white-space: nowrap;
    box-shadow: 2px 2px 0 0 var(--border);
}

.timeline-bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.timeline-bullets li {
    position: relative;
    padding-left: 1.25rem;
}

.timeline-bullets li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--border);
    font-size: 0.8rem;
}

/* Contact & Copy Email Box */
.contact-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 3.5rem 2.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.contact-headline {
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    font-weight: 800;
    max-width: 22ch;
    line-height: 1.1;
}

.email-copier-box {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    padding: 0.6rem 0.6rem 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    box-shadow: 3px 3px 0 0 var(--border);
    max-width: 100%;
}

.email-address-text {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
}

.social-links-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Modal Drawer Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(18, 19, 22, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 8px 8px 0 0 var(--border);
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-family: var(--font-mono);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 2px 2px 0 0 var(--border);
}

.modal-close-btn:hover {
    background: var(--accent);
    color: #FFFFFF;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.modal-body {
    line-height: 1.7;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Toast Feedback */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 300;
    background: var(--border);
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--primary);
    box-shadow: 4px 4px 0 0 var(--primary);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.toast-notification.active {
    transform: translateY(0);
    opacity: 1;
}

/* Footer */
footer {
    padding: 2.5rem 0;
    background: var(--bg);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--muted);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Mobile Menu Toggle & Navigation Drawer */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: var(--primary-contrast);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 2px 2px 0 0 var(--border);
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.mobile-menu-toggle:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 0 var(--border);
}

.mobile-nav-menu {
    display: none;
}

/* ==========================================================================
   PYTHON IDE WINDOW (HERO SECTION BASE STYLES)
   ========================================================================== */

.ide-window {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 1.5rem 0;
    max-width: 760px;
    width: 100%;
    box-sizing: border-box;
}

.ide-header {
    background: var(--surface-alt);
    border-bottom: 2px solid var(--border);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ide-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: inline-block;
}

.ide-dot-red { background: #FF5F56; }
.ide-dot-yellow { background: #FFBD2E; }
.ide-dot-green { background: #27C93F; }

.ide-tab {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
}

.btn-run-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    background: var(--primary);
    color: var(--primary-contrast);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 2px 2px 0 0 var(--border);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.btn-run-code:hover {
    transform: translate(-1px, -1px);
}

.btn-run-code:active {
    transform: translate(1px, 1px);
}

.ide-code-body {
    padding: 1.25rem 0.85rem;
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.15vw, 0.85rem);
    line-height: 1.65;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.ide-line {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    min-height: 1.5em;
    min-width: 0;
}

.ide-num {
    color: var(--muted);
    user-select: none;
    font-size: 0.8rem;
    width: 2rem;
    min-width: 2rem;
    flex-shrink: 0;
    text-align: right;
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
    display: inline-block;
}

.ide-text {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    color: var(--text);
    flex-grow: 1;
    min-width: 0;
}

/* Syntax Highlighting */
.syn-kw { color: var(--accent); font-weight: 700; }
.syn-fn { color: #2563EB; font-weight: 700; }
.syn-cls { color: #D97706; font-weight: 700; }
.syn-str { color: #059669; font-weight: 600; }
.syn-cm { color: var(--muted); font-style: italic; }

.ide-footer {
    background: var(--surface-alt);
    border-top: 2px solid var(--border);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ide-output-text {
    color: #059669;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (MUST BE AT THE VERY BOTTOM OF STYLESHEET)
   ========================================================================== */

@media (max-width: 900px) {
    html, body {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0.85rem !important;
        padding-right: 1.35rem !important; /* Extra padding on right to contain 4px/7px box shadows! */
        box-sizing: border-box !important;
    }

    section {
        padding: 3.5rem 0;
    }

    /* Enforce box shadow containment */
    .card-neo,
    .btn-neo,
    .ide-window,
    .badge-card,
    .skill-category-card,
    .timeline-card,
    .contact-card,
    .project-card,
    .tilted-card-figure {
        max-width: calc(100% - 6px) !important;
        box-sizing: border-box !important;
    }

    /* Mobile Header & Nav Drawer */
    .mobile-menu-toggle {
        display: inline-flex !important;
    }

    .nav-links {
        display: none !important;
    }

    .mobile-nav-menu {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        background: var(--bg);
        border-bottom: 2px solid var(--border);
        padding: 1.5rem 1.25rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: transform var(--transition-normal), opacity var(--transition-normal);
        z-index: 150;
    }

    .mobile-nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        list-style: none;
    }

    .mobile-nav-link {
        font-family: var(--font-mono);
        font-size: 1.05rem;
        font-weight: 700;
        text-decoration: none;
        color: var(--text);
        padding: 0.6rem 0;
        border-bottom: 1.5px dashed var(--border);
        display: block;
        transition: color var(--transition-fast);
    }

    .mobile-nav-link:hover {
        color: var(--accent);
    }

    .mobile-nav-cta {
        width: calc(100% - 6px);
        justify-content: center;
        font-size: 0.95rem;
        padding: 0.85rem;
    }

    /* Hero Section Mobile */
    .hero-section {
        padding: 2.25rem 0 1.75rem 0;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .hero-headline {
        font-size: clamp(1.75rem, 5.8vw, 2.8rem);
        word-break: break-word;
        line-height: 1.1;
        max-width: 100%;
    }

    .hero-headline span.highlight {
        display: inline-block;
        max-width: calc(100% - 6px);
        padding: 0.15em 0.35em;
        font-size: 0.88em;
        box-shadow: 3px 3px 0 0 var(--border);
        white-space: normal;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .hero-sub {
        font-size: 1rem;
        max-width: 100%;
    }

    .hero-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .hero-actions .btn-neo {
        width: calc(100% - 6px) !important;
        justify-content: center;
        text-align: center;
    }

    /* Eyebrow pills wrapping on mobile */
    .hero-badges {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.6rem;
    }

    .hero-badges .eyebrow {
        white-space: normal;
        word-break: break-word;
        text-align: left;
        max-width: calc(100% - 6px);
        font-size: 0.72rem;
        padding: 0.35rem 0.75rem;
        line-height: 1.4;
    }

    /* Python IDE Window Mobile Override */
    .ide-window {
        width: calc(100% - 6px) !important;
        max-width: calc(100% - 6px) !important;
        margin: 1.25rem 0;
        overflow: hidden;
    }

    .ide-code-body {
        padding: 0.85rem 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .ide-line {
        min-width: 0;
    }

    .ide-text {
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        min-width: 0;
    }

    .ide-footer {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
    }

    .ide-output-text {
        font-size: clamp(0.68rem, 2.5vw, 0.78rem);
        word-break: break-word;
        overflow-wrap: anywhere;
        max-width: 100%;
        line-height: 1.35;
    }

    /* Hero Visual Card Mobile */
    .badge-card {
        padding: 1.25rem 1rem;
        max-width: calc(100% - 6px) !important;
        box-sizing: border-box;
    }

    .badge-card-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .stat-big {
        font-size: clamp(1.3rem, 5vw, 1.85rem);
        word-break: break-word;
        margin: 0.3rem 0;
    }

    .stat-row {
        font-family: var(--font-mono);
        font-size: 0.8rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
        margin-top: 0.4rem;
    }

    .stat-validation {
        font-family: var(--font-mono);
        font-size: 0.76rem;
        color: var(--muted);
        word-break: break-all;
        overflow-wrap: anywhere;
        max-width: 100%;
        margin-top: 0.2rem;
    }

    /* About Section Mobile */
    .about-content-grid {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }

    .tilted-card-figure {
        max-width: 280px;
        height: 340px;
    }

    .about-statement {
        font-size: clamp(1.25rem, 4.2vw, 1.75rem);
    }

    .about-biography {
        font-size: 1rem;
    }

    /* Projects Grid Mobile */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Contact Card Mobile */
    .contact-card {
        padding: 2.25rem 1.15rem;
        max-width: calc(100% - 6px) !important;
    }

    .email-copier-box {
        flex-direction: column;
        align-items: stretch;
        width: calc(100% - 6px) !important;
        padding: 1rem;
        text-align: center;
        gap: 0.85rem;
    }

    .email-address-text {
        font-size: 0.92rem;
        word-break: break-all;
    }

    #copyEmailBtn {
        width: 100%;
        justify-content: center;
    }

    .social-links-grid {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .social-links-grid .btn-neo {
        width: calc(100% - 6px) !important;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .nav-cta-btn {
        display: none !important;
    }

    .brand-tag {
        display: none !important;
    }

    .section-title {
        font-size: clamp(1.65rem, 6vw, 2.2rem);
    }

    .filter-tabs {
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.4rem;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        max-width: 100%;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.85rem;
        flex-shrink: 0;
    }

    .project-card {
        padding: 1.25rem 1rem;
        max-width: calc(100% - 6px) !important;
    }

    .project-title {
        font-size: 1.3rem;
    }

    .project-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.65rem;
    }

    .project-actions .btn-neo {
        width: 100% !important;
        justify-content: center;
    }

    .skills-group-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .skill-category-card {
        padding: 1.25rem 1rem;
        max-width: calc(100% - 6px) !important;
    }

    .timeline-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .timeline-card {
        padding: 1.25rem 1rem;
        max-width: calc(100% - 6px) !important;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .timeline-date {
        align-self: flex-start;
    }

    /* Modal Drawer on Small Mobile */
    .modal-overlay {
        padding: 0.5rem;
    }

    .modal-container {
        padding: 1.35rem 1rem;
        max-height: 92vh;
        max-width: calc(100% - 6px) !important;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    /* Toast Notification on Mobile */
    .toast-notification {
        left: 0.85rem;
        right: 0.85rem;
        bottom: 1rem;
        width: calc(100% - 1.7rem);
        text-align: center;
        font-size: 0.8rem;
        padding: 0.75rem 0.85rem;
    }
}
