html,
body {
  padding: 0;
  margin: 0;
  background: #fff;
  height: 100%;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  color: #2c3e50; /* Original dark blue-gray text */
  min-height: 100vh;
  background-color: #f4f6f8; /* Original light gray background */
}

.container {
  display: flex;
  min-height: 100vh;
  border: 2px solid #bdc3c7; /* Light gray border */
}

.sidebar {
  background-color: #ecf0f1; /* Sidebar light gray background */
  color: #181818;
  width: 250px;
  min-width: 170px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2em 0 2em 0;
  border-right: 1.5px solid #e0e0e0;
  box-shadow: 2px 0 14px #eaeaea13;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar .profile-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.1em;
  background: #f2f2f2;
  border: 4px solid #2364aa;
  box-shadow: 0 3px 18px #cacaca10;
}

.sidebar .contact-block {
  font-size: 1em;
  margin-bottom: 1em;
  text-align: center;
}

.sidebar .contact-block a {
  color: #2364aa;
  text-decoration: none;
  display: block;
  margin: 0.13em 0;
  word-break: break-all;
  transition: color 0.13s;
}

.sidebar .contact-block a:hover {
  color: #a2bce0;
}

.sidebar nav {
  margin: 2em 0 1em 0;
  width: 93%;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sidebar nav a {
  display: block;
  color: #444;
  font-weight: 500;
  margin-bottom: 0.4em;
  padding: 0.32em 0 0.32em 0.7em;
  text-decoration: none;
  border-left: 4px solid transparent; /* Always present, prevents movement */
  border-radius: 2px;
  letter-spacing: 0.54px;
  font-size: 1.08em;
  transition: background 0.13s, color 0.17s, border 0.14s;
  width: 100%;
  scroll-behavior: smooth;
}

.sidebar nav a.active,
.sidebar nav a:focus,
.sidebar nav a:hover {
  color: #2364aa;
  border-left: 4px solid #2364aa; /* Changes color on hover */
  background: #f1f7fb;
}

.sidebar .download-cv {
  margin-top: 20px;
  display: inline-block;
  background-color: #2980b9; /* Button blue background */
  color: white;
  font-weight: 600;
  padding: 0.5em 1.1em;
  border-radius: 7px;
  text-decoration: none;
  letter-spacing: 0.05em;
  font-size: 1em;
  text-align: center;
  border: none;
  transition: background 0.15s;
}

.sidebar .download-cv:hover {
  background: #a2bce0;
  color: #181818;
}

.main {
  flex: 1;
  padding: 2em 2vw 1.3em 2vw;
  background: #fff;
  margin-left: 250px;
  transition: margin-left 0.2s;
  min-width: 0;
}

.notice {
  background: #e53935;
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 14px #e5393518;
  padding: 0.9em 1.2em;
  text-align: center;
  margin-bottom: 2em;
  font-size: 1.1em;
  letter-spacing: 0.5px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.nameblock {
  text-align: center;
  padding-top: 0.5em;
  margin-bottom: 2em;
}

.nameblock h1 {
  font-family: 'Merriweather', serif;
  color: #181818;
  font-size: 2em;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0.1em 0 0.1em 0;
}

.nameblock .role {
  color: #2364aa;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-size: 1.1em;
  margin-top: 0.1em;
}

.section {
  background: #fff;
  border-radius: 12px;
  max-width: 820px;
  box-shadow: 0 4px 28px #00000007;
  margin: 0 auto 2em auto;
  padding: 2.5em 1.8em 1.5em 1.8em; /* Increased padding */
  animation: fadein 0.34s;
  border: 1.5px solid #e0e0e0;
  scroll-margin-top: 1.5em;
}

@keyframes fadein {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  font-family: 'Merriweather', serif;
  color: #34495e; /* Section title dark blue-gray */
  font-size: 1.15em;
  font-weight: 700;
  border-left: 4px solid #2364aa;
  padding-left: 0.64em;
  margin-top: 0;
  margin-bottom: 1em;
  letter-spacing: 0.28px;
}

ul {
  padding-left: 1.2em;
  margin-bottom: 0;
}

li {
  margin-bottom: 0.7em;
  line-height: 1.7;
}

.tag {
  background: #2364aa;
  color: #fff;
  padding: 2.5px 10px;
  border-radius: 12px;
  font-size: 0.91em;
  margin-right: 7px;
}

.meta {
  color: #5e6875;
  font-size: 0.95em;
}

.highlight {
  color: #3498db; /* Bright blue text for foreground */
  background-color: transparent; /* Removed background color */
}

.subtle-highlight {
  background-color: #f0f4f8; /* Very light gray-blue background */
  color: #2c3e50; /* Dark blue-gray text */
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}

a {
  color: #3498db; /* Bright blue links */
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.paper-link {
  font-weight: bold;
}

/* Mobile: Sidebar on top, stays visible */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    max-width: 100%;
    border-right: none;
    border-bottom: 1.5px solid #e0e0e0;
    box-shadow: none;
    flex-direction: column;
    align-items: center;
    padding: 1.3em 0 0.6em 0;
    height: auto;
    top: auto;
    left: auto;
  }

  .main {
    margin-left: 0px;
    padding: 1.5em 0.7em 0.7em 0.7em;
    margin: 0 15px; /* Increased margins */
  }

  .section {
    padding: 1.5em 0.5em; /* Increased padding */
    margin: 0 15px; /* Existing increased margins */
  }

  .sidebar .profile-photo {
    width: 70px;
    height: 70px;
  }

  .nameblock {
    margin-bottom: 1em;
  }

  .nameblock h1 {
    font-size: 1.14em;
  }

  .notice {
    padding: 0.85em 0.3em;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 0.5em 0.1em;
    margin: 0 10px; /* Added margins */
  }

  .section {
    padding: 1em 0.3em; /* Increased padding */
    margin: 0 10px; /* Existing added margins */
  }

  .nameblock h1 {
    font-size: 1em;
  }

  .sidebar .profile-photo {
    width: 55px;
    height: 55px;
  }

  .notice {
    font-size: 0.98em;
  }
}