/* --- Global Styles & Variables --- */
:root {
  --background-color: #ffffff;
  --text-color: #1f2937;
  --secondary-text-color: #6b7280;
  --primary-color: #2563eb;
  --highlight-color: #2563eb;
  --card-background: #ffffff;
  --card-border: #e5e7eb;
  --button-primary-bg: #1f2937;
  --button-primary-text: #ffffff;
  --button-secondary-bg: #f3f4f6;
  --button-secondary-text: #1f2937;
  --footer-bg: #f9fafb;
  --footer-text: #6b7280;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol';
}

html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
  font-weight: 600;
}

p {
  color: var(--secondary-text-color);
  line-height: 1.6;
  font-size: 0.95rem;
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-color);
}


/* --- Header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--background-color);
  border-bottom: px solid var(--card-border);
  transition: box-shadow 0.9s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  transition: padding 0.3s ease;
}

.app-header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border-bottom-color: transparent;
}

.app-header.scrolled .header-content {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

body.dark-mode .app-header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.logo {
  font-weight: bold;
  font-size: 1.15rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.main-nav {
  display: flex;
  justify-content: center;
  align-items: center;
}
 
.main-nav ul {
  
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 0.5rem;
}

.main-nav a.active {
  font-weight: 600;
  color: var(--text-color);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--text-color);
  transition: background-color 0.3s ease;
}

.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--text-color);
  line-height: 1;
}

.theme-toggle i {
  display: block;
  transition: transform 0.3s ease-out, color 0.3s ease;
}

.theme-toggle:hover i {
  transform: scale(1.15) rotate(15deg);
  color: var(--primary-color);
}

.theme-toggle .fa-moon {
  display: none;
}

/* --- Dark Mode Styles --- */
body.dark-mode {
  --background-color: #111827;
  --text-color: #f9fafb;
  --secondary-text-color: #9ca3af;
  --highlight-color: #38bdf8;
  --card-background: #1f2937;
  --card-border: #374151;
  --button-primary-bg: #f9fafb;
  --button-primary-text: #1f2937;
  --button-secondary-bg: #374151;
  --button-secondary-text: #f9fafb;
  --footer-bg: #1f2937;
  --footer-text: #9ca3af;
}

body.dark-mode .theme-toggle {
  color: var(--text-color);
}

body.dark-mode .theme-toggle .fa-sun {
  display: none;
}

body.dark-mode .theme-toggle .fa-moon {
  display: block;
}

body.dark-mode .feature-item .icon-wrapper {
  background-color: #374151;
}

body.dark-mode .card:hover {
  border-color: #4b5563;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 7rem 0;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero .highlight {
  color: var(--highlight-color);
}

.hero .subtitle {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 1rem;
  color: var(--text-color);
}

.hero .description {
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

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

.btn {
  padding: 0.65rem 1.3rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background-color: var(--button-primary-bg);
  color: var(--button-primary-text);
}

.btn-primary i {
  margin-left: 0.5rem;
}

.btn-secondary {
  background-color: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  border: 1px solid var(--card-border);
}


/* --- Features Section --- */
.features {
  background-color: var(--footer-bg);
  padding: 6rem 0;
  transition: background-color 0.3s ease;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.feature-item .icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background-color: #f3f4f6;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  transition: background-color 0.3s ease;
}

.feature-item .icon-wrapper i {
  font-size: 1.3rem;
  color: var(--text-color);
}

.feature-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

/* --- Latest Work Section --- */
.latest-work {
  padding-top: 6rem;
  padding-bottom: 6rem;
  text-align: center;
}

.latest-work h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.latest-work > p {
  margin-bottom: 3rem;
}

.work-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  text-align: left;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.column-header h3 {
  font-size: 1.4rem;
}

.column-header a {
  font-weight: 500;
  font-size: 0.9rem;
}

.card {
  background-color: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
}


/* --- Footer --- */
.app-footer {
  background-color: var(--footer-bg);
  padding: 3.5rem 2rem;
  transition: background-color 0.3s ease;
}

.footer-columns {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-column h4 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-column.about p {
  font-size: 0.85rem;
  color: var(--footer-text);
  max-width: 350px;
}

.footer-column.links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column.links li {
  margin-bottom: 0.75rem;
}

.footer-column.links a {
  color: var(--footer-text);
  font-size: 0.85rem;
}

.social-icons {
  display: flex;
  gap: 1.5rem;
}

.social-icons a {
  color: var(--footer-text);
  font-size: 1.15rem;
}

.footer-bottom {
  border-top: 1px solid var(--card-border);
  padding-top: 2rem;
  margin-top: 3rem;
  text-align: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  transition: border-color 0.3s ease;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--footer-text);
  margin: 0;
}

/* --- Generic Page Styles --- */
.page-content {
  padding-top: 5rem;
  padding-bottom: 6rem;
  min-height: calc(100vh - 350px); /* Adjust value based on footer/header height */
}

.page-title {
  font-size: 2.8rem;
  text-align: center;
  margin-bottom: 1rem;
}

.page-content > p {
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3.5rem;
  font-size: 1rem;
}

/* --- Projects Page Styles --- */
.section-subtitle {
  font-size: 1.8rem;
  font-weight: 600;
  text-align: left;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.project-card {
  background-color: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07);
  border-color: var(--primary-color);
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid var(--card-border);
}

.project-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Allows links to stick to bottom */
}

.project-card-content h3 {
  font-size: 1.3rem;
  margin: 0 0 0.75rem 0;
}

.project-card-content p {
  text-align: left;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto; /* Pushes tags to bottom */
  padding-bottom: 1.25rem;
}

.project-tag {
  background-color: var(--button-secondary-bg);
  color: var(--secondary-text-color);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.project-links {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--card-border);
  margin-top: 0.8rem;
  transition: border-color 0.3s ease;
}

.project-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.project-link i {
  color: var(--secondary-text-color);
  transition: color 0.2s ease;
}

.project-link:hover i {
  color: var(--primary-color);
}

/* Dark mode for projects */
body.dark-mode .project-tag {
  color: var(--text-color);
}

body.dark-mode .project-card:hover {
   border-color: var(--highlight-color);
   box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

/* --- Articles Page Styles --- */
.article-card {
  background-color: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.article-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--secondary-text-color);
  margin-bottom: 0.75rem;
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.article-card h3 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.article-card p {
    text-align: left;
    margin-bottom: 0;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.article-tag {
  background-color: var(--button-secondary-bg);
  color: var(--secondary-text-color);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.article-read-more {
  display: inline-block;
  margin-top: 1.25rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-color);
}

.article-read-more i {
  transition: transform 0.2s ease;
  margin-left: 0.25rem;
}

.article-read-more:hover i {
  transform: translateX(4px);
}

/* Dark Mode for Articles */
body.dark-mode .article-card:hover {
   border-color: var(--highlight-color);
   box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

body.dark-mode .article-tag {
  color: var(--text-color);
}


/* --- Contact Page Styles --- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: flex-start;
}

.contact-details h3, .contact-form-container h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact-info-block {
  margin-bottom: 2.5rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.contact-item i {
  font-size: 1.1rem;
  color: var(--secondary-text-color);
  margin-top: 4px;
  width: 20px;
  text-align: center;
}

.contact-item-text h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.contact-item-text p {
  margin: 0;
  font-size: 0.9rem;
}

.contact-form-container {
  background-color: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 2.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

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

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body.dark-mode .contact-form input:focus, 
body.dark-mode .contact-form select:focus, 
body.dark-mode .contact-form textarea:focus {
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}


.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.btn-submit {
  width: 100%;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  font-size: 0.95rem;
}

.btn-submit i {
  margin-right: 0.5rem;
  margin-left: 0;
}

.cta-box {
  margin-top: 5rem;
  background-color: var(--button-secondary-bg);
  padding: 2.5rem;
  border-radius: 0.75rem;
  text-align: center;
  transition: background-color 0.3s ease;
}

.cta-box h3 {
  font-size: 1.6rem;
  margin: 0 0 0.75rem;
}

.cta-box p {
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.95rem;
}

/* --- About Me Page Styles --- */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: center;
  padding-bottom: 4rem;
}

.profile-picture-wrapper {
  text-align: center;
}

.profile-picture {
  width: 100%;
  max-width: 250px;
  border-radius: 1.5rem;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  border: 4px solid var(--background-color);
}

body.dark-mode .profile-picture {
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.about-intro-text h1 {
  font-size: 2.8rem;
  margin: 0 0 0.5rem;
}

.about-intro-text h2 {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--secondary-text-color);
  margin: 0 0 1rem;
}

.intro-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--secondary-text-color);
  font-size: 0.9rem;
}

.intro-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-intro-text p {
  font-size: 1rem;
  margin-bottom: 2rem;
}

.intro-buttons {
  display: flex;
  gap: 1rem;
}

.intro-buttons .btn i {
  margin-right: 0.5rem;
  margin-left:0;
}

.about-section {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--card-border);
}

.about-section:first-of-type {
    border-top: none;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* Skills */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  background-color: var(--button-secondary-bg);
  color: var(--text-color);
  padding: 0.4rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .skill-tag {
  color: var(--text-color);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--card-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.35rem; 
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--background-color);
  border: 3px solid var(--primary-color);
  z-index: 1;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .timeline-item::before {
   background-color: var(--background-color);
}

.timeline-content {
    flex-grow: 1;
}

.timeline-content h4 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.timeline-company {
  font-weight: 500;
  color: var(--secondary-text-color);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.timeline-content p {
  margin: 0;
  font-size: 0.9rem;
}

.timeline-date {
  font-weight: 500;
  color: var(--secondary-text-color);
  white-space: nowrap;
  font-size: 0.9rem;
}

/* Personal Note */
.personal-note {
  margin-top: 2rem;
  background-color: var(--button-secondary-bg);
  padding: 2rem;
  border-radius: 0.75rem;
  transition: background-color 0.3s ease;
}

.personal-note h3 {
  font-size: 1.4rem;
  margin: 0 0 0.75rem;
}

.personal-note a {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: underline;
}

/* --- Hamburger Menu & Responsive --- */
.hamburger-menu {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 1001;
  color: var(--text-color);
}

@media (max-width: 992px) {
  .hero h1 {
    font-size: 2.8rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .work-columns {
    grid-template-columns: 1fr;
  }
  .footer-columns {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-column.about p {
    margin-left: auto;
    margin-right: auto;
  }
  .social-icons {
    justify-content: center;
  }
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .about-intro {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .about-intro-text h1 {
     font-size: 2.5rem;
  }
  .intro-meta, .intro-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  .header-content {
    width: 100%;
  }
  .hamburger-menu {
    display: block;
  }
  .main-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  body.mobile-nav-open .main-nav {
    display: flex;
  }
  body.mobile-nav-open {
    overflow: hidden;
  }
  .main-nav ul {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .main-nav a {
    font-size: 1.5rem;
  }
  .hero {
    padding: 5rem 0;
  }
  .hero h1 {
    font-size: 2.3rem;
  }
  .hero .subtitle {
    font-size: 1.1rem;
  }
  .hero-buttons {
    flex-direction: column;
  }
  .app-footer {
     padding: 3rem 1rem;
  }
  .page-title {
    font-size: 2.2rem;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .section-subtitle {
    font-size: 1.75rem;
  }
  .article-card h3 {
    font-size: 1.4rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .contact-form-container {
    padding: 1.5rem;
  }
  .cta-box {
    padding: 2rem;
  }
  .about-intro {
    gap: 2rem;
  }
  .about-intro-text h1 {
    font-size: 2.25rem;
  }
  .section-title {
    font-size: 1.75rem;
  }
  .timeline-item {
    flex-direction: column;
    gap: 0.5rem;
  }
  .timeline-date {
    text-align: left;
  }
}