:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #111111;
  --muted: #4f4f4f;
  --line: #d6d6d6;
  --accent: #000000;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 2.25rem;
  border-bottom: 1px solid var(--line);
}

.brand,
.site-nav a,
.profile-links a {
  color: inherit;
  text-decoration: none;
}

.brand {
  font-family: "Baskervville", serif;
  font-size: 1.18rem;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.96rem;
}

.site-nav a:hover,
.profile-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 3.5rem;
  padding: 2.25rem 0 1rem;
}

.profile-sidebar {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.profile-panel {
  padding-top: 0.25rem;
}

h1,
h2 {
  font-family: "Baskervville", serif;
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.1;
  margin-top: 1.25rem;
  white-space: nowrap;
}

.native-name {
  font-size: 0.82em;
  letter-spacing: 0;
}

.sidebar-role,
.content-section p,
.detail-list span,
.publication-list li {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.photo-frame {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ececec;
}

.profile-photo,
.photo-fallback {
  width: 100%;
  height: 100%;
}

.profile-photo {
  display: none;
  object-fit: cover;
  object-position: center 18%;
}

.photo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Baskervville", serif;
  font-size: 3rem;
  color: var(--accent);
  background: linear-gradient(180deg, #f7f7f7 0%, #e2e2e2 100%);
}

.photo-frame.has-image .profile-photo {
  display: block;
}

.photo-frame.has-image .photo-fallback {
  display: none;
}

.photo-frame.is-fallback .profile-photo {
  display: none;
}

.photo-frame.is-fallback .photo-fallback {
  display: flex;
}

.sidebar-role {
  margin: 1rem 0 0.7rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
}

.profile-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.profile-links li {
  font-size: 0.96rem;
}

.profile-links a,
.profile-links span {
  display: block;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.content-column {
  min-width: 0;
}

.content-section {
  padding: 0 0 2.25rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--line);
}

.content-section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

h2 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  line-height: 1.08;
  margin-bottom: 1rem;
}

.detail-list,
.publication-list {
  margin: 0;
  padding-left: 1.2rem;
}

.detail-list li,
.publication-list li {
  margin-bottom: 1rem;
}

.publication-list {
  padding-left: 1.2rem;
  list-style: disc;
}

.publication-list li {
  text-align: left;
  color: var(--text);
}

.detail-list strong,
.publication-list strong {
  color: var(--text);
}

.detail-list span {
  display: block;
}

.site-footer {
  padding-top: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-panel,
.content-section {
  opacity: 0;
  transform: translateY(18px);
  animation: riseIn 0.55s ease forwards;
}

@keyframes riseIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .profile-sidebar {
    position: static;
  }

  .site-header {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    white-space: normal;
  }

  .photo-frame {
    max-width: 220px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1.2rem), var(--max-width));
  }

  .main-layout {
    padding-top: 1.6rem;
  }

  .photo-frame {
    max-width: 180px;
  }

  .sidebar-heading {
    font-size: 1.2rem;
  }
}
