:root {
  --ink: #1a1f1c;
  --muted: #5a6a63;
  --rule: #dfe6e1;
  --accent: #2f6e4f;
  --accent-soft: #e7f3ec;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #fff;
  color: var(--ink);
  font: 17px/1.68 Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 22px;
}

header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 10px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.id {
  display: flex;
  align-items: center;
  gap: 18px;
}

.title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
}

.profile-pic {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

nav {
  margin: 8px 0 0;
}

nav a {
  padding: 0 10px;
  border-right: 1px solid var(--rule);
  text-decoration: none;
}

nav a:first-child {
  padding-left: 0;
}

nav a:last-child {
  border-right: 0;
}

main section {
  padding: 28px 0;
}

h1,
h2,
h3 {
  margin: 0 0 10px;
  font-weight: 600;
}

h1 {
  font-size: 26px;
  font-variant: small-caps;
  letter-spacing: 0.5px;
}

h2 {
  font-size: 21px;
  font-variant: small-caps;
  letter-spacing: 0.4px;
}

h3 {
  font-size: 17px;
}

p {
  margin: 0 0 12px;
}

ul {
  margin: 0 0 0 20px;
}

li {
  margin: 4px 0;
}

.orn {
  border: 0;
  height: 10px;
  margin: 20px auto;
  max-width: 820px;
  background: linear-gradient(
    to right,
    transparent,
    var(--accent) 15%,
    var(--accent) 85%,
    transparent
  );
  -webkit-mask: linear-gradient(#000, transparent 60%);
  mask: linear-gradient(#000, transparent 60%);
}

.note {
  background: var(--accent-soft);
  border: 1px solid var(--rule);
  padding: 14px;
  border-radius: 10px;
}

.dropcap:first-letter {
  float: left;
  font-size: 3.1em;
  line-height: 0.9;
  color: var(--accent);
  font-weight: 700;
  margin: 0.05em 0.16em 0 0;
}

.project-card {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  margin: 26px 0;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.15);
}

.project-media img {
  width: 220px;
  max-height: 300px;
  object-fit: cover;
  border-radius: 16px;
  border: 4px solid var(--accent);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.project-content {
  flex: 1;
}

.project-content h3 {
  margin-top: 0;
}

.project-content ul {
  margin-top: 12px;
}

.interests-grid {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  grid-template-areas: "media content";
  gap: 26px;
  align-items: stretch;
  margin-top: 22px;
}

.interests-media {
  grid-area: media;
}

.interests-media img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 18px;
  border: 4px solid var(--accent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.interests-grid .research-interests {
  grid-area: content;
  margin: 0;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.interest-item h3 {
  margin: 0 0 6px;
  color: var(--accent);
}

.interest-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
}

.interest-item + .interest-item {
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 14px;
  padding: 18px 0;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .wrap {
    padding: 16px;
  }

  body {
    font-size: 16px;
    line-height: 1.6;
  }

  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
  }

  .id {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    width: 100%;
  }

  .profile-pic {
    width: 120px;
    height: 120px;
  }

  .title {
    font-size: 20px;
  }

  .subtitle {
    font-size: 13px;
  }

  nav {
    margin: 18px auto 0;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    -webkit-overflow-scrolling: touch;
    border: 0;
    background: transparent;
  }

  nav::before,
  nav::after {
    content: "";
    flex: 0 0 12px;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav a {
    padding: 4px 0;
    border: 0;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    white-space: nowrap;
    background: transparent;
    box-shadow: none;
    font-weight: 600;
    letter-spacing: 0.15px;
    scroll-snap-align: center;
    border-bottom: 2px solid transparent;
  }

  nav a:hover,
  nav a:focus-visible {
    border-bottom-color: var(--accent);
  }

  nav a:active {
    border-bottom-color: var(--accent);
    color: var(--accent);
  }

  main section {
    padding: 20px 0;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 16px;
  }

  .dropcap:first-letter {
    font-size: 2.5em;
    margin: 0.05em 0.12em 0 0;
  }

  .note {
    padding: 12px;
    font-size: 15px;
  }

  ul {
    margin: 0 0 0 16px;
  }

  .project-card {
    display: grid;
    grid-template-columns: minmax(120px, 40%) minmax(0, 1fr);
    grid-template-areas:
      "title title"
      "desc desc"
      "media list";
    gap: 16px 18px;
    align-items: start;
    text-align: left;
    padding: 22px;
  }

  .project-content {
    display: contents;
  }

  .project-card h3 {
    grid-area: title;
    margin-bottom: 0;
  }

  .project-card p {
    grid-area: desc;
    margin: 0;
  }

  .project-card ul {
    grid-area: list;
    margin-top: 0;
  }

  .project-media {
    grid-area: media;
  }

  .project-media img {
    width: 100%;
    height: auto;
    border-width: 3px;
    max-width: none;
  }

  .project-card:nth-of-type(2) {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 40%);
    grid-template-areas:
      "title title"
      "desc desc"
      "list media";
  }

  .project-card:nth-of-type(2) .project-media {
    justify-self: end;
    align-self: start;
  }

  .interests-grid {
    grid-template-columns: minmax(110px, 42%) minmax(0, 1fr);
    grid-template-areas: "media content";
    gap: 18px;
  }

  .interests-media {
    align-self: start;
  }

  .interests-media img {
    max-height: none;
    width: 100%;
    height: auto;
    max-width: none;
    margin: 0;
    border-width: 3px;
  }

  .interests-grid .research-interests {
    padding: 18px;
  }

  header {
    padding-bottom: 16px;
  }

  footer {
    padding: 16px 0;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 12px;
  }

  .profile-pic {
    width: 100px;
    height: 100px;
  }

  .title {
    font-size: 18px;
  }

  nav {
    gap: 18px;
    padding: 6px 14px;
  }

  nav::before,
  nav::after {
    flex: 0 0 16px;
  }

  nav a {
    padding: 4px 0;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }

  .project-media img {
    max-width: none;
  }

  .project-card {
    grid-template-columns: minmax(110px, 42%) minmax(0, 1fr);
    gap: 14px 16px;
  }

  .project-card:nth-of-type(2) {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 42%);
    grid-template-areas:
      "title title"
      "desc desc"
      "list media";
  }

  .interests-media img {
    max-width: none;
  }
}

.research-interests {
  background: var(--accent-soft);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.research-interests h3 {
  color: var(--accent);
  margin: 0 0 6px;
  font-size: 17px;
}

.research-interests p {
  color: var(--ink);
  margin: 0;
  line-height: 1.6;
}
