/* ==========================================================================
   1. Variables & Base Styles
   ========================================================================== */
:root {
    --background: #0D1117;
    --primary: #58A6FF;
    --secondary: #1F6FEB;
    --accent: #3FB950;
    --text-primary: #C9D1D9;
    --text-secondary: #8B949E;
    --border-color: #30363D;
    --panel-bg: rgba(22, 27, 34, 0.6);
    --font-family: 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 2rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==========================================================================
   2. Background & Layout
   ========================================================================== */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.grid {
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(to right, var(--border-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.2;
}

.terminal-window {
    max-width: 1200px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   3. Terminal Header & Navigation
   ========================================================================== */
.terminal-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(13, 17, 23, 0.8);
    border-radius: 8px 8px 0 0;
}

.header-buttons .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}
.dot.red { background-color: #FF5F56; }
.dot.yellow { background-color: #FFBD2E; }
.dot.green { background-color: #27C93F; }

.header-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-grow: 1;
    text-align: center;
}

.terminal-nav {
    display: flex;
    gap: 0.5rem;
}

.terminal-nav .nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background-color 0.2s, color 0.2s;
}

.terminal-nav .nav-item:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.terminal-nav .nav-item.active {
    color: var(--background);
    background-color: var(--primary);
    font-weight: 500;
}

/* ==========================================================================
   4. Terminal Body & Sections
   ========================================================================== */
.terminal-body {
    padding: 2rem;
    overflow-y: auto;
}

.terminal-section {
    padding: 4rem 0;
    border-bottom: 1px dashed var(--border-color);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.terminal-section:last-of-type {
    border-bottom: none;
}
.terminal-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

h2 {
    font-size: 1.5rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 500;
}

/* ==========================================================================
   5. Content Styling (Hero, About, etc.)
   ========================================================================== */

/* --- Hero Section --- */
#home {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

.hero-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    padding: 5px;
    background-color: var(--background);
}

.hero-text h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin: 0;
    font-weight: 700;
}

.hero-text p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 2rem;
}

.hero-text p::after {
    content: '_';
    animation: blink 1s step-end infinite;
    margin-left: 5px;
    color: var(--accent);
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.btn-primary {
    background-color: var(--primary);
    color: var(--background);
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: transparent;
    color: var(--primary);
}
.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}


/* --- About Section --- */
.about-text p {
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 1rem auto;
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.skill-category {
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    background-color: rgba(13, 17, 23, 0.5);
}
.skill-category h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.skill-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.skill-category li {
    background-color: var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* --- Portfolio Section --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}
.portfolio-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--panel-bg);
    transition: transform 0.3s, box-shadow 0.3s;
}
.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
}
.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}
.card-content {
    padding: 1.5rem;
}
.card-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: var(--text-primary);
}
.card-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.tech-tags span {
    font-size: 0.75rem;
    background-color: var(--secondary);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
}
.card-links {
    display: flex;
    gap: 1.5rem;
}
.card-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}
.card-links a:hover {
    text-decoration: underline;
}

/* --- Contact & Footer --- */
.contact-intro {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.social-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.2s;
}
.social-links a:hover {
    color: var(--primary);
}

.terminal-footer {
    padding: 1rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   6. Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    .terminal-header {
        flex-direction: column;
        gap: 1rem;
    }
    .header-title {
        display: none;
    }
    .terminal-body {
        padding: 1rem;
    }
    .terminal-section {
        padding: 2rem 0;
    }
    .hero-text h1 {
        font-size: 2rem;
    }
    .hero-text p {
        font-size: 1rem;
    }
}