:root {
  --bg: #fbfcf8;
  --ink: #171817;
  --muted: #68736b;
  --faint: #d9e0d8;
  --accent: #2f6f5e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Times New Roman", Times, serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 22px;
  border: 1px solid var(--faint);
  pointer-events: none;
}

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

.page {
  width: min(860px, calc(100% - 44px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 64px 0;
}

.sheet {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(240px, 0.68fr);
  gap: 48px;
  align-items: center;
}

.meta {
  margin-bottom: 46px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: 0;
}

.lead {
  max-width: 430px;
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.62;
}

.lead a {
  color: var(--accent);
  border-bottom: 1px solid rgba(47, 111, 94, 0.32);
}

.small {
  max-width: 390px;
  margin-top: 28px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.75;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 38px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.links a {
  color: var(--muted);
  border-bottom: 1px solid rgba(104, 115, 107, 0.38);
}

.links a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.figure {
  margin: 0;
}

.figure img {
  display: block;
  width: min(100%, 330px);
  margin-left: auto;
}

.caption {
  width: min(100%, 330px);
  margin: 18px 0 0 auto;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.65;
  text-transform: uppercase;
}

/* ---- Resume ---- */

.page--resume {
  display: block;
  min-height: auto;
  padding: 56px 0 60px;
}

.resume-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.resume-head .meta {
  margin-bottom: 18px;
}

.meta-return {
  color: var(--muted);
  border-bottom: 1px solid rgba(104, 115, 107, 0.38);
}

.meta-return:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.resume-name {
  font-size: 32px;
}

.resume-line {
  max-width: 470px;
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}

.resume-contact {
  margin-top: 16px;
  font-size: 11px;
}

.resume-photo {
  margin: 6px 0 0;
  flex: 0 0 auto;
}

.resume-photo img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--faint);
}

.resume-section {
  margin-top: 40px;
}

.section-label {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--faint);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.entry {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 22px;
  margin-top: 20px;
}

.entry-meta {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.8;
  text-transform: uppercase;
}

.tag {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag a {
  color: var(--muted);
  border-bottom: 1px solid rgba(104, 115, 107, 0.38);
}

.tag a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.tag--accent {
  color: var(--accent);
}

.entry-body h3 {
  font-size: 18px;
  font-weight: 400;
}

.entry-note {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.entry-body p {
  max-width: 620px;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.58;
}

.entry-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(47, 111, 94, 0.32);
}

.entry-tech {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.7;
}

.edu-line {
  font-size: 15px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 40px;
  margin-top: 22px;
}

.project h3 {
  font-size: 16px;
  font-weight: 400;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.project p {
  margin-top: 5px;
  font-size: 13.5px;
  line-height: 1.5;
}

.project .entry-tech {
  margin-top: 5px;
}

.instruments div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 22px;
  margin-top: 12px;
}

.instruments div:first-of-type {
  margin-top: 18px;
}

.instruments dt {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.9;
  text-transform: uppercase;
}

.instruments dd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink);
}

.resume-foot {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--faint);
  text-align: center;
}

@media (max-width: 760px) {
  body::before {
    inset: 12px;
  }

  .page {
    width: min(100%, 620px);
    min-height: auto;
    display: block;
    padding: 38px 24px 44px;
  }

  .sheet {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 34px;
  }

  .meta {
    margin-bottom: 30px;
  }

  h1 {
    font-size: clamp(27px, 8vw, 34px);
  }

  .lead {
    margin-top: 20px;
    font-size: 17px;
    line-height: 1.58;
  }

  .small {
    margin-top: 24px;
  }

  .links {
    margin-top: 28px;
  }

  .figure {
    width: 100%;
    padding-top: 4px;
  }

  .figure img {
    width: min(72vw, 240px);
    margin: 0 auto;
  }

  .caption {
    width: min(72vw, 240px);
    margin: 12px auto 0;
    text-align: left;
  }

  .page--resume {
    padding: 38px 24px 48px;
  }

  .resume-head {
    flex-direction: column;
    gap: 20px;
  }

  .resume-head .meta {
    margin-bottom: 16px;
  }

  .resume-photo img {
    width: 116px;
    height: 116px;
  }

  .resume-name {
    font-size: 28px;
  }

  .entry,
  .instruments div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .entry-meta br {
    display: none;
  }

  .entry-meta .tag::before {
    content: "\00a0\00a0";
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media print {
  body::before {
    display: none;
  }

  body {
    background: #fff;
  }

  .page--resume {
    width: 100%;
    padding: 0;
  }

  .meta-return {
    display: none;
  }

  .resume-section {
    margin-top: 22px;
    break-inside: avoid;
  }

  .entry-body a,
  .lead a {
    color: var(--ink);
    border-bottom: none;
  }
}
