:root {
  color-scheme: light;
  --background: #ffffff;
  --text: #272727;
  --muted: #6b6b6b;
  --border: #dedede;
  --link: #245a92;
  --link-hover: #173f69;
  --code-background: #f5f5f5;
  --page-width: 900px;
  --text-width: 720px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

p,
li {
  overflow-wrap: break-word;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  padding: 7px 10px;
  background: var(--text);
  color: #ffffff;
  z-index: 10;
}

.skip-link:focus {
  top: 10px;
}

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

.nav,
.site-footer,
.page-shell,
.home {
  width: min(var(--page-width), calc(100% - 40px));
  margin: 0 auto;
}

.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.site-main {
  min-height: calc(100vh - 154px);
}

.home,
.page-shell {
  padding-top: 54px;
  padding-bottom: 72px;
}

.home-header {
  margin-bottom: 38px;
}

.home-header h1,
.page-header h1 {
  margin: 0;
  font-size: 2.05rem;
  font-weight: 500;
  line-height: 1.25;
}

.home-header p,
.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 54px;
  align-items: start;
}

.about-copy,
.home-section,
.content {
  min-width: 0;
  max-width: var(--text-width);
}

.about-copy p:first-child,
.content > :first-child {
  margin-top: 0;
}

.contact-email {
  margin-top: 26px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.contact-email strong {
  font-weight: 600;
}

.contact-links {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 24px;
}

.contact-links span {
  color: var(--border);
}

.profile-photo {
  margin: 0;
}

.profile-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow:
    0 3px 8px rgb(0 0 0 / 0.14),
    0 15px 34px rgb(0 0 0 / 0.2);
}

.profile-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
}

.profile-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: currentColor;
}

.profile-link:hover {
  border-color: var(--link);
  background: var(--code-background);
  color: var(--link);
  text-decoration: none;
}

.profile-link:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.home-section {
  margin-top: 48px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.home-section h2,
.content h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.3;
}

.home-section p {
  margin: 0;
}

.page-header {
  max-width: var(--text-width);
  margin-bottom: 38px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.content h2 {
  margin-top: 2.2em;
}

.content h3 {
  margin: 1.8em 0 0.6em;
  font-size: 1.08rem;
  font-weight: 600;
}

.content img {
  max-width: 100%;
}

.content-wide {
  max-width: none;
}

.research-intro {
  max-width: var(--text-width);
}

.research-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  margin-top: 42px;
}

.research-feature figure {
  margin: 0;
}

.research-feature img {
  display: block;
  width: 100%;
  height: auto;
}

.research-feature p:first-child {
  margin-top: 0;
}

.research-feature p:last-child {
  margin-bottom: 0;
}

.research-divider {
  margin: 48px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.projects-list {
  display: grid;
  gap: 58px;
}

.project-entry {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1fr);
  gap: 42px;
  align-items: start;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}

.project-entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.project-entry--brief {
  grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
  gap: 30px;
  align-items: center;
}

.project-entry--brief .project-figure {
  width: min(270px, 100%);
  padding: 8px;
}

.project-entry--brief .project-figure img {
  width: 100%;
  max-width: 100%;
}

.project-entry--brief .project-copy {
  max-width: var(--text-width);
}

.project-entry--reverse {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.95fr);
}

.project-entry--reverse .project-figure {
  grid-column: 2;
}

.project-entry--reverse .project-copy {
  grid-column: 1;
  grid-row: 1;
}

.project-figure {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow:
    0 6px 18px rgb(0 0 0 / 0.08),
    0 18px 42px rgb(0 0 0 / 0.08);
}

.project-image-crop {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.project-figure--eikonal .project-image-crop {
  aspect-ratio: 2.5 / 1;
}

.project-figure--garch .project-image-crop {
  aspect-ratio: 2.25 / 1;
}

.project-figure img {
  display: block;
  width: 176%;
  max-width: none;
  height: auto;
}

.project-copy {
  min-width: 0;
}

.project-copy h2 {
  margin-top: 0;
}

.project-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.project-equation {
  margin: 20px 0;
  overflow-x: auto;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.92rem;
}

.project-links a:hover {
  border-color: var(--link);
  color: var(--link);
  text-decoration: none;
}

.content code {
  padding: 0.1em 0.3em;
  border-radius: 3px;
  background: var(--code-background);
  font-size: 0.92em;
}

.content pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--code-background);
}

.publication,
.post-list-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.publication:first-of-type,
.post-list-item:first-of-type {
  border-top: 0;
}

.publication h2,
.post-list-item h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.publication p,
.post-list-item p {
  margin: 4px 0;
}

.publication-year,
.post-date,
.muted {
  color: var(--muted);
}

.publication-year,
.post-date {
  font-size: 0.92rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 9px !important;
  font-size: 0.92rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.84rem;
}

.footer-links {
  display: flex;
  gap: 14px;
}

@media (max-width: 680px) {
  .nav {
    min-height: auto;
    padding: 15px 0 13px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 10px 20px;
    flex-wrap: wrap;
  }

  .home,
  .page-shell {
    padding-top: 38px;
    padding-bottom: 52px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .profile-photo {
    max-width: 210px;
    grid-row: 1;
  }

  .research-feature {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 34px;
  }

  .research-feature--result figure {
    grid-row: 1;
  }

  .research-divider {
    margin: 38px 0;
  }

  .project-entry,
  .project-entry--reverse {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .project-entry--reverse .project-figure,
  .project-entry--reverse .project-copy {
    grid-column: auto;
    grid-row: auto;
  }

  .project-entry {
    padding-bottom: 42px;
  }

  .publication,
  .post-list-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .nav,
  .site-footer,
  .page-shell,
  .home {
    width: calc(100% - 28px);
  }

  .home-header h1,
  .page-header h1 {
    font-size: 1.8rem;
  }

  .site-footer {
    flex-direction: column;
    gap: 7px;
  }
}
