/* Lab: how the work is shown. Loads after ../../styles.css and reads its tokens. */

:root { --slow: cubic-bezier(.16, .84, .3, 1); }

/* ---------- Browser frame, built in CSS ---------- */
.frame {
  position: relative;
  background: var(--black);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .09), 0 60px 110px -60px rgba(0, 0, 0, .95);
}
.frame-bar {
  height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; letter-spacing: .16em; text-transform: lowercase;
  color: rgba(255, 255, 255, .46);
  background: var(--black);
}
.on-gold .frame { box-shadow: 0 50px 90px -50px rgba(10, 10, 10, .55); }

/* ---------- Phone, built in CSS ---------- */
.phone {
  position: relative;
  padding: 7px;
  background: var(--black);
  border-radius: 34px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 50px 90px -40px rgba(0, 0, 0, .9);
}
.phone::after { /* the island */
  content: ""; position: absolute; z-index: 2;
  top: 15px; left: 50%; width: 30%; height: 18px; margin-left: -15%;
  background: var(--black); border-radius: 12px;
}
.phone > img, .phone .slides { border-radius: 27px; overflow: hidden; }

/* ---------- Slides: cross fade on desktop, swipe strip on phones ---------- */
.slides { position: relative; aspect-ratio: 16 / 10; }
.slides-phone { aspect-ratio: 780 / 1688; }
.slides > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.03);
  transition: opacity 1.4s var(--ease), transform 2.4s var(--slow);
}
.slides > img.is-on { opacity: 1; transform: none; }

.caps { position: relative; display: grid; }
.caps > span {
  grid-area: 1 / 1;
  opacity: 0; transform: translateY(8px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.caps > span.is-on { opacity: 1; transform: none; transition-delay: .25s; }

/* ---------- Title that rises line by line ---------- */
.lines .ln { display: block; overflow: hidden; padding: 0 .06em .14em 0; margin-bottom: -.1em; }
.lines .ln > * { display: block; transform: translateY(110%); transition: transform 1.6s var(--slow); }
.lines .ln:nth-child(2) > * { transition-delay: .14s; }
.lines.in .ln > *, .lines.reveal.in .ln > * { transform: none; }
.lines em { font-style: italic; color: var(--gold); }

/* =========================================================
   (a) Homepage Work feature
   ========================================================= */
.wf { padding-bottom: 0; }
.wf-plate { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 48px; }
.wf-plate .eyebrow { grid-column: 1 / -1; }
.wf-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 9vw, 136px); line-height: .98; letter-spacing: -.015em;
  white-space: nowrap;
}
.wf-title .ln:nth-child(2) { padding-left: .9em; }
.wf-plate-meta { color: var(--fg-soft); font-size: 14px; text-align: right; padding-bottom: .9em; }
.wf-plate-meta b { display: block; font-weight: 500; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--label); }

.wf-stage { position: relative; height: 300vh; }
.wf-sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: flex; align-items: center;
  padding-top: 70px;
}
.wf-grid {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr);
  gap: clamp(40px, 6vw, 96px); align-items: center;
}
.wf-copy p { color: var(--fg-soft); }
.wf-caps {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(20px, 1.9vw, 26px); line-height: 1.3;
  color: var(--gold-light) !important;
  min-height: 4em; margin: 16px 0 22px;
}
.wf-media { position: relative; }
.wf-frame {
  transform-origin: 60% 50%;
  transform: scale(calc(.9 + .1 * var(--p, 1)));
}
.wf-phone {
  position: absolute; left: -9%; bottom: -12%;
  width: 22%;
  transform: translateY(calc((1 - var(--p, 1)) * 90px));
  pointer-events: none;
}
.wf-hit { position: absolute; inset: 0; z-index: 3; }
.wf-hint { display: none; }

/* =========================================================
   (b) Case study
   ========================================================= */
.cx-hero { padding: clamp(120px, 12vw, 170px) 0 0; background: var(--black); }
.cx-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 11.4vw, 172px); line-height: .96; letter-spacing: -.02em;
  white-space: nowrap;
  margin: 14px 0 clamp(32px, 4vw, 52px);
}
.cx-title .ln:nth-child(2) { text-align: right; }
.cx-hero .cs-facts { border-top: 0; padding-top: 0; }

.cx-wide { width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 var(--gutter); }
.cx-opening { padding: clamp(56px, 8vw, 110px) 0 clamp(80px, 10vw, 140px); background: var(--black); }
.cx-opening .frame {
  transform-origin: 50% 0;
  transform: scale(calc(.84 + .16 * var(--p, 1)));
}
.cx-cap { margin-top: 18px; font-size: 13px; color: var(--fg-soft); max-width: 46em; }

/* A plate: one image edge to edge, settling as it arrives */
.cx-plate { margin: 0; background: var(--black); }
.cx-plate-img { overflow: hidden; }
.cx-plate-img img {
  width: 100%;
  transform: scale(calc(1.12 - .12 * var(--p, 1)));
  transform-origin: 50% 40%;
}
.cx-plate figcaption { padding-top: 18px; padding-bottom: clamp(56px, 8vw, 100px); font-size: 13px; color: var(--fg-soft); }

.cx-single { padding: clamp(64px, 9vw, 120px) 0; }

/* Story: the text moves, the screen holds and changes */
.cx-story {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(32px, 6vw, 96px); align-items: start;
}
.cx-story-media { position: sticky; top: 18vh; }
.cx-story-media .caps { margin-top: 16px; font-size: 13px; color: var(--fg-soft); }
.cx-beat + .cx-beat { margin-top: 18vh; }
.cx-beat:last-child { padding-bottom: 10vh; }
.cx-story .cs-lead { margin-top: 18px; }

/* Hold: the text holds, the screens pass by */
.cx-hold {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr);
  gap: clamp(32px, 6vw, 96px); align-items: start;
}
.cx-hold-text { position: sticky; top: 22vh; }
.cx-hold-text .cs-lead { margin-top: 18px; }
.cx-hold-text p:not(.cs-lead):not(.eyebrow) { color: var(--fg-soft); }
.cx-hold-media { display: grid; gap: 16vh; }
.cx-hold-media figure { margin: 0; }
.cx-hold-media figcaption { margin-top: 14px; font-size: 13px; color: var(--fg-soft); }

/* The phone moment */
.cx-phones-head { text-align: center; max-width: 40em; margin: 0 auto; }
.cx-phones-head .cs-lead { margin: 18px 0 18px; font-size: clamp(28px, 3.4vw, 46px); }
.cx-phones-head p:last-child { color: var(--fg-soft); }
.cx-phones {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
  max-width: 1040px; margin: clamp(64px, 9vw, 120px) auto 0;
  align-items: start;
}
.cx-phones li { transform: translateY(calc((1 - var(--p, 1)) * var(--d, 0px))); }
.cx-phones li:nth-child(1) { --d: 140px; margin-top: 12%; }
.cx-phones li:nth-child(2) { --d: 60px; }
.cx-phones li:nth-child(3) { --d: 200px; margin-top: 24%; }
.cx-phones .eyebrow { margin-top: 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .slides > img, .caps > span, .lines .ln > * { transition: none; transform: none; }
  .wf-frame, .wf-phone, .cx-opening .frame, .cx-plate-img img, .cx-phones li { transform: none; }
}

/* ---------- Tablet and phone ---------- */
@media (max-width: 900px) {
  .wf-plate { grid-template-columns: 1fr; }
  .wf-plate-meta { text-align: left; padding-bottom: 0; }
  .wf-stage { height: auto; }
  .wf-sticky { position: static; height: auto; display: block; padding: clamp(48px, 9vw, 72px) 0 clamp(88px, 13vw, 140px); }
  .wf-grid { grid-template-columns: 1fr; gap: 0; }
  .wf-media { order: -1; margin-bottom: 56px; }
  .wf-frame { transform: none; }
  .wf-phone { left: auto; right: 2%; bottom: -26%; width: 24%; transform: none; }
  .wf-hit { display: none; }
  .wf-hint {
    display: block; margin-top: 12px;
    font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--label);
  }
  .wf-caps { min-height: 0; margin-top: 0; }

  /* swipe strips: normal horizontal scrolling inside the frame */
  .strip-sm.slides {
    display: flex; aspect-ratio: auto;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .strip-sm.slides::-webkit-scrollbar { display: none; }
  .strip-sm.slides > img {
    position: static; flex: 0 0 100%; aspect-ratio: 16 / 10; height: auto;
    opacity: 1; transform: none; scroll-snap-align: start;
  }

  .cx-story, .cx-hold { grid-template-columns: 1fr; }
  .cx-story-media { position: static; order: 2; }
  .cx-beat + .cx-beat { margin-top: 28px; }
  .cx-beat:last-child { padding-bottom: 40px; }
  .cx-hold-text { position: static; margin-bottom: 48px; }
  .cx-hold-media { gap: 48px; }

  /* phones become a filmstrip you swipe */
  .cx-phones {
    display: flex; gap: 20px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 8px; scroll-padding: 0 var(--gutter);
    max-width: none;
  }
  .cx-phones::-webkit-scrollbar { display: none; }
  .cx-phones li { flex: 0 0 64%; max-width: 300px; margin-top: 0 !important; transform: none; scroll-snap-align: center; }
}
@media (max-width: 520px) {
  .wf-title .ln:nth-child(2) { padding-left: .5em; }
  .frame { border-radius: 7px; }
  .frame-bar { height: 26px; font-size: 9px; }
  .phone { padding: 5px; border-radius: 24px; }
  .phone::after { top: 10px; height: 12px; }
  .phone > img, .phone .slides { border-radius: 19px; }
  .cx-opening .frame { transform: scale(calc(.92 + .08 * var(--p, 1))); }
}

/* the three phones in one straight row, still (owner, 2026-11-07): same top and bottom, no scroll motion */
.cx-phones { align-items: start !important; }
.cx-phones li { transform: none !important; margin-top: 0 !important; }

/* a clear link to the client's live site, right under the facts */
.cx-hero .cx-visit { margin-top: clamp(28px, 4vw, 44px); }
@media (max-width: 760px) { .cx-hero .cx-visit { justify-content: center; } }
