:root {
  --bg: #d6d6d4;
  --ink: #1b1b1b;
  --ink-soft: #3c3c3c;
  --muted: #858585;
  --line: #9c9c9a;
  --font: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

.muted {
  color: var(--muted);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* top bar */

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 2fr) auto;
  padding: 34px 0 20px;
  border-bottom: 1px solid var(--line);
}

.topbar__item {
  min-width: 0;
  padding: 0 14px;
}

.topbar__item:first-child {
  padding-left: 0;
}

.topbar__item + .topbar__item {
  border-left: 1px solid var(--line);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.topbar .value {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.topbar__item:last-child .value {
  white-space: nowrap;
}

/* hero */

.hero {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 52px 0;
  border-bottom: 1px solid var(--line);
}

.avatar {
  flex: none;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  background: #0a0a0a;
}

.hero__name {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.hero__role {
  margin-top: 6px;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 26px);
  line-height: 1.3;
}

/* sections */

.section {
  padding: 36px 0 44px;
  border-bottom: 1px solid var(--line);
}

.section__label {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
}

.about p {
  max-width: 66ch;
}

/* entries: date column + content column */

.entry {
  display: grid;
  grid-template-columns: 23% minmax(0, 1fr);
  column-gap: 2%;
}

.entry + .entry {
  margin-top: 40px;
}

.entry__date {
  padding-top: 7px;
  font-size: 13px;
}

.tag {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

a.tag:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

a.tag:hover .muted {
  color: var(--line);
}

.bullets {
  max-width: 460px;
  margin-top: 22px;
  list-style: none;
}

.bullets li + li {
  margin-top: 10px;
}

.bullets li::before {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.55em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: -0.02em;
}

.entry__text {
  max-width: 460px;
  margin-top: 16px;
}

/* skills grid: 3 per row, a lone last item sits in the middle */

.skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}

.skills .tag {
  display: block;
  padding: 10px 14px;
  text-align: center;
}

.skills .tag:last-child:nth-child(3n + 1) {
  grid-column: 2;
}

/* footer */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 40px;
  font-size: 12px;
}

/* load-in: only the top of the page, so nothing further down ever starts hidden */

@media (prefers-reduced-motion: no-preference) {
  .topbar,
  .hero {
    animation: rise 0.6s ease both;
  }

  .hero { animation-delay: 0.08s; }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }
}

/* responsive */

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr 1fr;
    row-gap: 18px;
  }

  .topbar__item:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skills .tag:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 7px);
  }
}

@media (max-width: 600px) {
  /* name first, contact rows underneath */
  .page {
    display: flex;
    flex-direction: column;
  }

  .hero {
    order: -1;
    animation-delay: 0s;
  }

  .topbar {
    animation-delay: 0.08s;
  }

  /* top bar becomes compact "label  value" rows */
  .topbar {
    grid-template-columns: 1fr;
    row-gap: 6px;
    padding: 22px 0 20px;
  }

  .topbar__item,
  .topbar__item + .topbar__item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: baseline;
    padding: 0;
    border-left: 0;
  }

  .topbar .value {
    margin-top: 0;
  }

  /* keep avatar beside the name, like desktop */
  .hero {
    gap: 16px;
    padding: 32px 0;
  }

  .avatar {
    width: 76px;
    height: 76px;
  }

  .hero__name {
    font-size: min(28px, 7vw);
  }

  .hero__role {
    margin-top: 4px;
    font-size: 15px;
  }

  .section {
    padding: 28px 0 32px;
  }

  .section__label {
    margin-bottom: 16px;
  }

  /* company on one line, role on the next */
  .entry .tag .muted {
    display: block;
  }

  .entry {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .entry__date {
    padding-top: 0;
  }

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

  .skills .tag:last-child:nth-child(odd) {
    grid-column: auto;
    width: auto;
    justify-self: stretch;
  }

  .footer {
    flex-wrap: wrap;
    padding-bottom: 32px;
  }
}
