/* Cards: the design system's service-card, the three modes, the client dock and the press
   strip. The expertise rail lives in rail.css. */

/* Service card (design system §4), as a sheet of paper resting on the page (paper.css): its
   shadow is its edge; on hover it lifts 3px, the shadow deepens and a fern edge appears. */
.service-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid transparent;
  border-radius: var(--paper-radius);
  box-shadow: var(--paper-shadow-rest);
  transition: border-color var(--duration-hover) ease, transform var(--duration-hover) ease, box-shadow var(--duration-hover) ease;
}

.service-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--paper-shadow-lift);
  transform: translateY(-3px);
}

/* ─── Modes ─── */

.modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.mode {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-6);
}

.facet-icon {
  width: 34px;
  height: 34px;
  margin-bottom: var(--space-4);
  fill: var(--color-primary);
}

.mode__index {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--color-text-secondary);
}

.mode__name {
  font-size: var(--text-xl);
  line-height: 1.15;
}

.mode__promise {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-style: italic;
  line-height: 1.35;
  color: var(--color-primary);
}

.mode__body {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

@media (max-width: 1023px) {
  .modes {
    grid-template-columns: 1fr;
  }
}

/* ─── Client dock: nine logos on light tiles, magnified by proximity (DockMagnifier) ───
   No headroom is reserved above the row: the tiles sit right under the copy, and a magnified
   tile and its label rise over the copy above while hovered, like a tooltip. */

.dock-wrap {
  position: relative;
  z-index: 3;
  margin-top: var(--space-7);
}

.dock {
  --dock-gap: var(--space-3);
  --dock-size: clamp(4.5rem, calc((100vw - 2 * var(--gutter) - 8 * var(--dock-gap)) / 9), 7.25rem);
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--dock-gap);
}

.dock__item {
  position: relative;
  flex: none;
  width: var(--dock-size);
}

.dock__target {
  display: block;
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
}

.dock__tile {
  display: grid;
  place-items: center;
  width: 100%;
  height: var(--dock-size);
  padding: 14%;
  background: var(--paper-050);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transform-origin: 50% 100%;
}

.dock__tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dock__label {
  position: absolute;
  bottom: calc(100% + var(--space-3));
  left: 50%;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--ink-900);
  color: var(--paper-100);
  font-size: var(--text-sm);
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-1 * var(--lift, 0px)));
  transition: opacity var(--duration-hover) ease;
}

/* The end tiles' labels open inward, so a label never pokes past the edge of the window. */
.dock__item:first-child .dock__label {
  left: 0;
  transform: translate(0, calc(-1 * var(--lift, 0px)));
}

.dock__item:last-child .dock__label {
  right: 0;
  left: auto;
  transform: translate(0, calc(-1 * var(--lift, 0px)));
}

.dock__name {
  font-weight: 600;
}

.dock__trade {
  font-size: var(--text-xs);
  color: var(--mist-500);
}

.dock__item[data-active] .dock__label {
  opacity: 1;
}

.dock__target:focus-visible {
  outline: none;
}

.dock__target:focus-visible .dock__tile {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
}

/* ─── Press ─── */

/* The press: clippings on the page. Each mention is its own sheet (paper.css); the two articles
   are cut out with their headline, set in the display face like the page's own headings, and
   their corner folded back. Mastheads are printed in ink, as on newsprint, and take their own
   colours back when a clipping is picked up (hover, focus). */
.press {
  margin-top: var(--space-8);
}

.press__title {
  margin-bottom: var(--space-4);
}

.press__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  /* Room for the sheets' resting shadows inside the scroll box. */
  padding: var(--space-1) var(--space-1) var(--space-5);
  margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-1)) calc(-1 * var(--space-5));
}

.press__viewport:focus-visible {
  outline-offset: calc(-1 * var(--focus-width));
}

.press__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15rem, 1fr);
  gap: var(--space-4);
}

.press-item {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-6);
  scroll-snap-align: start;
}

.press-item img {
  width: auto;
  max-width: 100%;
  height: 2rem;
  object-fit: contain;
  object-position: left center;
  /* Ink: colour drops out and the contrast is pushed so coloured blocks print dark and the
     logos' white stays paper (multiplied onto the sheet). */
  filter: grayscale(1) contrast(1.8);
  mix-blend-mode: multiply;
  opacity: 0.88;
  transition: filter var(--duration-base) ease, opacity var(--duration-base) ease;
}

.press-item:hover img,
.press-item:focus-within img {
  filter: none;
  opacity: 1;
}

/* An article: masthead over a rule, then the headline as the clipping's own text. */
.press-item--article img {
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-2);
  height: calc(2rem + var(--space-3));
  box-sizing: border-box;
  border-bottom: 1px solid var(--color-border);
  width: 100%;
}

.press-item--article .press-item__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1.25;
  text-wrap: balance;
}

.press-item__meta {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.press-item--article .text-link {
  justify-self: start;
  margin-top: var(--space-2);
}

/* A mention: the masthead alone, its name below in the label voice. */
.press-item--mention {
  align-content: center;
  justify-items: start;
}

.press-item--mention .press-item__title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* Wide screens: the two articles side by side, the two mentions stacked beside them. */
@media (min-width: 821px) {
  .press__track {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(13rem, 0.6fr);
  }

  .press-item--article {
    grid-row: span 2;
  }
}

@media (max-width: 820px) {
  .press__track {
    grid-auto-columns: min(17rem, 78vw);
  }
}
