/* ========================================================================
   04 — WAYS TO WORK TOGETHER
   ======================================================================== */

.section-work-together {
  position: relative;
  background: var(--color-black);
  padding-block: var(--space-6);
}

.work-bg {
  position: absolute;
  inset: 0;
}
.work-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.05);
  opacity: 0.9;
}

.work-card {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin-inline: auto;
  background: var(--color-offwhite);
  border-radius: var(--radius-card);
  padding: clamp(2rem, 3.4vw, 4rem);
}

.work-card__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-3);
}

.work-card__eyebrow {
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.work-card__name {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-display-lg);
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: var(--space-3);
}

.work-card__portrait {
  width: clamp(100px, 13vw, 165px);
  aspect-ratio: 3 / 4;
  border-radius: calc(var(--radius-card) * 0.55);
  overflow: hidden;
  flex-shrink: 0;
}
.work-card__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(100%) contrast(1.05);
}

.work-card__divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-3);
}

.work-card__bottom {
  display: grid;
  /* minmax(0, 1fr): the two service columns must never let a transient
     child (the pill-expand hover panel) grow their track past the
     available width and squeeze the credentials column into wrapping.
     A slightly tighter gap (vs. --space-4) hands the freed width to
     Strategic Consulting/Brand Partnership and shifts the credentials
     column's divider a bit further right, so the block reads less
     center-squeezed. */
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) auto;
  gap: var(--space-3);
}

.work-service {
  display: flex;
  flex-direction: column;
}

.work-service__head {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.6em;
  margin-bottom: 0.5em;
}

.work-service__title {
  color: var(--color-black);
  font-weight: 700;
  font-size: var(--fs-body);
  letter-spacing: var(--ls-normal);
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-editorial);
}

a.work-service__title:hover {
  color: var(--color-accent);
}

.work-service__timing {
  display: inline-block;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  background: var(--color-accent);
  color: var(--color-black);
  padding: 0.35em 0.6em;
  border-radius: var(--radius-btn);
  transition: transform var(--dur-fast) var(--ease-editorial);
}
.work-service__timing:hover {
  transform: scale(1.06);
}

.work-service__text {
  font-size: var(--fs-small);
  line-height: 1.3;
  opacity: 0.85;
  margin-bottom: 0.6em;
}

.work-service__section-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-body);
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  color: var(--color-black);
  margin-bottom: 0.5em;
}

.work-service__pills {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5em;
  margin-top: 0.2em;
}

.work-service__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-top: 0.2em;
}

.work-service__pill {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-normal);
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--color-black);
  color: var(--color-white);
  padding: 0.3em 0.55em;
  border: none;
  border-radius: var(--radius-btn);
  transition: background var(--dur-fast) var(--ease-editorial), color var(--dur-fast) var(--ease-editorial);
}

.work-service__request .work-service__pill {
  cursor: pointer;
  /* Bigger, more legible label text on a more compact plaque than the
     shared base size/padding above (Cooperation Strategy's step pills
     keep those untouched). */
  font-size: 0.78rem;
  padding: 0.24em 0.45em;
}

/* ---- "Possible requests" pills: hover/tap reveals the real underlying
   ask in a panel that slides out to the right. The panel is taken out of
   flow (absolute, anchored to the pill) so a collapsed/hidden panel can
   never inflate its own row's height or interfere with any other pill —
   each request stays a compact, single-line label at rest, regardless of
   how long its hover text is. Opening one reserves a bit of extra space
   below it (margin-bottom) so the panel doesn't sit on top of the next
   pill in the vertical stack — a small, deliberate "structure moves a
   little" instead of an overlap. */
.work-service__request {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  transition: margin-bottom 380ms var(--ease-editorial);
}

.work-service__request:hover,
.work-service__request.is-open {
  margin-bottom: 3.4rem;
}

.work-service__request:hover .work-service__pill,
.work-service__request.is-open .work-service__pill,
.work-service__pill:focus-visible {
  background: var(--color-accent);
  color: var(--color-black);
}

.work-service__pill-expand {
  --panel-w: min(17rem, 78vw);
  --panel-gap: 0.6em;
  position: absolute;
  left: 100%;
  top: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  transition: width 380ms var(--ease-editorial);
}

.work-service__request:hover .work-service__pill-expand,
.work-service__request.is-open .work-service__pill-expand,
.work-service__pill:focus-visible + .work-service__pill-expand {
  width: calc(var(--panel-gap) + var(--panel-w));
  pointer-events: auto;
}

.work-service__pill-panel {
  width: var(--panel-w);
  margin-left: var(--panel-gap);
  padding: 0.45em 0.7em;
  background: var(--color-pale-grey-soft);
  color: var(--color-black);
  font-size: 0.83rem;
  line-height: 1.5;
  letter-spacing: var(--ls-normal);
  text-transform: none;
  border-radius: var(--radius-btn);
  opacity: 0;
  transition: opacity 220ms var(--ease-editorial);
}

.work-service__request:hover .work-service__pill-panel,
.work-service__request.is-open .work-service__pill-panel,
.work-service__pill:focus-visible + .work-service__pill-expand .work-service__pill-panel {
  opacity: 1;
  transition-delay: 100ms;
}

@media (prefers-reduced-motion: reduce) {
  .work-service__request,
  .work-service__pill-expand,
  .work-service__pill-panel { transition: none; }
}

.work-service__step {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  opacity: 0;
}

.work-service__steps.is-visible .work-service__step {
  animation: work-step-reveal 450ms var(--ease-editorial) forwards;
}

@keyframes work-step-reveal {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .work-service__step { opacity: 1; animation: none !important; }
}

.work-service__step-arrow {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  opacity: 0.45;
}

.work-credentials {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  padding-left: var(--space-4);
  border-left: 1px solid var(--color-border);
  font-size: clamp(0.82rem, 0.75rem + 0.3vw, 1.05rem);
  white-space: nowrap;
}

.work-credentials strong { font-weight: 700; }

.work-credentials p {
  transform-origin: left center;
  transition: transform var(--dur-fast) var(--ease-editorial);
}
.work-credentials p:hover {
  font-weight: 700;
  transform: scale(1.06);
}

.work-credentials p::before {
  content: "—";
  display: inline-block;
  margin-right: 0.5em;
  font-family: var(--font-mono);
  color: var(--color-accent);
}

@media (max-width: 900px) {
  .work-card__bottom { grid-template-columns: 1fr; gap: var(--space-4); }
  .work-credentials {
    border-left: none;
    padding-left: 0;
    white-space: normal;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-2);
  }
  /* On narrow screens the pill + gap + panel no longer fits the 17rem
     cap without running past the viewport edge — shrink the panel to
     whatever room is actually left after the card's own padding and the
     pill itself. */
  .work-service__pill-expand { --panel-w: calc(100vw - 16rem); }
  /* The long RU service titles ("СТРАТЕГИЧЕСКОЕ БРЕНД-ПАРТНЁРСТВО") don't
     fit next to their timing pill in one nowrap line at this width —
     let the head wrap instead of forcing the whole column wider than
     the viewport. */
  .work-service__head { flex-wrap: wrap; }
  .work-service__title { white-space: normal; }
}

/* ========================================================================
   LAPTOP / LOW-HEIGHT DESKTOP — see profile.css for the breakpoint's
   rationale. This block is already approved, so the touch is light
   (~8-10%): outer padding, the card's own padding, the name headline
   (--fs-display-lg is shared with direction-page.css, so overridden here
   directly) and the portrait. Everything else is untouched.
   ======================================================================== */
@media (min-width: 1100px) and (max-width: 1440px) and (max-height: 900px) {
  .section-work-together { padding-block: 4.9rem; }
  .work-card { padding: clamp(1.8rem, 3vw, 3.6rem); }
  .work-card__name { font-size: clamp(2.3rem, 1.5rem + 4.6vw, 6rem); }
  .work-card__portrait { width: clamp(90px, 11.5vw, 148px); }
}

/* Footer moved to css/base.css (base.css is the one stylesheet every
   page shares — work-together.css only loads on the home page, but the
   footer is now on all 5). */
