:root {
  color-scheme: light;
  --paper: #fafafa;
  --ink: #20201e;
  --muted: #65645e;
  --rule: #bcb9af;
  --panel: #f1f1ef;
  --accent: #244b43;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Lato", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

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

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

.page {
  width: min(100% - 48px, 1080px);
  margin: 0 auto;
  padding: 58px 0 72px;
}

.masthead {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  margin-top: 21px;
  font-size: .96rem;
}

section {
  margin-top: 47px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.intro {
  max-width: 790px;
  margin: 0;
  font-size: 1.08rem;
}

.project-list {
  display: grid;
  gap: 18px;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 25px;
  align-items: stretch;
  padding: 23px 0;
  border-bottom: 1px solid var(--rule);
}

.project:nth-child(even) {
  grid-template-columns: 220px minmax(0, 1fr);
}

.project:nth-child(even) .project-visual {
  order: -1;
}

/* Projects without a visual panel span the full width */
.project:not(:has(.project-visual)),
.project:nth-child(even):not(:has(.project-visual)) {
  grid-template-columns: minmax(0, 1fr);
}

.project h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.3;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 6px 0 12px;
  color: var(--muted);
}

.project-meta time {
  white-space: nowrap;
}

.project ul {
  margin: 0;
  padding-left: 1.2rem;
}

.project li {
  margin: 4px 0;
  padding-left: 3px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 15px;
  font-size: .95rem;
}

.project-visual {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--panel);
}

.project-visual img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.education-list,
.activity-list {
  display: grid;
  gap: 15px;
}

.education-item,
.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.education-item strong,
.activity-item strong {
  display: block;
}

.education-item p,
.activity-item p {
  margin: 2px 0 0;
  color: var(--muted);
}

.education-place {
  min-width: 190px;
  text-align: right;
  color: var(--muted);
}

.skills {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 8px 18px;
  margin: 0;
}

.skills dt {
  font-weight: 700;
}

.skills dd {
  margin: 0;
}

.activities-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
}

.activities-row h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.activities-row p {
  margin: 5px 0 14px;
}

footer {
  margin-top: 52px;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: .88rem;
}

@media (max-width: 700px) {
  .page {
    width: min(100% - 32px, 600px);
    padding-top: 35px;
  }

  section {
    margin-top: 36px;
  }

  .project,
  .project:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project:nth-child(even) .project-visual {
    order: 0;
  }

  .project-visual {
    min-height: 135px;
  }

  .education-item,
  .activity-item {
    flex-direction: column;
    gap: 1px;
  }

  .education-place {
    min-width: 0;
    text-align: left;
  }

  .skills {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .skills dd {
    margin-bottom: 10px;
  }

  .activities-row {
    grid-template-columns: 1fr;
  }
}