:root {
    --content-width: 1100px;
    --text-width: 700px;

    --text: #222;
    --muted: #666;
    --line: #ececec;
    --bg: #fff;

    --space-xs: .5rem;
    --space-s: 1rem;
    --space-m: 2rem;
    --space-l: 5rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);

    font: 16px/1.6 system-ui, sans-serif;
}

.portfolio {
    width: min(92%, var(--content-width));
    margin: 5rem auto 8rem;
}

.project-preview {
    padding: 0 0 5rem;
    margin-bottom: 5rem;
    border-bottom: 1px solid var(--line);
}

.project-preview:last-child {
    border: 0;
}

.project-preview h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 500;
}

.project-meta {
    margin: .4rem 0 1rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .8rem;
}

.project-description {
    max-width: var(--text-width);
    margin-bottom: 2rem;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.project-gallery img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    display: block;
}

.view-project {
    display: inline-block;
    margin-top: 2rem;

    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

/* =========================
   Navigation bar
   ========================= */

.portfolio-filters {
  display: flex;
  gap: .5rem;
  margin-bottom: 4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.portfolio-filters::-webkit-scrollbar {
  display: none;
}

.filter {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  padding: .5rem .9rem;
  border-radius: 999px;
  color: #666;
  font: inherit;
  cursor: pointer;
}

.filter:hover {
  color: #111;
}

.filter.active {
  background: #111;
  color: #fff;
}

.project-card.is-hidden {
  display: none;
}

/* =========================
   Project page
   ========================= */

.project {
    width: min(92%, 1100px);
    margin: 5rem auto;
}

.project-header {
    max-width: 720px;
    margin-bottom: 6rem;
}

.project-header h1 {
    font-size: clamp(2.8rem, 5vw, 4.5rem);
    margin: 0;
    font-weight: 500;
}

.project-header .meta {
    margin: .5rem 0 2rem;
    color: #666;
}

.work {
    margin-bottom: 7rem;
}

.images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
    gap: 1rem;
	align-items: end
}

.images img,
.images video {
    width: 100%;
    display: block;
    object-fit: cover;
}

.info {
    margin-top: 1.5rem;
    max-width: 650px;
}

.info h2 {
    margin-bottom: .4rem;
    font-size: 1.4rem;
}

.info p {
    margin: .5rem 0;
}

/* =========================
   About
   ========================= */

.about {
  max-width: 1100px;
  margin: 8rem auto 6rem;
  /*padding-top: 5rem;
  border-top: 1px solid var(--line);*/
}

.about h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 500;
}

.about-content {
  max-width: 650px;
  color: var(--muted);
}

.about-content p {
  margin: 0 0 1rem;
}


/* =========================
   Footer
   ========================= */

.site-footer {
  width: min(92%, var(--content-width));
  margin: 0 auto;
  padding: 2rem 0 3rem;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;

  border-top: 1px solid var(--line);

  color: var(--muted);
  font-size: .8rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  gap: 1.5rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}


/* =========================
   Mobile
   ========================= */

@media (max-width: 600px) {
  .about {
    margin-top: 6rem;
    padding-top: 3rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .site-footer nav {
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
  }
}

/* ==========================
   Generic text page
   ========================== */

.page {
  width: min(92%, 760px);
  margin: 4rem auto 0;
}

.text-page {
  margin-bottom: 6rem;
}

.text-page header {
  margin-bottom: 4rem;
}

.text-page h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
}

.text-page h2 {
  margin: 3rem 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.text-page p {
  margin: 0 0 1rem;
  line-height: 1.7;
}

.text-page .lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 40rem;
}

.text-page section + section {
  margin-top: 2rem;
}

/* =========================
   Comic reader
   ========================= */

.comic-reader {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x proximity;

  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;
  margin-bottom: 5rem;
}

.comic-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;

  width: max-content;
}

.comic-page {
  flex: 0 0 auto;

  scroll-snap-align: start;
}

.comic-page img {
  display: block;

  height: min(80vh, 900px);
  width: auto;
  max-width: none;
}

/* =========================
   Back to portfolio
   ========================= */

.back-link {
  display: inline-block;
  margin-bottom: 3rem;

  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .02em;
  text-decoration: none;
}

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

/* =========================
   A tiny bit of accessibility
   ========================= */
   
@media (prefers-reduced-motion: reduce) {
    .work-video {
        animation: none;
    }
}