@font-face {
  font-family: "Axiforma Book";
  src: url("Axiforma/Axiforma-Book.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Axiforma Black";
  src: url("Axiforma/Axiforma-Black.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

* {
  box-sizing: border-box;
  font-family: "Axiforma Book", sans-serif;
  font-weight: 400;
}

:root {
  color-scheme: light;
  --page-bg: #ffffff;
  --page-text: #111111;
  --text-soft: rgba(17, 17, 17, 0.92);
  --text-muted: rgba(17, 17, 17, 0.68);
  --text-subtle: rgba(17, 17, 17, 0.56);
  --text-faint: rgba(17, 17, 17, 0.48);
  --line-strong: rgba(17, 17, 17, 0.46);
  --line-medium: rgba(17, 17, 17, 0.2);
  --line-soft: rgba(17, 17, 17, 0.16);
  --line-faint: rgba(17, 17, 17, 0.08);
  --menu-border: rgba(255, 255, 255, 0.52);
  --menu-border-hover: rgba(255, 255, 255, 0.78);
  --menu-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24));
  --menu-bg-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.28));
  --menu-shadow: 0 18px 48px rgba(17, 17, 17, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 -1px 10px rgba(255, 255, 255, 0.24);
  --menu-shadow-hover: 0 20px 56px rgba(17, 17, 17, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.88), inset 0 -1px 12px rgba(255, 255, 255, 0.32);
  --menu-indicator-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.34));
  --menu-indicator-shadow: 0 8px 18px rgba(17, 17, 17, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92), inset 0 -1px 8px rgba(255, 255, 255, 0.4);
  --cover-fade: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff 90%, #ffffff);
  --surface-bg: #ffffff;
  --tooltip-bg: rgba(255, 255, 255, 0.92);
  --tooltip-shadow: 0 10px 24px rgba(17, 17, 17, 0.1);
  --gallery-shadow: 0 12px 28px rgba(17, 17, 17, 0.12);
  --map-filter: grayscale(1) brightness(1.08) contrast(0.82);
  --theme-icon-bg: #111111;
  --theme-icon-dot: #ffffff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #080808;
  --page-text: #f3f3f3;
  --text-soft: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.72);
  --text-subtle: rgba(255, 255, 255, 0.62);
  --text-faint: rgba(255, 255, 255, 0.5);
  --line-strong: rgba(255, 255, 255, 0.5);
  --line-medium: rgba(255, 255, 255, 0.24);
  --line-soft: rgba(255, 255, 255, 0.18);
  --line-faint: rgba(255, 255, 255, 0.1);
  --menu-border: rgba(255, 255, 255, 0.14);
  --menu-border-hover: rgba(255, 255, 255, 0.28);
  --menu-bg: linear-gradient(135deg, rgba(20, 20, 20, 0.74), rgba(20, 20, 20, 0.34));
  --menu-bg-hover: linear-gradient(135deg, rgba(28, 28, 28, 0.84), rgba(28, 28, 28, 0.42));
  --menu-shadow: 0 18px 48px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 10px rgba(0, 0, 0, 0.28);
  --menu-shadow-hover: 0 20px 56px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 12px rgba(0, 0, 0, 0.34);
  --menu-indicator-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  --menu-indicator-shadow: 0 8px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 8px rgba(0, 0, 0, 0.36);
  --cover-fade: linear-gradient(to bottom, rgba(8, 8, 8, 0), #080808 90%, #080808);
  --surface-bg: #080808;
  --tooltip-bg: rgba(20, 20, 20, 0.94);
  --tooltip-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  --gallery-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  --map-filter: grayscale(1) brightness(0.78) contrast(1.08) invert(0.86);
  --theme-icon-bg: #ffffff;
  --theme-icon-dot: #080808;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--page-text);
  background: var(--page-bg);
  transition: color 180ms ease, background-color 180ms ease;
}

.menu-layer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  padding: 24px 40px;
  opacity: var(--menu-opacity, 0);
  pointer-events: none;
  transition: opacity 120ms ease;
}

.menu-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: fit-content;
  margin: 0 auto;
  padding: 6px;
  border: 1px solid var(--menu-border);
  border-radius: 999px;
  background: var(--menu-bg);
  box-shadow: var(--menu-shadow);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  pointer-events: none;
  transform-origin: center;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.menu-bar:hover,
.menu-bar.menu-moving {
  border-color: var(--menu-border-hover);
  background: var(--menu-bg-hover);
  box-shadow: var(--menu-shadow-hover);
}

.menu-bar:hover {
  animation: menu-droplet 520ms ease;
}

.menu-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  z-index: 0;
  width: var(--menu-indicator-width, 0);
  border-radius: 999px;
  background: var(--menu-indicator-bg);
  box-shadow: var(--menu-indicator-shadow);
  transform: translateX(var(--menu-indicator-left, 0));
  transform-origin: center;
  transition: transform 360ms cubic-bezier(0.2, 1.35, 0.34, 1), width 360ms cubic-bezier(0.2, 1.35, 0.34, 1), height 180ms ease;
  pointer-events: none;
}

.menu-bar.menu-moving .menu-indicator {
  animation: indicator-droplet 420ms ease;
}

.menu-layer.menu-visible .menu-bar {
  pointer-events: auto;
}

.menu-link {
  position: relative;
  z-index: 1;
  padding: 8px 14px;
  color: var(--page-text);
  font-family: "Axiforma Book", sans-serif;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  opacity: 0.48;
  transition: opacity 160ms ease;
}

.menu-link:hover,
.menu-link.active {
  opacity: 1;
}

.theme-toggle {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--page-text);
  background: transparent;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 160ms ease, transform 160ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  opacity: 1;
  transform: scale(1.06);
}

.theme-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.theme-toggle-icon {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--theme-icon-bg) 50%, transparent 50%);
}

.theme-toggle-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--theme-icon-dot);
  transform: translateY(-50%);
}

@keyframes menu-droplet {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.018, 0.94);
  }

  65% {
    transform: scale(0.992, 1.045);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes indicator-droplet {
  0% {
    top: 6px;
    bottom: 6px;
  }

  38% {
    top: 4px;
    bottom: 8px;
  }

  72% {
    top: 8px;
    bottom: 4px;
  }

  100% {
    top: 6px;
    bottom: 6px;
  }
}

.content-layer {
  position: relative;
  z-index: 1;
}

.page-section {
  min-height: fit-content;
  padding-right: 200px;
  padding-left: 200px;
  scroll-margin-top: 88px;
  margin-top: 120px;
}

.cover-section {
  position: relative;
  min-height: 100vh;
  background-image: url("images/cover.jpeg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
  margin-top: 0;
}

.cover-section::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 45%;
  background: var(--cover-fade);
  pointer-events: none;
}

.cover-section > * {
  position: relative;
  z-index: 1;
}

.cover-title {
  position: absolute;
  bottom: 340px;
  left: 50%;
  display: inline-block;
  color: #ffffff;
  transform: translateX(calc(-50% + 80px));
  -webkit-box-reflect: below -2px linear-gradient(to bottom, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0));
}

.cover-explore {
  position: absolute;
  bottom: 96px;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 12px;
  color: var(--text-subtle);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  transform: translateX(-50%);
  transition: color 180ms ease, transform 180ms ease;
}

.cover-explore:hover {
  color: var(--text-soft);
  transform: translateX(-50%) translateY(4px);
}

.cover-arrow-head {
  width: 14px;
  height: 14px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

#introduction::after {
  content: "";
  display: block;
  clear: both;
}

.profile-image {
  float: right;
  width: min(32vw, 240px);
  height: auto;
  margin: 0 0 0 48px;
}

.intro-quote {
  margin: 32px 0 0;
  color: var(--text-subtle);
}

.intro-quote p {
  margin: 0;
  font-family: "Snell Roundhand", "Apple Chancery", "Brush Script MT", cursive;
  font-size: 28px;
  line-height: 1.35;
}

.intro-quote cite {
  display: block;
  margin-top: 8px;
  font-family: "Axiforma Book", sans-serif;
  font-size: 14px;
  font-style: normal;
  color: var(--text-faint);
}

.timeline {
  position: relative;
  display: grid;
  gap: 40px;
  margin-top: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 220px;
  width: 1px;
  background: var(--line-soft);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 80px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 215px;
  width: 11px;
  height: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-bg);
}

.timeline-date {
  color: var(--text-subtle);
  font-size: 14px;
  line-height: 1.45;
}

.timeline-content h4 {
  margin: 0 0 8px;
}

.timeline-content p {
  margin: 0;
  line-height: 1.7;
}

.timeline-content .timeline-note {
  margin-top: 6px;
  color: var(--text-subtle);
  font-size: 14px;
  line-height: 1.6;
}

.publication-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin-top: 40px;
}

.publication-column h3 {
  margin: 0 0 24px;
}

.publication-list {
  display: grid;
  gap: 28px;
}

.publication-item {
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.publication-item h4 {
  margin: 0 0 8px;
}

.publication-meta,
.publication-note {
  margin: 0;
  line-height: 1.6;
}

.publication-meta {
  color: var(--text-muted);
}

.publication-note {
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 14px;
}

.publication-connector {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.publication-emoji {
  font-size: 28px;
  line-height: 1.15;
  text-align: center;
}

.publication-code {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.publication-arrow {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.publication-arrow span {
  display: block;
  flex: 1;
  height: 2px;
  border-radius: 999px;
  background: var(--line-medium);
  animation: arrow-flow 1.4s infinite;
}

.publication-arrow span:nth-child(2) {
  animation-delay: 160ms;
}

.publication-arrow span:nth-child(3) {
  animation-delay: 320ms;
}

.publication-arrow span:nth-child(4) {
  animation-delay: 480ms;
}

.publication-arrow span:nth-child(5) {
  animation-delay: 640ms;
}

.publication-arrow .arrow-head {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--line-medium);
  border-right: 2px solid var(--line-medium);
  border-radius: 0;
  background: none;
  transform: rotate(45deg);
  animation-name: arrow-head-flow;
  animation-delay: 800ms;
}

.cv-viewer {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--line-soft);
}

.site-footer {
  padding: 48px 200px;
  color: var(--text-faint);
  font-size: 14px;
  text-align: center;
}

.footer-return {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: fit-content;
  margin: 0 auto 28px;
  color: var(--text-subtle);
  line-height: 1;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.footer-return:hover {
  color: var(--text-soft);
  transform: translateY(-4px);
}

.footer-arrow-head {
  width: 14px;
  height: 14px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.site-footer p {
  margin: 0;
}

@keyframes arrow-flow {
  0%,
  100% {
    opacity: 0.28;
  }

  45% {
    opacity: 1;
    background: var(--text-soft);
  }
}

@keyframes arrow-head-flow {
  0%,
  100% {
    opacity: 0.28;
    border-color: var(--line-medium);
  }

  45% {
    opacity: 1;
    border-color: var(--text-soft);
  }
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b,
em {
  font-family: "Axiforma Black", sans-serif;
  font-weight: 400;
}

h1 {
  font-size: 64px;
}

h2 {
  font-size: 42px;
}

h3 {
  font-size: 32px;
}

h4 {
  font-size: 20px;
}

h5 {
  font-size: 16px;
}

h6 {
  font-size: 14px;
}

#places-map {
  margin: 24px 0 40px;
}

#places-map img {
  width: 100%;
  height: auto;
  display: block;
  filter: var(--map-filter);
}

#places-map .map {
  position: relative;
  max-width: 56.4375em;
  margin: 0 auto;
}

#places-map .map-pins {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@keyframes map-marker-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.25);
    opacity: 0;
  }

  40% {
    opacity: 0.48;
  }

  100% {
    transform: translate(-50%, -50%) scale(2.3);
    opacity: 0;
  }
}

#places-map .academic-marker,
#places-map .journey-marker {
  position: absolute;
  z-index: 3;
  width: 1rem;
  height: 1rem;
  margin-top: -1.15rem;
  margin-left: -0.5rem;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  transform-origin: center;
  isolation: isolate;
  cursor: pointer;
}

#places-map .academic-marker {
  background: linear-gradient(180deg, rgba(232, 67, 57, 0.82) 0%, rgba(186, 32, 39, 0.82) 100%);
  filter: drop-shadow(0 8px 14px rgba(186, 32, 39, 0.34));
}

#places-map .journey-marker {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.575rem;
  margin-left: -0.25rem;
  background: linear-gradient(180deg, rgba(124, 124, 124, 0.82) 0%, rgba(82, 82, 82, 0.82) 100%);
  filter: drop-shadow(0 8px 14px rgba(82, 82, 82, 0.3));
}

#places-map .academic-marker::before,
#places-map .journey-marker::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 2px solid rgba(186, 32, 39, 0.34);
  background: transparent;
  animation: map-marker-pulse 2.2s ease-out infinite;
}

#places-map .journey-marker::before {
  width: 0.475rem;
  height: 0.475rem;
  border-width: 1px;
  border-color: rgba(82, 82, 82, 0.34);
}

#places-map .academic-marker::after,
#places-map .journey-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  transform: translate(-50%, -50%);
}

#places-map .journey-marker::after {
  width: 0.21rem;
  height: 0.21rem;
}

#places-map .academic-marker:hover::before,
#places-map .academic-marker:focus-visible::before,
#places-map .journey-marker:hover::before,
#places-map .journey-marker:focus-visible::before {
  animation-play-state: paused;
}

#places-map .academic-marker:hover .map-marker-tooltip,
#places-map .academic-marker:focus-visible .map-marker-tooltip,
#places-map .journey-marker:hover .map-marker-tooltip,
#places-map .journey-marker:focus-visible .map-marker-tooltip {
  opacity: 1;
  transform: translate(-50%, -0.45rem);
}

#places-map .map-marker-tooltip {
  position: absolute;
  bottom: calc(100% + 0.9rem);
  left: 50%;
  z-index: 4;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line-faint);
  border-radius: 999px;
  color: var(--page-text);
  background: var(--tooltip-bg);
  box-shadow: var(--tooltip-shadow);
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -0.15rem);
  transition: opacity 140ms ease, transform 140ms ease;
}

.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 24px auto 0;
}

.photo-gallery img {
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  height: clamp(120px, 14vw, 180px);
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--gallery-shadow);
}
