.work-page {
  --work-bg: #14141d;
  --work-ink: #faf8f2;
  --work-muted: rgba(250, 248, 242, 0.58);
  min-width: 320px;
  overflow-x: clip;
  background: var(--work-bg);
  color: var(--work-ink);
}

.work-page-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  pointer-events: none;
  background: #14141d;
  isolation: isolate;
}

.work-page-backdrop > span {
  position: absolute;
  inset: 0;
  background: url('../images/home/hero-overlay.webp') center / cover no-repeat;
  opacity: 0.35;
  mix-blend-mode: plus-lighter;
}

.work-main {
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Trionn's header is a one-viewport stage pinned for one more viewport. */
.work-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: transparent;
}

.work-hero-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  perspective: 600px;
  transform-style: preserve-3d;
  background: transparent;
}

.work-fragment-field {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  transform-style: preserve-3d;
}

.work-fragment {
  position: absolute;
  top: 0;
  left: 0;
  width: 170px;
  height: 114px;
  overflow: visible;
  transform-origin: center;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

.work-fragment-float {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(250, 248, 242, 0.06);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.16);
  will-change: transform;
}

.work-fragment img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-hero-center {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  transform: translateY(-4.5vh);
}

.work-logo-assembly {
  position: relative;
  width: clamp(188px, 16.2vw, 230px);
  aspect-ratio: 320 / 247;
  margin: 0 0 clamp(22px, 2.5vh, 30px);
  transform-origin: center;
  will-change: transform;
}

.work-logo-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.work-logo-outline path {
  fill: none;
  stroke: rgba(250, 248, 242, 0.18);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.work-logo-outline { will-change: opacity; }

.work-logo-solid {
  fill: #faf8f2;
  opacity: 0;
  will-change: opacity;
}

.work-logo-band {
  fill: #faf8f2;
  transform: scaleX(0);
  transform-box: fill-box;
  will-change: transform;
}

.work-logo-band:nth-child(odd) {
  transform-origin: left center;
}

.work-logo-band:nth-child(even) {
  transform-origin: right center;
}

.work-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(92vw, 760px);
}

.work-hero h1 {
  margin: 0 0 0.34em;
  font-family: 'PP Eiko', 'Satoshi', sans-serif;
  font-size: var(--hero-title-size, clamp(2.55rem, 4vw, 4rem));
  font-weight: 600;
  line-height: var(--hero-title-line-height, 1.08);
  letter-spacing: 0.006em;
  word-spacing: 0.045em;
  color: var(--work-ink);
}

.work-hero-intro {
  max-width: 46ch;
  margin: 0;
  font-size: clamp(0.94rem, 1.04vw, 1.05rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: rgba(250, 248, 242, 0.72);
}

.work-scroll-cue {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: clamp(28px, 5.5vh, 54px);
  width: 20px;
  height: 20px;
  border: 1px solid rgba(250, 248, 242, 0.42);
  border-radius: 50%;
  transform: translateX(-50%);
  opacity: 0.55;
  will-change: opacity;
}

.work-scroll-cue::before,
.work-scroll-cue::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  color: rgba(250, 248, 242, 0.72);
  transform: translateX(-50%) rotate(45deg);
}

.work-scroll-cue::before { top: 4px; }
.work-scroll-cue::after { top: 8px; }
.work-scroll-cue > span,
.work-scroll-cue > i { display: none; }

.work-projects {
  position: relative;
  z-index: 3;
  padding: clamp(360px, 46vh, 540px) 0 clamp(160px, 13vw, 250px);
  background: transparent;
  isolation: isolate;
}

.work-flow {
  position: absolute;
  z-index: 0;
  top: -100vh;
  top: -100svh;
  right: 0;
  left: 0;
  height: calc(100% + 100vh);
  height: calc(100% + 100svh);
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.work-flow-float {
  animation: workFlowDrift 6.5s ease-in-out infinite alternate;
}

.work-flow-line {
  fill: none;
  stroke: rgba(250, 248, 242, 0.19);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  will-change: stroke-dashoffset;
}

.work-flow-line--2 { stroke: rgba(250, 248, 242, 0.14); }
.work-flow-line--3 { stroke: rgba(250, 248, 242, 0.17); }

.work-flow-dot {
  fill: rgba(250, 248, 242, 0.72);
  opacity: 0;
}

@keyframes workFlowDrift {
  0% { transform: translate3d(-2px, -3px, 0); }
  48% { transform: translate3d(2px, 2px, 0); }
  100% { transform: translate3d(-1px, 4px, 0); }
}

/* Exact desktop rhythm: 4% side inset, one project per row, five-vw gap. */
.work-project-list {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 5vw, 82px);
  width: 100%;
}

.work-project-item {
  position: relative;
  display: block;
  color: inherit;
  outline: none;
  opacity: 0;
  will-change: opacity;
}

.work-page .project-card.work-project-item {
  flex: none !important;
  opacity: var(--work-project-opacity, 0) !important;
  transform: none !important;
  transition: none !important;
  will-change: opacity !important;
}

.work-project-item.is-visible {
  opacity: 1;
}

.work-project-item--1,
.work-project-item--3 { width: 41%; margin-left: 4%; margin-right: auto; }
.work-project-item--2 { width: 36%; margin-left: auto; margin-right: 4%; }
.work-project-item--4,
.work-project-item--7 { width: 46%; margin-inline: auto; }
.work-project-item--5 { width: 41%; margin-left: auto; margin-right: 4%; }
.work-project-item--6 { width: 36%; margin-left: 4%; margin-right: auto; }
.work-project-item--8 { width: 29%; margin-left: auto; margin-right: 4%; }

.work-project-figure {
  position: relative;
  width: 100%;
  aspect-ratio: 36 / 25;
  margin: 0 0 24px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  outline: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
  transform: translateZ(0);
}

.work-project-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
  background: transparent;
  transform: none;
  filter: none;
}

#shared-card-wave-canvas {
  position: fixed;
  z-index: 3;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background: transparent;
}

.work-project-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-project-name {
  width: 58.333%;
  margin: 0;
  font-family: 'PP Eiko', 'Satoshi', sans-serif;
  font-size: clamp(1.72rem, 2.05vw, 2.65rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.work-project-meta {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(155px, 5fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: end;
}

.work-project-text {
  max-width: 32ch;
  margin: 0;
  font-size: clamp(0.9rem, 0.96vw, 1.02rem);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--work-muted);
}

.work-project-link {
  justify-self: end;
  align-self: end;
  color: #fff !important;
}

.work-page .work-project-link,
.work-page .work-project-link .char,
.work-page .work-project-link .button-arrow,
.work-page .work-contact-cta .project-link,
.work-page .work-contact-cta .button-blur-text,
.work-page .work-contact-cta .button-arrow {
  color: #fff !important;
}

.work-page .work-project-link::after,
.work-page .work-contact-cta .project-link::after {
  background: #fff !important;
  opacity: 1 !important;
}

.work-contact-cta {
  display: flex;
  justify-content: center;
  width: min(92%, 560px);
  margin: 0 auto;
}

.work-contact-cta .project-link { color: #fff !important; }

.work-contact-end {
  position: relative;
  z-index: 2;
  width: min(92%, 1120px);
  margin: clamp(180px, 16vw, 300px) auto 0;
  text-align: center;
}

.work-contact-note {
  max-width: 52ch;
  margin: clamp(54px, 5vw, 82px) auto 0;
  font-family: 'Satoshi', sans-serif;
  font-size: clamp(1.1rem, 1.55vw, 1.65rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: rgba(250, 248, 242, 0.82);
}

.work-page .site-footer { z-index: 4; }

@media (max-width: 980px) {
  .work-logo-assembly { width: clamp(178px, 24vw, 220px); }
  .work-project-item--1,
  .work-project-item--3,
  .work-project-item--5 { width: 58%; }
  .work-project-item--2,
  .work-project-item--6 { width: 52%; }
  .work-project-item--4,
  .work-project-item--7 { width: 64%; }
  .work-project-item--8 { width: 44%; }
  .work-project-meta { grid-template-columns: 1fr; gap: 18px; }
  .work-project-link { justify-self: start; }
}

@media (max-width: 700px) {
  .work-fragment { width: 112px; height: 75px; }
  .work-hero-center { transform: translateY(0); }
  .work-logo-assembly { width: min(42vw, 188px); margin-bottom: 24px; }
  .work-hero-copy { width: min(88vw, 540px); }
  .work-hero h1 { margin-bottom: 0.42em; }
  .work-hero-intro { max-width: 31ch; font-size: 0.94rem; }
  .work-projects { padding-top: 34vh; }
  .work-project-list { gap: 96px; }
  .work-project-item,
  .work-project-item--1,
  .work-project-item--2,
  .work-project-item--3,
  .work-project-item--4,
  .work-project-item--5,
  .work-project-item--6,
  .work-project-item--7,
  .work-project-item--8 {
    width: 92%;
    margin-inline: auto;
  }
  .work-project-item:nth-child(even) { width: 82%; margin-right: 4%; }
  .work-project-figure { margin-bottom: 20px; }
  .work-project-name { width: 100%; }
  .work-project-meta { display: block; }
  .work-project-link { margin-top: 22px; }
  .work-contact-end { margin-top: 140px; }
  .work-contact-note { max-width: 31ch; font-size: clamp(1.05rem, 4.8vw, 1.35rem); }
}

@media (prefers-reduced-motion: reduce) {
  .work-fragment-field,
  .work-scroll-cue { display: none; }
  .work-logo-band { transform: scaleX(1) !important; }
  .work-logo-bands { opacity: 0 !important; visibility: hidden !important; }
  .work-logo-solid { opacity: 1 !important; }
  .work-flow-float { animation: none; }
  .work-project-item {
    --work-project-opacity: 1;
  }
  #shared-card-wave-canvas { display: none; }
  .work-project-image { visibility: visible !important; }
}
