:root {
  --bg: #f6f8fb;
  --text: #1f2937;
  --primary: #1d4ed8;
  --card: #ffffff;
  --muted: #4b5563;
  --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: #fff;
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.07);
  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: 4rem 0 3rem;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 60%, #f8fafc 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: center;
}

.tag {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

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

.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: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 4px solid #dbeafe;
  display: block;
  margin: 0 auto 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: #dbeafe;
}

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

.alt {
  background: #eef2ff;
}

.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;
}

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

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

@media (max-width: 900px) {
  .hero-grid,
  .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;
  }
}


.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;
  }
}
