/* Homepage layout is intentionally isolated from legacy project-page styles. */
@property --home-edge-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.home-page {
  --page-width: 1120px;
  --side-padding: clamp(18px, 5vw, 42px);
  --header-height: 56px;
  --nav-surface: rgba(255, 255, 255, 0.94);
  box-sizing: border-box;
  min-width: 0;
  padding: 0 !important;
  margin: 0 !important;
  overflow-x: hidden;
  opacity: 1;
  visibility: visible !important;
  font-size: 14px;
  line-height: 1.6;
  font-family: Helvetica, Arial, sans-serif;
}

.home-page *,
.home-page *::before,
.home-page *::after {
  box-sizing: inherit;
}

.home-page::before {
  content: "";
  position: fixed;
  z-index: 11;
  inset: -24px;
  pointer-events: none;
  opacity: 0;
  background: conic-gradient(
    from var(--home-edge-angle) at 50% 50%,
    #45dfff 0deg,
    #8570ff 58deg,
    #ff52bd 122deg,
    #ffbd4d 184deg,
    #58e9b2 246deg,
    #4d9dff 306deg,
    #45dfff 360deg
  );
  filter: blur(30px) saturate(150%) hue-rotate(0deg);
  -webkit-mask-image:
    linear-gradient(to bottom, #000 0 28px, transparent 45px),
    linear-gradient(to top, #000 0 28px, transparent 45px),
    linear-gradient(to right, #000 0 28px, transparent 45px),
    linear-gradient(to left, #000 0 28px, transparent 45px);
  mask-image:
    linear-gradient(to bottom, #000 0 28px, transparent 45px),
    linear-gradient(to top, #000 0 28px, transparent 45px),
    linear-gradient(to right, #000 0 28px, transparent 45px),
    linear-gradient(to left, #000 0 28px, transparent 45px);
  animation: home-edge-flow 10s linear infinite;
  animation-play-state: paused;
  transition: opacity 700ms ease;
  will-change: background-position, filter;
}

.home-page.music-is-playing::before {
  opacity: 0.38;
  animation-play-state: running;
}

@keyframes home-edge-flow {
  0% {
    --home-edge-angle: 0deg;
    filter: blur(30px) saturate(150%) hue-rotate(0deg);
  }
  50% {
    --home-edge-angle: 180deg;
    filter: blur(36px) saturate(175%) hue-rotate(28deg);
  }
  100% {
    --home-edge-angle: 360deg;
    filter: blur(30px) saturate(150%) hue-rotate(0deg);
  }
}

.home-page::after,
.site-header::after {
  content: "";
  left: 0;
  width: 100%;
  height: clamp(52px, 8vh, 86px);
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.site-header::after {
  position: absolute;
  top: 100%;
  background: linear-gradient(to bottom, var(--nav-surface) 0%, rgba(255, 255, 255, 0.82) 35%, rgba(255, 255, 255, 0) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

.home-page::after {
  position: fixed;
  z-index: 8;
  bottom: 0;
  background: linear-gradient(to top, #fff 0%, rgba(255, 255, 255, 0.82) 35%, rgba(255, 255, 255, 0) 100%);
  mask-image: linear-gradient(to top, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 100%);
}

.home-page a {
  color: #0864c7;
}

.home-page a:focus-visible,
.home-page button:focus-visible {
  outline: 2px solid #0864c7;
  outline-offset: 4px;
}

.home-page img[data-lightbox-ready="true"] {
  cursor: zoom-in;
}

.home-page .image-lightbox[hidden] {
  display: none;
}

.home-page .image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.home-page .image-lightbox__image {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 94vw !important;
  max-height: 90vh !important;
  object-fit: contain;
  cursor: zoom-out;
  filter: drop-shadow(0 16px 44px rgba(0, 0, 0, 0.2));
}

.home-page .image-lightbox__close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  font: 30px/1 Helvetica, Arial, sans-serif;
  cursor: pointer;
}

.home-page.lightbox-open {
  overflow: hidden;
}

.page-shell {
  width: min(100%, calc(var(--page-width) + (2 * var(--side-padding))));
  margin-inline: auto;
  padding-inline: var(--side-padding);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  height: var(--header-height);
  background: var(--nav-surface);
  backdrop-filter: blur(8px);
}

.site-nav {
  width: min(100%, calc(var(--page-width) + (2 * var(--side-padding))));
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--side-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav .site-name {
  color: #000;
  text-decoration: none;
  font-size: 14px;
}

.site-nav .site-contact {
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.gallery-easter-egg {
  display: grid;
  grid-template-rows: 0fr;
  scroll-margin-top: var(--header-height);
  opacity: 0;
  visibility: hidden;
  transition:
    grid-template-rows 900ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 420ms ease,
    visibility 0s linear 900ms;
}

.gallery-easter-egg.is-visible {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition:
    grid-template-rows 900ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 420ms ease,
    visibility 0s;
}

.gallery-easter-egg__inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  padding-block: 0;
  transition: padding 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-easter-egg.is-visible .gallery-easter-egg__inner {
  padding-block: clamp(76px, 11vh, 120px) clamp(56px, 8vh, 88px);
}

.gallery-easter-egg__player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.gallery-easter-egg__player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-carousel {
  width: min(100%, 980px);
}

.video-carousel__stage {
  display: grid;
  grid-template-columns: minmax(96px, 0.34fr) minmax(0, 1fr) minmax(96px, 0.34fr);
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

.video-carousel__preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  opacity: 0.46;
  filter: saturate(0.72);
  cursor: pointer;
  transform: scale(0.9);
  transition: opacity 180ms ease, filter 180ms ease, transform 180ms ease;
}

.video-carousel__preview:hover,
.video-carousel__preview:focus-visible {
  opacity: 0.82;
  filter: saturate(1);
  transform: scale(0.95);
}

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

.video-carousel__controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

.video-carousel__arrow {
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  font: 18px/30px Helvetica, Arial, sans-serif;
  cursor: pointer;
  transition: transform 160ms ease;
}

.video-carousel__arrow:hover,
.video-carousel__arrow:focus-visible {
  transform: scale(1.16);
}

.discovery-counter {
  min-height: 48px;
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
}

.discovery-counter__button {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #06c;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.discovery-counter__button:disabled {
  color: #777;
  cursor: default;
}

.discovery-counter__result {
  margin: 5px 0 0;
  color: #000;
}

.projects-section h1,
.projects-section h2 {
  margin: 0 0 16px;
  font: inherit;
  font-weight: 700;
  color: #000;
}

.projects-section {
  min-height: calc(100vh - var(--header-height));
  padding-top: clamp(76px, 11vh, 120px);
  padding-bottom: clamp(80px, 12vw, 140px);
  scroll-margin-top: var(--header-height);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(270px, 1fr);
  align-items: start;
  gap: clamp(56px, 6.25vw, 88px);
}

.project-column,
.other-work {
  min-width: 0;
}

.project-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-page .project-entry {
  display: grid;
  grid-template-columns: 42px 132px minmax(0, 1fr);
  align-items: start;
  margin: 0;
  min-height: 136px;
}

.project-entry time,
.project-entry > span:first-child {
  padding: 1px 8px 0 0;
  color: #aaa;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.project-media {
  position: relative;
  align-self: stretch;
  min-height: 136px;
  padding: 7px 0 22px 18px;
  border-left: 2px solid #d2d2d2;
}

.project-media::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #d2d2d2;
}

.project-media::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -2px;
  width: 2px;
  height: 18px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
}

.project-media img {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 10px;
  clip-path: inset(0 round 10px);
}

.project-media img.project-thumbnail--natural {
  height: auto;
}

.project-placeholder {
  display: block;
  width: 110px;
  height: 110px;
  border-radius: 10px;
  background: #f3f3f3;
}

.project-entry > p {
  min-width: 0;
  margin: 0;
  padding: 0 0 28px 20px;
}

.project-entry > p a {
  font-weight: 700;
}

.project-entry > p span {
  margin-left: 0.55em;
}

.other-work {
  padding-top: 0;
}

.work-gallery {
  display: grid;
  place-items: center;
  width: min(100%, clamp(260px, 30vh, 360px));
  aspect-ratio: 1 / 1;
  margin: 0 0 36px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}

.work-gallery img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: 12px;
  clip-path: inset(0 round 12px);
}

.home-page .project-entry.other-work-entry {
  grid-template-columns: 110px minmax(0, 1fr);
}

.other-work-entry > span:first-child {
  display: none;
}

.other-work-entry .project-media {
  padding-left: 0;
  border-left: 0;
}

.other-work-entry .project-media::before,
.other-work-entry .project-media::after {
  display: none;
}

.other-work-link {
  margin: 8px 0 0;
}

.other-work-link span {
  margin-left: 0.55em;
}

@media (min-width: 1200px) {
  .page-shell,
  .site-nav {
    width: min(60vw, 1120px);
    padding-inline: 0;
  }
}

@media (max-width: 680px) {
  .home-page {
    --side-padding: clamp(18px, 6vw, 28px);
  }

  .projects-section {
    padding-top: 64px;
  }

  .home-page .project-entry {
    grid-template-columns: 42px 82px minmax(0, 1fr);
    min-height: 94px;
  }

  .project-entry time,
  .project-entry > span:first-child {
    padding-right: 7px;
    font-size: 11px;
  }

  .project-media {
    min-height: 94px;
    padding: 7px 0 18px 12px;
  }

  .project-media img {
    width: 66px;
    height: 66px;
  }

  .project-placeholder {
    width: 66px;
    height: 66px;
  }

  .home-page .project-entry.other-work-entry {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .project-entry > p {
    padding: 0 0 24px 14px;
    line-height: 1.45;
  }

  .project-entry > p span {
    display: block;
    margin: 3px 0 0;
  }

  .work-gallery {
    margin-left: 0;
  }

  .work-gallery img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .video-carousel__stage {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    gap: 8px;
  }

  .video-carousel__preview {
    border-radius: 7px;
  }
}

@media (max-width: 900px) {
  .projects-section {
    grid-template-columns: 1fr;
    gap: 72px;
  }

  .other-work {
    padding-top: 0;
  }

}

@media (max-width: 360px) {
  .home-page .project-entry {
    grid-template-columns: 40px 70px minmax(0, 1fr);
  }

  .project-media {
    padding-left: 10px;
  }

  .project-media img {
    width: 56px;
    height: 56px;
  }

  .project-placeholder {
    width: 56px;
    height: 56px;
  }

  .home-page .project-entry.other-work-entry {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .project-entry > p {
    padding-left: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page::before {
    animation: none;
    opacity: 0;
  }

  .home-page.music-is-playing::before {
    opacity: 0.28;
  }

  .gallery-easter-egg,
  .gallery-easter-egg__inner {
    transition: none;
  }

  .home-page {
    scroll-behavior: auto;
  }
}
