/* ==========================================================================
   Opening "Our work" showcase
   --acc / --acc-deep are set per project by js/showcase.js
   ========================================================================== */
.work {
  --acc: #5FE0C8;
  --acc-deep: #0BA88F;
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy-950);
  color: #C5D3E4;
}

.work__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.work__grid {
  position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(75% 75% at 65% 45%, #000, transparent);
}
.work__aurora {
  position: absolute; width: 70vmax; height: 70vmax; right: -18vmax; top: -24vmax; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc-deep) 60%, transparent), transparent 65%);
}
.work__ghost {
  position: absolute; left: 0; bottom: 92px; white-space: nowrap;
  font: 700 clamp(5rem, 13vw, 11rem)/1 var(--font-display); letter-spacing: -.03em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .07);
}

.work__stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
  padding-block: 112px 24px;
}

.work__kicker {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
  font: 600 .8125rem var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--acc);
}
.work__kicker::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.work__count { margin-left: auto; font-weight: 500; letter-spacing: .06em; color: #8EA3BC; }
.work__count b { color: #fff; font-weight: 700; }

.work-slide[hidden] { display: none; }
.work-slide__sector { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 500; color: #E3EBF5; }
.work-slide__sector em {
  padding: 2px 10px; border-radius: 999px; font-style: normal; font-size: .75rem; font-weight: 600;
  color: var(--acc); border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent);
}
.work-slide__title { color: #fff; font-size: clamp(2.5rem, 5.2vw, 4.5rem); line-height: 1.04; letter-spacing: -.03em; }
.work-slide__summary { margin-top: 18px; max-width: 34em; font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); }
.work-slide__built { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; }
.work-slide__built li { display: flex; align-items: center; gap: 10px; color: #E3EBF5; }
.work-slide__built li::before { content: ""; width: 8px; height: 8px; flex: none; transform: rotate(45deg); border-radius: 2px; background: var(--acc); }
.work-slide__tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 22px 0 0; }
.work-slide__tags li { padding: 5px 12px; border-radius: 999px; font-size: .8125rem; font-weight: 500; color: #E3EBF5; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); }

.work__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.work__cta .btn--primary { background: var(--acc); color: var(--navy-950); box-shadow: none; }
.work__cta .btn--primary:hover { background: #fff; box-shadow: none; }
.work__cta .btn--ghost { color: #fff; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .22); }
.work__cta .btn--ghost:hover { color: #fff; border-color: var(--acc); }

/* Project visual */
.work__visual { position: relative; perspective: 1400px; min-width: 0; }
.work__window {
  position: relative; border-radius: 16px; overflow: hidden; background: #0B2036;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .8), 0 0 90px -30px var(--acc-deep);
}
.work__chrome { display: flex; align-items: center; gap: 6px; padding: 11px 14px; background: rgba(255, 255, 255, .05); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.work__chrome i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.work__chrome i:first-child { background: var(--acc); }
.work__screen { aspect-ratio: 640 / 420; }

/* Rail */
.work__rail { position: relative; z-index: 2; padding-bottom: 22px; }
.work__rail-inner { display: flex; align-items: center; gap: 12px; }
.work__rail-list { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.work-tab {
  width: 100%; min-height: 56px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center;
  padding: 8px 0 0; border: 0; background: none; text-align: left; color: #8EA3BC; cursor: pointer;
  transition: color .2s;
}
.work-tab:hover, .work-tab.is-active { color: #fff; }
.work-tab__num { font: 600 .75rem var(--font-display); }
.work-tab.is-active .work-tab__num { color: var(--acc); }
.work-tab__name { font-size: .875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-tab__bar { grid-column: 1 / -1; height: 2px; margin-top: 8px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .14); }
.work-tab__bar i { display: block; height: 100%; background: var(--acc); transform: scaleX(0); transform-origin: left; }
.work-tab.is-active .work-tab__bar i { transform: scaleX(1); }

@media (max-width: 1024px) {
  .work__stage { grid-template-columns: 1fr; gap: 36px; }
}

/* ==========================================================================
   Animated project screens (js/showcase-art.js)
   ========================================================================== */
.art { display: block; width: 100%; height: 100%; font-family: var(--font-body); }
.a-head { font: 700 20px var(--font-display); fill: #fff; }
.a-text { font-size: 14px; font-weight: 500; fill: #E3EBF5; }
.a-small { font-size: 13px; fill: #9FB2C8; }
.a-num { font: 700 18px var(--font-display); fill: #fff; }
.a-num--lg { font-size: 26px; }
.a-side { fill: rgba(255, 255, 255, .04); }
.a-panel { fill: rgba(255, 255, 255, .05); stroke: rgba(255, 255, 255, .08); }
.a-dot { fill: rgba(255, 255, 255, .12); }
.a-fill { fill: var(--acc); }
.a-fillsoft { fill: color-mix(in srgb, var(--acc) 22%, transparent); }
.a-line { fill: rgba(255, 255, 255, .13); }
.a-linehi { fill: rgba(255, 255, 255, .34); }
.a-bar { fill: var(--acc); }
.a-track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 9; }
.a-ring { fill: none; stroke: var(--acc); stroke-width: 9; stroke-linecap: round; stroke-dasharray: var(--c); animation: a-ring 1.3s var(--ease) both; animation-delay: calc(var(--i) * 90ms); }
.a-node { fill: #12304D; stroke: var(--acc); stroke-width: 2; }
.a-halo { fill: none; stroke: var(--acc); opacity: .35; transform-box: fill-box; transform-origin: center; animation: a-halo 2.6s ease-out infinite; animation-delay: calc(var(--i) * 300ms); }
.a-flow { fill: none; stroke: var(--acc); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 16; animation: a-flow 1s linear infinite; }
.a-flow--slow { animation-duration: 1.6s; }
.a-pick { fill: color-mix(in srgb, var(--acc) 90%, transparent); }
.a-pickt { font-size: 14px; font-weight: 700; fill: var(--navy-950); }
.a-glyph { fill: var(--navy-950); }
.a-pulse { transform-box: fill-box; transform-origin: center; animation: a-pulse 1.6s ease-in-out infinite; }
.a-gridline { stroke: rgba(255, 255, 255, .08); stroke-dasharray: 3 5; }
.a-area { fill: color-mix(in srgb, var(--acc) 16%, transparent); animation: a-fade .8s .9s both; }
.a-draw { fill: none; stroke: var(--acc); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; animation: a-draw 1.5s .3s var(--ease) both; }
.a-alert { fill: var(--navy-950); stroke: var(--acc); }
.a-alertt { font-size: 13px; font-weight: 600; fill: var(--acc); }
.a-sheet { fill: #F4F7FA; }
.a-doc { font-size: 14px; fill: #334155; }
.a-dochead { font: 700 22px var(--font-display); fill: var(--navy-900); }
.a-docline { stroke: #DCE5EE; }
.a-stamp { transform-box: fill-box; transform-origin: center; animation: a-stamp .5s 1.3s var(--ease-spring) both; }
.a-stampbox { fill: rgba(255, 255, 255, .92); stroke: var(--acc-deep); stroke-width: 2.5; }
.a-stampt { font: 700 16px var(--font-display); letter-spacing: .12em; fill: var(--acc-deep); }

.a-pop, .a-slide, .a-grow, .a-rise { transform-box: fill-box; animation-duration: .6s; animation-timing-function: var(--ease); animation-fill-mode: both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
.a-pop { transform-origin: center; animation-name: a-pop; }
.a-slide { animation-name: a-slide; }
.a-grow { transform-origin: left; animation-name: a-grow; }
.a-rise { transform-origin: bottom; animation-name: a-rise; }

@keyframes a-pop { from { opacity: 0; transform: scale(.82); } }
@keyframes a-slide { from { opacity: 0; transform: translateX(-16px); } }
@keyframes a-grow { from { transform: scaleX(0); } }
@keyframes a-rise { from { transform: scaleY(0); } }
@keyframes a-fade { from { opacity: 0; } }
@keyframes a-ring { from { stroke-dashoffset: var(--c); } to { stroke-dashoffset: var(--to); } }
@keyframes a-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes a-flow { to { stroke-dashoffset: -18; } }
@keyframes a-halo { from { opacity: .45; transform: scale(.72); } to { opacity: 0; transform: scale(1.2); } }
@keyframes a-pulse { 50% { transform: scale(1.14); } }
@keyframes a-stamp { from { opacity: 0; transform: scale(2); } }

/* ==========================================================================
   Motion: wipe, letters, 3D window, auto-play
   ========================================================================== */
.js .work:not(.is-ready) .work__stage,
.js .work:not(.is-ready) .work__rail { opacity: 0; }

/* colour bands that sweep between projects */
.work__wipe { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.work__wipe i { position: absolute; top: -10%; bottom: -10%; left: -30%; width: 160%; transform: translateX(-120%) skewX(-16deg); }
.work__wipe i:nth-child(1) { background: var(--next-deep); }
.work__wipe i:nth-child(2) { background: var(--next); }
.work__wipe i:nth-child(3) { background: var(--navy-900); }
.work__wipe.is-on i { animation: work-wipe 1s cubic-bezier(.7, 0, .25, 1) both; }
.work__wipe.is-on i:nth-child(2) { animation-delay: .05s; }
.work__wipe.is-on i:nth-child(3) { animation-delay: .1s; }
@keyframes work-wipe { to { transform: translateX(120%) skewX(-16deg); } }

/* letters and copy */
.work-slide__title .w { display: inline-block; white-space: nowrap; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.work-slide__title .ch { display: inline-block; }
.work.is-ready .work-slide__title .ch { animation: work-char .7s var(--ease) both; animation-delay: calc(var(--c) * 18ms + 120ms); }
.work.is-ready .work-slide > :not(.work-slide__title),
.work.is-ready .work__cta { animation: work-up .7s var(--ease) both; }
.work.is-ready .work-slide__sector { animation-delay: .1s; }
.work.is-ready .work-slide__summary { animation-delay: .45s; }
.work.is-ready .work-slide__built { animation-delay: .55s; }
.work.is-ready .work-slide__tags { animation-delay: .65s; }
.work.is-ready .work__cta { animation-delay: .75s; }
@keyframes work-char { from { transform: translateY(110%) rotate(8deg); } }
@keyframes work-up { from { opacity: 0; transform: translateY(20px); } }

/* 3D window, card deck and floating labels */
.work__tilt { --rx: 3deg; --ry: -8deg; position: relative; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s var(--ease); }
.work.is-ready .work__window.is-enter { animation: work-fly .95s var(--ease) both; }
@keyframes work-fly { from { opacity: 0; transform: translateX(90px) translateZ(-160px) rotateY(24deg) scale(.92); } }
.work__deck { position: absolute; inset: 0; border-radius: 16px; pointer-events: none; transform-origin: 50% 100%; }
.work__deck--1 { background: color-mix(in srgb, var(--acc-deep) 55%, transparent); transform: translate3d(22px, -18px, -50px) rotate(2.5deg); }
.work__deck--2 { background: color-mix(in srgb, var(--acc) 22%, transparent); transform: translate3d(44px, -36px, -100px) rotate(5deg); }
.work__float {
  position: absolute; padding: 9px 14px; border-radius: 12px; white-space: nowrap;
  font: 600 .875rem var(--font-display); color: var(--navy-950); background: var(--acc);
  box-shadow: 0 18px 36px -14px rgba(0, 0, 0, .7);
  transform: translateZ(60px); animation: work-bob 5s ease-in-out infinite;
}
.work__float--1 { left: -40px; top: 36%; }
.work__float--2 { right: -14px; bottom: 16%; background: #fff; animation-delay: -2.5s; }
@keyframes work-bob { 50% { transform: translateZ(60px) translateY(-12px); } }

/* moving background */
.work__spot { position: absolute; inset: 0; background: radial-gradient(420px circle at var(--mx, 70%) var(--my, 40%), color-mix(in srgb, var(--acc) 14%, transparent), transparent 70%); }
.work__aurora { animation: work-drift 14s ease-in-out infinite alternate; }
@keyframes work-drift { to { transform: translate(-16vmax, 12vmax) scale(1.2); } }
.work__ghost { animation: work-ghost 48s linear infinite; }
@keyframes work-ghost { to { transform: translateX(-33.333%); } }

/* auto-play progress: this animation ending moves to the next project */
.work.is-playing .work-tab.is-active .work-tab__bar i { animation: work-progress 3.57s linear both; } /* + .43s wipe = 4s per project */
.work.is-paused .work-tab.is-active .work-tab__bar i { animation-play-state: paused; }
@keyframes work-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* pause control: a bright, labelled button so visitors know they can stop to read */
.work__pause {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 1rem var(--font-display); color: var(--navy-950); background: var(--acc);
  box-shadow: 0 12px 30px -10px var(--acc-deep);
  transition: background-color .2s, transform .2s var(--ease);
}
.work__pause:hover { background: #fff; transform: translateY(-2px); }
.work__pause:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.work__pause::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 var(--acc);
}
.work.is-playing .work__pause:not(.is-held)::after { animation: work-beacon 2s ease-out infinite; }
@keyframes work-beacon { to { box-shadow: 0 0 0 16px transparent; } }

.work__pause-icon { position: relative; width: 16px; height: 18px; flex: none; }
.work__pause-icon::before, .work__pause-icon::after { content: ""; position: absolute; top: 0; width: 5px; height: 18px; border-radius: 1px; background: currentColor; }
.work__pause-icon::before { left: 0; }
.work__pause-icon::after { right: 0; }
.work__pause.is-held { background: #fff; }
.work__pause.is-held .work__pause-icon::after { display: none; }
.work__pause.is-held .work__pause-icon::before { left: 2px; width: 0; height: 0; background: none; border-radius: 0; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent currentColor; }

/* Real project photo in the window: the whole picture opens the project page */
.work__screen:has(.work__shot) { aspect-ratio: 16 / 9; }
.work__shot { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; }
.work__shot img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top left; transition: transform .6s var(--ease); }
.work.is-ready .work__shot img { animation: work-pan 6s ease-out both; }
@keyframes work-pan { from { transform: scale(1.07); } }
.work__shot:hover img { transform: scale(1.03); }
.work__view {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  font: 600 .875rem var(--font-display); color: var(--navy-950); background: #fff;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6);
}

/* ==========================================================================
   Tablets and phones
   ========================================================================== */
@media (max-width: 1024px) {
  .work__visual { max-width: 620px; width: 100%; justify-self: center; }
  .work__ghost { bottom: 110px; }
}

@media (max-width: 640px) {
  /* project picture first, then the words, all inside one swipeable screen */
  .work { min-height: 100svh; }
  .work__stage { gap: 22px; padding-block: calc(84px + env(safe-area-inset-top)) 12px; align-items: start; }
  .work__visual { order: -1; width: 92%; }
  .work__tilt { --rx: 2deg; --ry: -5deg; }
  .work__window { border-radius: 12px; }
  .work__chrome { padding: 7px 10px; }
  .work__chrome i { width: 7px; height: 7px; }
  .work__deck { border-radius: 12px; }
  .work__deck--1 { transform: translate3d(10px, -9px, -30px) rotate(2deg); }
  .work__deck--2 { transform: translate3d(20px, -18px, -60px) rotate(4deg); }
  .work__float { padding: 6px 10px; border-radius: 9px; font-size: .75rem; }
  .work__float--1 { left: -10px; top: 18%; }
  .work__float--2 { right: -8px; bottom: 12%; }
  .work__ghost { display: none; }
  .work__aurora { width: 110vmax; height: 110vmax; right: -60vmax; top: -50vmax; }

  .work__kicker { margin-bottom: 10px; }
  .work-slide__sector { margin-bottom: 8px; font-size: .9375rem; }
  .work-slide__title { font-size: clamp(1.9rem, 8.6vw, 2.5rem); }
  .work-slide__summary { margin-top: 10px; font-size: 1rem; line-height: 1.5; }
  .work-slide__built, .work-slide__tags { display: none; }
  .work__cta { margin-top: 16px; }
  .work__cta .btn { flex: 1; min-height: 50px; padding-inline: 10px; gap: 6px; font-size: .9375rem; white-space: nowrap; }

  /* rail: numbered progress segments, the current name shows in the title above */
  .work__rail { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .work__rail-list { gap: 6px; }
  .work-tab { min-height: 44px; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; padding: 0; }
  .work-tab__name { display: none; }
  .work-tab__num { text-align: center; }
  .work-tab__bar { margin-top: 0; }
  .work__rail-inner { gap: 10px; }
  .work__pause { min-height: 44px; padding: 0 14px 0 12px; gap: 8px; font-size: .8125rem; box-shadow: none; }
  .work__pause-icon { width: 12px; height: 14px; }
  .work__pause-icon::before, .work__pause-icon::after { width: 4px; height: 14px; }
  .work.is-playing .work__pause:not(.is-held)::after { animation: none; }
  .work__pause.is-held .work__pause-icon::before { border-width: 7px 0 7px 11px; }
}

/* short phones: drop the summary before anything gets cut off */
@media (max-width: 640px) and (max-height: 700px) {
  .work-slide__summary { display: none; }
  .work__visual { width: 72%; }
}

/* landscape phones: side by side, no forced full height */
@media (max-height: 520px) and (orientation: landscape) {
  .work { min-height: auto; }
  .work__stage { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 24px; padding-top: 84px; }
  .work__visual { order: 0; }
  .work-slide__built, .work-slide__tags { display: none; }
  .work-slide__title { font-size: 2rem; }
}
