@font-face {
  font-family: "PP Neue Montreal";
  src: url("assets/fonts/PPNeueMontreal-Medium.woff2") format("woff2");
  font-display: swap;
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: "PP Neue Montreal";
  src: url("assets/fonts/PPNeueMontreal-Book.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

:root {
  --ink: #080808;
  --muted: #5f5f5f;
  --accent: #0b0db7;
  --paper: #ffffff;
  --preview: #ffbfc1;
  --edge: clamp(24px, 3.2vw, 48px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "PP Neue Montreal", sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: grid;
  width: max-content;
  padding: 6px 8px;
  color: var(--paper);
  background: var(--accent);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transform: translate(14px, 14px);
  transition:
    opacity 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
  white-space: nowrap;
}

body.has-cursor .cursor-label {
  opacity: 1;
}

body.cursor-live .cursor-label {
  background: var(--ink);
  transform: translate(14px, 14px) scale(1.04);
}

.hero {
  position: relative;
  display: grid;
  min-height: 500vh;
  grid-template-columns: 43% 57%;
  align-items: start;
}

nav {
  position: fixed;
  top: 24px;
  right: var(--edge);
  left: var(--edge);
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

nav a {
  display: inline-flex;
  width: 42px;
}

nav img {
  display: block;
  width: 100%;
  height: auto;
}

nav p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.2;
  text-transform: uppercase;
  mix-blend-mode: difference;
}

.left {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: 116px var(--edge) 64px;
}

h1 {
  min-width: (100%, 550px);
  margin: -5vh 0 0;
  font-size: clamp(54px, 5.6vw, 92px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.8;
  text-transform: uppercase;
}

.left h3 {
  width: min(600px, 100%);
  margin: 112px 0 0 8.5vw;
  color: var(--muted);
  font-size: clamp(16px, 1.35vw, 24px);
  font-weight: 400;
  line-height: 1.4;
}

.cta-wrapper {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 98px 0 0;
  font-size: 16px;
}

.cta-wrapper p {
  margin: 0;
  white-space: nowrap;
  text-transform: uppercase;
}

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 16px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 0 16px;
}

.cta img {
  width: 20px;
  transition: transform 0.3s ease;
}

.cta:hover img,
.cta:focus-visible img {
  transform: translate(2px, -2px);
}

.cta-underline {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 14px;
  overflow: visible;
  pointer-events: none;
}

.cta-underline-path {
  stroke: currentColor;
  stroke-width: 2;
}

.right {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: end;
  align-items: end;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100vh;
  gap: clamp(30px, 5vw, 84px);
  padding: 0 var(--edge) 0 0;
}

.preview-wrapper {
  position: relative;
  overflow: hidden;
  width: min(39vw, 35vw);
  max-width: 650px;
  height: 100%;
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

.preview-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform;
}

.preview-hit {
  position: absolute;
  left: 0;
  z-index: 3;
  display: none;
  cursor: none;
}

.preview-item {
  width: 100%;
  flex-shrink: 0;
  overflow: hidden;
  transform-style: preserve-3d;
  transform-origin: center center;
  will-change: transform, filter, opacity;
}

.preview-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
  pointer-events: none;
}

.preview-item img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 6/4;
  object-fit: cover;
  cursor: none;
  pointer-events: none;
}

.minimap {
  position: relative;
  width: 150px;
  padding: 0 20px;
  margin-bottom: 48px;
}

.minimap-viewport {
  position: relative;
  overflow: hidden;
  width: 110px;
}

.minimap-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  will-change: transform;
}

.minimap-track .item {
  position: relative;
  width: 110px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
}

.minimap-track .item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.minimap-frame {
  position: absolute;
  left: 20px;
  right: 20px;
  height: 80px;
  pointer-events: none;
  z-index: 1;
}

.minimap-frame::after {
  position: absolute;
  top: -10px;
  right: -10px;
  bottom: -10px;
  left: -10px;
  content: "";
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 24px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left top / 2px 24px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 24px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 2px 24px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 24px 2px
      no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 2px 24px
      no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 24px 2px
      no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 2px 24px
      no-repeat;
}
@media (max-width: 900px) {
  :root {
    --edge: 24px;
  }

  .left {
    width: 100%;
  }

  .right {
    width: 100%;
    gap: 24px;
  }

  .preview-wrapper {
    width: min(37vw, 440px);
  }

  .minimap {
    width: 78px;
    padding: 0 10px;
  }

  .minimap-viewport,
  .minimap .item {
    width: 58px;
  }

  .minimap .item {
    height: 48px;
  }

  .minimap-frame {
    left: 0;
    right: 0;
    height: 48px;
  }
}

@media (max-width: 680px) {
  .portfolio-stage {
    display: block;
    min-height: 0;
  }

  nav {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    padding: 18px var(--edge) 0;
  }

  .left {
    position: relative;
    display: block;
    min-height: 0;
    width: 100%;
    padding: 94px var(--edge) 56px;
  }

  h1 {
    margin: 0;
    font-size: clamp(48px, 14vw, 78px);
    line-height: 0.82;
  }

  .left h3 {
    max-width: 360px;
    margin: 64px 0 0 18vw;
    font-size: 17px;
  }

  .cta-wrapper {
    margin-top: 64px;
  }

  .right {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    align-items: flex-start;
    gap: 18px;
    padding: 0 var(--edge) 40px;
  }

  .preview-wrapper {
    width: calc(100% - 76px);
    height: 82vw;
    min-height: 0;
    max-height: 560px;
  }

  .minimap {
    width: 58px;
    padding: 0;
    gap: 10px;
  }

  .minimap-viewport,
  .minimap .item {
    width: 58px;
  }

  .minimap .item {
    height: 44px;
  }

  .minimap-frame {
    display: none;
  }

  .minimap .item.active {
    overflow: visible;
  }

  .minimap .item.active::after {
    position: absolute;
    top: -5px;
    right: -5px;
    bottom: -5px;
    left: -5px;
    content: "";
    background-size:
      25px 2px,
      2px 25px,
      25px 2px,
      2px 25px,
      25px 2px,
      2px 25px,
      25px 2px,
      2px 25px;
    background-repeat: no-repeat;
    background-position:
      left top,
      left top,
      right top,
      right top,
      left bottom,
      left bottom,
      right bottom,
      right bottom;
    background-image:
      linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta svg {
    transition: none;
  }
}

@media (hover: none), (max-width: 680px) {
  .cursor-label {
    display: none;
  }
}
