/* Max Krehbiel: portfolio. One typeface, white page, images first. */

:root {
  --page: #ffffff;
  --text: #16191d;
  --text-2: #3b4148;
  --muted: #626a72;
  --rule: #eceef0;
  --img-border: #e3e6e9;
  --button-bg: #16191d;
  --button-text: #ffffff;
  --img-filter: none;
  --font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --pad: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0f1215;
    --text: #e8ebee;
    --text-2: #b4bcc4;
    --muted: #8a939b;
    --rule: #22282e;
    --img-border: #2a3138;
    --button-bg: #e8ebee;
    --button-text: #0f1215;
    --img-filter: brightness(0.92);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--button-bg);
  color: var(--button-text);
}

.skip:focus {
  top: 12px;
}

/* Header */

.masthead {
  border-bottom: 1px solid var(--rule);
}

.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  min-height: 68px;
}

.wordmark {
  font-weight: 600;
  text-decoration: none;
}

.masthead__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 26px;
  font-size: 15px;
}

.masthead__nav a {
  color: var(--text-2);
  text-decoration: none;
}

.masthead__nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Intro */

.intro {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 64px;
  padding-bottom: 56px;
}

.intro img {
  width: 104px;
  height: 104px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
}

.intro h1 {
  font-size: 44px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.intro__text {
  max-width: 62ch;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-2);
}

.intro__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 12px;
  font-size: 15px;
}

/* Projects */

.projects {
  border-top: 1px solid var(--rule);
}

.projects__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 48px;
}

.projects h2,
.section h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.filter {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.filter:hover {
  color: var(--text);
}

.filter[aria-pressed="true"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.cases {
  list-style: none;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.case {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding: 48px 0;
  border-bottom: 1px solid var(--rule);
}

.case:last-child {
  border-bottom: 0;
}

.case--flip {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
}

.case--flip .case__shot {
  order: 2;
}

.case[hidden] {
  display: none;
}

.case__shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--img-border);
  border-radius: 6px;
  filter: var(--img-filter);
}

.case__title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.case__title a {
  text-decoration: none;
}

.case__title a:hover {
  text-decoration: underline;
}

.case__story {
  margin-bottom: 12px;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text-2);
}

.case__origin {
  margin-bottom: 12px;
  font-size: 14.5px;
  font-style: italic;
  color: var(--muted);
}

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

.case__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 500;
}

/* Experience, education, skills, contact */

.section {
  padding-top: 56px;
  padding-bottom: 56px;
  border-top: 1px solid var(--rule);
}

.section h2 {
  margin-bottom: 24px;
}

.section__sub {
  margin-top: 40px;
}

.jobs {
  list-style: none;
}

.job {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 4px 40px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}

.job__dates {
  font-size: 15px;
  color: var(--muted);
}

.job__org {
  font-size: 19px;
  font-weight: 600;
}

.job__role {
  font-size: 15.5px;
  color: var(--muted);
}

.job__bullets {
  max-width: 76ch;
  margin-top: 10px;
  padding-left: 1.1em;
  color: var(--text-2);
}

.job__bullets li {
  margin: 6px 0;
}

.job__related {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
}

.edu__school {
  font-size: 19px;
  font-weight: 600;
}

.degrees {
  list-style: none;
  margin-top: 10px;
}

.degrees li {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 24px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.edu__honors {
  margin-top: 12px;
  color: var(--text-2);
}

.edu__project {
  margin-top: 24px;
  font-size: 17px;
  font-weight: 600;
}

.skills {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px 40px;
}

.skills dt {
  font-weight: 500;
}

.skills dd {
  color: var(--text-2);
}

.contact {
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 18px;
}

.contact .muted {
  display: inline-block;
  min-width: 110px;
  font-size: 15px;
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--text);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
  background: var(--rule);
}

.button--primary {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-text);
}

.button--primary:hover {
  background: var(--text-2);
  border-color: var(--text-2);
}

/* Case-study page */

.project {
  max-width: 1180px;
  padding-top: 36px;
  padding-bottom: 72px;
}

.crumbs {
  font-size: 15px;
  margin-bottom: 28px;
}

.crumbs a::before {
  content: "\2190\00a0";
}

.project h1 {
  font-size: 46px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.project__story {
  max-width: 68ch;
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-2);
}

.project__story p + p {
  margin-top: 12px;
}

.hero {
  margin: 36px 0 24px;
}

.hero img,
.shot__open img {
  width: 100%;
  background: #fff;
  border: 1px solid var(--img-border);
  border-radius: 6px;
  filter: var(--img-filter);
}

.note {
  max-width: 76ch;
  margin-top: 12px;
  font-size: 15px;
  font-style: italic;
  color: var(--muted);
}

.block {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.block h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}

.block > p {
  max-width: 76ch;
  color: var(--text-2);
}

.block > p + h2 {
  margin-top: 28px;
}

.shot {
  margin-top: 28px;
}

.shot__open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.shot figcaption {
  max-width: 80ch;
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
}

.stages {
  max-width: 80ch;
  padding-left: 1.4em;
  color: var(--text-2);
}

.stages li {
  margin: 10px 0;
}

.stages strong {
  color: var(--text);
  font-weight: 600;
}

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

.map h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 8px 0 8px;
}

.map ul {
  list-style: none;
}

.map li {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15.5px;
}

.map .code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
}

.prevnext {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
}

.lightbox {
  width: min(1500px, 95vw);
  max-height: 94vh;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--page);
  color: var(--text);
}

.lightbox::backdrop {
  background: rgba(10, 12, 14, 0.85);
}

.lightbox form {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.lightbox__img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #fff;
}

.lightbox__caption {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
}

/* Footer */

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

.footer__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* Narrow screens */

@media (max-width: 860px) {
  :root {
    --pad: 20px;
  }

  .case,
  .case--flip {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .case--flip .case__shot {
    order: 0;
  }

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

  .job {
    gap: 2px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .intro img {
    width: 88px;
    height: 88px;
  }

  .intro h1 {
    font-size: 36px;
  }

  .intro__text {
    font-size: 16.5px;
  }

  .project h1 {
    font-size: 34px;
  }

  .masthead__nav {
    gap: 2px 16px;
    font-size: 14px;
  }
}

@media print {
  .masthead__nav,
  .filters,
  .case__shot,
  .actions {
    display: none;
  }
}
