:root {
    --bg-color: #000000;
    --surface-color: #161b22;
    --primary-color: #ff5858;
    --text-color: #d9c9c9;
    --subtle-text-color: #8b949e;
    --border-color: #30363d;

    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
}

/* --- Base & Parallax --- */
@layer base {
  body::before {
    --size: 45px;
    --line: rgba(255, 255, 255, 0.08);
    content: '';
    height: 100vh;
    width: 100vw;
    position: fixed;
    background: linear-gradient( 90deg, var(--line) 1px, transparent 1px var(--size) ) 50% 50% / var(--size) var(--size), linear-gradient(var(--line) 1px, transparent 1px var(--size)) 50% 50% / var(--size) var(--size);
    -webkit-mask: linear-gradient(-20deg, transparent 30%, white);
    mask: linear-gradient(-20deg, transparent 30%, white);
    top: 0;
    transform-style: flat;
    pointer-events: none;
    z-index: -1;
  }

  body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, var(--bg-color) 90%);
    pointer-events: none;
    z-index: -1;
  }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px; /* Increased max-width */
    margin: 0 auto;
}

h2 {
    font-family: var(--font-primary);
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center; /* Centered again */
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    margin: 0.75rem auto 0; /* Centered again */
}

section {
    padding: 6rem 0;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Header --- */
.header {
    position: fixed;
    top: 20px; /* Float down from the top */
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    z-index: 1000;
    transition: all 0.3s ease;
    background-color: rgba(22, 27, 34, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1.5rem;
}

.header .container {
    display: flex;
    justify-content: center; /* Center nav */
    align-items: center;
    gap: 2rem;
}

.main-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 2rem; /* Increased gap for more obvious spacing */
}

.main-nav a {
    color: var(--subtle-text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
    padding: 5px 10px;
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center; /* Align text and pseudo-elements */
}

.main-nav a::before, .main-nav a::after {
    font-family: monospace;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.main-nav a::before {
    content: '.';
    margin-right: 2px;
}

.main-nav a::after {
    content: '()';
    margin-left: 2px;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--text-color);
}

.main-nav a:hover::before, .main-nav a:hover::after,
.main-nav a.active::before, .main-nav a.active::after {
    opacity: 1;
}

.header-right {
    position: relative; /* For modal positioning */
    display: flex;
    align-items: center;
}

.lang-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.lang-menu-btn:hover {
    transform: rotate(45deg);
}

.language-modal {
    position: absolute;
    top: calc(100% + 15px); /* Positioned below the gear icon */
    left: 50%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.language-modal.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.lang-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.lang-btn.active {
    box-shadow: 0 0 8px var(--primary-color);
}

.lang-btn img {
    display: block;
    border-radius: 3px;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0 auto;
    text-align: left; /* Ensure left alignment */
}

.hero-logo {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0;
    line-height: 1.2;
    text-align: left; 
}

.hero-logo::after {
    margin: 0.75rem 0 0;
}

.hero-content h1 {
    font-size: 4.5rem;
    line-height: 1.2;
}

.hero-content .subtitle {
    font-size: 1.3rem;
    color: var(--subtle-text-color);
    margin: 2rem 0; /* Adjusted margin */
}

.social-links a {
    color: var(--subtle-text-color);
    font-size: 2.2rem;
    margin: 0 1.5rem 0 0;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

/* --- About Section --- */
.about-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* border: 4px solid var(--primary-color); */
    box-shadow: 0 0 26px rgba(255, 88, 88, 0.16);
}

.about-text p {
    font-size: 1.2rem; /* Increased font size */
}

.about-text p strong {
    color: var(--primary-color); /* Bold text in primary color */
}

/* --- Experience Section --- */
.experience-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.experience-timeline::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
    opacity: 0.5;
}

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

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--bg-color);
    border: 4px solid var(--primary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left { left: 0; }
.left::after { right: -11.5px; }
.right { left: 50%; }
.right::after { left: -11.5px; }

.timeline-content {
    padding: 25px 35px;
    background-color: var(--surface-color);
    position: relative;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 26px rgba(255, 88, 88, 0.16);
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Standardized gap */
}

.timeline-content h4 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0; /* Removed margin to rely on gap */
}

.job-list {
    list-style-type: none;
}

.job-description-item {
    display: flex;
    flex-direction: column; /* Stack icon and content vertically */
    gap: 0.5rem; /* Add some space between the icon and the text */
}

.job-item-content {
    display: flex;
    flex-direction: column; /* Stack title and description vertically */
    gap: 0.25rem; /* Add some space between the title and the description */
}

.job-list li strong {
    font-size: 1.1rem;
    color: var(--text-color);
}

.job-tech .tag {
    display: inline-block;
    background-color: rgba(255, 88, 88, 0.1);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-top: 8px;
    border: 1px solid rgba(255, 88, 88, 0.2);
}

.job-duration {
    display: flex;
    align-items: center;
}

.job-duration::before {
    content: '\f073'; /* Unicode for fa-calendar-alt */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 5px;
    color: var(--primary-color);
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.project-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 26px rgba(255, 88, 88, 0.16);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 88, 88, 0.1);
}

.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-content h3 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.project-content p {
    flex-grow: 1;
}

.project-tags {
    margin-top: 1rem;
}

.project-tags .tag {
    display: inline-block;
    background-color: rgba(255, 88, 88, 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.project-links a {
    display: inline-block;
    margin-top: 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.project-links a:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--primary-color);
}

/* --- Tech Stack Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.skill-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 88, 88, 0.08); /* Reduced glow */
}

.skill-card i {
    font-size: 4.5rem;
    /* margin-bottom is removed to allow space-between to work */
    color: var(--primary-color);
}

.skill-card span {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 1rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 1rem 0;
    margin-top: 4rem;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    color: var(--subtle-text-color);
    font-size: 0.9rem;
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
    h2 { text-align: center; }
    h2::after { margin: 0.75rem auto 0; }
    .header .main-nav, .header .header-right { display: none; } /* Hide for simplicity */
    .about-content, .projects-grid, .skill-categories-container { grid-template-columns: 1fr; }
    .experience-timeline::after { left: 15px; }
    .timeline-item { width: 100%; padding-left: 50px; padding-right: 15px; }
    .timeline-item::after { left: 5px; }
    .right { left: 0%; }
}