/* ============ US window — scroll-driven panels ============ */

.win-us { background: var(--bg-light); }

.usw-scroll {
  position: absolute; inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.usw-scroll::-webkit-scrollbar { display: none; }

.usw-stage {
  position: sticky;
  top: 0;
  height: 100%;
  overflow: hidden;
}

.usw-track { height: 700%; }

/* ---------- generic panel ---------- */
.usw-panel {
  position: absolute; inset: 0;
  display: flex;
  align-items: stretch;
  gap: clamp(20px, 3.5vw, 56px);
  padding: clamp(24px, 5vh, 48px) clamp(24px, 4vw, 60px);
  background: var(--bg-light);
  will-change: transform;
}
.usw-panel.flip { flex-direction: row-reverse; }

/* keep panel content clear of the BACK button (top-left) so the photo
   sits just below it with a small gap (matches projects-page spacing) */
.win-us .usw-panel { padding-top: clamp(56px, 7vh, 70px); }

.usw-photo {
  flex: 0 0 42%;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  z-index: 3;
}
.usw-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.usw-copy {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

/* extend the copy mask flush to the photo edge so names emerge from behind the photo */
#panel-us .usw-copy, #panel-adam .usw-copy {
  margin-left: calc(-1 * clamp(20px, 3.5vw, 56px));
  padding-left: clamp(20px, 3.5vw, 56px);
}
#panel-mitch .usw-copy {
  margin-right: calc(-1 * clamp(20px, 3.5vw, 56px));
  padding-right: clamp(20px, 3.5vw, 56px);
}

.usw-name {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-size: clamp(48px, 7.2vw, 128px);
  align-items: center;
  text-align: center;
  transform: translateX(-110%);
  transition: transform 1s var(--ease-win), color 0.8s ease;
  user-select: none;
}
.usw-panel.flip .usw-name { transform: translateX(110%); }
.nm-line { display: block; width: max-content; white-space: nowrap; }
#panel-us .usw-name {
  font-size: clamp(110px, 17vw, 300px);
}

.usw-panel.active .usw-name { transform: translateX(0); }
.usw-panel.ghost .usw-name { color: #FFFFFF; }

.usw-body {
  position: relative;
  z-index: 2;
  font-size: clamp(13.5px, 1.18vw, 17.5px);
  line-height: 1.72;
  font-weight: 500;
  color: var(--ink);
  max-width: 62ch;
  text-align: left;
  opacity: 0;
  /* fade in exactly in step with the name's colour flip (.usw-name color 0.8s) */
  transition: opacity 0.8s ease;
}
.usw-panel.ghost .usw-body { opacity: 1; }
.usw-body strong { font-weight: 800; }

/* between opens, the JS adds .us-reset for one frame to snap names + bodies
   back to their hidden start state without any visible fade (see us-window.js) */
.win-us.us-reset .usw-name,
.win-us.us-reset .usw-body { transition: none !important; }

/* ---------- US intro: long copy scrolls inside its own panel ----------
   This copy is far longer than the fixed panel height, so #panel-us lets its
   body scroll internally. us-window.js yields the wheel to this element until
   it reaches the bottom, then resumes the conveyor snap to the Mitch panel. */
#panel-us .usw-copy { align-items: stretch; }
#panel-us .usw-body {
  align-self: stretch;
  height: 100%;
  /* vertically centre the copy when it fits; fall back to top-aligned +
     scrollable (safe) when it's taller than the panel */
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(18,18,18,0.28) transparent;
  /* soft fade top & bottom so it reads as "more below" */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26px, #000 calc(100% - 34px), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 26px, #000 calc(100% - 34px), transparent 100%);
}
#panel-us .usw-body::-webkit-scrollbar { width: 8px; }
#panel-us .usw-body::-webkit-scrollbar-thumb {
  background: rgba(18,18,18,0.28); border-radius: 999px;
}
#panel-us .usw-body::-webkit-scrollbar-track { background: transparent; }

/* ---------- detail panel (OUR …) ---------- */
.usw-panel.detail {
  align-items: stretch;            /* dark column fills full panel height, top → bottom */
  gap: clamp(12px, 1.6vw, 26px);   /* tighter gap between the headings block and the text */
}

.detail-left {
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;  /* OUR + 4 headings = 5 rows evenly spread over the height */
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  user-select: none;
  background: #333333;
  margin: calc(-1 * clamp(56px, 7vh, 70px)) 0 calc(-1 * clamp(24px, 5vh, 48px)) calc(-1 * clamp(24px, 4vw, 60px));
  padding: clamp(56px, 7vh, 70px) clamp(30px, 3vw, 56px) clamp(24px, 5vh, 48px);
}
/* OUR pinned to top, white. Font sizes are set by fitText() in us-window.js;
   the clamps below are pre-JS fallbacks. */
.detail-our { font-size: clamp(40px, 5.6vw, 96px); color: #FFFFFF; }
.detail-word {
  font-size: clamp(30px, 4.2vw, 72px);
  color: #000000;                  /* default black; active heading flips to white */
  transition: color 0.5s ease;
}
.detail-word.on { color: #FFFFFF; }

.detail-right {
  flex: 0 0 clamp(420px, 45%, 720px);   /* dark headings block is the larger side (~53%) */
  position: relative;
  height: 100%;
  min-width: 0;
}

.detail-textwrap { position: absolute; inset: 0; }

/* right-side copy that flicks through in sync with the heading word */
.dtext {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #121212;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.dtext.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.dtext h3 {
  font-size: clamp(26px, 2.6vw, 40px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 0.6em;
  color: #121212;
}
.dtext p {
  font-size: clamp(13px, 1.05vw, 16px);
  line-height: 1.7;
  font-weight: 500;
  color: #121212;
}

/* ---------- media & awards panel ---------- */
.usw-panel.media {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(28px, 5vh, 56px);
}

.media-head {
  display: flex;
  align-items: center;
  gap: 0.22em;
  font-weight: 800;
  font-size: clamp(40px, 6.4vw, 92px);
  line-height: 1;
  user-select: none;
}
.media-word { color: var(--ink); will-change: transform; }
.media-amp { color: #FFFFFF; will-change: transform; }
.awards-chip {
  background: #121212;
  color: #FFFFFF;
  border-radius: 0.2em;
  padding: 0 0.34em;
  height: 1.24em;
  display: inline-flex;
  align-items: flex-start;
  overflow: hidden;
}
.awards-reel {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.awards-reel span { display: block; height: 1.24em; line-height: 1.24; }

.media-cols {
  display: grid;
  width: 100%;
  flex: 1;
  min-height: 0;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 7vw, 130px);            /* pronounced separation between Media & Awards */
  padding: 0 clamp(8px, 2vw, 44px);        /* breathing room around the grids */
  align-items: start;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.usw-panel.media.in .media-cols { opacity: 1; transition-delay: 0.15s; }

/* Media / Awards sections, each a grid of link-preview cards */
.ma-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: clamp(8px, 1.3vh, 14px);
}
.ma-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(18, 18, 18, 0.45);
}
.ma-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 1.6vw, 26px);
}

.ma-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  background: #FFFFFF;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s var(--ease-win), box-shadow 0.3s ease;
}
.ma-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18); }

.ma-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  background: #e9e7e6;
}
.ma-cap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 12px 10px;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 700;
  line-height: 1.2;
}
.ma-cap small { font-weight: 400; font-size: 0.82em; color: rgba(18, 18, 18, 0.55); }

.mbv-winner {
  width: clamp(130px, 55%, 200px);
  object-fit: contain;
  height: auto;
  margin: 2px 0;
}

/* ---------- mobile / tablet: keep the desktop conveyor + all its motion ----------
   The sliding panels, name reveals and OUR word-swap are preserved (the JS engine
   and its transforms run exactly as on desktop). We only adapt LAYOUT for the
   narrow screen: stack photo over copy, enlarge the photo, and let copy-heavy
   panels scroll internally and then chain on to the next section. */
@media (max-width: 760px) {
  .usw-panel {
    flex-direction: column;
    gap: 14px;
    padding: 56px 18px 20px;          /* top padding clears the BACK button (as desktop does) */
  }
  .usw-panel.flip { flex-direction: column; }
  .usw-photo { flex: 0 0 46%; }       /* taller portrait (was a cropped 30%) */
  .usw-copy { align-items: flex-start; }
  .usw-name { justify-content: flex-start; text-align: left; font-size: clamp(34px, 11vw, 64px); }
  #panel-us .usw-name { font-size: clamp(74px, 26vw, 132px); }

  /* the giant name reveals then the copy fades in (desktop motion kept); the copy
     scrolls within its panel and at the bottom chains on to the conveyor → next panel */
  .usw-body {
    font-size: 13.5px; line-height: 1.55;
    max-height: 100%; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: auto;
  }
  #panel-us .usw-body { overscroll-behavior: auto; padding-right: 6px; }

  .usw-panel.detail { flex-direction: column; align-items: stretch; }
  .detail-left {
    flex: 0 0 auto; flex-direction: column; justify-content: flex-start; gap: 6px;
    margin: -56px -18px 0 -18px; padding: 56px 18px 16px;
  }
  .detail-our { font-size: clamp(24px, 7vw, 38px); }
  .detail-word { font-size: clamp(22px, 6vw, 34px); }
  .detail-right { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .dtext { position: relative; }
  .dtext:not(.active) { display: none; }
  .dtext h3 { font-size: clamp(19px, 5.5vw, 28px); }
  .dtext p { font-size: 12.5px; line-height: 1.5; }

  /* media & awards panel scrolls internally so every award is reachable */
  .usw-panel.media { justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .media-head { flex-wrap: wrap; font-size: clamp(30px, 10vw, 52px); }
  .media-cols { grid-template-columns: 1fr; min-width: 0; }
  .ma-section { min-width: 0; }
  .ma-grid { grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
  .ma-card { min-width: 0; }
  .ma-cap { overflow-wrap: anywhere; }
}
