:root {
    /* Solarpunk Terminal Palette */
    --bg-color: #2b3a42;
    /* Soft dark teal/slate background */
    --terminal-bg: #1e282c;
    /* Slightly darker screen background */
    --text-primary: #fdf6e3;
    /* Creamy white for main text */
    --text-accent: #859900;
    /* Solarpunk green */
    --text-secondary: #2aa198;
    /* Cyan/Teal for prompts */
    --text-highlight: #b58900;
    /* Yellow/Orange for highlights */
    --scanline-color: rgba(181, 137, 0, 0.05);
    /* Warm tint scanline */
    --glow-color: rgba(133, 153, 0, 0.5);

    --font-stack: 'VT323', monospace;
}

/* Light Mode Theme overrides */
body.light-mode {
    --bg-color: #fdf6e3;
    /* Cream */
    --terminal-bg: #eee8d5;
    /* Beige */
    --text-primary: #586e75;
    /* Dark Slate */
    --text-accent: #2aa198;
    /* Use Teal as primary accent in light mode for better contrast */
    --text-secondary: #859900;
    /* Green for secondary */
    --text-highlight: #b58900;
    /* Orange/Yellow */
    --scanline-color: rgba(101, 123, 131, 0.08);
    /* Darker scanline for light bg */
    --glow-color: rgba(42, 161, 152, 0.2);
    /* Reduced glow */
}

/* Specific Light Mode Adjustments */
body.light-mode .project-row,
body.light-mode .contact-btn,
body.light-mode .interest-item {
    background: rgba(42, 161, 152, 0.1);
    border-width: 2px;
}

body.light-mode .scanline {
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.05) 50%,
            rgba(0, 0, 0, 0.05));
    background-size: 100% 4px;
}

body.light-mode h1 {
    text-shadow: none;
    /* text shadow can look messy on light mode */
}


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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 1.2rem;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll, handle inside terminal */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Monitor/Screen Wrapper to give depth if we want, or just full screen */
.monitor {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: var(--terminal-bg);
    overflow: hidden;
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
    animation: scroll 10s linear infinite;
}

@keyframes scroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

/* Optional CRT Flicker */
.monitor::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% {
        opacity: 0.02;
    }

    50% {
        opacity: 0.05;
    }

    100% {
        opacity: 0.02;
    }
}

.terminal-wrapper {
    width: 100%;
    height: 100%;
    padding: 2rem;
    overflow-y: auto;
    /* Custom scrollbar for webkit */
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) var(--terminal-bg);
}

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

.terminal-wrapper::-webkit-scrollbar-track {
    background: var(--terminal-bg);
}

.terminal-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--text-secondary);
    border-radius: 4px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--text-secondary);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tray {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

#theme-toggle:hover {
    color: var(--text-accent);
}

.terminal-content {
    max-width: 900px;
    margin: 0 auto;
}

section {
    margin-bottom: 3rem;
}

.prompt {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.prompt .command {
    color: var(--text-primary);
    font-weight: bold;
}

h1 {
    font-size: 4rem;
    color: var(--text-accent);
    text-shadow: 0 0 5px var(--glow-color);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.role {
    font-size: 1.5rem;
    color: var(--text-highlight);
    margin-bottom: 1rem;
}

/* Bio Typing Area */
.typewriter {
    white-space: pre-wrap;
    min-height: 60px;
    /* reserve space */
}

/* Interests Grid */
.interests-grid {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping */
    gap: 0.8rem;
    /* Relaxed gap */
    margin-top: 1rem;
}

.interest-item {
    border: 1px solid var(--text-secondary);
    padding: 0.3rem 0.6rem;
    /* Compact padding */
    color: var(--text-primary);
    background: rgba(42, 161, 152, 0.05);
    /* Slight tint matching others */
    font-family: var(--font-stack);
    font-size: 1.2rem;
    /* Larger font for readability */
    white-space: nowrap;
    /* Prevent text wrapping inside item */
    transition: all 0.2s ease;
    cursor: default;
}

.interest-item:hover {
    background: var(--text-secondary);
    color: var(--terminal-bg);
    transform: translateY(-2px);
    box-shadow: 2px 2px 0px var(--text-highlight);
}

/* Light mode hover fix for better contrast */
body.light-mode .interest-item:hover {
    background: var(--text-primary);
    /* Dark Slate */
    color: var(--bg-color);
    /* Cream */
}

/* Project Lists */
.project-group {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px dashed var(--text-secondary);
    transition: background 0.2s;
}

.project-row:hover {
    background: rgba(42, 161, 152, 0.1);
    border-style: solid;
}

.pixel-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    color: var(--text-accent);
    /* Make SVGs look crisp/pixelated */
    image-rendering: pixelated;
}

.favicon {
    width: 32px;
    height: 32px;
    margin-right: 1.5rem;
    margin-left: 0.5rem;
    /* align center with 48px icons */
    border-radius: 4px;
    /* Slight round for modern favicons */
}

.emoji-icon {
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
    margin-right: 1.5rem;
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.project-info {
    display: flex;
    flex-direction: column;
}

.project-link {
    font-size: 1.4rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.project-link:hover {
    color: var(--text-accent);
    text-decoration: underline;
}

.project-desc {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.contact-btn {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--text-secondary);
    background: rgba(42, 161, 152, 0.05);
    /* Slight tint */
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.contact-btn .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 1rem;
    border-right: 2px solid var(--text-secondary);
    padding-right: 1rem;
    color: var(--text-accent);
}

.contact-btn .info {
    display: flex;
    flex-direction: column;
}

.contact-btn .info .label {
    font-size: 0.8rem;
    color: var(--text-highlight);
    letter-spacing: 1px;
    font-weight: bold;
}

.contact-btn .info .value {
    font-size: 1rem;
    font-family: var(--font-stack);
}

.contact-btn:hover {
    transform: translateY(-3px);
    background: var(--text-secondary);
    color: var(--terminal-bg);
    border-color: var(--text-secondary);
    box-shadow: 0 5px 15px rgba(42, 161, 152, 0.3);
}

.contact-btn:hover .icon {
    color: var(--terminal-bg);
    border-color: var(--terminal-bg);
}

.contact-btn:hover .info .label {
    color: var(--terminal-bg);
}

.input-line {
    margin-top: 3rem;
    display: flex;
    align-items: center;
}

.cursor {
    display: inline-block;
    width: 12px;
    height: 24px;
    background-color: var(--text-accent);
    margin-left: 5px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .terminal-wrapper {
        padding: 1rem;
    }

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