:root {
  color-scheme: light;
  --page-background: #f1f4f8;
  --surface: #fff;
  --ink: #263445;
  --muted: #526174;
  --accent: #285579;
  --accent-soft: #eaf2f8;
  --highlight: #347b80;
  --line: #d5dfe8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-background);
  color: var(--ink);
  font: 100%/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  overflow-wrap: anywhere;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:visited {
  color: #66517c;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 3px;
}

[id] {
  scroll-margin-top: 1rem;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a img {
  border: 0;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.3;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.8rem, 4vw, 2.3rem);
}

h1::after {
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: 0.7rem;
  background: var(--highlight);
  content: "";
}

h2 {
  margin: 2rem 0 1rem;
  padding-left: 0.7rem;
  border-left: 3px solid var(--highlight);
  font-size: 1.4rem;
}

h3 {
  margin: 1.5rem 0 0.6rem;
  color: var(--accent);
  font-size: 1.15rem;
}

p, ul, ol {
  margin: 0 0 1rem;
}

ul, ol {
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.6rem;
}

hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.site-header {
  border-top: 4px solid var(--highlight);
  border-bottom: 1px solid var(--line);
  background: #e5edf5;
}

.site-header-inner,
.site-footer {
  width: min(100% - 2rem, 64rem);
  margin-inline: auto;
}

.site-header-inner {
  padding-block: 1.1rem 0.75rem;
}

.site-name {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
}

.site-name a,
.site-name a:visited {
  color: var(--ink);
  text-decoration: none;
}

.site-description {
  margin: 0.2rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: block;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border-radius: 0.3rem;
  color: var(--accent);
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--surface);
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  background: var(--accent);
  color: var(--surface);
  font-weight: 600;
}

.site-main {
  width: min(100% - 2rem, 84ch);
  margin: 2rem auto;
  padding: clamp(1rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: 0 3px 14px #26344508;
}

.site-main > :last-child {
  margin-bottom: 0;
}

.site-main article + article {
  margin-top: 1.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  z-index: 1;
  padding: 0.5rem 1rem;
  transform: translateY(-200%);
  background: var(--surface);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.home-profile {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.home-profile h1 {
  margin-bottom: 1rem;
}

.home-profile p:last-child {
  margin-bottom: 0;
}

.home-portrait {
  width: 10rem;
  border-radius: 0.5rem;
}

.project-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.project-link,
.project-link:visited {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  box-shadow: 0 2px 5px #26344514;
}

.project-link-hardware,
.project-link-hardware:visited {
  background: var(--highlight);
}

.project-link:hover {
  background: var(--ink);
}

.project-link:hover > span:first-of-type {
  text-decoration: underline;
}

.project-link-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
}

.project-link-arrow {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 1.25rem;
}

.seminar-topics > li {
  margin-block: 1.5rem;
  padding-left: 0.35rem;
}

.seminar-topics > li::marker {
  color: var(--highlight);
  font-weight: 700;
}

.seminar-topics > li + li {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.project-entry {
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr);
  column-gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.site-main .project-entry + .project-entry {
  padding-top: 1.5rem;
}

.project-entry > h3,
.project-entry > p {
  grid-column: 2;
}

.project-entry > h3 {
  margin-top: 0;
}

.project-entry > p:last-child {
  margin-bottom: 0;
}

.project-visual {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 6.25rem;
  height: 6.25rem;
}

.project-visual,
.entry-visual {
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--accent-soft);
}

.project-visual-hardware {
  background: var(--surface);
}

.illustrated-entry {
  --illustration-size: 6.25rem;
  display: grid;
  grid-template-columns: var(--illustration-size) minmax(0, 1fr);
  grid-template-rows: min-content auto;
  gap: 0.6rem 1.5rem;
  align-items: start;
  margin-block: 1.5rem;
}

.illustrated-entry + .illustrated-entry {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.entry-heading {
  grid-column: 2;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--accent);
  font-size: 1.15rem;
}

.entry-visual {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: var(--illustration-size);
  height: var(--illustration-size);
}

.entry-body {
  grid-column: 2;
  min-width: 0;
  margin: 0;
}

.entry-body > :last-child {
  margin-bottom: 0;
}

.publication-entry {
  --illustration-size: 8rem;
}

.publication-entry .entry-visual {
  height: auto;
  border: 0;
  border-radius: 0;
  background: none;
}

.entry-visual.book-cover {
  height: auto;
  max-height: 7.5rem;
  border: 0;
  border-radius: 0;
  background: none;
}

.seminar-topic {
  --illustration-size: 4.5rem;
  position: relative;
  column-gap: 1rem;
  min-height: var(--illustration-size);
  margin: 0;
}

/* Keep native list markers aligned with the heading's text baseline. */
.seminar-topic .entry-visual {
  position: absolute;
  top: 0;
  left: 0;
}

.seminar-topic .entry-heading {
  font-size: 1rem;
  line-height: 1.5;
  text-wrap: auto;
}

.event-list {
  padding: 0;
  list-style: none;
}

.event-year {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-main-wide {
  max-width: 64rem;
  width: calc(100% - 2rem);
}

.illustrated-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: 1.5rem;
}

.language-columns,
.image-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.language-columns h2 {
  margin-top: 0;
}

.image-pair {
  margin-bottom: 1.5rem;
}

.image-pair figure {
  margin: 0;
  text-align: center;
}

.image-pair figcaption {
  margin-top: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 48rem) {
  .illustrated-intro,
  .language-columns,
  .image-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-main {
    margin-block: 1rem;
  }
}

@media (max-width: 36rem) {
  .home-profile {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-portrait {
    width: 8rem;
  }

  .illustrated-entry {
    --illustration-size: 3.5rem;
    gap: 0.75rem 1rem;
  }

  .entry-visual {
    grid-row: 1;
    border-radius: 0.5rem;
  }

  .entry-heading {
    align-self: center;
  }

  .entry-body {
    grid-column: 1 / -1;
  }

  .seminar-topic {
    grid-template-rows: minmax(var(--illustration-size), auto) auto;
  }

  .project-entry {
    grid-template-columns: 3.5rem minmax(0, 1fr);
    gap: 0.75rem 1rem;
  }

  .project-visual {
    grid-row: 1;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.5rem;
  }

  .project-entry > h3 {
    align-self: center;
    margin-bottom: 0;
  }

  .project-entry > p {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .site-footer,
  .skip-link {
    display: none;
  }

  .site-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  h1, h2, h3, h4 {
    break-after: avoid;
  }

  .project-entry,
  .illustrated-entry,
  .home-profile {
    break-inside: avoid;
  }

  .project-link,
  .project-link:visited {
    border-color: var(--line);
    background: none;
    color: #000;
    box-shadow: none;
  }
}
