@font-face {
  font-family: 'HelveticaNowDisplay';
  src: url('fonts/Helvetica Now Display Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

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

html, body {
  background: #ffffff;
  font-family: 'HelveticaNowDisplay', Helvetica Neue, Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Header ---- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
  pointer-events: none;
}

.header-top {
  position: relative;
  background: #ffffff;
  padding: 10px 0 0;
  pointer-events: auto;
}

.name {
  display: block;
  text-align: center;
  cursor: pointer;
}

.name img {
  display: inline-block;
  width: 45%;
  max-width: 600px;
  height: auto;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Hide broken/empty image state */
.name img:not([src]), .name img[src=""] {
  visibility: hidden;
  height: 0;
}

.header-nav {
  position: absolute;
  right: 4vw;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.header.open .header-nav {
  opacity: 1;
  pointer-events: auto;
}

.header-nav-link {
  font-family: 'HelveticaNowDisplay', sans-serif;
  font-size: clamp(0.9rem, 1.8vw, 1.4rem);
  cursor: pointer;
  color: #000;
  line-height: 1.4;
  transition: opacity 0.2s;
}

.header-nav-link:hover {
  opacity: 0.4;
}

.gradient-fade {
  width: 100%;
  height: 120px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}

/* ---- Page Overlays ---- */

.page-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.page-overlay.active {
  display: flex;
}

.overlay-content {
  font-family: 'HelveticaNowDisplay', sans-serif;
  font-size: clamp(0.55rem, 0.85vw, 0.75rem);
  line-height: 1.7;
  text-align: center;
  max-width: 500px;
  padding: 2rem;
}

.overlay-content p {
  margin-bottom: 1.2em;
}

.overlay-close {
  position: absolute;
  top: 28px;
  right: 36px;
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  font-family: sans-serif;
  z-index: 301;
}

.overlay-close:hover {
  opacity: 1;
}

.email-reveal {
  color: inherit;
  text-decoration: none;
  font-size: clamp(0.8rem, 1.5vw, 1.1rem);
}

/* ---- Works ---- */

.gradient-bottom {
  display: none;
}

.works {
  padding-top: 200px; /* overridden by JS */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding-bottom: 0;
}

.work-item {
  display: flex;
  justify-content: center;
}

.work-item img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ---- Vimeo ---- */

.vimeo-thumb {
  position: relative;
  width: 100%;
  cursor: pointer;
  background: #111;
  aspect-ratio: 16 / 9;
}

.vimeo-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  font-size: 0;
}

.vimeo-play-btn {
  display: none;
}

.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.video-modal.active {
  display: flex;
}

.video-modal-inner {
  position: relative;
  width: 90vw;
  max-width: 1400px;
  aspect-ratio: 16 / 9;
}

.video-modal-inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal-close {
  position: absolute;
  top: 24px;
  right: 30px;
  font-size: 1.4rem;
  color: #ffffff;
  cursor: pointer;
  font-family: sans-serif;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 1001;
}

.video-modal-close:hover {
  opacity: 1;
}

/* ---- Mobile ---- */

@media (max-width: 768px) {
  .name img {
    width: 80%;
  }

  .header-nav {
    position: static;
    transform: none;
    flex-direction: row;
    align-items: center;
    align-self: flex-end;
    gap: 20px;
    padding: 4px 4vw 4px 0;
  }

  .gradient-fade {
    height: 80px;
  }

  .gradient-bottom {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(
      to top,
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
    z-index: 100;
  }

  .works {
    padding-top: 200px; /* overridden by JS */
    gap: 5vw;
  }

  .work-item {
    min-width: 0;
  }
}
