/* ---------- Colours and fonts ---------- */

:root {
  --bg: #ffffff;
  --text: #1b1c1e;
  --muted: #55585e;
  --faint: #6b6e75;        /* footer: 5.1:1 on white (WCAG AA) */
  --rule: #cfd4db;         /* section dividers */
  --pill-border: #cfd4db;  /* outline of the arXiv / DOI / Slides buttons */
  --accent: #173f6e;
  --accent-soft: #eaf0f7;

  /* Loaded from Google Fonts in index.html; the rest are fallbacks. */
  --serif: "Source Serif 4", Charter, Cambria, Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
          "Noto Sans JP", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 30%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection {
  background: var(--accent-soft);
}

p {
  margin: 0 0 1em;
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Layout ---------- */

/* 920px of content: wide enough for the venue column plus the longest
   author list on one line. Paragraphs stay narrower so they read easily. */
.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 72px 40px 48px;
}

#about p {
  max-width: 760px;
}

/* ---------- Profile header ---------- */

.profile {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 36px;
  margin-bottom: 64px;
}

/* Name at the photo's top edge, links at its bottom edge,
   title / institute / email evenly spaced in between. */
.profile-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.avatar {
  align-self: start;
  position: relative;
  width: 152px;
  aspect-ratio: 763 / 1065;  /* same portrait shape as the old Google Site */
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 40px/1 var(--sans);
  letter-spacing: 0.02em;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile h1 {
  margin: -0.12em 0 0;  /* pulls the capitals up flush with the photo's top edge */
  font: 600 2.1rem/1 var(--serif);
  letter-spacing: -0.01em;
  color: var(--accent);
}

.role {
  margin: 0;
  font: 0.95rem/2 var(--sans);
  color: var(--text);
}

.email {
  margin: 0;
  font: 0.95rem/2 var(--sans);
}

.links {
  list-style: none;
  margin: 0 0 -5px;  /* sets the icons flush with the photo's bottom edge */
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font: 0.9rem/1.4 var(--sans);
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}

.links svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: var(--accent);
}

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

/* ---------- Sections ---------- */

section + section {
  margin-top: 56px;
}

h2 {
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font: 600 1.25rem/1.3 var(--sans);
  letter-spacing: -0.01em;
  color: var(--accent);
}

/* ---------- Publication list ---------- */

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub + .pub {
  margin-top: 22px;
}

.pub-title {
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
}

.authors {
  margin: 2px 0 0;
  font-size: 0.94rem;
  color: var(--muted);
}

/* Left: venue badge. Right: title, authors, then arXiv / DOI / Slides. */
.pub {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 0 24px;
}

.pub-side {
  padding-top: 1px;
}

/* Every badge is the same width: just enough for "WALCOM 2027". */
.venue {
  display: block;
  width: 104px;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 0.72rem/1.5 var(--sans);
  letter-spacing: 0.03em;
  text-align: center;
}

/* Badges that link to the conference homepage. */
a.venue {
  text-decoration: none;
}

a.venue:hover {
  background: #d9e4f1;
}

.pub-links {
  margin: 7px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font: 500 0.75rem/1 var(--sans);
}

.pub-links a {
  padding: 4px 9px;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  text-decoration: none;
}

.pub-links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 72px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font: 0.8rem/1.5 var(--sans);
  color: var(--faint);
}

.site-footer p {
  margin: 0;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 640px) {
  .page {
    padding: 36px 20px 32px;
  }

  .profile {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 44px;
  }

  /* The text is taller than the small photo here, so just stack it. */
  .profile-text {
    justify-content: flex-start;
    gap: 10px;
  }

  .links {
    margin-bottom: 0;
  }

  .avatar {
    width: 96px;
    border-radius: 12px;
    font-size: 28px;
  }

  .profile h1 {
    font-size: 1.6rem;
  }

  .links {
    gap: 6px 14px;
  }

  /* On phones: the venue badge sits above the title. */
  .pub {
    grid-template-columns: minmax(0, 1fr);
  }

  .pub-side {
    margin-bottom: 6px;
    padding-top: 0;
  }
}
