:root {
  --text: #404040;
  --text-strong: #000000;
  --text-muted: #737373;
  --line: #d4d4d4;
  --line-soft: #e5e5e5;
  --bg-soft: #fafafa;
  --bg-hover: #f5f5f5;
  --bg-dark: #111827;
  --text-dark: #e5e5e5;
  --content-width: 48rem;
  --wide-width: 72rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 1.1rem 0 2rem;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 1.125rem;
  line-height: 1.75;
  background: #ffffff;
}

body.home-page {
  overflow: hidden;
}

@media (min-width: 640px) {
  body {
    padding: 2.4rem 0 4rem;
  }
}

@media (min-width: 768px) {
  body {
    padding: 3.2rem 0 6rem;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
ul {
  margin: 0;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.layout {
  width: min(100%, calc(var(--content-width) + 2rem));
  margin: 0 auto;
  padding: 0 1rem;
}

.layout-wide {
  width: min(100%, calc(var(--wide-width) + 2rem));
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .layout,
  .layout-wide {
    padding: 0 1.5rem;
  }
}

.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
  margin-bottom: 1.35rem;
}

.brand {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  color: var(--text-strong);
}

.identity-copy {
  display: flex;
  flex-direction: column;
}

.avatar-top {
  display: flex;
  justify-content: center;
  margin-bottom: 1.35rem;
}

.avatar-wrap {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  flex: none;
}

.name-g {
  color: inherit;
  text-decoration: none;
}

.name-g:hover {
  color: inherit;
  text-decoration: none;
}

.avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 1.25rem;
  border: 1px solid var(--line-soft);
  background: #f3efe8;
  object-fit: cover;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.avatar-primary {
  opacity: 1;
}

.avatar-hover {
  opacity: 0;
}

.avatar-caption {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.6rem);
  transform: translateX(-50%) translateY(0.2rem);
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  background: rgba(17, 24, 39, 0.94);
  color: #ffffff;
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.avatar-wrap:hover .avatar-primary {
  opacity: 0;
}

.avatar-wrap:hover .avatar-hover {
  opacity: 1;
}

.avatar-wrap:hover .avatar-caption {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.page-title {
  margin-left: 0.3rem;
  font-weight: 300;
}

.page-title-dash {
  color: #a3a3a3;
}

.nav {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding-top: 0;
  color: var(--text-muted);
}

.nav a {
  transition: color 0.15s ease;
}

.nav a:hover,
.nav a.active {
  color: #5e17eb;
}

main {
  display: block;
}

.stack-lg > * + * {
  margin-top: 3.5rem;
}

.stack-md > * + * {
  margin-top: 1.25rem;
}

.stack-sm > * + * {
  margin-top: 1rem;
}

.lead {
  line-height: 1.375;
}

.link {
  text-decoration: underline;
  text-decoration-color: #a3a3a3;
  text-underline-offset: 2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.link:hover {
  color: #5e17eb;
  text-decoration-color: #5e17eb;
}

.project-pair {
  display: grid;
  gap: 0.25rem;
  margin: 0 -0.75rem;
  padding: 0.5rem 0.75rem;
  transition: background-color 0.15s ease;
}

.project-pair:hover {
  background: var(--bg-hover);
}

.section-title {
  margin-bottom: 0.75rem;
  color: var(--text-strong);
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
}

.section-title-spaced {
  margin-top: 2.5rem;
}

.awards-page {
  max-width: 46rem;
}

.section-rule {
  margin: 0 0 1.75rem;
  border: 0;
  border-top: 1px solid var(--line-soft);
}

.awards-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.award-group-year {
  margin-bottom: 0.35rem;
  color: var(--text-strong);
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}

.awards-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.award-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: baseline;
  line-height: 1.25;
}

.award-title {
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.4;
}

.award-amount {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.award-note {
  width: 100%;
  margin-top: 0.15rem;
  margin-bottom: 0;
  padding-left: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.service-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: baseline;
  line-height: 1.25;
}

.service-label {
  color: var(--text-strong);
  font-weight: 600;
}

.service-text {
  color: var(--text);
}

.subsection-label {
  margin: -0.35rem 0 0.35rem;
  color: var(--text-strong);
  font-weight: 600;
}

.inline-note {
  color: var(--text-muted);
  font-weight: 400;
}

.inline-hover {
  position: relative;
  display: inline-block;
}

.inline-hover-trigger {
  text-decoration: underline;
  text-decoration-color: #a3a3a3;
  text-underline-offset: 2px;
}

.inline-hover-caption {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(0.2rem);
  width: 18rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.55rem;
  background: rgba(17, 24, 39, 0.96);
  color: #ffffff;
  font-size: 0.78rem;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  text-decoration: none;
}

.inline-hover:hover .inline-hover-caption {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 640px) {
  .project-pair {
    grid-template-columns: 1fr 2fr;
  }
}

.project-title {
  color: var(--text-strong);
  font-weight: 500;
}

.project-status {
  margin-top: 0.125rem;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--text-muted);
}

.footer {
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.4;
}

.footer-label,
.footer-credit {
  color: var(--text-muted);
}

.footer-divider {
  flex: 1;
  border: 0;
  border-top: 1px dotted var(--line);
  margin: 0;
}

.footer-credit {
  margin-top: 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.toc-wrap {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.toc {
  padding: 3rem 0;
}

.toc-inner {
  max-width: var(--content-width);
}

.toc-title {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #ffffff;
}

.toc-list {
  list-style: none;
  padding: 0;
  columns: 1;
}

@media (min-width: 640px) {
  .toc-list {
    columns: 2;
  }
}

.toc-list li {
  break-inside: avoid;
  margin-bottom: 0.35rem;
}

.filter-bar {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft);
}

.filter-inner {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #000000;
  font-size: 1rem;
}

.filter-icon {
  width: 1rem;
  height: 1rem;
  border: 1.5px solid currentColor;
  border-radius: 0.2rem;
  position: relative;
}

.filter-icon::before,
.filter-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.filter-icon::before {
  width: 100%;
  height: 1.5px;
  left: 0;
  top: 0.35rem;
}

.filter-icon::after {
  width: 1.5px;
  height: 0.35rem;
  left: 0.25rem;
  top: -0.2rem;
  box-shadow: 0.4rem 0 0 currentColor;
}

.research-section {
  padding: 2.5rem 0;
}

.research-title {
  margin-bottom: 0.5rem;
  color: var(--text-strong);
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
}

.research-date {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 400;
  white-space: nowrap;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  margin-right: 0.375rem;
  margin-bottom: 0.5rem;
  border-radius: 999px;
  padding: 1px 0.375rem;
  background: var(--bg-hover);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.research-grid {
  display: grid;
  gap: 1rem;
}

.research-grid > :only-child {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .research-grid {
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .research-grid {
    gap: 3rem;
  }
}

.research-summary {
  margin-bottom: 0.75rem;
  color: var(--text-strong);
  font-weight: 300;
}

.research-body p + p {
  margin-top: 1rem;
}

.research-image {
  align-self: start;
}

.research-image img {
  border: 1px solid var(--line-soft);
}

@media (max-width: 580px) {
  .page-title {
    display: block;
    margin-left: 0;
    font-size: 1.25rem;
    line-height: 1.75rem;
  }

  .page-title-dash {
    display: none;
  }
}

@media (max-width: 420px) {
  .header {
    align-items: flex-start;
  }

  .avatar {
    border-radius: 1rem;
  }

  .avatar-wrap {
    width: 3.75rem;
    height: 3.75rem;
  }

  .avatar-caption {
    left: 0;
    transform: translateX(0) translateY(0.2rem);
    white-space: normal;
    width: 10rem;
  }

  .avatar-wrap:hover .avatar-caption {
    transform: translateX(0) translateY(0);
  }

  .nav {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }
}
