:root {
  color-scheme: light;
  --bg: #f6f2eb;
  --bg-soft: #efe7dd;
  --ink: #1b1a18;
  --muted: #5b5955;
  --accent: #8a3c1f;
  --accent-strong: #5f2a14;
  --accent-soft: #f1e6d8;
  --border: #d9cfc2;
  --card: #fffdf9;
  --shadow: 0 12px 30px rgba(34, 24, 12, 0.12);
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background-image:
    radial-gradient(900px 520px at 8% -10%, #f9efe4 0%, transparent 60%),
    radial-gradient(700px 520px at 92% 0%, #e7eef3 0%, transparent 55%),
    linear-gradient(transparent 94%, rgba(74, 64, 49, 0.05) 96%),
    linear-gradient(90deg, transparent 94%, rgba(74, 64, 49, 0.05) 96%),
    linear-gradient(180deg, #f7f2ea 0%, #f2ede5 40%, #f8f4ef 100%);
  background-size: auto, auto, 26px 26px, 26px 26px, auto;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

h1,
h2,
h3 {
  font-family: "Source Serif 4", "Georgia", serif;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.1rem, 2.6vw, 3.1rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  margin-bottom: 0.5rem;
}

.page {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 28px 84px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.8s ease both;
}

.avatar {
  position: relative;
  width: 100%;
  min-height: 240px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #e7d8c9 0%, #f5efe6 100%);
  border: 1px dashed var(--border);
}

.avatar::after {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Source Serif 4", "Georgia", serif;
  font-size: 3rem;
  color: var(--accent-strong);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.avatar.no-image::after {
  opacity: 1;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(41, 28, 12, 0.18);
}

.avatar img.is-hidden {
  display: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--muted);
}

.hero-affiliation,
.hero-location {
  font-size: 0.98rem;
  color: var(--muted);
}

.hero-tagline {
  font-size: 1.05rem;
  color: #2e2a24;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 18px rgba(98, 46, 24, 0.2);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(98, 46, 24, 0.26);
}

.button.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}

.button.ghost {
  background: var(--accent-soft);
  color: var(--accent-strong);
  cursor: not-allowed;
}

.helper-text {
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-interests {
  display: grid;
  gap: 10px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero-interests ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
}

.hero-interests li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.88rem;
  color: var(--accent-strong);
}

.layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 40px;
  margin-top: 40px;
}

.nav {
  position: sticky;
  top: 28px;
  align-self: start;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.nav-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 12px;
}

.nav-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.nav-list a {
  font-weight: 600;
  color: #342a20;
}

.nav-list a:hover {
  color: var(--accent);
}

.nav-switch a {
  display: inline-block;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--accent);
}

.content {
  display: grid;
  gap: 32px;
}

.section-wrapper {
  animation: fadeUp 0.6s ease both;
}

.section {
  padding: 24px 26px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(35, 26, 18, 0.08);
}

.section-header {
  margin-bottom: 16px;
}

.section-intro {
  color: var(--muted);
  margin-top: 6px;
}

.section-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

.section-list {
  display: grid;
  gap: 18px;
}

.gallery-timeline {
  position: relative;
  margin-top: 18px;
  display: grid;
  gap: 0;
  padding: 4px 0 2px;
}

.gallery-timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(86, 71, 52, 0.16);
}

.gallery-timeline.is-empty::before {
  display: none;
}

.gallery-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.gallery-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.gallery-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: translateX(-50%);
}

.gallery-card {
  width: min(420px, 92%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.gallery-item.left .gallery-card {
  grid-column: 1;
  justify-self: end;
  margin-right: 24px;
}

.gallery-item.right .gallery-card {
  grid-column: 2;
  justify-self: start;
  margin-left: 24px;
}

.gallery-date {
  font-weight: 700;
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.gallery-photo {
  width: 100%;
  height: auto;
  max-height: 260px;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: var(--accent-soft);
}

.gallery-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.gallery-location {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (min-width: 900px) {
  .gallery-item + .gallery-item {
    margin-top: clamp(-120px, -8vw, -70px);
  }
}

@media (max-width: 899px) {
  .gallery-item + .gallery-item {
    margin-top: 16px;
  }
}

body.gallery-only .content > .section-wrapper {
  display: none;
}

body.gallery-only .content > .gallery-wrapper {
  display: block;
}

.section-group {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.section-divider {
  height: 0;
  border: 0;
  border-top: 1px solid rgba(86, 71, 52, 0.16);
  margin: 6px 0 2px;
}

.section-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.section-group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(90, 74, 55, 0.25), transparent);
}

.timeline {
  position: relative;
  margin-top: 16px;
  padding-left: 36px;
  display: grid;
  gap: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 6px;
}

.timeline-marker {
  position: absolute;
  left: -29px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-period {
  font-weight: 700;
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.timeline-title {
  font-weight: 700;
  margin-top: 4px;
}

.timeline-subtitle {
  color: var(--muted);
  margin-top: 2px;
}

.timeline-thesis {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.95rem;
}

.section-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

#projects .section-item {
  grid-template-columns: minmax(140px, 180px) 1fr;
}

#projects .item-period {
  white-space: nowrap;
}

#research .section-item {
  grid-template-columns: minmax(140px, 200px) 1fr;
}

.section-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

#awards .section-item {
  border-bottom: none;
  padding-bottom: 0;
}

#awards .section-item + .section-item {
  margin-top: 10px;
}

#awards .section-divider {
  margin: 10px 0 6px;
}

.item-period {
  font-weight: 600;
  color: var(--muted);
}

.item-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.item-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.item-description {
  margin-top: 6px;
  color: #3e362d;
}

.publications {
  margin-top: 12px;
}

.pub-list {
  list-style: none;
  display: grid;
  gap: 16px;
}

.pub-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: start;
}

.pub-index {
  font-weight: 700;
  color: var(--accent-strong);
}

.pub-content {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #2d2721;
}

.pub-title {
  font-style: italic;
}

.pub-venue,
.pub-year {
  color: var(--muted);
}

.name-highlight {
  color: #b0302a;
  font-weight: inherit;
}

.contact {
  display: grid;
  gap: 14px;
}

.contact-item {
  display: grid;
  gap: 4px;
}

.contact-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
}

.contact-helper {
  color: var(--muted);
  font-size: 0.9rem;
}

.item-title,
.item-subtitle,
.item-description,
.pub-content,
.contact,
.hero-tagline {
  overflow-wrap: anywhere;
}

.footer {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .nav {
    position: relative;
    top: 0;
  }

  .nav-list {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .section-item {
    grid-template-columns: 1fr;
  }

  .pub-item {
    grid-template-columns: 1fr;
  }

  #projects .section-item {
    grid-template-columns: minmax(120px, 140px) 1fr;
  }

#projects .item-period {
  white-space: nowrap;
}

@media (max-width: 600px) {
  #projects .item-period {
    font-size: 0.86rem;
  }
}
}

@media (max-width: 900px) {
  .page {
    max-width: 100%;
    padding: 32px 20px 60px;
  }

  .hero {
    padding: 22px;
    gap: 22px;
  }

  .hero-avatar {
    max-width: 220px;
    margin: 0 auto;
  }

  .hero-content {
    gap: 14px;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .nav {
    padding: 16px;
  }

  .section {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .layout {
    gap: 24px;
  }

  .nav-list {
    grid-auto-flow: row;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-list a {
    display: block;
    padding: 4px 0;
  }

  .section-list {
    gap: 14px;
  }

  .section-item {
    gap: 10px;
  }

  .item-period {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-strong);
  }

  .pub-content {
    display: block;
  }

  .gallery-timeline::before {
    left: 12px;
  }

  .gallery-item {
    grid-template-columns: 1fr;
    padding-left: 16px;
  }

  .gallery-item::before {
    left: 12px;
    top: 18px;
  }

  .gallery-item.left .gallery-card,
  .gallery-item.right .gallery-card {
    grid-column: 1;
    justify-self: stretch;
    margin: 0 0 0 16px;
    width: auto;
  }
}

@media (max-width: 600px) {
  .page {
    max-width: 100%;
    padding: 26px 16px 52px;
  }

  .hero {
    padding: 18px;
    border-radius: 14px;
  }

  .section {
    padding: 18px;
    border-radius: 14px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .hero-interests ul {
    gap: 6px 10px;
  }

  .item-title {
    font-size: 0.98rem;
  }

  .item-subtitle,
  .item-description {
    font-size: 0.92rem;
  }

  .section-item {
    gap: 10px;
    padding-bottom: 10px;
  }

  .pub-content {
    display: block;
  }

  .pub-title,
  .pub-venue,
  .pub-year {
    display: inline;
  }
}

@media (max-width: 480px) {
  .nav-list {
    gap: 12px;
    padding-bottom: 4px;
  }

  .hero-interests li {
    font-size: 0.82rem;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .page {
    width: 90vw;
    max-width: 1400px;
    min-width: 1120px;
  }
}

@media (min-width: 1400px) {
  .page {
    width: 80vw;
    max-width: 1600px;
    min-width: 1120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
