@font-face {
  font-family: "Open Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/open-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "Open Sans";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/open-sans-700.woff2") format("woff2");
}

:root {
  --text: #646a7d;
  --heading: #48494b;
  --accent: #ff9e1f;
  --muted: #9aa0b0;
  --bg: #ffffff;
  --gap: 20px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.6 "Open Sans", system-ui, sans-serif;
}

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

a {
  color: inherit;
}

a:hover {
  color: var(--accent);
}

h1,
h2 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.25;
}

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

/* Header */

.site-header {
  padding: 48px 20px 36px;
  text-align: center;
}

.logo img {
  width: min(320px, 80vw);
  margin: 0 auto;
}

.tagline {
  margin: 14px 0 6px;
  font-size: 12px;
  letter-spacing: 1px;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 22px;
}

.site-nav a {
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--accent);
}

/* Work grid */

main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f3f5;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.tile-title {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 14px 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tile-count {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
}

.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.03);
}

.tile:hover .tile-title,
.tile:focus-visible .tile-title {
  opacity: 1;
}

@media (hover: none) {
  .tile-title {
    opacity: 1;
  }
}

/* Lightbox */

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--text);
}

.lightbox::backdrop {
  background: rgba(255, 255, 255, 0.95);
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.92);
}

.lightbox-bar button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: var(--heading);
  font: 700 22px/1 "Open Sans", sans-serif;
  background: #f1f1f4;
  cursor: pointer;
}

.lightbox-bar button:hover {
  color: #fff;
  background: var(--accent);
}

.lightbox-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.lightbox-info {
  max-width: 680px;
  margin: 0 auto 28px;
  text-align: center;
}

.lb-title {
  margin: 0 0 8px;
  font-size: 26px;
}

.lb-desc {
  margin: 0 0 10px;
}

.lb-desc:empty {
  display: none;
}

.lb-link {
  font-weight: 700;
  color: var(--accent);
}

.lb-link[hidden] {
  display: none;
}

.lb-images {
  display: grid;
  gap: var(--gap);
}

.lb-images img {
  width: 100%;
}

/* About */

.about {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  max-width: 980px;
  margin: 10px auto 0;
}

.about-bio {
  order: 2;
}

.about-bio h1 {
  margin-top: 0;
  font-size: 28px;
}

.about-side h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.about-side p {
  margin: 0 0 22px;
  font-size: 16px;
}

/* 404 */

.not-found {
  padding: 40px 0 80px;
  text-align: center;
}

/* Footer */

.site-footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 56px 20px 48px;
  font-size: 14px;
}

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

/* Responsive */

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  :root {
    --gap: 14px;
  }

  .site-header {
    padding-top: 32px;
  }

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

  .about {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .about-bio {
    order: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile img,
  .tile-title {
    transition: none;
  }
}
