* {
  margin: 0;
  cursor: none;
}

button {
  all: unset;
}

button:focus {
  outline: revert;
}

body {
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1rem;
  margin: 0;
  background-color: #F2F2F2;
  overflow-x: hidden;
  cursor: none;
  position: relative;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Ensure animated elements are always visible */
  .projects_header h2,
  .filter-btn {
    opacity: 1 !important;
  }
}

/* Grain effect */
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.grain:after {
  content: '';
  position: absolute;
  width: 110%;
  height: 110%;
  top: -5%;
  left: -5%;
  opacity: .05;
  background-image:
    repeating-conic-gradient(var(--black, #000) 0%, transparent .00003%, transparent .0005%, transparent .00095%),
    repeating-conic-gradient(var(--black, #000) 0%, transparent .00005%, transparent 0.00015%, transparent 0.0009%);
  animation: grain 2.5s steps(1) infinite;
  filter: drop-shadow(0px 0px 1px black);
}

@keyframes grain {

  0%,
  100% {
    transform: translate(0, 0);
  }

  10% {
    transform: translate(-1%, -1%);
  }

  20% {
    transform: translate(1%, 1%);
  }

  30% {
    transform: translate(-2%, -2%);
  }

  40% {
    transform: translate(3%, 3%);
  }

  50% {
    transform: translate(-3%, -3%);
  }

  60% {
    transform: translate(4%, 4%);
  }

  70% {
    transform: translate(-4%, -4%);
  }

  80% {
    transform: translate(2%, 2%);
  }

  90% {
    transform: translate(-3%, -3%);
  }
}

/* Ensure all content appears above grain */
main,
footer {
  position: relative;
}

header {
  position: relative;
  z-index: 3;
}

/* Ensure cursor appears above everything */
.cursor-dot {
  position: relative;
  z-index: 9999;
}

header {
  padding: 2rem 8rem 3rem 8rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

nav ul {
  display: flex;
  flex-direction: row;
  gap: 5rem;
  font-size: 1.4rem;
  font-weight: 600;
  text-transform: uppercase;
}

ul {
  margin: 0;
  list-style: none;
}

a,
button,
[role="button"],
input[type="submit"],
input[type="button"],
.filter-btn,
.nav-btn,
.project-card {
  text-decoration: none;
  color: black;
  cursor: none;
}

.explore_btn_container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.explore_btn {
  padding: 1rem 5rem;
  background-color: #E65B39;
  color: #F2F2F2;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 2rem;
  margin: 10rem 0 0rem 0;
  transition: all 0.2s;
}

.explore_btn:hover {
  padding: 1rem 5rem;
  transform: scale(1.05);
  background-color: transparent;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  color: #E65B39;
}

/* Custom cursor styles */
.cursor-dot {
  width: 48px;
  height: 48px;
  background-color: #F1F1F1;
  mix-blend-mode: difference;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%) scale(0.25);
  transition: transform 0.3s ease-out;
  /* Improve rendering quality in Safari */
  -webkit-transform: translate(-50%, -50%) scale(0.25);
  -webkit-backface-visibility: hidden;
  -webkit-perspective: 1000px;
}

.cursor-dot.expanded {
  transform: translate(-50%, -50%) scale(2);
  display: flex;
  background-color: #F1F1F1;
  mix-blend-mode: difference;
  opacity: 100%;
  align-items: center;
  justify-content: center;
  -webkit-transform: translate(-50%, -50%) scale(2);
  -webkit-backface-visibility: hidden;
  -webkit-perspective: 1000px;
}

.cursor-dot.hovering {
  transform: translate(-50%, -50%) scale(0.5);
}

.cursor-dot .sound-icon {
  display: none;
  width: 24px;
  height: 24px;
  mix-blend-mode: difference;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.cursor-dot.expanded .sound-icon {
  color: #1B1D1D;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cursor-dot.expanded .sound-icon svg {
  width: 24px;
  height: 24px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  mix-blend-mode: difference;
  color: #1B1D1D;
  text-transform: uppercase;
  z-index: 99;
}

.logo svg {
  width: 15px;
  height: 15px;
  transform: translateY(-8px);
}

.mask {
  position: fixed;
  top: 0;
  left: 0;
  background-color: #000000;
  width: 170vw;
  height: 100vh;
  z-index: 1;
  transform: translateY(-100vh);
  /* Hidden by default, only shown on home page intro */
}


/* Showreel video styling */
.showreel {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  aspect-ratio: 1920 / 810;
  /* 2.35:1 cinematic ratio */
}

#player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* This will crop the video to fill the container */
  object-position: center;
  /* Center the crop */
}

.services {
  padding: 8rem;
}

.services_container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.services_title {
  margin: 0;
  text-transform: uppercase;
  font-size: 10rem;
  line-height: 1;
  font-weight: 600;
}

.dot {
  font-size: 3rem;
  margin-right: 0.3rem;
  font-weight: 800;
  color: #E65B39;
}

.line {
  color: black;
  width: 100%;
  size: 1;
  margin-bottom: 2rem;
}

.service_category {
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service_category:hover {
  transform: translateY(-5px);
}

.service_category h2 {
  font-size: 1.5rem;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 1rem;
}

.service_category p {
  line-height: 1.6;
  color: #576262;
  max-width: 45ch;
  margin: 0;
}


/* Projects Page Styles */
.projects_header {
  padding: 4rem 8rem 2rem 8rem;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 2rem;
}

.projects_header h2 {
  font-size: 10rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0;
  opacity: 0;
  /* Hidden initially for GSAP animation */
}

.filter_buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  border: 1px solid #1B1D1D;
  border-radius: 2rem;
  background: transparent;
  color: #1B1D1D;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  transition: none;
  opacity: 0;
  /* Hidden initially for GSAP animation */
}

.filter-btn:hover,
.filter-btn.active {
  background: #E65B39;
  border: 1px solid #E65B39;
  color: #F2F2F2;
}

.projects_container {
  padding: 0 8rem 4rem 8rem;
  margin-bottom: 12rem;
}

.projects_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.project-card {
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-8px);
}

.project-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
}

.project-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.project-card:hover .project-thumbnail img {
  transform: scale(1.05);
}

.project-preview-video {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
  pointer-events: none !important;
  z-index: 10 !important;
  background: black;
}

/* Show video only when hovering AND video is ready/playing */
.project-card:hover.video-ready .project-preview-video,
.project-card:hover.video-playing .project-preview-video {
  opacity: 1 !important;
}

/* Hide thumbnail when video is ready/playing and card is hovered */
.project-card:hover.video-ready .project-thumbnail img,
.project-card:hover.video-playing .project-thumbnail img {
  opacity: 0 !important;
  transform: scale(1.05) !important;
}

.video-count-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #F2F2F2;
  color: #1B1D1D;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 2;
}

.category-tag {
  z-index: 2;
}

.project-details {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.project-client {
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 0.3rem 0;
}

.project-year {
  font-size: 0.8rem;
  font-weight: 200;
  text-transform: uppercase;
  margin: 0;
}

.project-category {
  font-size: 1rem;
  font-weight: 200;
  margin: 0;
}

.project-detail-container {
  margin: 0 auto;
  padding: 0rem 8rem;
}

.footer_container {
  margin-top: 2rem;
  padding: 0 8rem 5rem 8rem;
}

.footer_container h2 {
  font-size: 6rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.8rem;
}

.contact {
  display: flex;
  flex-direction: column;
}

.contact_info {
  display: flex;
  flex-direction: row;
  text-transform: uppercase;
  gap: 1rem;
  font-weight: 200;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.socials {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.socials svg {
  width: 2rem;
  height: 2rem;
}

.credits {
  text-transform: lowercase;
  font-size: 0.9rem;
  margin-top: 2rem;
  font-weight: 200;
}

.credits a {
  font-weight: 200;
  text-decoration: underline;
}

.footer_bigtext_container {
  width: 120vw;
  /* Wider than viewport for bleed */
  overflow: hidden;
  height: 12vw;
  /* Adjust for how much is visible */
  position: relative;
  margin: 0;
  padding: 0;
  line-height: 1;
  left: 50%;
  transform: translateX(-50%);
}

.bottom_text {
  font-size: 25vw;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: #111;
  margin: 0;
  padding: 0;
  line-height: 1;
  position: relative;
  user-select: none;
  pointer-events: none;
  left: 50%;
  transform: translateX(-50%);
  width: 120vw;
  /* Match container width */
  text-align: center;
}

@media (max-width: 1200px) {

  header {
    padding: 2rem 4rem 3rem 4rem;
  }

  .services {
    padding: 4rem;
  }

  .project-detail-container {
    margin: 0 auto;
    padding: 0rem 4rem;
  }

  .footer_container {
    margin-top: 2rem;
    padding: 0 4rem 5rem 4rem;
  }

  .projects_container {
    padding: 0 4rem 4rem 4rem;
    margin-bottom: 4rem;
  }

  .projects_header {
    padding: 4rem 4rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 2rem;
  }
}

/* Project Grid */
@media (max-width: 767px) {
  .projects_header {
    padding: 2rem 1rem 1rem 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .projects_header h2 {
    font-size: 4rem;
    opacity: 1 !important;
    /* Always visible on mobile */
  }

  .filter_buttons {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    opacity: 1 !important;
    /* Always visible on mobile */
  }

  .projects_container {
    padding: 0 1rem 2rem 1rem;
  }

  .projects_grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .video-count-badge {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }
}

/* Home page */
@media (max-width: 767px) {

  /* Disable transitions on mobile */
  * {
    transition: none !important;
  }

  header {
    padding: 1rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  nav ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 1rem;
    font-weight: 700;
    padding: 0;
    text-transform: uppercase;
  }

  .logo {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .services {
    padding: 2rem 1rem;
  }

  .service_category {
    margin-bottom: 1.5rem;
  }

  .service_category h2 {
    font-size: 1.3rem;
  }

  .services_title {
    font-size: 3rem;
    margin-top: 2rem;
  }

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

  .showreel {
    margin-top: 2rem
  }

}

/* Footer */
@media (max-width: 767px) {
  .footer_container {
    margin-top: 2rem;
    padding: 0 1rem 5rem 1rem;
  }

  .footer_container h2 {
    font-size: 3rem;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.8rem;
  }

  .contact {
    display: flex;
    flex-direction: column;
  }

  .contact_info {
    display: flex;
    flex-direction: row;
    text-transform: uppercase;
    gap: 1rem;
    font-weight: 200;
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .socials {
    display: flex;
    flex-direction: row;
    gap: 1rem;
  }

  .socials svg {
    width: 2rem;
    height: 2rem;
  }

  .credits {
    text-transform: lowercase;
    font-size: 0.9rem;
    margin-top: 2rem;
    font-weight: 200;
  }

  .credits a {
    font-weight: 200;
    text-decoration: underline;
  }

  .footer_bigtext_container {
    display: none;
  }

}

@media (min-width: 1600px) {
  header {
    padding: 2rem 12rem 3rem 12rem;
  }

  .services {
    padding: 12rem;
  }

  .project-detail-container {
    margin: 0 auto;
    padding: 0rem 12rem;
  }

  .footer_container {
    margin-top: 2rem;
    padding: 0 12rem 5rem 12rem;
  }

  .projects_container {
    padding: 0 12rem 4rem 12rem;
  }

  .projects_header {
    padding: 4rem 12rem 2rem 12rem;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 2rem;
  }

}