:root {
  --morandi1: #a3a8a6;
  --morandi2: #b7a69e;
  --morandi3: #c9b7ad;
  --morandi4: #b5c0b1;
  --morandi5: #a7bfc9;
  --main-bg: #ffffff;
  --body-bg: #f9f8f7;
  --main-text: #333333;
  --heading-text: var(--morandi5);
}

.dark-theme {
  --main-bg: #232323;
  --body-bg: #181818;
  --main-text: #e0e0e0;
  --heading-text: #a7bfc9;
  --morandi1: #444;
  --morandi2: #b7a69e;
  --morandi3: #333;
  --morandi4: #b5c0b1;
  --morandi5: #a7bfc9;
}

body {
  background: var(--body-bg);
  color: var(--main-text);
  font-family: 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.7;
  font-size: 16px;
}

header {
  padding: 2rem 0 1rem 0;
  text-align: center;
}

header h1 {
  color: var(--morandi2);
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

nav {
  margin: 1rem 0;
}

nav a {
  color: var(--morandi2);
  text-decoration: none;
  margin: 0 1.2rem;
  font-weight: 500;
  transition: color 0.2s, transform 0.2s;
  position: relative;
  padding-bottom: 6px;
  font-size: 1.1rem;
}

nav a:hover {
  color: var(--morandi4);
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--morandi4);
  transition: width 0.3s ease, left 0.3s ease;
}

nav a:hover::after {
  width: 100%;
  left: 0;
}

/* Language and theme controls */
.header-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.language-switcher {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.lang-btn, #theme-toggle {
  background: none;
  border: 1px solid var(--morandi3);
  color: var(--main-text);
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.lang-btn:hover, #theme-toggle:hover {
  background-color: var(--morandi5);
  color: white;
  border-color: var(--morandi5);
}

.lang-btn.active {
  background-color: var(--morandi2);
  color: white;
  border-color: var(--morandi2);
}

#theme-toggle {
  font-size: 1.2rem;
  padding: 0.5rem;
  min-width: 2.5rem;
}

.hero {
  background-color: var(--morandi5);
  color: white;
  text-align: center;
  padding: 3.5rem 1.5rem;
  margin-bottom: 2.5rem;
}

.hero h2 {
  color: white;
  font-size: 2.2rem;
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0.5rem auto 0 auto;
  line-height: 1.6;
}

main {
  max-width: 750px;
  margin: 2.5rem auto;
  padding: 2rem;
  background-color: var(--main-bg);
  box-shadow: 0 5px 25px rgba(0,0,0,0.07);
  border-radius: 10px;
}

section {
  margin-bottom: 3rem;
  padding: 2rem 0;
}

section:not(:first-of-type) {
    border-top: 1px dashed var(--morandi1);
}

section h2 {
  color: var(--heading-text);
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1.8rem;
  position: relative;
  padding-bottom: 0.8rem;
}

section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: var(--morandi4);
}

h3 {
  color: var(--morandi2);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

p {
  margin-bottom: 1.2rem;
  color: var(--main-text);
}

ul {
  list-style-type: none;
  padding-left: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: #fdfdfd;
  padding: 1.8rem;
  border: 1px solid var(--morandi3);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dark-theme .project-card {
  background-color: var(--main-bg);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 7px 18px rgba(0,0,0,0.09);
}

.project-card h3 {
  margin-top: 0;
}

.project-link {
  color: var(--morandi5);
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  margin-top: 1rem;
  transition: color 0.2s;
}

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

#contact a {
  color: var(--morandi5);
  text-decoration: none;
}

#contact a:hover {
  text-decoration: underline;
  color: var(--morandi2);
}

.news-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--morandi3);
}

.news-item:last-child {
    border-bottom: none;
}

.news-item h3 {
    margin-bottom: 0.5rem;
}

.news-item p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.news-item a {
    color: var(--morandi5);
    text-decoration: none;
    font-weight: bold;
}

.news-item a:hover {
    color: var(--morandi2);
    text-decoration: underline;
}

footer {
  text-align: center;
  color: var(--morandi1);
  padding: 2.5rem 0 1.5rem 0;
  border-top: 1px solid var(--morandi1);
  font-size: 0.9rem;
  margin-top: 3rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
  header h1 {
    font-size: 2.2rem;
  }
  
  .hero h2 {
    font-size: 1.8rem;
  }
  
  nav a {
    margin: 0 0.8rem;
    font-size: 1rem;
  }
  
  main {
    margin: 1.5rem auto;
    padding: 1.5rem;
  }
  
  .project-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .header-controls {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .language-switcher {
    gap: 0.3rem;
  }
  
  .lang-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
}