/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --page-bg: #e2e5d9;
  --text: #72766d;
  --muted: #74786f;
  --soft: rgba(114, 118, 109, 0.58);
  --fishhook-cursor: default;
}

html {
  font-size: 18px;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--page-bg);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  cursor: var(--fishhook-cursor);
  -webkit-font-smoothing: antialiased;
}

body * {
  cursor: var(--fishhook-cursor);
}

a,
button,
.cover-wrap,
.pf-image {
  cursor: var(--fishhook-cursor);
}

/* ===== LANDING PAGE ===== */
.cover-wrap {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  overflow: hidden;
  background: #000;
  cursor: var(--fishhook-cursor);
  text-decoration: none;
  color: inherit;
}

.cover-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateY(1cm);
}

.cover-enter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  pointer-events: none;
}

.cover-enter .site-name {
  font-size: 1.3rem;
  letter-spacing: 0.15em;
  color: #fff;
  mix-blend-mode: difference;
  display: block;
  margin-bottom: 0.5em;
}

.cover-enter .enter-link {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: #fff;
  mix-blend-mode: difference;
  display: block;
}

.cover-wrap:hover .site-name,
.cover-wrap:hover .enter-link {
  font-style: italic;
}

/* ===== PORTFOLIO PAGE ===== */
.pf-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.7rem 1.75rem;
  font-size: 0.78rem;
  letter-spacing: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  z-index: 20;
}

.pf-name {
  font-weight: 400;
  color: inherit;
  text-decoration: none;
}

.pf-name:hover,
.pf-name.is-italic {
  font-style: italic;
}

.pf-links {
  display: flex;
  gap: 1.05rem;
  align-items: center;
}

.pf-music-toggle {
  position: fixed;
  top: 1.62rem;
  right: calc(14.9rem - 1cm);
  z-index: 1100;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.58;
  cursor: pointer;
}

.pf-music-toggle:hover {
  opacity: 1;
}

.pf-music-toggle svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pf-music-toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -0.1rem;
  width: 1.2rem;
  height: 1px;
  background: currentColor;
  transform: rotate(-45deg) scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.pf-music-toggle.is-muted::after {
  transform: rotate(-45deg) scaleX(1);
}

.pf-project-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
  z-index: 1000;
}

body.is-project-open {
  overflow: hidden;
}

.pf-language {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.74rem;
  line-height: 1;
  color: inherit;
  opacity: 0.58;
}

.pf-language button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  line-height: 1;
  color: inherit;
  opacity: 0.52;
}

.pf-language button:hover,
.pf-language button.is-active {
  opacity: 1;
  font-style: italic;
}

.pf-language span {
  opacity: 0.5;
  line-height: 1;
}

.pf-links a {
  text-decoration: none;
  color: inherit;
  opacity: 0.58;
  line-height: 1;
}

.pf-links a:hover {
  opacity: 1;
  font-style: italic;
}

.pf-intro {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.7fr;
  gap: 6vw;
  align-items: center;
  padding: 12vh 1.75rem 20vh;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow: hidden;
}

.sea-reveal-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.48;
  filter: grayscale(100%) saturate(0) contrast(0.82) brightness(1.24);
  pointer-events: none;
}

.pf-intro-copy,
.pf-services,
.pf-contact {
  position: relative;
  z-index: 1;
  align-self: center;
}

.pf-intro-copy p + p,
.pf-services p + p {
  margin-top: 1.8rem;
}

.pf-contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform: translateY(-0.65rem);
}

.pf-contact a {
  width: fit-content;
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.pf-contact a:hover {
  font-style: italic;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11rem clamp(1.2rem, 3.7vw, 6rem);
  padding: 3rem 1.75rem 3.8rem;
}

.pf-item {
  display: flex;
  flex-direction: column;
}

.pf-num {
  font-size: 0.82rem;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: 0.7rem;
  display: block;
  min-height: 0.9rem;
  white-space: nowrap;
}

.pf-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  isolation: isolate;
}

.pf-image img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(0.95) brightness(0.88) saturate(0.72);
  transform: scale(1.001);
  transition: filter 0.65s ease, transform 0.65s ease;
  will-change: filter, transform;
}

.wave-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.pf-item:hover .pf-image img,
.pf-item.is-hovering .pf-image img {
  filter: grayscale(0%) contrast(1.02) brightness(1.02) saturate(1.05);
  transform: scale(1.018);
}

.pf-item:hover .wave-canvas,
.pf-item.is-hovering .wave-canvas {
  opacity: 1;
}

.pf-title {
  font-size: 0.72rem;
  letter-spacing: 0;
  padding: 1rem 0 0;
  margin: 0;
  color: var(--soft);
}

.pf-small-marquee {
  --small-gap: clamp(1.2rem, 2.4vw, 3rem);
  --small-image-width: clamp(7.6rem, 11.2vw, 11.4rem);
  position: relative;
  overflow: hidden;
  padding: 6cm 0 13rem;
  box-sizing: border-box;
}

.pf-small-heading {
  position: absolute;
  top: calc(6cm - 2.1rem);
  left: 1.75rem;
  z-index: 1;
  font-size: 0.82rem;
  color: var(--muted);
}

.pf-small-track {
  display: flex;
  gap: var(--small-gap);
  width: max-content;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.pf-small-set {
  display: flex;
  flex: 0 0 auto;
  gap: var(--small-gap);
  margin-right: var(--small-gap);
  padding: 0;
}

.pf-small-item {
  align-items: center;
  flex: 0 0 var(--small-image-width);
}

.pf-small-item .pf-image {
  width: 100%;
  aspect-ratio: 3 / 4.45;
}

.pf-small-title {
  align-self: flex-start;
  white-space: nowrap;
  font-size: 0.72rem;
}

/* ===== PROJECT DETAIL PAGE ===== */
body.proj-page {
  background: var(--page-bg);
  padding: 0;
}

.proj-nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.7rem 1.75rem;
  font-size: 0.78rem;
  z-index: 20;
}

.proj-nav-name {
  text-decoration: none;
  color: inherit;
  font-weight: 400;
}

.proj-nav-name:hover { font-style: italic; }

.proj-nav-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
}

.proj-back {
  text-decoration: none;
  color: inherit;
  opacity: 0.58;
  font-size: 0.72rem;
}

.proj-back:hover {
  opacity: 1;
  font-style: italic;
}

/* Project side text */
.proj-side-text {
  position: fixed;
  bottom: 2.2rem;
  right: 2.2rem;
  width: clamp(240px, 30vw, 480px);
  font-size: 0.68rem;
  line-height: 1.75;
  color: var(--text);
  opacity: 0.72;
}

.proj-side-text p + p {
  margin-top: 1.2rem;
}

/* Project detail layout */
.proj-main {
  padding: 5.5rem 2.2rem 5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.proj-card-stack {
  display: flex;
  flex-direction: column;
  gap: 2.58rem;
  width: clamp(440px, 54.1vw, 998px);
  margin-left: 1cm;
}

.proj-page--centered .proj-main {
  align-items: center;
}

.proj-page--centered .proj-card-stack {
  margin-left: 0;
}

.proj-page--centered .proj-split-desc {
  align-self: center;
  width: clamp(440px, 54.1vw, 998px);
  padding-left: 0;
}

.proj-main-card {
  width: 100%;
  background: #c8ccc0;
  outline: 1px solid rgba(114,118,109,0.12);
}

.proj-card-img-wrap {
  display: block;
  position: relative;
  margin: 0;
  overflow: hidden;
  box-shadow:
    2px 3px 8px rgba(0,0,0,0.18),
    4px 8px 18px rgba(0,0,0,0.14);
}

.proj-card-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* Duo portrait layout */
.proj-card-duo-wrap {
  display: flex;
  margin: 0;
  gap: 3%;
}

.proj-card-duo-img {
  flex: 1;
  position: relative;
  overflow: hidden;
  box-shadow:
    2px 3px 8px rgba(0,0,0,0.18),
    4px 8px 18px rgba(0,0,0,0.14);
}

.proj-card-duo-img img {
  width: 100%;
  height: auto;
  display: block;
}

.proj-card-duo-img--zoom img {
  transform: scale(1.05);
  transform-origin: center center;
}

.proj-card-slider {
  position: absolute;
  inset: 0;
  overflow: hidden;
  box-shadow:
    2px 3px 8px rgba(0,0,0,0.18),
    4px 8px 18px rgba(0,0,0,0.14);
}

.proj-card-slider-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: project-card-slide 48s linear infinite;
  will-change: transform;
}

.proj-card-slider:hover .proj-card-slider-track {
  animation-play-state: paused;
}

.proj-card-slide-set {
  display: flex;
  flex: 0 0 auto;
  height: 100%;
}

.proj-card-slider img {
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  display: block;
}

@keyframes project-card-slide {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.proj-card-duo-img::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="4" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="200" height="200" filter="url(%23n)"/></svg>');
  background-size: 200px 200px;
  opacity: 0.09;
  mix-blend-mode: overlay;
}

.proj-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="4" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="200" height="200" filter="url(%23n)"/></svg>');
  background-size: 200px 200px;
  opacity: 0.09;
  mix-blend-mode: overlay;
}

.proj-card-slider::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="4" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="200" height="200" filter="url(%23n)"/></svg>');
  background-size: 200px 200px;
  opacity: 0.09;
  mix-blend-mode: overlay;
}

.magnifier {
  position: fixed;
  top: 0;
  left: 0;
  width: 140px;
  height: 140px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 9999;
  background-repeat: no-repeat;
  will-change: transform, background-position;
  border-radius: 50%;
  box-shadow:
    0 0 16px rgba(114, 118, 109, 0.18),
    inset 0 0 18px rgba(226, 229, 217, 0.2);
  -webkit-mask-image: radial-gradient(circle, #000 58%, rgba(0,0,0,0.86) 68%, rgba(0,0,0,0.34) 80%, transparent 90%);
  mask-image: radial-gradient(circle, #000 58%, rgba(0,0,0,0.86) 68%, rgba(0,0,0,0.34) 80%, transparent 90%);
  filter: drop-shadow(0 4px 11px rgba(0,0,0,0.16));
}

.magnifier.is-visible {
  opacity: 1;
}

.proj-card-img-wrap img,
.proj-card-duo-img img,
.proj-card-slider img {
  cursor: none;
}

.proj-main-card--slider {
  position: relative;
  aspect-ratio: 3 / 2;
}

.proj-main-card--bare {
  background: transparent;
  outline: none;
}

.proj-main-card--bare .proj-card-img-wrap {
  margin: 0;
}

.proj-split-desc {
  margin-top: 2.8rem;
  align-self: flex-start;
  font-size: 0.72rem;
  color: var(--soft);
  line-height: 1.65;
  padding-left: calc(1cm + (100% - clamp(440px, 54.1vw, 998px)) / 2);
}

@media (max-width: 900px) {
  .pf-intro {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    align-items: end;
    padding-top: 18vh;
  }

  .pf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5rem 2rem;
  }

  .pf-small-marquee {
    --small-gap: 2.8rem;
    --small-image-width: 7.8rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .pf-image img {
    transition: filter 0.2s ease;
  }

  .pf-item:hover .pf-image img {
    filter: grayscale(0%) contrast(1.02) brightness(1.02) saturate(1.04);
    transform: none;
  }

  .wave-canvas {
    display: none;
  }

  .pf-small-track {
    animation: none;
  }
}

/* ===== FINAL GARMENTS: VIDEO + PAGE-FLIP BOOK ===== */
.fg-main {
  padding: 5.5rem 2.2rem 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.4rem;
}

.fg-video-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.fg-video-frame {
  position: relative;
  width: clamp(440px, 64vw, 1180px);
  aspect-ratio: 16 / 9;
  background: #14150f;
  overflow: hidden;
  box-shadow:
    2px 3px 8px rgba(0,0,0,0.18),
    4px 8px 18px rgba(0,0,0,0.14);
}

.fg-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #14150f;
  display: block;
}

.fg-video-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  background: rgba(20, 21, 15, 0.32);
  border: none;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.fg-video-frame.is-playing .fg-video-overlay {
  opacity: 0;
  pointer-events: none;
}

.fg-play-icon {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.75);
  padding-left: 3px;
}

.fg-video-label {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.48);
}

.fg-book-wrap {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  width: 100%;
  justify-content: center;
}

.fg-arrow {
  background: none;
  border: none;
  font-size: 1.15rem;
  color: var(--text);
  opacity: 0.5;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.fg-arrow:hover {
  opacity: 1;
}

.fg-arrow:disabled {
  opacity: 0.18;
  cursor: default;
}

.fg-book {
  position: relative;
  width: clamp(484px, 63.8vw, 1144px);
  aspect-ratio: 1.4147 / 1;
  perspective: 2600px;
  cursor: pointer;
}

.fg-static-half,
.fg-flip {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
}

.fg-static-half {
  overflow: hidden;
  background: #f2f2ee;
}

.fg-static-half--left,
.fg-flip--left {
  left: 0;
  box-shadow:
    -2px 3px 8px rgba(0,0,0,0.18),
    -4px 8px 18px rgba(0,0,0,0.14);
}

.fg-static-half--right,
.fg-flip--right {
  right: 0;
  box-shadow:
    2px 3px 8px rgba(0,0,0,0.18),
    4px 8px 18px rgba(0,0,0,0.14);
}

.fg-static-half img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.fg-flip {
  transform-style: preserve-3d;
  transition: transform 0.68s ease-in-out;
  z-index: 2;
}

.fg-flip--right {
  transform-origin: left center;
  transform: rotateY(0deg);
}

.fg-flip--right.is-flipped {
  transform: rotateY(-178deg);
}

.fg-flip--left {
  transform-origin: right center;
  transform: rotateY(0deg);
}

.fg-flip--left.is-flipped {
  transform: rotateY(178deg);
}

/* Two faces so the page stays visible through the whole turn: the front
   shows the current half, the back (paper-toned) swings into view once the
   turn passes 90° instead of the page vanishing mid-flip. */
.fg-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: #e6e3d8;
}

.fg-flip-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.fg-flip--right .fg-flip-face--back {
  transform: rotateY(180deg);
}

.fg-flip--left .fg-flip-face--back {
  transform: rotateY(-180deg);
}

@keyframes fg-page-turn-shade {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(0.78); }
}

/* Applied to the faces, not the rotating .fg-flip container itself — a filter
   animation on the element that also carries the 3D rotation + preserve-3d
   context is a well-known trigger for broken backface-visibility rendering
   in several engines (the "back" face's own backface showed through as a
   mirrored front instead of staying hidden). Scoping it to the leaf faces
   keeps the rotating element itself filter-free. */
.fg-flip.is-turning .fg-flip-face {
  animation: fg-page-turn-shade 0.68s ease-in-out;
}

.fg-dots {
  display: flex;
  gap: 0.7rem;
}

.fg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--soft);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.fg-dot:hover {
  border-color: var(--text);
}

.fg-dot.is-active {
  background: var(--text);
  border-color: var(--text);
}

@media (max-width: 700px) {
  .fg-book {
    width: clamp(308px, 92.4vw, 770px);
  }

  .fg-arrow {
    font-size: 1rem;
    padding: 0.3rem;
  }
}
