/* ── Project Pages — Shared Styles ────────────────────── */

/* ── Back Link ───────────────────────────────────────── */
.back {
  position: fixed;
  top: 28px;
  left: 48px;
  z-index: 100;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
  mix-blend-mode: difference;
  transition: color 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back::before {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s;
}

.back:hover {
  color: var(--white);
}

.back:hover::before {
  width: 40px;
}

/* ── Project Nav (right side) ────────────────────────── */
.project-nav {
  position: fixed;
  top: 28px;
  right: 48px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  mix-blend-mode: difference;
}

.project-nav a {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  transition: color 0.3s;
}

.project-nav a:hover {
  color: var(--white);
}

.project-nav .lang-switcher {
  flex-shrink: 0;
}

/* ── Project Hero ────────────────────────────────────── */
[data-speed] {
  transform: translate3d(0, var(--parallax-y, 0px), 0);
  will-change: transform;
}

.proj-hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 0 48px 80px;
  position: relative;
}

.proj-hero-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.proj-number {
  font-size: clamp(6rem, 15vw, 12rem);
  font-weight: 200;
  color: var(--dim);
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.proj-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: 8px;
}

.proj-meta {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.proj-meta span {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
}

/* ── Project Info Block ──────────────────────────────── */
.proj-info {
  padding: 120px 48px;
}

.proj-info-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
}

.proj-info-label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gray);
}

.proj-info-text {
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 1.8;
  opacity: 0.85;
}

.proj-info-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

.project-cta::after {
  content: "\2197";
  font-size: 0.95rem;
  line-height: 1;
}

.project-cta:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.26);
  transform: translateY(-2px);
}

/* ── Full-width Image/Canvas Section ─────────────────── */
.proj-visual {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.proj-visual-full {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 3D Viewer — Sticky Scroll-Lock ──────────────────── */
.viewer-3d-wrap {
  position: relative;
  height: 400vh; /* scroll runway for the full rotation */
  overflow: visible;
}

.viewer-3d-wrap.viewer-3d-wrap-mobile {
  height: auto;
  padding: 0 48px;
}

.viewer-3d-wrap.viewer-3d-wrap-mobile .viewer-3d-sticky {
  position: relative;
  top: auto;
  height: min(76svh, 680px);
  min-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.viewer-3d-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08), transparent 35%),
    linear-gradient(180deg, #111111 0%, #090909 100%);
}

.viewer-3d-sticky canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.viewer-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
  opacity: 0.6;
  transition: opacity 0.5s;
}

.viewer-hint.hidden {
  opacity: 0;
}

/* Progress bar during rotation */
.viewer-progress {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: var(--dim);
}

.viewer-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gray);
  transition: width 0.05s linear;
}

/* ── 2D Gallery Panels ───────────────────────────────── */
.panel-gallery {
  padding: 80px 48px;
}

.panel-gallery-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.panel-row {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

.panel-row.two {
  grid-template-columns: 1fr 1fr;
}

.panel-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.panel-row.hero-img {
  grid-template-columns: 1fr;
}

.panel {
  aspect-ratio: 16 / 10;
  background: var(--dim);
  overflow: hidden;
  position: relative;
}

.panel-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel:hover .panel-inner {
  transform: scale(1.03);
}

.panel-label {
  position: absolute;
  bottom: 16px;
  left: 20px;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
}

/* ── Mockup Browser Frame ────────────────────────────── */
.mockup-section {
  padding: 80px 48px;
}

.mockup-wrap {
  max-width: 1000px;
  margin: 0 auto;
  perspective: 1200px;
}

.mockup {
  background: var(--dim);
  border-radius: 8px;
  overflow: hidden;
  transform-style: preserve-3d;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 0.1s linear;
  margin-bottom: 60px;
}

.mockup-bar {
  height: 32px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 6px;
}

.mockup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
}

.mockup-screen {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mockup-placeholder {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--gray);
  letter-spacing: 0.1em;
}

/* ── Typography Showcase ─────────────────────────────── */
.type-section {
  padding: 60px 48px;
  overflow: hidden;
}

.type-specimen {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 0;
  border-top: 1px solid var(--dim);
  overflow: hidden;
}

.type-specimen:last-child {
  border-bottom: 1px solid var(--dim);
}

.type-big {
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 200;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--white);
  white-space: nowrap;
  transform: translateX(var(--type-shift, 0px));
  transition: transform 0.05s linear;
}

.type-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 20px;
}

.type-meta {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
}

.type-weight-demo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 80px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.type-weight-line {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--white);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s, transform 0.6s;
}

.type-weight-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Scroll-driven Image Stack (2D projects) ─────────── */
.img-stack {
  position: relative;
  height: 300vh;
}

.img-stack-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  perspective: 1400px;
  transform-style: preserve-3d;
}

.stack-card {
  position: absolute;
  width: 60vw;
  max-width: 700px;
  aspect-ratio: 4 / 3;
  background: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 200;
  color: var(--gray);
  transition: transform 0.05s linear;
  will-change: transform;
  transform-style: preserve-3d;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

/* ── Images Inside Panels / Mockups / Stack Cards ────── */
.panel-inner img,
.mockup-screen img,
.stack-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
  transition: none;
}

.panel-inner img.is-viewable,
.mockup-screen img.is-viewable,
.stack-card img.is-viewable {
  cursor: none;
}

.panel:hover .panel-inner img {
  filter: none;
}

.stack-card img {
  position: absolute;
  inset: 0;
}

.stack-label {
  position: relative;
  z-index: 2;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}

.mockup-screen img {
  display: block;
}

.asset-section {
  padding: 80px 48px;
}

.asset-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.asset-grid.asset-grid-single {
  max-width: 760px;
  grid-template-columns: minmax(0, 1fr);
}

.asset-grid.asset-grid-two {
  max-width: 980px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.asset-card {
  min-height: 240px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.asset-card-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
}

.asset-card-title {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.2;
}

.asset-card-text {
  font-size: 0.98rem;
  line-height: 1.7;
  color: rgba(232, 232, 232, 0.82);
}

.file-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-links a {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.82;
  transition: opacity 0.3s;
}

.file-links a:hover {
  opacity: 1;
}

.doc-viewer-section {
  padding: 80px 48px;
}

.doc-viewer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.doc-frame {
  aspect-ratio: 16 / 10;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.doc-frame iframe,
.doc-frame object {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.doc-fallback {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
}

.doc-fallback p {
  max-width: 34rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(232, 232, 232, 0.8);
}

body.viewer-open {
  overflow: hidden;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(0, 88px) minmax(0, 1fr) minmax(0, 88px);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.image-viewer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.image-viewer__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 30%),
    rgba(4, 4, 4, 0.92);
}

.image-viewer__chrome {
  position: absolute;
  top: 28px;
  left: 28px;
  right: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.image-viewer__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-viewer__counter {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.image-viewer__tool,
.image-viewer__close,
.image-viewer__nav {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  font: inherit;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.image-viewer__tool {
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.image-viewer__close {
  padding: 12px 16px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.image-viewer__nav {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  font-size: 1.2rem;
}

.image-viewer__tool:hover,
.image-viewer__close:hover,
.image-viewer__nav:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
}

.image-viewer__nav--prev {
  grid-column: 1;
  justify-self: center;
}

.image-viewer__nav--next {
  grid-column: 3;
  justify-self: center;
}

.image-viewer__figure {
  position: relative;
  z-index: 2;
  grid-column: 2;
  justify-self: center;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(100%, 1200px);
  min-width: 0;
  min-height: 0;
}

.image-viewer__viewport {
  position: relative;
  width: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}

.image-viewer__viewport.is-zoomed {
  cursor: grab;
}

.image-viewer__viewport.is-panning {
  cursor: grabbing;
}

.image-viewer__img {
  display: block;
  max-width: min(1200px, calc(100vw - 220px));
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
  transform-origin: center center;
  transition: transform 0.22s ease;
  will-change: transform;
  user-select: none;
}

.image-viewer__figure.is-portrait {
  width: min(100%, 640px);
}

.image-viewer__figure.is-portrait .image-viewer__img {
  max-width: min(640px, calc(100vw - 140px));
  max-height: calc(100vh - 132px);
}

.image-viewer__figure.is-square {
  width: min(100%, 860px);
}

.image-viewer__caption {
  max-width: 100%;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, 0.66);
}

.image-viewer__close:focus-visible,
.image-viewer__nav:focus-visible,
.panel-inner img.is-viewable:focus-visible,
.mockup-screen img.is-viewable:focus-visible,
.stack-card img.is-viewable:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
}

/* ── Next Project ────────────────────────────────────── */
.next-project {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 80px 48px;
  text-align: center;
}

.next-label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 16px;
}

.next-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  transition: opacity 0.3s;
}

.next-project:hover .next-title {
  opacity: 0.6;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 100;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.92) 0%, rgba(10, 10, 10, 0.72) 72%, rgba(10, 10, 10, 0) 100%);
    backdrop-filter: blur(14px);
  }

  .proj-hero {
    min-height: 92svh;
    padding: 116px 20px 44px;
  }

  .proj-info {
    padding: 56px 20px;
  }

  .proj-info-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .proj-number {
    font-size: clamp(4.2rem, 24vw, 6.8rem);
  }

  .proj-title {
    font-size: clamp(2rem, 10vw, 3.3rem);
    line-height: 1.02;
  }

  .proj-meta {
    gap: 10px 16px;
    flex-wrap: wrap;
    margin-top: 18px;
  }

  .proj-meta span {
    font-size: 0.66rem;
    letter-spacing: 0.12em;
  }

  .proj-info-text {
    font-size: 1rem;
    line-height: 1.75;
  }

  .proj-info-copy {
    gap: 18px;
  }

  .project-cta {
    width: 100%;
    justify-content: space-between;
    padding: 15px 18px;
  }

  .panel-gallery {
    padding: 32px 20px;
  }

  .panel-row.two,
  .panel-row.three {
    grid-template-columns: 1fr;
  }

  .panel-row {
    gap: 16px;
    margin-bottom: 16px;
  }

  .panel-label {
    left: 16px;
    bottom: 12px;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
  }

  .mockup-section {
    padding: 32px 20px;
  }

  .asset-section {
    padding: 32px 20px;
  }

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

  .asset-grid.asset-grid-single,
  .asset-grid.asset-grid-two {
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .asset-card {
    min-height: auto;
    padding: 22px;
    gap: 16px;
  }

  .asset-card-title {
    font-size: 1.22rem;
  }

  .asset-card-text {
    font-size: 0.94rem;
    line-height: 1.7;
  }

  .file-links a {
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    line-height: 1.5;
    word-break: break-word;
  }

  .doc-viewer-section {
    padding: 32px 20px;
  }

  .doc-frame {
    aspect-ratio: 3 / 4;
  }

  .viewer-3d-wrap {
    height: 250svh;
  }

  .viewer-3d-sticky {
    height: 84svh;
  }

  .viewer-3d-wrap.viewer-3d-wrap-mobile {
    height: auto;
    padding: 0 20px;
  }

  .viewer-3d-wrap.viewer-3d-wrap-mobile .viewer-3d-sticky {
    height: 68svh;
    min-height: 340px;
  }

  .viewer-hint {
    bottom: 30px;
    width: calc(100% - 40px);
    text-align: center;
    line-height: 1.6;
    letter-spacing: 0.16em;
  }

  .viewer-progress {
    bottom: 16px;
    width: 96px;
  }

  .image-viewer {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .image-viewer__chrome {
    top: 20px;
    left: 20px;
    right: 20px;
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .image-viewer__figure {
    grid-column: 1;
    justify-self: stretch;
    padding-top: 96px;
    width: 100%;
  }

  .image-viewer__viewport {
    width: 100%;
  }

  .image-viewer__img {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 180px);
  }

  .image-viewer__figure.is-portrait {
    width: min(100%, 420px);
  }

  .image-viewer__figure.is-portrait .image-viewer__img {
    max-width: calc(100vw - 56px);
    max-height: calc(100vh - 168px);
  }

  .image-viewer__nav {
    position: absolute;
    bottom: 22px;
  }

  .image-viewer__controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .image-viewer__tool,
  .image-viewer__close {
    min-height: 44px;
  }

  .image-viewer__nav--prev {
    left: 20px;
  }

  .image-viewer__nav--next {
    right: 20px;
  }

  .type-section {
    padding: 32px 20px;
  }

  .type-specimen {
    padding: 48px 0;
  }

  .type-big {
    font-size: clamp(2.4rem, 11vw, 4rem);
    line-height: 1.02;
    white-space: normal;
  }

  .type-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .back {
    top: 18px;
    left: 20px;
    mix-blend-mode: normal;
    z-index: 101;
  }

  .project-nav {
    top: 18px;
    right: 20px;
    max-width: none;
    text-align: right;
    mix-blend-mode: normal;
    z-index: 101;
  }

  .back,
  .project-nav a {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }

  .project-nav .lang-switcher {
    gap: 2px;
  }

  .project-nav .lang-switcher__btn {
    min-width: 34px;
    padding: 6px 7px;
  }

  .img-stack {
    height: 220svh;
  }

  .stack-card {
    width: 90vw;
    max-width: none;
  }

  .img-stack-sticky {
    height: 92svh;
  }

  .next-project {
    min-height: 38svh;
    padding: 56px 20px;
  }

  .next-title {
    font-size: clamp(1.8rem, 10vw, 3rem);
  }
}
