:root {
  --bg: #0d0d0d;
  --text: #ffffff;
  --accent: #8dc0ff;
  --muted: rgba(255, 255, 255, 0.6);
  --gap: 8px;
  --side: 64px;
  --side-narrow: 48px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Custom cursor */

body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button {
  cursor: none;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ffffff;
  pointer-events: none;
  z-index: 999;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.3s ease;
  will-change: transform;
}

.cursor-dot.is-hovering {
  width: 32px;
  height: 32px;
  background-color: #ffffff;
  mix-blend-mode: difference;
}

/* Top bar */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--side-narrow);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.32px;
  z-index: 10;
  color: #fff;
  mix-blend-mode: difference;
}

.logo {
  font-weight: 500;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topnav a {
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.topnav a:hover {
  opacity: 1;
}

/* Hero */

.hero {
  padding: 158px var(--side-narrow) 44px;
}

.hero h1 {
  font-weight: 300;
  font-size: 44px;
  line-height: 1.18;
  letter-spacing: -0.88px;
  max-width: 900px;
}

/* Split-text reveal */

.split-line {
  display: block;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
}

.split-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%);
  will-change: transform, opacity;
  transition: transform 1.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.split.is-revealed .split-word {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .split-word {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* Gallery */

.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 0 0 var(--gap);
}

.gallery-row {
  display: flex;
  gap: var(--gap);
}

.gallery-item {
  position: relative;
  flex: 1 0 0;
  height: 689px;
  overflow: hidden;
  background: #1a1a1a;
  opacity: 0;
  transform: translateY(90px);
  transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1), transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-row--two .gallery-item {
  height: 620px;
}

/* 2x2 grid (row 2): top row 829:507, bottom row split evenly */

.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  height: 1200px;
}

.grid-row {
  display: flex;
  flex: 1 0 0;
  gap: var(--gap);
  min-height: 0;
}

.grid-row .gallery-item {
  height: auto;
}

.grid-row--top .gallery-item {
  flex: 1 0 0;
}

.grid-row--bottom .gallery-item {
  flex: 1 0 0;
}

.gallery-item.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.03);
}

/* "Coming soon" hover overlay */

.coming-soon-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: rgba(13, 13, 13, 0.4);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.coming-soon:hover .coming-soon-overlay {
  opacity: 1;
}

.coming-soon-track {
  display: flex;
  align-items: center;
  gap: 16px;
  width: max-content;
  animation: coming-soon-scroll 16s linear infinite;
}

.coming-soon-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.coming-soon-text,
.coming-soon-dot {
  white-space: nowrap;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.56px;
  color: #fff;
}

.coming-soon-text {
  text-transform: uppercase;
}

@keyframes coming-soon-scroll {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .coming-soon-track {
    animation: none;
  }
}

/* Looping image slideshow */

.slideshow {
  position: relative;
  width: 100%;
  height: 100%;
}

.slideshow-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: transform 0.5s ease;
}

.slideshow-slide.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .slideshow-slide {
    transition: transform 0.5s ease;
  }
}

/* Composited card: background frame + centered inset image */

.composite-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #38516f;
}

.composite-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composite-blur {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.composite-inset {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85.6%;
  aspect-ratio: 613 / 337;
  overflow: hidden;
}

.composite-inset img,
.composite-inset video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Generic fade-up reveal */

.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-up {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* Project details */

.project-cover .gallery-item {
  height: 556px;
}

.project-cover .gallery-item:first-child {
  flex: 4 0 0;
}

.project-cover .gallery-item:last-child {
  flex: 3 0 0;
}

.project-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding: 80px var(--side-narrow);
}

.project-back {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.project-back:hover {
  opacity: 1;
}

.project-back svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.project-intro h1 {
  font-weight: 300;
  font-size: 44px;
  line-height: 1.18;
  letter-spacing: -0.88px;
  flex-shrink: 0;
}

.project-copy {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 767px;
  font-size: 16px;
  letter-spacing: -0.32px;
}

.project-copy-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  line-height: 1.6;
}

.project-copy-text p {
  opacity: 0.8;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-weight: 500;
}

/* Closing / contact section */

.closing {
  position: relative;
  background: var(--bg);
  padding: 120px var(--side-narrow) 24px;
  min-height: 475px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.closing-copy {
  position: relative;
  z-index: 1;
}

.closing-copy h2 {
  font-weight: 300;
  font-size: 44px;
  line-height: 1.18;
  letter-spacing: -0.88px;
  max-width: 700px;
  margin-bottom: 20px;
}

.email {
  display: inline-block;
  font-size: 44px;
  line-height: 1.18;
  letter-spacing: -0.88px;
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

/* text-decoration doesn't propagate into inline-block descendants,
   so each split word needs the underline set directly. */
.email .split-word {
  text-decoration: underline;
}

.email:hover {
  opacity: 0.8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  padding: 16px 22px;
  background: #1a1a1a;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.32px;
  border-radius: 0;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 50;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.3s ease;
    transform: translateX(-50%);
  }
}

.footbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.32px;
  margin-top: 80px;
}

#clock-time {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.clock-char {
  display: inline-block;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .clock-char {
    transition: none !important;
  }
}

/* Responsive */

@media (max-width: 900px) {
  :root {
    --side: 32px;
    --side-narrow: 24px;
  }

  .hero {
    padding-top: 120px;
  }

  .hero h1,
  .closing-copy h2,
  .email {
    font-size: 28px;
    letter-spacing: -0.56px;
  }

  .gallery-row,
  .grid-row {
    flex-direction: column;
  }

  .gallery-item {
    height: 420px;
  }

  .gallery-row--two .gallery-item {
    height: 420px;
  }

  .gallery-grid {
    height: auto;
  }

  .grid-row {
    flex: none;
  }

  .grid-row--top .gallery-item,
  .grid-row--bottom .gallery-item {
    flex: none;
    height: 420px;
  }

  .project-cover .gallery-item {
    height: 320px;
  }

  .project-intro {
    flex-direction: column;
    gap: 20px;
    padding: 56px var(--side-narrow);
  }

  .project-intro h1 {
    font-size: 28px;
    letter-spacing: -0.56px;
  }

  .closing {
    padding-top: 72px;
    min-height: 0;
  }

  .footbar {
    margin-top: 48px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 20px var(--side-narrow);
  }

  .hero h1,
  .closing-copy h2,
  .email {
    font-size: 22px;
    letter-spacing: -0.44px;
  }

  .gallery-item {
    height: 300px;
  }

  .gallery-row--two .gallery-item {
    height: 300px;
  }

  .grid-row--top .gallery-item,
  .grid-row--bottom .gallery-item {
    height: 300px;
  }
}
