:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3fff7;
  --text: #163024;
  --muted: #3b5d4c;
  --primary: #1f9d55;
  --primary-2: #16a34a;
  --border: #cdebd6;
  --hover-dark: #0f6d3f;
  --shadow: 0 10px 25px rgba(22, 28, 45, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #111827;
    --surface-2: #1f2937;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --primary: #7c94ff;
    --primary-2: #a78bfa;
    --border: #334155;
    --hover-dark: #1e3a8a;
    --shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% -10%, rgba(34, 197, 94, 0.18), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(74, 222, 128, 0.16), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
}

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

.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(17, 24, 39, 0.88);
  backdrop-filter: blur(8px);
}

.nav-controls {
  display: flex;
  gap: 0.4rem;
}

.top-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.top-nav a {
  display: block;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
  color: #f8fafc;
  border-radius: 10px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.top-nav a:hover,
.top-nav a.active {
  background: linear-gradient(135deg, var(--hover-dark), #166534);
  transform: translateY(-1px);
}

.lang-switch {
  background: #0b1220;
  color: #fff;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lang-switch:hover {
  background: #166534;
  transform: translateY(-1px);
}

.lang-switch.active {
  background: linear-gradient(135deg, var(--hover-dark), #166534);
  border-color: #bbf7d0;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.hero {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(74, 222, 128, 0.12));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.hero-text {
  flex: 1;
}

.hero-email {
  margin: 0.4rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.hero-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.grid-two {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 1rem;
}

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

.card:hover,
.hero:hover {
  border-color: var(--hover-dark);
  box-shadow: 0 14px 28px rgba(22, 101, 52, 0.23);
}

.card:hover {
  transform: translateY(-2px);
}

.profile-img {
  width: 100%;
  max-width: 280px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th, td {
  border: 1px solid var(--border);
  padding: 0.65rem;
  text-align: left;
}

th {
  background: var(--surface-2);
}

tr:nth-child(even) td {
  background: rgba(127, 127, 127, 0.05);
}

tr:hover td {
  background: rgba(22, 163, 74, 0.12);
}

.publication {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 12px;
  border-bottom: 1px dashed var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.publication:hover {
  background: rgba(22, 163, 74, 0.12);
  border-color: var(--hover-dark);
  box-shadow: 0 8px 18px rgba(22, 101, 52, 0.2);
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin: 0.9rem 0;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.section-card:hover {
  border-color: var(--hover-dark);
  box-shadow: 0 14px 28px rgba(22, 101, 52, 0.2);
  transform: translateY(-1px);
}

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
  border-color: var(--hover-dark);
  box-shadow: 0 12px 24px rgba(22, 101, 52, 0.2);
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  .grid-two { grid-template-columns: 1fr; }
  .hero-content {
    align-items: flex-start;
  }
}
