/*
 * Main styles for Jurij Petrov's academic website.
 *
 * This stylesheet defines a simple, modern layout that emphasises readability
 * and responsiveness. It avoids external dependencies and heavy frameworks
 * to keep loading times fast on all devices.
 */

/* Color palette */
:root {
  --color-dark: #182c25;
  --color-primary: #306844;
  --color-secondary: #2c4c3b;
  --color-accent: #1e453e;
  --color-light: #455b55;
  --text-light: #ffffff;
}

/* Reset margins and set base typography */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-light);
  background-color: var(--color-dark);
}

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

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

/* Container: central wrapper for content */
.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Header styling */
header {
  background: var(--color-secondary);
  border-bottom: 1px solid var(--color-accent);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
}
header h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1;
}
header nav {
  margin-top: 10px;
}
header nav a {
  margin-left: 15px;
  text-decoration: none;
  color: var(--text-light);
  font-weight: 600;
  transition: color 0.2s ease-in-out;
}
header nav a:hover {
  color: var(--color-primary);
}

/* Hero section */
#hero {
  background: var(--color-accent);
  padding: 80px 0;
  text-align: center;
}
#hero h2 {
  margin-bottom: 10px;
  font-size: 2rem;
  font-weight: 700;
}
#hero p {
  margin: 0.5em 0;
}

/* Button styling */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--color-primary);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.2s ease-in-out;
}
.btn:hover {
  background: var(--color-secondary);
}

/* Sections */
section {
  margin: 40px 0;
}
section h2 {
  margin-top: 0;
  font-size: 1.75rem;
}

/* Card grid for research projects */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.card {
  background: var(--color-secondary);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  padding: 20px;
  flex: 1;
  min-width: 250px;
  box-sizing: border-box;
  transition: box-shadow 0.2s ease-in-out;
}
.card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Footer */
footer {
  background: var(--color-secondary);
  text-align: center;
  padding: 10px 0;
  border-top: 1px solid var(--color-accent);
  font-size: 0.875rem;
}

/* Responsive navigation */
@media (max-width: 600px) {
  header nav {
    display: block;
    margin-top: 0.5em;
  }
  header nav a {
    display: block;
    margin: 5px 0;
  }
  .card-grid {
    flex-direction: column;
  }
}

/* Name rotator slide animations */
#name-rotator {
  display: inline-block;
}

.slide-out {
  animation: slideOut 0.6s forwards;
}

.slide-in {
  animation: slideIn 0.6s forwards;
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-0.5em);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(0.5em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}