/* Home page sections, in page order. */

/* ---------- 0. hero ----------
   Desktop: the intro is carved out of the top-left of a large photo, with concave
   corners where the two meet, and a diagonal panel sits in the bottom-right corner.
   Below 1024px the photo comes first and the intro stacks under it. */
.hero {
  --hero-r: clamp(20px, 2.2vw, 36px);    /* corner radius of photo, intro and notch */
  --hero-gap: clamp(10px, 1vw, 14px);    /* white gutter along the diagonal */
  --hero-leg: clamp(200px, 27vw, 380px); /* how far the diagonal panel reaches along each edge */
  --hero-bleed: 40px;                    /* the panel's tips sit this far outside the photo, so the frame cuts them off straight */
  /* white space below as well, so the photo card does not run into the next section's background */
  padding-block: clamp(12px, 0.6rem + 0.8vw, 24px) clamp(28px, 1rem + 2vw, 48px);
}

.hero__frame {
  position: relative;
  height: clamp(560px, calc(100dvh - var(--topbar-h) - var(--header-h) - 40px), 780px);
}

/* photo + corner panel */
.hero__stage {
  position: absolute;
  inset: 0;
  border-radius: var(--hero-r);
  overflow: hidden;
  isolation: isolate;
}

/* three photos stacked; the active one fades in and drifts slowly towards full size */
.hero__photo {
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}

.hero__photo.is-active {
  opacity: 1;
}

.hero__photo img {
  transform: scale(1.07);
  transition: transform 7s linear;
}

.hero__photo.is-active img {
  transform: scale(1);
}

/* dash indicators and pause button. Desktop: light controls floating on the photo's
   bottom-left. Phones and tablets: a slim row under the photo (see the 1023px rules). */
.hero__controls {
  position: absolute;
  left: 22px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--c-on-deep);
  filter: drop-shadow(0 1px 3px rgba(28, 23, 21, 0.55));
}

.hero__dot {
  width: 30px;
  padding: 16px 3px;
}

.hero__dot span {
  position: relative;
  display: block;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}

.hero__dot span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c-on-deep);
  transform: scaleX(0);
  transform-origin: left;
}

.hero__dot.is-active span::after {
  transform: scaleX(1);
}

[data-hero-rotator].is-playing .hero__dot.is-active span::after {
  animation: hero-progress var(--hero-interval, 5500ms) linear both;
}

.hero__toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: 4px;
  border-radius: 50%;
  color: inherit;
  opacity: 0.85;
  transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.hero__toggle:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.14);
}

.hero__toggle .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.25;
}

.hero__toggle .icon--play,
.hero__toggle[aria-pressed="true"] .icon--pause {
  display: none;
}

.hero__toggle[aria-pressed="true"] .icon--play {
  display: block;
}

/* intro, carved out of the photo */
.hero__intro {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: min(48%, 620px);
  padding: clamp(8px, 1vw, 20px) clamp(24px, 3vw, 48px) clamp(24px, 2.6vw, 40px) 0;
  border-bottom-right-radius: var(--hero-r);
  background: var(--c-paper);
}

/* the two concave corners where the intro meets the photo */
.hero__intro::before,
.hero__intro::after {
  content: "";
  position: absolute;
  width: var(--hero-r);
  height: var(--hero-r);
  background: radial-gradient(circle at 100% 100%, transparent calc(var(--hero-r) - 0.5px), var(--c-paper) var(--hero-r));
}

.hero__intro::before {
  top: 0;
  left: 100%;
}

.hero__intro::after {
  top: 100%;
  left: 0;
}

.hero__intro > * {
  animation: hero-up 0.9s var(--ease) both;
}

.hero__intro > :nth-child(2) {
  animation-delay: 0.12s;
}

.hero__brandline {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.6vw, 26px);
}

.hero__title {
  font-size: clamp(2.25rem, 0.6rem + 3.1vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
}

.hero__mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: clamp(14px, 1.6vw, 26px);
  border-left: 2px solid var(--c-line);
  color: var(--c-accent);
  line-height: 1;
}

.hero__mark span {
  max-width: 7em;
  font-size: clamp(0.6875rem, 0.6rem + 0.25vw, 0.8125rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-transform: uppercase;
}

.hero__mark b {
  margin-block: 2px 4px;
  font-size: clamp(3rem, 1.6rem + 3.6vw, 5.25rem);
  font-weight: 500;
  line-height: 0.82;
}

.hero__row {
  display: grid;
  grid-template-columns: clamp(110px, 13vw, 184px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 1.6vw, 24px);
  margin-top: clamp(20px, 2.6vw, 40px);
}

.hero__thumb {
  border-radius: 16px;
  --ratio: 1 / 0.82;
}

.hero__text {
  max-width: 30em;
  color: var(--c-ink-2);
  font-size: clamp(0.9375rem, 0.85rem + 0.3vw, 1.0625rem);
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 20px;
  border: 1.5px solid var(--c-ink);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.hero__pill:hover {
  background: var(--c-ink);
  color: var(--c-paper);
}

.hero__pill--go {
  padding-right: 5px;
  border-color: var(--c-accent);
  background: var(--c-accent);
  color: var(--c-on-deep);
}

.hero__pill--go:hover {
  border-color: var(--c-accent-dark);
  background: var(--c-accent-dark);
}

.hero__arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-on-deep);
  color: var(--c-accent);
  transition: transform var(--dur) var(--ease);
}

.hero__arrow .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.25;
}

.hero__pill--go:hover .hero__arrow {
  transform: rotate(45deg);
}

/* diagonal panel: a white gutter triangle with the dark panel inside it.
   Both triangles are sharp and extend --hero-bleed past the photo's right and bottom
   edges, so the white gutter runs straight to both edges and the photo's own rounded
   corner shapes the panel's corner. */
.hero__corner {
  position: absolute;
  right: calc(var(--hero-bleed) * -1);
  bottom: calc(var(--hero-bleed) * -1);
  width: calc(var(--hero-leg) + var(--hero-gap) * 1.414 + var(--hero-bleed) * 2);
  aspect-ratio: 1;
  background: var(--c-paper);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  animation: hero-corner 1s 0.25s var(--ease) both;
}

.hero__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(var(--hero-leg) + var(--hero-bleed) * 2);
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--c-deep);
  color: var(--c-on-deep);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.hero__panel .media img {
  object-position: 88% 62%;
  transition: transform var(--dur-slow) var(--ease);
}

.hero__panel:hover .media img {
  transform: scale(1.06);
}

.hero__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  /* darkest along the diagonal edge, clearing towards the pouches in the corner */
  background: linear-gradient(135deg, rgba(28, 23, 21, 0.97) 50%, rgba(28, 23, 21, 0.6) 68%, rgba(28, 23, 21, 0.4) 100%);
}

.hero__panel-mark {
  position: absolute;
  left: calc(var(--hero-bleed) + var(--hero-leg) * 0.34);
  bottom: calc(var(--hero-bleed) - var(--hero-leg) * 0.14);
  z-index: 1;
  color: transparent;
  font-size: calc(var(--hero-leg) * 0.95);
  font-weight: 700;
  line-height: 1;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.12);
}

/* anchored in the corner, the one spot that is inside the triangle at every size */
.hero__panel-text {
  position: absolute;
  right: calc(var(--hero-bleed) + var(--hero-leg) * 0.08);
  bottom: calc(var(--hero-bleed) + var(--hero-leg) * 0.08);
  z-index: 2;
  display: grid;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(28, 23, 21, 0.7);
}

.hero__panel-text b {
  font-size: clamp(0.9375rem, 0.8rem + 0.4vw, 1.125rem);
  font-weight: 700;
}

.hero__panel-text span {
  color: var(--c-gold-light);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

@keyframes hero-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes hero-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes hero-corner {
  from {
    opacity: 0;
    transform: translate(18%, 18%);
  }
}

/* ---------- 1. what we do: statement over a soft background ---------- */
.story {
  position: relative;
  min-height: 728px;
  padding-block: clamp(3rem, 1.5rem + 6vw, 7rem) clamp(3rem, 2rem + 4vw, 6rem);
  isolation: isolate;
}

.story > .media {
  z-index: -2;
}

.story::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.86) 42%, #ffffff 100%);
}

.story__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr);
  gap: 40px;
}

.story__title {
  font-size: var(--fs-h2);
  font-weight: 700;
  text-transform: uppercase;
}

.story__quote {
  font-size: var(--fs-quote);
  font-weight: 300;
  line-height: 1.38;
}

.story__quote span {
  color: var(--c-accent);
  font-weight: 700;
}

.story__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: clamp(2.5rem, 1rem + 6vw, 6.5rem);
}

.thumb-card {
  display: block;
  text-align: center;
}

.thumb-card .media {
  border-radius: var(--radius);
  --ratio: 245 / 160;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur) var(--ease);
}

.thumb-card:hover .media {
  transform: translateY(-6px);
}

.thumb-card__title {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  transition: color var(--dur) var(--ease);
}

.thumb-card:hover .thumb-card__title {
  color: var(--c-accent);
}

/* ---------- client logos ---------- */
.clients {
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem);
  border-bottom: 1px solid var(--c-line);
}

.clients__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  max-width: 980px;
}

.clients__count {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-right: clamp(20px, 3vw, 48px);
  border-right: 2px solid var(--c-line);
  color: var(--c-accent);
  line-height: 1;
}

.clients__count b {
  font-size: clamp(3rem, 2rem + 3.6vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.clients__count span {
  margin-top: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.clients__lead {
  max-width: 46ch;
  margin-top: 10px;
  color: var(--c-ink-2);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.clients__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(28px, 3vw, 48px);
}

/* logo tile: white with the logo contained inside; hatched only while the file is missing */
.media--logo {
  border: 1px solid var(--c-line);
  border-radius: 12px;
  background-color: var(--c-paper);
  background-image: none;
  --ratio: 2 / 1;
}

/* logos have transparent backgrounds, so the placeholder label only shows when the file is missing */
.media--logo .media__label {
  visibility: hidden;
}

.media--logo.is-missing .media__label {
  visibility: visible;
}

.media--logo.is-missing {
  background-color: #f6f3ef;
  background-image: repeating-linear-gradient(135deg, rgba(28, 23, 21, 0.045) 0 1px, transparent 1px 14px);
}

/* centred; each logo's width is set inline so all 15 carry the same visual weight */
.media--logo img {
  inset: auto;
  top: 50%;
  left: 50%;
  height: auto;
  max-height: 80%;
  object-fit: contain;
  transform: translate(-50%, -50%);
  transition: scale var(--dur) var(--ease);
}

.media--logo:hover img {
  scale: 1.05;
}

/* ---------- 2. industries carousel ---------- */
.markets {
  padding-block: clamp(3.5rem, 1rem + 9vw, 9.375rem) clamp(3.5rem, 2rem + 5vw, 6.25rem);
  background: var(--c-panel);
}

.markets .carousel {
  margin-top: 40px;
}

/* ---------- 3. product finder ---------- */
.finder {
  position: relative;
  padding-block: clamp(2.75rem, 1.5rem + 5vw, 5.625rem) clamp(3rem, 2rem + 3vw, 3.75rem);
  isolation: isolate;
}

.finder::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 432px;
  background: var(--grad-soft);
}

.finder__title {
  color: var(--c-accent-dark);
  font-size: var(--fs-h2-sm);
  font-weight: 700;
  text-align: center;
}

.finder .search {
  margin-top: 36px;
}

.finder__question {
  margin-top: clamp(2rem, 1rem + 4vw, 4rem);
  color: var(--c-ink-2);
  font-size: var(--fs-lead);
  text-align: center;
}

.finder .tiles {
  margin-top: 28px;
}

.finder__empty {
  margin-top: 28px;
  padding: 28px;
  border: 1px dashed var(--c-line);
  border-radius: var(--radius);
  color: var(--c-muted);
  text-align: center;
}

.finder__empty a {
  color: var(--c-accent);
  text-decoration: underline;
}

.finder .chips {
  max-width: 1112px;
  margin: clamp(2.5rem, 1.5rem + 3vw, 4rem) auto 0;
}

/* ---------- 4. process panel (dark, inset, rounded) ---------- */
.panel-wrap {
  padding-inline: 24px;
  margin-bottom: clamp(3.75rem, 2rem + 5vw, 6rem);
}

.panel {
  position: relative;
  display: grid;
  min-height: clamp(640px, 58vw, 860px);
  border-radius: var(--radius);
  background: var(--c-deep);
  color: var(--c-on-deep);
  overflow: hidden;
  isolation: isolate;
}

.panel__media {
  position: absolute;
  inset: 0 0 0 46%;
  z-index: -1;
  aspect-ratio: auto;
}

.panel__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--c-deep) 0%, rgba(28, 23, 21, 0.2) 28%, rgba(28, 23, 21, 0) 60%);
}

.panel__body {
  align-self: center;
  width: min(100%, 50% + 40px);
  padding: 72px 0 72px calc(var(--edge) - 24px);
}

.panel__title {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.25;
}

.panel__title em {
  color: var(--c-gold-light);
  font-style: normal;
}

.panel .stats {
  margin-top: clamp(2rem, 1rem + 3vw, 3.5rem);
}

.panel__text {
  max-width: 28em;
  margin-top: clamp(2rem, 1rem + 3vw, 3.5rem);
  color: var(--c-on-deep-muted);
  font-size: var(--fs-lead);
  line-height: 1.4;
}

.panel .btn {
  margin-top: 40px;
}

/* ---------- 5. guides ---------- */
.guides__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 345px;
  gap: 16px;
}

.guide {
  position: relative;
  display: block;
  border-radius: var(--radius);
  background: var(--c-panel);
  overflow: hidden;
}

.guide--tall {
  grid-row: span 2;
}

.guides__grid.is-filtered .guide--tall {
  grid-row: auto;
}

.guide .media img {
  transition: transform var(--dur-slow) var(--ease);
}

.guide:hover .media img {
  transform: scale(1.04);
}

.guide__body {
  position: absolute;
  inset: auto 0 0;
  padding: 72px 30px 24px;
  background: linear-gradient(to top, #ffffff 0%, rgba(255, 255, 255, 0.96) 58%, rgba(255, 255, 255, 0) 100%);
}

.guide__title {
  margin-top: 10px;
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.625rem);
  font-weight: 700;
  line-height: 1.45;
}

.guide__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--c-muted);
  font-size: var(--fs-small);
}

/* ---------- responsive ---------- */
@media (max-width: 1279px) {
  .hero__intro {
    width: 54%;
  }
}

@media (max-width: 1023px) {
  /* stacked: photo first, then the intro. Only the visual order changes; the headline
     stays first in the HTML for search engines and screen readers. */
  .hero {
    --hero-leg: clamp(240px, 34vw, 320px);
  }

  .hero__title {
    font-size: clamp(2.5rem, 1rem + 4.6vw, 3.6rem);
  }

  .hero__frame {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .hero__intro {
    position: relative;
    width: 100%;
    padding: clamp(22px, 3.5vw, 32px) 0 4px;
    border-radius: 0;
  }

  .hero__intro::before,
  .hero__intro::after {
    content: none;
  }

  .hero__row {
    max-width: 620px;
  }

  .hero__stage {
    position: relative;
    inset: auto;
    order: -1;
    aspect-ratio: 16 / 10;
  }

  .hero__intro {
    order: 1;
  }

  /* a slim row under the photo instead of a control on top of it */
  .hero__controls {
    position: static;
    margin: 10px 0 0 -3px;
    color: var(--c-ink);
    filter: none;
  }

  .hero__dot span {
    background: var(--c-line);
  }

  .hero__dot span::after {
    background: var(--c-accent);
  }

  .hero__toggle {
    margin-left: auto;
  }

  .hero__toggle:hover {
    background: var(--c-panel);
  }

  .story {
    min-height: 0;
  }

  .story::after {
    background: rgba(255, 255, 255, 0.88);
  }

  .story__grid {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .panel {
    min-height: 0;
  }

  .panel__media {
    position: relative;
    inset: auto;
    order: 2;
    aspect-ratio: 16 / 10;
  }

  .panel__media::after {
    background: linear-gradient(to bottom, var(--c-deep) 0%, rgba(28, 23, 21, 0) 40%);
  }

  .panel__body {
    width: 100%;
    padding: 56px calc(var(--gutter) - 8px) 40px;
  }
}

@media (max-width: 767px) {
  .hero {
    --hero-leg: 48vw;
  }

  .hero__title {
    font-size: clamp(2.125rem, 9.5vw, 2.75rem);
  }

  /* the "9 colour printing" mark becomes one line under the headline */
  .hero__brandline {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .hero__mark {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-left: 0;
    border-left: 0;
  }

  .hero__mark span {
    max-width: none;
  }

  .hero__mark b {
    margin: 0;
    font-size: 2.25rem;
  }

  .hero__row {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
  }

  /* let the buttons drop under both the thumbnail and the text */
  .hero__row > div {
    display: contents;
  }

  .hero__actions {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .hero__stage {
    aspect-ratio: 1 / 1;
  }

  .hero__panel-text b {
    font-size: 0.8125rem;
  }

  .hero__panel-text span {
    display: none;
  }

  .story__cards {
    gap: 12px;
  }

  .clients__head {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .clients__count {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    padding-right: 0;
    border-right: 0;
  }

  .clients__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .media--logo .media__label span {
    display: none;
  }

  .thumb-card__title {
    font-size: 0.875rem;
    line-height: 1.35;
  }

  .thumb-card .media {
    border-radius: 12px;
  }

  .finder::before {
    height: 380px;
  }

  .panel-wrap {
    padding-inline: 16px;
  }

  .panel__body {
    padding: 40px 20px 32px;
  }

  .panel .btn {
    width: 100%;
    justify-content: center;
  }

  .guides__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 400px;
  }

  .guide--tall {
    grid-row: auto;
  }

  .guide__body {
    padding: 64px 20px 20px;
  }
}
