:root {
  color-scheme: light;
  --text: #1c1c1c;
  --muted: #666;
  --line: #ddd;
  --background: #f2f9ff;
  --max-width: 940px;
  --accent: #f8d84a;
  --accent-deep: #8a6a10;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  line-height: 1.65;
}

::selection {
  background: var(--accent);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--background);
}

.nav {
  width: min(100% - 32px, var(--max-width));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 1.02rem;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.96rem;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a.is-active {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

main {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
}

.section {
  padding: 68px 0;
  border-bottom: 1px solid var(--line);
}

.about-section {
  padding-top: 76px;
}

.profile {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 44px;
  align-items: start;
}

.profile-image {
  width: 190px;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.profile-text {
  max-width: 680px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
.brand {
  font-family: "Lora", Georgia, "Times New Roman", serif;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 300;
  line-height: 1.15;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.45rem;
  font-weight: 300;
  line-height: 1.3;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.04rem;
  font-weight: 400;
  line-height: 1.35;
}

p {
  margin-bottom: 10px;
}

.links {
  display: grid;
  gap: 6px;
  margin-top: 24px;
}

.contact-title,
.contact-email {
  margin: 0;
}

.contact-title {
  color: var(--text);
  font-weight: 400;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 6px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 56px;
}

.details-grid article,
.content-list article {
  min-width: 0;
}

.details-grid p,
.content-list p {
  color: var(--muted);
}

.section-heading {
  max-width: 640px;
  margin-bottom: 30px;
}

.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading h2::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  background: var(--accent);
  image-rendering: pixelated;
}

.content-list {
  display: grid;
  gap: 30px;
}

.research-list {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

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

.site-footer {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 30px 0 42px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}


.pixel-duck {
  position: fixed;
  left: 0;
  top: 0;
  width: 64px;
  height: 64px;
  z-index: 20;
  pointer-events: auto;
  cursor: pointer;
  image-rendering: pixelated;
  transform: translate3d(var(--duck-x, 24px), var(--duck-y, 24px), 0) scaleX(var(--duck-facing, 1));
}

.pixel-duck__sprite {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
}

.pixel-duck__cell {
  position: absolute;
  width: 4px;
  height: 4px;
  background: transparent;
  box-shadow: var(--duck-shadow);
}

.pixel-duck.is-walking .pixel-duck__sprite {
  animation: duck-bob 0.55s steps(2, end) infinite;
}

.pixel-duck__sprite.is-pecking {
  animation: duck-peck 0.3s ease-in-out;
}

.pixel-duck.is-sleeping .pixel-duck__sprite {
  transform: translateY(4px);
}

@keyframes duck-bob {
  50% {
    transform: translateY(2px);
  }
}

@keyframes duck-peck {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(3px);
  }
  75% {
    transform: translateY(1px);
  }
}

.pixel-duck__bubble {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 21;
  pointer-events: none;
  transform: translate3d(calc(var(--duck-x, 24px) + 10px), calc(var(--duck-y, 24px) - 26px), 0);
  padding: 3px 6px;
  background: #fff;
  border: 2px solid #2a2522;
  border-bottom-color: var(--accent);
  color: var(--text);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 0.72rem;
  white-space: nowrap;
}

.pixel-duck__zzz {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 21;
  pointer-events: none;
  color: var(--muted);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  animation: duck-zzz-float 2.4s ease-in-out infinite;
}

@keyframes duck-zzz-float {
  0%,
  100% {
    transform: translate3d(calc(var(--duck-x, 24px) + 42px), calc(var(--duck-y, 24px) - 16px), 0);
    opacity: 0.85;
  }
  50% {
    transform: translate3d(calc(var(--duck-x, 24px) + 42px), calc(var(--duck-y, 24px) - 24px), 0);
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pixel-duck {
    display: none;
  }
}

@media (max-width: 720px) {
  .nav {
    min-height: auto;
    padding: 18px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.92rem;
  }

  .profile {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .profile-image {
    width: min(190px, 62vw);
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .section,
  .about-section {
    padding: 48px 0;
  }
}
