/* Home. Loaded after main.css, projects.css (tokens, stats, cards, links),
   services.css (labels, intros, creds band, reveal) and about.css (values grid, split heads).
   Every class here is prefixed hm-. */

/* ---------- Hero: full-screen cross-fading slideshow ---------- */
.hm-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: calc(100svh - var(--header-h)); display: flex; align-items: flex-end;
  background: var(--black); color: #fff;
}
.hm-hero__slides { position: absolute; inset: 0; z-index: -2; }
.hm-hero__slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.08); transition: opacity 1.4s var(--px-ease), transform 7s linear;
}
.hm-hero__slide.is-on { opacity: 1; transform: scale(1); }
.hm-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.1) 30%, rgba(0,0,0,.35) 60%, rgba(0,0,0,.9) 100%),
    linear-gradient(90deg, rgba(66,5,0,.55) 0%, rgba(0,0,0,0) 60%);
}
.hm-hero__inner { width: 100%; padding-block: clamp(56px, 9vh, 140px) clamp(24px, 3.5vw, 44px); }
.hm-hero .px-eyebrow span { margin-left: 14px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.4); letter-spacing: 0; font-size: 1.05em; text-transform: none; }
.hm-hero__title { margin-top: 16px; }
.hm-hero__big { display: block; max-width: 12ch; font-size: clamp(2.6rem, 1rem + 5.2vw, 5.6rem); font-weight: 800; line-height: 1.4; letter-spacing: -.03em; }
.hm-hero__sub { display: block; margin-top: 18px; max-width: 40ch; font-size: clamp(1.05rem, .95rem + .5vw, 1.35rem); font-weight: 600; line-height: 1.4; color: rgba(255,255,255,.88); }
.hm-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hm-hero__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-top: clamp(32px, 5vh, 64px); }
.hm-hero__foot .px-stats { margin-top: 0; flex: 1; max-width: 760px; }

.hm-hero__now { position: relative; flex: none; width: 300px; min-height: 120px; }
.hm-hero__caption {
  position: absolute; left: 0; right: 0; bottom: 52px; display: flex; flex-direction: column; gap: 4px;
  color: #fff; text-decoration: none; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .6s var(--px-ease), transform .6s var(--px-ease);
}
.hm-hero__caption.is-on { opacity: 1; transform: none; pointer-events: auto; }
.hm-hero__label { font-size: .625rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.hm-hero__caption strong { font-size: 1.05rem; line-height: 1.25; }
.hm-hero__caption span:last-child { font-size: .8125rem; color: rgba(255,255,255,.75); }
.hm-hero__caption:hover strong { text-decoration: underline; }
.hm-hero__controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; }
.hm-hero__dots { flex: 1; display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.hm-hero__dots li { flex: 1; }
.hm-hero__dots button { display: block; width: 100%; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.hm-hero__dots i { position: relative; display: block; height: 3px; overflow: hidden; border-radius: 2px; background: rgba(255,255,255,.3); }
.hm-hero__dots i::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.hm-hero__dots button[aria-current="true"] i::after { transform: scaleX(1); }
.hm-hero__dots i.is-run::after { animation: hm-run 6s linear forwards; }
.hm-hero__pause {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: rgba(0,0,0,.25); color: #fff; cursor: pointer;
  transition: background .2s, color .2s;
}
.hm-hero__pause:hover { background: #fff; color: var(--black); }
.hm-hero__pause svg { width: 16px; height: 16px; }
@keyframes hm-run { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Two divisions ---------- */
.hm-choose { padding-top: var(--section-y); background: #fff; }
.hm-choose .ab-head { margin-bottom: clamp(32px, 4vw, 56px); }
.hm-choose__panels { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
.hm-div { position: relative; isolation: isolate; overflow: hidden; min-height: clamp(560px, 56vw, 760px); display: flex; align-items: flex-end; color: #fff; }
.hm-div + .hm-div { border-left: 1px solid var(--rule-dark); }
.hm-div > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--px-ease); }
.hm-div::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,.45) 35%, rgba(0,0,0,.92) 100%); }
.hm-div__body { padding: clamp(28px, 4vw, 56px); max-width: 640px; --focus: #fff; }
.hm-div .px-eyebrow { margin: 0 0 14px; letter-spacing: .2em; }
.hm-div__name { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.4rem); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.hm-div__name span { display: block; margin-top: 8px; font-size: .42em; font-weight: 600; letter-spacing: 0; color: rgba(255,255,255,.8); }
.hm-div__text { margin: 18px 0 0; max-width: 48ch; color: rgba(255,255,255,.85); }
.hm-div__list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 20px 0 0; }
.hm-div__list li { padding: 5px 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.9); backdrop-filter: blur(4px); }
.hm-div__links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 28px 0 0; }
.hm-div .pd-link { color: #fff; }
@media (hover: hover) { .hm-div:hover > img { transform: scale(1.05); } }

/* ---------- Selected projects carousel ---------- */
.hm-work { padding-block: var(--section-y); background: #fff; overflow: hidden; }
.hm-work__head { margin-bottom: clamp(20px, 3vw, 32px); }
.hm-work__nav { display: flex; align-items: center; gap: 10px; }
.hm-work__nav .pd-link { margin-right: 14px; }
.hm-arrow {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--rule); border-radius: 50%;
  background: #fff; color: var(--black); cursor: pointer; transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.hm-arrow svg { width: 20px; height: 20px; }
.hm-arrow:hover:not(:disabled) { background: var(--oxblood); border-color: var(--oxblood); color: #fff; }
.hm-arrow:disabled { opacity: .35; cursor: default; }
/* The track starts at the container's left edge and bleeds off the right of the screen */
.hm-rail {
  --inset: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  list-style: none; margin: 0; display: flex; gap: clamp(14px, 1.6vw, 24px);
  padding: 0 var(--inset) 8px; scroll-padding-inline: var(--inset);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.hm-rail::-webkit-scrollbar { display: none; }
.hm-rail > li { flex: 0 0 clamp(300px, 34vw, 460px); height: clamp(420px, 40vw, 540px); scroll-snap-align: start; }
.hm-rail__end a {
  display: flex; flex-direction: column; justify-content: flex-end; height: 100%; padding: clamp(24px, 3vw, 40px);
  border-radius: var(--px-radius); background: var(--oxblood); color: #fff; text-decoration: none; transition: background .3s;
}
.hm-rail__end a:hover { background: var(--oxblood-deep); }
.hm-rail__end a:focus-visible { outline: 3px solid var(--oxblood); outline-offset: 3px; }
.hm-rail__count { font-size: clamp(4rem, 2rem + 6vw, 7rem); font-weight: 800; line-height: .9; letter-spacing: -.03em; }
.hm-rail__label { margin-top: 10px; font-size: 1.1rem; font-weight: 600; max-width: 18ch; }
.hm-rail__end .pd-link { margin-top: 28px; color: #fff; }

/* Values heading inside the "who we are" chapter (h3 → h4 inside cells) */
.ab-value h4 { font-size: clamp(1.1rem, 1rem + .4vw, 1.35rem); font-weight: 800; line-height: 1.2; color: var(--black); }
.sv-intro + .sv-sub { margin-top: clamp(48px, 6vw, 80px); }

/* ---------- Client logo marquee ---------- */
.hm-clients { padding-block: var(--section-y); background: #fff; overflow: hidden; }
.hm-clients .ab-head { margin-bottom: clamp(28px, 4vw, 48px); }
.hm-marquee { display: flex; width: max-content; }
.hm-marquee + .hm-marquee { margin-top: 14px; }
.hm-marquee__track { display: flex; gap: 14px; list-style: none; padding: 0 14px 0 0; margin: 0; animation: hm-marquee 60s linear infinite; }
.hm-marquee--reverse .hm-marquee__track { animation-direction: reverse; animation-duration: 75s; }
.hm-marquee:hover .hm-marquee__track, .hm-clients.is-still .hm-marquee__track { animation-play-state: paused; }
.hm-marquee__track li { display: flex; align-items: center; justify-content: center; flex: none; width: 180px; height: 96px; padding: 18px 24px; border: 1px solid var(--rule); border-radius: var(--px-radius); background: #fff; }
.hm-marquee__track img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: grayscale(1); opacity: .75; transition: filter .3s, opacity .3s; }
.hm-marquee__track li:hover img { filter: none; opacity: 1; }
.hm-clients__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: clamp(28px, 4vw, 40px); }
.hm-clients__pause {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 999px; background: #fff;
  font: inherit; font-size: .8125rem; font-weight: 700; color: var(--charcoal); cursor: pointer; transition: border-color .2s;
}
.hm-clients__pause:hover { border-color: var(--charcoal); }
@keyframes hm-marquee { to { transform: translateX(-100%); } }

/* ---------- Latest news ---------- */
.hm-news { padding-block: var(--section-y); background: var(--px-soft); border-top: 1px solid var(--rule); }
/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .hm-hero__foot { flex-direction: column; align-items: stretch; }
  .hm-hero__now { width: 100%; max-width: 420px; }
  .hm-choose__panels { grid-template-columns: 1fr; }
  .hm-div { min-height: 560px; }
  .hm-div + .hm-div { border-left: 0; border-top: 1px solid var(--rule-dark); }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .hm-hero { min-height: calc(100svh - var(--header-h)); }
  .hm-hero .px-eyebrow span { display: block; margin: 8px 0 0; padding: 0; border: 0; }
  .hm-hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .hm-hero__foot { gap: 24px; }

  .hm-div { min-height: 0; padding-top: 220px; }
  .hm-div__list li { font-size: .6875rem; }

  .hm-work__nav .hm-arrow { display: none; }
  .hm-work__nav .pd-link { margin-right: 0; }
  .hm-rail > li { flex-basis: 82%; height: auto; }
  .hm-rail .px-card__count { display: none; } /* the division tag needs the full card width */
  .hm-rail__end a { min-height: 260px; }

  .hm-marquee__track li { width: 140px; height: 76px; padding: 14px 18px; }
}

/* Reduced motion: no slideshow zoom, no marquee (logos wrap into a static grid) */
@media (prefers-reduced-motion: reduce) {
  .hm-hero__slide { transition: opacity .01s; transform: none; }
  .hm-hero__dots i.is-run::after { animation: none; }
  .hm-marquee { width: auto; }
  .hm-marquee__track { animation: none; flex-wrap: wrap; justify-content: center; padding: 0 var(--gutter); }
  .hm-marquee__track[aria-hidden="true"] { display: none; }
  .hm-clients__pause { display: none; }
  .hm-div > img, .hm-arrow, .hm-hero__caption { transition: none; }
}
