/* ===== FONTS ===== */
/* PP Neue Montreal — body / UI (font-sans) */
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../Fonts/PPNeueMontreal/otf/PPNeueMontreal-Light.otf') format('opentype');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../Fonts/PPNeueMontreal/otf/PPNeueMontreal-LightItalic.otf') format('opentype');
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../Fonts/PPNeueMontreal/otf/PPNeueMontreal-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../Fonts/PPNeueMontreal/otf/PPNeueMontreal-Italic.otf') format('opentype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../Fonts/PPNeueMontreal/otf/PPNeueMontreal-Semibold.otf') format('opentype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../Fonts/PPNeueMontreal/otf/PPNeueMontreal-SemiboldItalic.otf') format('opentype');
  font-weight: 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('../Fonts/PPNeueMontreal/otf/PPNeueMontreal-Extrabold.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}

/* PP Editorial New — display headings + serif accent (font-display / font-serif) */
@font-face {
  font-family: 'PP Editorial New';
  src: url('../Fonts/PPEditorialNew/PPEditorialNew-Ultralight.otf') format('opentype');
  font-weight: 200; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PP Editorial New';
  src: url('../Fonts/PPEditorialNew/PPEditorialNew-UltralightItalic.otf') format('opentype');
  font-weight: 200; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'PP Editorial New';
  src: url('../Fonts/PPEditorialNew/PPEditorialNew-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PP Editorial New';
  src: url('../Fonts/PPEditorialNew/PPEditorialNew-Italic.otf') format('opentype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'PP Editorial New';
  src: url('../Fonts/PPEditorialNew/PPEditorialNew-Ultrabold.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PP Editorial New';
  src: url('../Fonts/PPEditorialNew/PPEditorialNew-UltraboldItalic.otf') format('opentype');
  font-weight: 800; font-style: italic; font-display: swap;
}

/* Prevent horizontal scroll on iOS — body alone is insufficient */
html {
  overflow-x: hidden;
  /* Nav anchors ease to their section instead of jumping */
  scroll-behavior: smooth;
  /* Stop the fixed 72px nav from covering the top of the target section */
  scroll-padding-top: 72px;
}

/* Honour users who ask the OS for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Animation easing variables — referenced in keyframes and JS */
:root {
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.83, 0, 0.17, 1);
  --ease-reveal: cubic-bezier(0.77, 0, 0.175, 1);
}

@media (hover: none) {
  .cursor, .cursor-dot { display: none !important; }
}

/* ===== CURSOR =====
   The cursor paints in difference blend mode, so it renders as the exact
   per-channel inverse of whatever sits behind it — flat section, dark panel,
   or a full-colour game screenshot. It can never match its own backdrop, and
   it needs no JS to stay in sync while scrolling. */
.cursor {
  position: fixed;
  width: 42px;
  height: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width    0.38s var(--ease-out),
    height   0.38s var(--ease-out),
    background   0.3s,
    border-color 0.3s,
    opacity      0.3s;
  will-change: transform;
}

.cursor-dot {
  position: fixed;
  width: 4px;
  height: 4px;
  background: #ffffff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: opacity 0.2s;
  will-change: transform;
}

/* Black is the identity colour under difference, so the label knocks out of
   the inverted disc and reads as the backdrop's own colour */
.cursor__label {
  font-size: 0.44rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #000000;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.cursor.hover {
  width: 72px;
  height: 72px;
  background: #ffffff;
  border-color: #ffffff;
}
.cursor.hover + .cursor-dot { opacity: 0; }

.cursor.project-hover {
  width: 90px;
  height: 90px;
  background: #ffffff;
  border-color: #ffffff;
}
.cursor.project-hover .cursor__label { opacity: 1; }
.cursor.project-hover + .cursor-dot  { opacity: 0; }

/* ===== LOADER ===== */
.loader {
  transition: opacity 0.7s var(--ease-in-out), transform 0.7s var(--ease-in-out);
}
.loader__name {
  opacity: 0;
  animation: loaderFadeIn 0.6s var(--ease-out) 0.1s forwards;
}
.loader__bar {
  transform: scaleX(0);
  transform-origin: left;
  animation: loaderProgress 1.1s var(--ease-out) 0.25s forwards;
}
.loader.is-done {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
@keyframes loaderFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes loaderProgress {
  to { transform: scaleX(1); }
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ===== NAV SCROLLED STATE ===== */
.nav.scrolled {
  background: rgba(237, 237, 235, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #d4d3ce;
}

/* Nav link underline draw */
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #111110;
  transition: width 0.32s var(--ease-out);
}
.nav__link:hover::after { width: 100%; }

/* ===== HERO PHOTO ===== */
.hero-photo {
  width: 100%;
  aspect-ratio: 5/3;
}
@media (min-width: 768px) {
  .hero-photo {
    width: clamp(30rem, 52vw, 44rem);
    aspect-ratio: 16/9;
  }
}

/* ===== HERO ANIMATIONS ===== */
.hero__headline,
.hero__headline + div,
.hero-photo {
  opacity: 0;
  animation: fadeSlide 0.95s var(--ease-out) both;
}
.hero__headline      { animation-delay: 1.70s; }
.hero__headline + div { animation-delay: 1.85s; }
.hero-photo          { animation-delay: 2.00s; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ===== PROJECT CARD GRID LAYOUT ===== */
.project-card__link {
  grid-template-columns: 3fr 2fr;
}
.card-flip .project-card__link {
  grid-template-columns: 2fr 3fr;
}
.card-flip .project-card__media-wrap { order: 2; }
.card-flip .project-card__body       { order: 1; }

/* Clip-path wipe reveal */
.project-card__media {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s var(--ease-reveal);
}
.card-flip .project-card__media {
  clip-path: inset(0 0 0 100%);
}
.project-card.is-visible .project-card__media {
  clip-path: inset(0 0 0 0);
}

/* Image hover scale */
.project-card__img {
  transition: transform 0.9s var(--ease-out);
}
.project-card__link:hover .project-card__img {
  transform: scale(1.07);
}

/* Overlay dark on hover */
.project-card__overlay {
  background: rgba(17, 17, 16, 0);
  transition: background 0.45s var(--ease-out);
}
.project-card__link:hover .project-card__overlay {
  background: rgba(17, 17, 16, 0.3);
}

/* "View" label slides up on hover */
.project-card__view {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.38s var(--ease-out);
}
.project-card__link:hover .project-card__view {
  opacity: 1;
  transform: none;
}

/* Body (text column) fades up on scroll reveal */
.project-card__body {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease-out) 0.5s,
              transform 0.85s var(--ease-out) 0.5s;
}
.project-card.is-visible .project-card__body {
  opacity: 1;
  transform: none;
}

/* Title dims, arrow moves on hover */
.project-card__link:hover .project-card__title { opacity: 0.5; }
.project-card__arrow {
  transition: transform 0.32s var(--ease-out), color 0.25s;
}
.project-card__link:hover .project-card__arrow {
  transform: translate(5px, -5px);
  color: #111110;
}

/* ===== MARQUEE SCROLL ===== */
.marquee__track {
  animation: marquee 20s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== CTA HOVER FILL ===== */
.cta {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out);
}
.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #2a2a27;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.cta:hover::before  { transform: scaleX(1); }
.cta__label, .cta__icon { position: relative; z-index: 1; }
.cta__icon { transition: transform 0.3s var(--ease-out); }
.cta:hover .cta__icon { transform: translate(3px, -3px); }

/* ===== FOOTER LINK UNDERLINE ===== */
.footer__link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: #111110;
  transition: width 0.32s var(--ease-out);
}
.footer__link:hover::after { width: 100%; }
.footer--dark .footer__link::after { background: #ededeb; }

/* ===== SHOW MORE ===== */
.project-card--hidden { display: none; }

/* ===== PLATFORM TOGGLE ===== */
.plat-toggle__btn {
  padding: 0.6rem 1.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #78766f;
  background: transparent;
  transition: color 0.25s, background 0.35s var(--ease-out);
}
.plat-toggle__btn + .plat-toggle__btn { border-left: 1px solid #3a3a37; }
.plat-toggle__btn:hover      { color: #ededeb; }
.plat-toggle__btn.is-active  { color: #111110; background: #ededeb; }

/* ===== SCREEN GALLERY ===== */
.shot__media {
  transition: aspect-ratio 0.5s var(--ease-out);
}
.shot__img {
  transition: transform 0.8s var(--ease-out), opacity 0.3s;
}
.shot__img.is-swapping { opacity: 0; }
.shot__btn:hover .shot__img { transform: scale(1.035); }

.shot__zoom {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.38s var(--ease-out);
}
.shot__btn:hover .shot__zoom { opacity: 1; transform: none; }

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1.25rem 3.5rem;
  background: rgba(10, 10, 9, 0.96);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), visibility 0.4s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
body.lb-locked    { overflow: hidden; }

.lightbox__figure {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: min(1500px, 100%);
  max-height: 100%;
}
.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 12rem);
  width: auto;
  height: auto;
  object-fit: contain;
  transform: scale(0.97);
  transition: transform 0.45s var(--ease-out);
}
.lightbox.is-open .lightbox__img { transform: none; }

.lightbox__cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid rgba(237, 237, 235, 0.16);
  padding-top: 0.75rem;
  font-size: 0.72rem;
  line-height: 1.6;
  color: rgba(237, 237, 235, 0.62);
}
.lightbox__cap span:last-child {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(237, 237, 235, 0.38);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(237, 237, 235, 0.55);
  border: 1px solid rgba(237, 237, 235, 0.18);
  background: transparent;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.lightbox__close:hover,
.lightbox__nav:hover {
  color: #111110;
  background: #ededeb;
  border-color: #ededeb;
}
.lightbox__close {
  top: 1.25rem; right: 1.25rem;
  width: 2.75rem; height: 2.75rem;
  font-size: 0.9rem;
}
.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem; height: 3rem;
  font-size: 1rem;
}
.lightbox__nav--prev { left: 1.25rem; }
.lightbox__nav--next { right: 1.25rem; }

@media (max-width: 768px) {
  .lightbox { padding: 4rem 0.75rem 4.5rem; }
  .lightbox__nav { top: auto; bottom: 1rem; transform: none; }
  .lightbox__nav--prev { left: 0.75rem; }
  .lightbox__nav--next { right: 0.75rem; }
  .lightbox__cap { flex-direction: column; gap: 0.35rem; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .project-card__link,
  .card-flip .project-card__link {
    grid-template-columns: 1fr !important;
  }
  .card-flip .project-card__media-wrap,
  .card-flip .project-card__body {
    order: unset;
  }

  /* Title + arrow inline on mobile */
  .project-card__body {
    display: grid !important;
    grid-template-columns: 1fr auto;
    row-gap: 1.75rem;
    column-gap: 0.75rem;
  }
  .project-card__body > :first-child {
    grid-column: 1 / -1;
  }
  .project-card__title {
    min-width: 0;
    align-self: start;
  }
  .project-card__arrow {
    align-self: start;
  }
}
