/* ═══════════════════════════════════════════════════════
   CSS Custom Properties
═══════════════════════════════════════════════════════ */
:root {
    --primary: #1a2942;
    /* Deep Navy */
    --secondary: #243b55;
    /* Mid Navy */
    --accent: #0a84ff;
    /* Electric Blue */
    --accent-dark: #0060cc;
    /* Hover Blue */
    --bg: #f0f2f5;
    /* Off-white background */
    --card-bg: #ffffff;
    --text: #1c1c1e;
    --text-light: #636366;
    --border: #d1d1d6;
    --success: #34c759;
    --radius: 10px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.14);
    --transition: 0.25s ease;
}

/* System preference dark mode (when no manual override is set) */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --primary: #90caf9;
        --secondary: #64b5f6;
        --accent: #42a5f5;
        --accent-dark: #1e88e5;
        --bg: #121212;
        --card-bg: #1e1e1e;
        --text: #e0e0e0;
        --text-light: #aaaaaa;
        --border: #333333;
        --success: #81c784;
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    }
    html:not([data-theme="light"]) header,
    html:not([data-theme="light"]) footer {
        background-color: #0d1b2a;
    }
}

/* Manual dark mode override (set by toggle button, persisted via localStorage) */
html[data-theme="dark"] {
    --primary: #90caf9;
    --secondary: #64b5f6;
    --accent: #42a5f5;
    --accent-dark: #1e88e5;
    --bg: #121212;
    --card-bg: #1e1e1e;
    --text: #e0e0e0;
    --text-light: #aaaaaa;
    --border: #333333;
    --success: #81c784;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] header,
html[data-theme="dark"] footer {
    background-color: #0d1b2a;
}

/* Terminal theme override (hacker aesthetic) */
html[data-theme="terminal"] {
    --primary: #39ff14;
    --secondary: #1bff00;
    --accent: #39ff14;
    --accent-dark: #2acc0f;
    --bg: #0a0a0a;
    --card-bg: #121212;
    --text: #39ff14;
    --text-light: #1bff00;
    --border: #39ff14;
    --success: #39ff14;
    --shadow-sm: 0 0 10px rgba(57, 255, 20, 0.1);
    --shadow-md: 0 0 20px rgba(57, 255, 20, 0.2);
    --shadow-lg: 0 0 30px rgba(57, 255, 20, 0.3);
}

html[data-theme="terminal"] body {
    font-family: 'Courier New', Courier, monospace;
}

html[data-theme="terminal"] header,
html[data-theme="terminal"] footer {
    background-color: #000000;
    border-bottom: 1px solid var(--accent);
}

html[data-theme="terminal"] h1,
html[data-theme="terminal"] h2,
html[data-theme="terminal"] h3,
html[data-theme="terminal"] h4 {
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
}

html[data-theme="terminal"] h2::before {
    content: "user@jflip-sec:~$ ";
    color: #ffffff;
    text-shadow: none;
}

html[data-theme="terminal"] .card,
html[data-theme="terminal"] .project-card,
html[data-theme="terminal"] .github-repo-card,
html[data-theme="terminal"] .cert-card,
html[data-theme="terminal"] .learning-card,
html[data-theme="terminal"] .experience-item,
html[data-theme="terminal"] .education-item {
    border: 1px solid var(--accent);
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

html[data-theme="terminal"] .card:hover,
html[data-theme="terminal"] .project-card:hover,
html[data-theme="terminal"] .github-repo-card:hover,
html[data-theme="terminal"] .cert-card:hover,
html[data-theme="terminal"] .learning-card:hover {
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
    border-color: var(--accent);
}

html[data-theme="terminal"] a {
    color: var(--accent);
}

html[data-theme="terminal"] a:hover {
    text-decoration: underline;
}

html[data-theme="terminal"] .nav-links a {
    color: var(--text);
}

html[data-theme="terminal"] .resume-btn {
    background-color: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

html[data-theme="terminal"] .resume-btn:hover {
    background-color: var(--accent);
    color: #000000;
}

/* ═══════════════════════════════════════════════════════
   Reset & Base
═══════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.7;
}

img {
    max-width: 100%;
    display: block;
}

/* ═══════════════════════════════════════════════════════
   Skip Link (Accessibility)
═══════════════════════════════════════════════════════ */
.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 10px 18px;
    z-index: 9999;
    font-weight: 600;
    border-radius: 0 0 6px 0;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
}

/* ═══════════════════════════════════════════════════════
   Navigation
═══════════════════════════════════════════════════════ */
header {
    background: var(--primary);
    color: white;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

header nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    gap: 4px;
    flex: 1;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    color: #cdd5e0;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 5px;
    letter-spacing: 0.02em;
    transition: background var(--transition), color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* Theme toggle buttons */
.theme-toggle-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.theme-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #cdd5e0;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-toggle.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.8);
}

/* Legacy support for dark mode toggle */
.dark-mode-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #cdd5e0;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    flex-shrink: 0;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Hamburger button — hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #cdd5e0;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animated X when open */
.hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════
   Section Layout (Carousel Mode)
═══════════════════════════════════════════════════════ */
main {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    height: calc(100vh - 120px);
    overflow: hidden;
    background-color: var(--bg);
}

section {
    padding: 40px 24px 80px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

section::-webkit-scrollbar {
    width: 6px;
}
section::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

section.active {
    display: block;
    animation: slideFadeIn 0.8s ease forwards;
}

@keyframes slideFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fade-in-section {
    /* Kept for compatibility but overridden by active state animation */
}

h2 {
    text-align: center;
    color: var(--primary);
    font-size: 1.9rem;
    margin-bottom: 10px;
    position: relative;
    padding-bottom: 16px;
}

h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--accent);
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-sub {
    text-align: center;
    color: var(--text-light);
    margin-top: 0;
    margin-bottom: 40px;
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════
   Hero / About
═══════════════════════════════════════════════════════ */
.hero-section {
    padding-top: 80px;
    text-align: center;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
    padding: 40px;
    max-width: 720px;
    margin: 0 auto 48px;
    border-left: 5px solid var(--accent);
}

.avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.text {
    text-align: left;
}

.text h1 {
    margin: 0 0 6px;
    font-size: 2rem;
    color: var(--primary);
    line-height: 1.2;
}

.text p {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 600;
}

.location {
    margin: 0 !important;
    font-size: 0.95rem !important;
    color: var(--text-light) !important;
    font-weight: normal !important;
    text-align: left;
    padding-bottom: 0 !important;
}

.location::after {
    display: none !important;
}

/* Bio */
.bio {
    max-width: 820px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.85;
    text-align: left;
}

.bio h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-top: 36px;
    margin-bottom: 12px;
}

.differentiator-heading {
    margin-top: 28px;
}

.bio ul {
    padding-left: 22px;
    margin-bottom: 32px;
}

.bio ul li {
    margin-bottom: 10px;
}

.resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent);
    color: white;
    padding: 13px 26px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 24px;
    transition: background var(--transition), transform var(--transition);
}

.resume-btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-1px);
}

.social-links {
    margin-top: 22px;
}

.social-links a {
    font-size: 1.6rem;
    margin-right: 18px;
    color: var(--primary);
    transition: color var(--transition);
}

.social-links a:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   Certifications
═══════════════════════════════════════════════════════ */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 36px;
}

.cert-card {
    background: var(--card-bg);
    padding: 30px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--accent);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

.cert-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.cert-icon {
    font-size: 2.4rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.cert-icon img {
    width: 100%;
    max-width: 110px;
    margin: 0 auto;
    height: auto;
}

.cert-card h3 {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 1.05rem;
}

.cert-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}

.cert-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cert-badge.in-progress {
    background: rgba(10, 132, 255, 0.12);
    color: var(--accent);
    border: 1px solid rgba(10, 132, 255, 0.3);
}

.cert-badge.earned {
    background: rgba(52, 199, 89, 0.12);
    color: var(--success);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

/* ═══════════════════════════════════════════════════════
   Skills
═══════════════════════════════════════════════════════ */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.skill-category {
    background: var(--card-bg);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--accent);
}

.skill-category h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.95rem;
}

.skill-list li:last-child {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════════════
   Daily Learning Stack
═══════════════════════════════════════════════════════ */
.learning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 24px;
    margin-top: 36px;
}

.learning-card {
    background: var(--card-bg);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

.learning-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.learning-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 14px;
}

.learning-card h3 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 1.05rem;
}

.learning-card p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.65;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   Experience & Volunteer
═══════════════════════════════════════════════════════ */
.experience-item {
    background: var(--card-bg);
    padding: 28px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent);
}

.experience-item h3 {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 1.2rem;
}

.experience-item h4 {
    margin: 0 0 16px;
    color: var(--text-light);
    font-weight: normal;
    font-style: italic;
    font-size: 0.95rem;
}

.experience-item ul {
    padding-left: 20px;
    margin: 0;
}

.experience-item li {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 0.97rem;
}

/* ═══════════════════════════════════════════════════════
   Connect Section
═══════════════════════════════════════════════════════ */
.connect-container {
    max-width: 700px;
    margin: 40px auto 0;
}

.connect-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--accent);
    text-align: center;
}

.connect-icon {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.connect-card h3 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.connect-card p {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.connect-cta {
    background: rgba(10, 132, 255, 0.05);
    padding: 20px;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
    margin: 30px 0;
}

.linkedin-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #0077b5;
    color: white;
    padding: 16px 32px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 20px 0;
    transition: background var(--transition), transform var(--transition);
    box-shadow: var(--shadow-md);
}

.linkedin-btn:hover {
    background-color: #005885;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.privacy-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.privacy-note i {
    color: var(--accent);
    margin-right: 5px;
}

/* ═══════════════════════════════════════════════════════
   Education
═══════════════════════════════════════════════════════ */
.education-item {
    background: var(--card-bg);
    padding: 28px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent);
}

.education-item h3 {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 1.2rem;
}

.education-item h4 {
    margin: 0 0 16px;
    color: var(--text-light);
    font-weight: normal;
    font-style: italic;
    font-size: 0.95rem;
}

.education-item p {
    color: var(--text);
    font-size: 0.97rem;
    line-height: 1.7;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   Projects
═══════════════════════════════════════════════════════ */

/* Projects subsections */
.projects-subsection {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 2px solid var(--border);
}

.projects-subsection:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.subsection-title {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    padding-bottom: 12px;
}

.subsection-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 2px;
}

.subsection-title i {
    color: var(--accent);
    font-size: 1.2em;
}

.subsection-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

/* GitHub Repositories Grid */
.github-repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 1.1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-spinner i {
    margin-right: 8px;
    color: var(--accent);
}

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

.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: var(--radius);
    color: #ff3b30;
}

.error-message a {
    color: var(--accent);
    font-weight: 600;
}

.github-repo-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

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

/* Stagger animation for repo cards */
.github-repo-card:nth-child(1) { animation-delay: 0.05s; }
.github-repo-card:nth-child(2) { animation-delay: 0.1s; }
.github-repo-card:nth-child(3) { animation-delay: 0.15s; }
.github-repo-card:nth-child(4) { animation-delay: 0.2s; }
.github-repo-card:nth-child(5) { animation-delay: 0.25s; }
.github-repo-card:nth-child(6) { animation-delay: 0.3s; }
.github-repo-card:nth-child(7) { animation-delay: 0.35s; }
.github-repo-card:nth-child(8) { animation-delay: 0.4s; }
.github-repo-card:nth-child(9) { animation-delay: 0.45s; }
.github-repo-card:nth-child(10) { animation-delay: 0.5s; }
.github-repo-card:nth-child(11) { animation-delay: 0.55s; }
.github-repo-card:nth-child(12) { animation-delay: 0.6s; }

.github-repo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.github-repo-card h4 {
    margin: 0;
    font-size: 1.05rem;
    flex: 1;
    min-width: 0;
}

.github-repo-card h4 a {
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition);
    word-break: break-word;
}

.github-repo-card h4 a:hover,
.github-repo-card h4 a:focus {
    color: var(--accent);
    outline: none;
}

.github-repo-card h4 a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.github-repo-card h4 i {
    flex-shrink: 0;
    font-size: 0.9em;
}

.language-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Language color coding */
.lang-javascript { background: rgba(247, 223, 30, 0.15); color: #f7df1e; border: 1px solid rgba(247, 223, 30, 0.3); }
.lang-typescript { background: rgba(49, 120, 198, 0.15); color: #3178c6; border: 1px solid rgba(49, 120, 198, 0.3); }
.lang-python { background: rgba(53, 114, 165, 0.15); color: #3572a5; border: 1px solid rgba(53, 114, 165, 0.3); }
.lang-html { background: rgba(227, 76, 38, 0.15); color: #e34c26; border: 1px solid rgba(227, 76, 38, 0.3); }
.lang-css { background: rgba(86, 61, 124, 0.15); color: #563d7c; border: 1px solid rgba(86, 61, 124, 0.3); }
.lang-astro { background: rgba(255, 93, 1, 0.15); color: #ff5d01; border: 1px solid rgba(255, 93, 1, 0.3); }
.lang-go { background: rgba(0, 173, 216, 0.15); color: #00add8; border: 1px solid rgba(0, 173, 216, 0.3); }
.lang-rust { background: rgba(222, 165, 132, 0.15); color: #dea584; border: 1px solid rgba(222, 165, 132, 0.3); }
.lang-java { background: rgba(176, 114, 25, 0.15); color: #b07219; border: 1px solid rgba(176, 114, 25, 0.3); }

.repo-description {
    color: var(--text-light);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repo-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.repo-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.repo-meta i {
    font-size: 0.85em;
}

.repo-updated {
    margin-left: auto;
}

/* Featured Projects Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
    margin-top: 20px;
}

.project-card {
    background: var(--card-bg);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-card h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.2rem;
}

.project-card p {
    color: var(--text);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 8px;
}

.project-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.project-badge.security {
    background: rgba(10, 132, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(10, 132, 255, 0.3);
}

.project-badge.automation {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.project-badge.open-source {
    background: rgba(175, 82, 222, 0.1);
    color: #af52de;
    border: 1px solid rgba(175, 82, 222, 0.3);
}

.project-card code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--accent);
}

html[data-theme="dark"] .project-card code,
html:not([data-theme="light"]) .project-card code {
    background: rgba(255, 255, 255, 0.08);
}

/* Dark mode adjustments for GitHub repos */
html[data-theme="dark"] .github-repo-card,
html:not([data-theme="light"]) .github-repo-card {
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .github-repo-card:hover,
html:not([data-theme="light"]) .github-repo-card:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .repo-meta,
html:not([data-theme="light"]) .repo-meta {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.project-card ul {
    padding-left: 18px;
    margin: 8px 0 12px;
}

.project-card ul li {
    font-size: 0.92rem;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.5;
}

.tech-stack {
    font-size: 0.85rem !important;
    color: var(--text-light) !important;
    margin-top: 12px !important;
}

.card-links {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.card-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color var(--transition);
}

.card-links a:hover {
    color: var(--accent-dark);
}

/* ═══════════════════════════════════════════════════════
   Footer
═══════════════════════════════════════════════════════ */
footer {
    background: var(--primary);
    color: #cdd5e0;
    text-align: center;
    padding: 50px 24px;
    margin-top: 60px;
    font-size: 0.9rem;
}

.footer-tagline {
    color: white;
    font-weight: 500;
    margin-bottom: 12px;
}

footer .social-links a {
    color: #cdd5e0;
}

footer .social-links a:hover {
    color: white;
}

/* ═══════════════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Nav: show hamburger, collapse links */
    .hamburger {
        display: flex;
        order: -1;
    }

    header nav {
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 2px);
        left: 0;
        right: 0;
        background: var(--primary);
        padding: 12px 0;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        z-index: 999;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        flex: none;
        width: 100%;
    }

    .nav-links.nav-open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 10px 20px;
        border-radius: 0;
        font-size: 0.95rem;
    }

    /* Content layouts */
    .card {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .card .text {
        text-align: center;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }

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

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

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

    .github-repos-grid {
        grid-template-columns: 1fr;
    }

    .subsection-title {
        font-size: 1.2rem;
    }

    .repo-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .language-badge {
        align-self: flex-start;
    }

    .text h1 {
        font-size: 1.6rem;
    }

    .text p {
        font-size: 0.95rem;
    }

    .terminal-tools-grid {
        grid-template-columns: 1fr;
    }

    .terminal-input-area,
    .terminal-output-area {
        min-height: 150px;
    }

    .connect-card {
        padding: 30px 20px;
    }

    .connect-icon {
        font-size: 3rem;
    }

    .connect-card h3 {
        font-size: 1.5rem;
    }

    .linkedin-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════
   Terminal Theme Interactive Components
═══════════════════════════════════════════════════════ */

/* Security Log Ticker */
.security-log-ticker {
    background: var(--card-bg);
    border-top: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    padding: 10px 0;
    overflow: hidden;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
}

/* Add padding to main content when ticker is visible */
html[data-theme="terminal"] main {
    padding-bottom: 60px;
}

html[data-theme="terminal"] footer {
    margin-bottom: 50px;
}

.log-ticker-content {
    display: flex;
    animation: scroll-left 30s linear infinite;
    white-space: nowrap;
}

.log-entry {
    padding: 0 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.log-level {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.log-level.info {
    background: rgba(10, 132, 255, 0.2);
    color: #42a5f5;
}

.log-level.success {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.log-level.warning {
    background: rgba(255, 159, 10, 0.2);
    color: #ff9f0a;
}

.log-level.critical {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

html[data-theme="terminal"] .log-level.info,
html[data-theme="terminal"] .log-level.success {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

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

/* Command Terminal */
.command-terminal {
    background: var(--card-bg);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    margin: 30px 0;
    font-family: 'Courier New', Courier, monospace;
    box-shadow: var(--shadow-md);
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.terminal-title {
    color: var(--accent);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.terminal-btn.close { background: #ff5f56; }
.terminal-btn.minimize { background: #ffbd2e; }
.terminal-btn.maximize { background: #27c93f; }

.terminal-output {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 4px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
    color: var(--text);
    line-height: 1.6;
}

.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.terminal-line {
    margin-bottom: 8px;
}

.terminal-prompt {
    color: var(--accent);
    font-weight: bold;
}

.terminal-command {
    color: var(--text);
}

.terminal-response {
    color: var(--text-light);
    margin-left: 20px;
}

.terminal-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.terminal-input-label {
    color: var(--accent);
    font-weight: bold;
    flex-shrink: 0;
}

.terminal-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px;
    color: var(--text);
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
}

.terminal-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.3);
}

/* Terminal Tools Grid */
.terminal-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.terminal-tool {
    background: var(--card-bg);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    box-shadow: var(--shadow-md);
}

.tool-header {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.terminal-input-area,
.terminal-output-area {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px;
    color: var(--text);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    width: 100%;
    min-height: 120px;
    resize: vertical;
}

.terminal-input-area:focus,
.terminal-output-area:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.3);
}

.tool-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.tool-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.tool-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.ip-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin-top: 15px;
}

.ip-info-label {
    color: var(--accent);
    font-weight: bold;
}

.ip-info-value {
    color: var(--text);
    word-break: break-all;
}

.loading-indicator {
    color: var(--accent);
    text-align: center;
    padding: 20px;
}

.loading-indicator i {
    animation: spin 1s linear infinite;
}

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