* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: #000000;
  color: #f4f4f4;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
}

button {
  font: inherit;
}

a,
button {
  color: #f4f4f4;
}

a {
  text-decoration: none;
}

a:hover,
button:hover {
  opacity: 0.65;
}

/* HEADER */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  padding: 32px 42px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.site-title,
.view-button {
  pointer-events: auto;
  border: 0;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.82);
  color: #f4f4f4;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
}

.site-title:hover,
.view-button:hover {
  text-decoration: none;
}

.view-nav {
  display: flex;
  gap: 8px;
  padding: 0;
  background: rgba(0, 0, 0, 0.82);
  border-radius: 8px;
}

.view-button {
  opacity: 0.45;
}

.view-button.is-active {
  opacity: 1;
}

.header-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.view-button .header-icon {
  width: 16px;
  height: 16px;
}

/* INFO PANEL */

.info-panel {
  position: fixed;
  top: 76px;
  left: 42px;
  z-index: 30;
  width: min(420px, calc(100vw - 84px));
  padding: 28px;
  background-color: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f4f4f4;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.info-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.info-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: none;
  color: #f4f4f4;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 5px;
}

.info-content {
  padding-right: 24px;
}

.info-kicker {
  margin-top: 0;
  font-weight: 700;
}

.info-content p {
  margin: 0 0 18px;
  line-height: 1.65;
}

.info-content a {
  color: rgb(176, 176, 176);
}

.info-content a:hover {
  opacity: 0.65;
  text-decoration: none;
}

/* MAIN */

.portfolio-main {
  min-height: 100vh;
  padding: 100px 32px 80px;
}

/* VIEWS */

.gallery-view,
.flow-view {
  display: none;
}

.gallery-view.is-visible,
.flow-view.is-visible {
  display: block;
}

/* GRID */

.grid-gallery {
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.grid-card {
  width: 100%;
}

.grid-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
}

.grid-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: grayscale(100%);
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.grid-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0) 48%,
    rgba(0, 0, 0, 0.42) 100%
  );
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.grid-item:hover img {
  opacity: 0.9;
  transform: scale(1.025);
  filter: grayscale(0%);
}

.grid-item:hover::after {
  opacity: 0.45;
}

/* PHOTO METADATA UNDER GRID */

.photo-meta {
  min-height: 38px;
  margin-top: 10px;
  color: rgba(244, 244, 244, 0.62);
  font-size: 12px;
  line-height: 1.4;
}

.photo-meta p {
  margin: 0;
}

.photo-meta-main {
  color: rgba(244, 244, 244, 0.86);
  font-weight: 500;
}

.photo-meta-secondary {
  margin-top: 2px;
  color: rgba(244, 244, 244, 0.42);
}

/* FLOW */

.flow-view {
  width: 100%;
}

.flow-gallery {
  height: calc(100vh - 120px);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 36vw;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.flow-gallery::-webkit-scrollbar {
  display: none;
}

.flow-item {
  flex: 0 0 auto;
  height: 72vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  scroll-snap-align: center;
}

.flow-item img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  display: block;
  cursor: pointer;
  filter: grayscale(100%);
  transform: scale(0.82);
  opacity: 0.45;
  transition: transform 0.06s linear, opacity 0.06s linear, filter 0.06s linear;
  will-change: transform, opacity, filter;
  border-radius: 5px;
}

/* LIGHTBOX */

.no-scroll {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background-color: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-image {
  max-width: 72vw;
  max-height: 84vh;
  object-fit: contain;
  display: block;
  cursor: default;
  opacity: 0;
  transform: scale(0.72);
  border-radius: 5px;
}

.lightbox.is-open .lightbox-image {
  animation: lightboxImageReveal 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes lightboxImageReveal {
  from {
    opacity: 0;
    transform: scale(0.72);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-meta {
  position: fixed;
  top: 50%;
  right: 48px;
  z-index: 51;
  width: 220px;
  color: #f4f4f4;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: auto;
}

.lightbox.is-open .lightbox-meta {
  animation: lightboxMetaReveal 0.28s ease 0.42s forwards;
}

@keyframes lightboxMetaReveal {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(16px);
  }

  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.lightbox-meta-main,
.lightbox-meta-secondary {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  min-height: 18px;
}

.lightbox-meta-main {
  color: rgba(244, 244, 244, 0.92);
  font-weight: 500;
}

.lightbox-meta-secondary {
  margin-top: 6px;
  color: rgba(244, 244, 244, 0.48);
}

/* FIXED INSTAGRAM */

.instagram-fixed {
  position: fixed;
  right: 42px;
  bottom: 32px;
  z-index: 25;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.82);
  color: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.instagram-fixed:hover {
  opacity: 0.65;
}

.instagram-icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* LEGAL PAGE */

.legal-page {
  min-height: 100vh;
  background-color: #000000;
  color: #f4f4f4;
}

.legal-main {
  min-height: 100vh;
  padding: 140px 32px 96px;
}

.legal-content {
  width: min(720px, 100%);
  margin: 0 auto;
  color: rgba(244, 244, 244, 0.78);
}

.legal-content h1 {
  margin: 0 0 64px;
  color: #f4f4f4;
  font-size: 22px;
  font-weight: 500;
}

.legal-content h2 {
  margin: 48px 0 12px;
  color: rgba(244, 244, 244, 0.9);
  font-size: 15px;
  font-weight: 600;
}

.legal-content p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.7;
}

.legal-content a {
  color: #f4f4f4;
  text-decoration: none;
}

.legal-content a:hover {
  opacity: 0.65;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
  .grid-gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .site-header {
    padding: 28px 28px;
  }

  .portfolio-main {
    padding: 100px 24px 64px;
  }

  .grid-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .flow-gallery {
    gap: 22px;
    padding: 0 28vw;
  }

  .flow-item {
    height: 68vh;
  }

  .info-panel {
    top: 68px;
    left: 28px;
    width: calc(100vw - 56px);
  }

  .lightbox {
    padding: 32px;
  }

  .lightbox-image {
    max-width: 88vw;
    max-height: 72vh;
  }

  .lightbox-meta {
    top: auto;
    right: auto;
    left: 32px;
    bottom: 32px;
    width: calc(100vw - 64px);
    transform: none;
  }

  .lightbox.is-open .lightbox-meta {
    animation: lightboxMetaRevealMobile 0.28s ease 0.42s forwards;
  }

  @keyframes lightboxMetaRevealMobile {
    from {
      opacity: 0;
      transform: translateY(12px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 576px) {
  .site-header {
    padding: 24px 20px;
  }

  .site-title,
  .view-button {
    font-size: 13px;
  }

  .view-nav {
    gap: 6px;
  }

  .header-icon {
    width: 16px;
    height: 16px;
  }

  .portfolio-main {
    padding: 92px 16px 48px;
  }

  .grid-gallery {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .flow-gallery {
    height: calc(100vh - 96px);
    gap: 18px;
    padding: 0 18vw;
  }

  .flow-item {
    height: 64vh;
  }

  .lightbox {
    padding: 20px;
  }

  .lightbox-image {
    max-width: 92vw;
    max-height: 68vh;
  }

  .lightbox-meta {
    left: 20px;
    bottom: 24px;
    width: calc(100vw - 40px);
  }

  .info-panel {
    top: 64px;
    left: 20px;
    width: calc(100vw - 40px);
    padding: 24px;
  }

  .instagram-fixed {
    right: 20px;
    bottom: 20px;
    width: 38px;
    height: 38px;
    padding: 9px;
  }

  .legal-main {
    padding: 120px 20px 80px;
  }

  .legal-content h1 {
    font-size: 20px;
    margin-bottom: 48px;
  }

  .legal-content h2 {
    margin-top: 40px;
  }
}
