:root {
  --bg: #eef1f8;
  --text: #1f2e42;
  --primary: #4d6285;
  --card: #ffffff;
  --muted: #5a6780;
  --header-offset: 4.5rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: var(--header-offset);
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 10px rgba(34, 48, 72, 0.1);
  z-index: 10;
}

.nav-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.8rem 0;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.hero {
  padding: 3.5rem 0 3rem;
  background: linear-gradient(145deg, #d9d9e8 0%, #e5e9f3 55%, #f2f4f8 100%);
}

.hero-intro {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.tag {
  color: var(--primary);
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: 0.01em;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1.2rem;
}

.hero-card,
.card,
.member {
  background: var(--card);
  border-radius: 14px;
  padding: 1.2rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.hero-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.portrait {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  border: 5px solid #f3f5fb;
  display: block;
  margin: 0 auto 1.25rem;
  box-shadow: 0 10px 25px rgba(38, 52, 77, 0.16);
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.4rem 0 1.35rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid #c4cede;
  background: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-btn:hover {
  background: #ffffff;
  border-color: #94a7c4;
  transform: translateY(-1px);
}

.social-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-text {
  max-width: 780px;
  margin: 0 auto;
  text-align: left;
  font-size: 1.16rem;
  line-height: 1.75;
}

.hero-text p {
  margin: 0 0 1rem;
}

.btn {
  display: inline-block;
  margin-top: 1rem;
  text-decoration: none;
  background: var(--primary);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
}

.btn-secondary {
  background: #334155;
}

.section {
  padding: 2rem 0 3rem;
}

.table-wrap {
  overflow-x: auto;
}

.cv-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.cv-table th,
.cv-table td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.cv-table th {
  background: #d3dbe8;
}

.cv-table tbody tr:last-child td {
  border-bottom: none;
}

.alt {
  background: #e8edf6;
}

.card-grid,
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.detail-card {
  margin-bottom: 1rem;
}

.project-logo {
  display: block;
  width: min(100%, 180px);
  height: 96px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  margin: 0 auto 0.75rem;
}

.project-logo-large {
  width: min(100%, 280px);
  max-height: 130px;
  margin-bottom: 1rem;
}


.kivima-logo {
  width: min(100%, 270px);
  max-height: 135px;
}

.project-logo-large.kivima-logo {
  width: min(100%, 420px);
  max-height: 195px;
}

.section-subtitle {
  margin-top: 2rem;
}

.list {
  padding-left: 1.2rem;
}

.publication-list li {
  margin-bottom: 0.55rem;
}

.teaching-overview-list li {
  margin-bottom: 0.48rem;
  font-size: 0.94rem;
  line-height: 1.45;
}

.current-teaching-list li {
  margin-bottom: 0.62rem;
}

.current-teaching-list a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid #b8c3d7;
  padding-bottom: 1px;
}

.current-teaching-list a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.ekvv-overview-link {
  margin: 0.35rem 0 0.7rem;
  font-size: 0.95rem;
}

.ekvv-overview-link a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(77, 98, 133, 0.45);
}

.ekvv-overview-link a:hover {
  border-bottom-color: var(--primary);
}

.project-title {
  min-height: 2.4em;
}

.site-footer {
  background: #111827;
  color: #e5e7eb;
  text-align: center;
  padding: 1.2rem 0;
}

@media (max-width: 900px) {
  .card-grid,
  .team-grid,
  .project-layout {
    grid-template-columns: 1fr;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem 0.9rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 6.25rem;
  }

  :root {
    --header-offset: 6.25rem;
  }

  .nav-wrap {
    padding: 0.6rem 0;
  }

  .nav-links {
    font-size: 0.88rem;
    gap: 0.45rem 0.7rem;
  }

  .cv-table th,
  .cv-table td {
    padding: 0.7rem 0.75rem;
    font-size: 0.92rem;
  }

  .portrait {
    width: 180px;
    height: 180px;
  }

  .hero-text {
    font-size: 1.05rem;
  }
}


.project-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  align-items: start;
}

.project-sidebar {
  position: sticky;
  top: 5.5rem;
}

.compact-list {
  margin: 0;
  padding-left: 1rem;
}

.sidebar-heading {
  margin: 1rem 0 0.35rem;
  font-weight: 700;
  color: var(--muted);
}

.compact-list li {
  margin-bottom: 0.5rem;
}

.compact-list a {
  color: var(--text);
  text-decoration: none;
}

.compact-list a:hover {
  text-decoration: underline;
}

.project-content h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

@media (max-width: 900px) {
  .project-layout {
    grid-template-columns: 1fr;
  }

  .project-sidebar {
    position: static;
  }
}
