:root {
  --ink: #20282c;
  --muted: #657178;
  --line: #dce6e9;
  --aegean: #147895;
  --aegean-dark: #0a526c;
  --portrait-bg: #e9f3f5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "Latin Modern Roman", "Latin Modern", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
}

main {
  width: min(940px, calc(100% - 40px));
  margin: 34px auto 28px;
}

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

a:hover,
a:focus-visible {
  color: var(--aegean-dark);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.aegean-banner {
  display: block;
  width: 100%;
  height: 174px;
  object-fit: cover;
  object-position: center;
}

.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 48px;
  align-items: start;
  padding: 38px 18px 30px;
}

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

h1 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 4vw, 2.55rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h2 {
  margin: 34px 18px 25px;
  font-size: 1.6rem;
  font-weight: 500;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
}

.research-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 18px 25px;
}

.research-head h2 {
  margin: 0;
}

.pub-filter {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.pub-filter button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--aegean);
  font: inherit;
  cursor: pointer;
}

.pub-filter button:hover,
.pub-filter button:focus-visible {
  color: var(--aegean-dark);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.pub-filter button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 700;
  cursor: default;
  text-decoration: none;
}

.show-selected .publication:not(.selected) {
  display: none;
}

.introduction > p {
  margin-bottom: 14px;
}

.links {
  font-size: 0.98rem;
}

.links span,
.paper-links a + a {
  margin-left: .5em;
}

.portrait {
  display: block;
  width: 210px;
  height: 210px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--portrait-bg);
  object-fit: cover;
  object-position: center 18%;
  box-shadow: 0 0 0 1px rgba(19, 95, 116, 0.13);
}

.affiliations {
  display: flex;
  min-height: 55px;
  margin-top: 22px;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}

.affiliations a {
  display: inline-flex;
  align-items: center;
}

.affiliations img {
  display: block;
  width: auto;
  height: 35px;
}

.affiliations .uoa-logo {
  height: 55px;
}

.publication {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  margin: 0 18px;
}

.publication > div:last-child {
  padding: 26px 0;
}

.publication p {
  margin-bottom: 3px;
}

.teaser {
  position: relative;
}

/* The image fills the whole row (text plus half the gap on each side)
   without stretching the row itself. */
.teaser img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.authors,
.publication p {
  font-size: 0.96rem;
}

.authors {
  color: #3f494e;
}

.paper-links {
  margin-top: 5px;
}

.equal-note {
  color: var(--muted);
  font-size: 0.92em;
}

sup {
  line-height: 0;
}

@media (max-width: 690px) {
  main {
    width: min(100% - 24px, 940px);
    margin-top: 12px;
  }

  .aegean-banner {
    height: 125px;
  }

  .profile {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 8px 26px;
  }

  .portrait {
    grid-row: 1;
    width: 156px;
    height: 156px;
    margin: 0 auto;
  }

  h1 {
    text-align: center;
  }

  h2,
  .research-head {
    margin-left: 8px;
    margin-right: 8px;
  }

  .publication {
    grid-template-columns: 1fr;
    gap: 0;
    margin-left: 8px;
    margin-right: 8px;
  }

  .publication .teaser {
    padding-top: 26px;
  }

  .publication > div:last-child {
    padding-top: 12px;
  }

  .teaser img {
    position: static;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 220px;
  }
}
