/* Dead Cult — Home page (prefix: hm-)
   Comp: "1 Home.jpg" — 1920 wide. vw values = designPx / 19.2 */

/* 1. Hero + Editions stage */
.hm-top {
  position: relative;
  background: var(--bg-hero);
}
.art--hero {
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1920 / 1748;
  background-size: 100% 100%;
  background-image: url("../img/home/hero.jpg");
  background-image: image-set(
    url("../img/home/hero.webp") type("image/webp"),
    url("../img/home/hero.jpg") type("image/jpeg")
  );
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
/* bottom of the stage melts into the page colour */
.hm-top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12vw;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

/* 2. Hero */
.hm-hero {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  min-height: clamp(560px, 57.81vw, 1110px);
  padding-block: var(--header-h) clamp(2.5rem, 3.75vw, 72px);
}
.hm-hero__eyebrow {
  margin: 0;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--green-light);
  text-transform: uppercase;
}
.hm-hero__title {
  margin: clamp(0.25rem, 0.52vw, 10px) 0 0;
  font-size: var(--fs-hero);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: 0.012em;
  color: var(--green-light);
  text-transform: uppercase;
}
.hm-hero__lead {
  margin: clamp(0.75rem, 1.04vw, 20px) 0 0;
  font-size: var(--fs-lead);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}
.hm-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 0.94vw, 18px);
  margin-top: clamp(1.25rem, 1.82vw, 35px);
}

/* 3. Editions */
.hm-editions {
  position: relative;
  z-index: 2;
  padding-block: clamp(3rem, 11.98vw, 230px) clamp(3rem, 4.53vw, 87px);
}
.hm-editions__title {
  font-size: var(--fs-h2-sm);
  letter-spacing: 0.075em;
}
.hm-editions__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(2.5rem, 1.82vw, 35px) clamp(1rem, 1.82vw, 35px);
  margin-top: clamp(1.75rem, 2.5vw, 48px);
}
.hm-ecard {
  min-height: clamp(240px, 15.05vw, 289px);
  padding: clamp(1.5rem, 2.24vw, 43px) clamp(1rem, 1.3vw, 25px) clamp(1.75rem, 1.56vw, 30px);
  background: rgba(3, 5, 3, 0.35);
}
.hm-ecard__icon {
  height: clamp(54px, 3.65vw, 70px);
}
.hm-ecard__title {
  margin: clamp(1rem, 1.15vw, 22px) 0 0;
  font-size: var(--fs-card-h);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.035em;
  color: var(--green);
  text-transform: uppercase;
}
.hm-ecard__text {
  margin: clamp(0.5rem, 0.78vw, 15px) 0 0;
  max-width: 20em;
  font-size: var(--fs-card);
  font-weight: 400;
  line-height: 1.22;
  color: var(--ink-soft);
}
.hm-ecard__cta {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
}
.hm-ecard__cta:hover,
.hm-ecard__cta:focus-visible {
  transform: translate(-50%, 50%) translateY(-2px);
}

/* 4. What is Dead Cult? */
.hm-about {
  position: relative;
  padding-block: clamp(3rem, 7.66vw, 147px) clamp(3rem, 5.52vw, 106px);
}
.art--eye {
  top: -13.33vw;
  left: 0;
  width: 73.96vw;
  aspect-ratio: 1420 / 1244;
  background-size: 100% 100%;
  background-image: url("../img/home/eye.png");
  background-image: image-set(
    url("../img/home/eye.webp") type("image/webp"),
    url("../img/home/eye.png") type("image/png")
  );
  animation: eye-breathe 9s ease-in-out infinite;
}
@keyframes eye-breathe {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.18) drop-shadow(0 0 30px rgba(91, 232, 76, 0.18));
  }
}
.hm-about .container-xxl {
  position: relative;
  z-index: 2;
  max-width: none;
  padding-inline: 0;
}
.hm-about__copy {
  margin-left: 54.32vw;
  max-width: clamp(0px, 38.8vw, 745px);
}
.hm-about__title {
  margin: clamp(0.5rem, 0.89vw, 17px) 0 0;
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--green);
  text-transform: uppercase;
}
.hm-about__body {
  margin-top: clamp(1rem, 1.04vw, 20px);
}
.hm-about__body p {
  margin: 0 0 clamp(0.75rem, 1.15vw, 22px);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.28;
  color: var(--ink);
}
.hm-about__body p:last-child {
  margin-bottom: 0;
}
.hm-about__strong {
  font-weight: 600 !important;
}
.hm-about__cta {
  margin-top: clamp(1.25rem, 1.56vw, 30px);
}

/* 5. Why Dead Cult? */
.hm-why {
  position: relative;
  z-index: 2;
  padding-top: clamp(3rem, 3.39vw, 65px);
  text-align: center;
}
.hm-why .container-xxl {
  max-width: calc(1642px + var(--pad-x) * 2);
}
.hm-why__title {
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: 0.095em;
}
.hm-why__lead {
  margin: clamp(0.75rem, 1.15vw, 22px) 0 0;
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--ink);
}
.hm-why__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 9.32vw, 179px);
  margin-top: clamp(2rem, 3.91vw, 75px);
}
.hm-wcard {
  min-height: clamp(280px, 21.2vw, 407px);
  padding: clamp(1.75rem, 2.97vw, 57px) clamp(1rem, 1.3vw, 25px) clamp(1.75rem, 2.6vw, 50px);
}
.hm-wcard__icon {
  height: clamp(76px, 6.15vw, 118px);
}
.hm-wcard__title {
  margin: clamp(1.25rem, 1.67vw, 32px) 0 0;
  font-family: var(--font-ui);
  font-size: var(--fs-feature-h);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: 0.02em;
  color: var(--green-mid);
  text-transform: uppercase;
}
.hm-wcard__text {
  margin: clamp(0.5rem, 0.68vw, 13px) 0 0;
  max-width: 18em;
  font-size: var(--fs-card);
  font-weight: 400;
  line-height: 1.22;
  color: var(--ink-soft);
}

/* 6. Dead Cult Intelligence */
.hm-intel {
  position: relative;
  padding-top: clamp(3rem, 4.43vw, 85px);
  text-align: center;
}
/* Diagram = one scalable picture.
   .hm-intel__diagram  in-flow wrapper (clips the crop on small screens)
   .hm-intel__canvas   the comp's 1920 x 1068 artwork box; everything inside is
                       positioned in % and sized in cqw (1cqw = 1% of canvas width),
                       so the layout is identical at every screen size. */
.hm-intel__diagram {
  position: relative;
  z-index: 0;
  margin-top: -11.61vw;          /* artwork slides 223px up under the heading at 1920 */
}
.hm-intel__canvas {
  position: relative;
  aspect-ratio: 1920 / 1068;
  container-type: inline-size;
}
.art--shield {
  inset: 0;
  background-size: 100% auto;
  background-image: url("../img/home/shield.jpg");
  background-image: image-set(
    url("../img/home/shield.webp") type("image/webp"),
    url("../img/home/shield.jpg") type("image/jpeg")
  );
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

.hm-dot {
  position: absolute;
  z-index: 1;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: max(0.83cqw, 7px);      /* 16px at 1920 */
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--green);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0 rgba(91, 232, 76, 0.6);
  animation: dot-pulse 2.6s ease-out infinite;
}
.hm-dot:nth-of-type(2) { animation-delay: 0.65s; }
.hm-dot:nth-of-type(3) { animation-delay: 1.3s; }
.hm-dot:nth-of-type(4) { animation-delay: 1.95s; }
@keyframes dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(91, 232, 76, 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 max(0.83cqw, 7px) rgba(91, 232, 76, 0);
  }
}

.hm-intel__head {
  position: relative;
  z-index: 2;
}
.hm-intel__title {
  margin: 0;
  color: var(--green-light);
  text-transform: uppercase;
  line-height: 1.08;
}
.hm-intel__title-light,
.hm-intel__title-bold {
  display: block;
}
.hm-intel__title-light {
  font-size: clamp(1.75rem, 3.23vw, 3.875rem);   /* 62 */
  font-weight: 400;
  letter-spacing: 0.08em;
}
.hm-intel__title-bold {
  font-size: clamp(1.625rem, 3.02vw, 3.625rem);   /* 58 */
  font-weight: 800;
  letter-spacing: 0.1em;
}
.hm-intel__text {
  max-width: clamp(0px, 46vw, 884px);
  margin: clamp(0.75rem, 1.04vw, 20px) auto 0;
  font-size: var(--fs-text);
  line-height: 1.2;
  color: var(--ink);
}
.hm-intel__kicker {
  margin: clamp(1.25rem, 1.82vw, 35px) 0 0;
  font-size: var(--fs-card);
  font-weight: 400;
  letter-spacing: 0.25em;
  color: var(--green-soft);
  text-transform: uppercase;
}

.hm-nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* The <li> is a zero-size anchor sitting exactly on the icon centre (--x, --y).
   The inner box hangs from it: centred horizontally, icon centre on the anchor.
   Positioning uses left/top/margin only, never transform, so AOS can animate
   .hm-node__inner without moving it off its point. */
.hm-node {
  --icon-h: max(3.54cqw, 26px);  /* 68px at 1920 */
  --node-w: max(16cqw, 104px);   /* text column, wraps on small screens */
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: 0;
  height: 0;
}
.hm-node__inner {
  position: absolute;
  left: calc(var(--node-w) / -2);
  top: calc(var(--icon-h) / -2);
  width: var(--node-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hm-node__icon {
  height: var(--icon-h);
  width: auto;
  transition: filter 0.3s var(--ease);
}
.hm-node:hover .hm-node__icon {
  filter: drop-shadow(0 0 12px var(--green-glow));
}
.hm-node__label {
  margin-top: max(0.83cqw, 4px); /* 16px at 1920 */
  font-size: max(1.2cqw, 12px);  /* 23px at 1920 */
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
}
.hm-node__sub {
  margin-top: 0.3em;
  font-size: max(0.89cqw, 10px); /* 17px at 1920 */
  font-weight: 400;
  line-height: 1.2;
  color: var(--green-soft);
}

/* 7. Responsive */
@media (max-width: 1199.98px) {
  .hm-editions__grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 860px;
    margin-inline: auto;
    row-gap: 3rem;
  }
  .hm-about__copy {
    margin-left: 50vw;
    max-width: 46vw;
    padding-right: var(--pad-x);
  }
}

@media (max-width: 991.98px) {
  .art--hero {
    background-image: image-set(
      url("../img/home/hero-1280.webp") type("image/webp"),
      url("../img/home/hero.jpg") type("image/jpeg")
    );
  }
  .hm-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(7, 7, 7, 0.88) 0%, rgba(7, 7, 7, 0.55) 55%, transparent 100%);
    pointer-events: none;
  }
  .hm-hero {
    min-height: clamp(520px, 80vw, 760px);
  }

  /* About (tablet): same side-by-side layout as desktop, eye a little larger */
  .art--eye {
    width: 82vw;
    background-image: image-set(
      url("../img/home/eye-960.webp") type("image/webp"),
      url("../img/home/eye.png") type("image/png")
    );
  }
  .hm-about__copy {
    margin-left: 48vw;
    max-width: 50vw;
  }

  .hm-why__grid {
    gap: 1rem;
  }

  /* Intelligence: same diagram, zoomed so the comp's x 400–1520 band
     (the shield + all four nodes) fills the screen; the empty sides are cropped. */
  .hm-intel__text {
    max-width: 40rem;
  }
  .hm-intel__diagram {
    margin-top: -20vw;
    overflow-x: clip;       /* crop the empty sides only — */
    overflow-y: visible;    /* floating / animating parts never get cut top or bottom */
  }
  .hm-intel__canvas {
    width: calc(100% * 1920 / 1120);
    margin-left: calc(-100% * 400 / 1120);
  }
  .art--shield {
    background-image: image-set(
      url("../img/home/shield-1280.webp") type("image/webp"),
      url("../img/home/shield.jpg") type("image/jpeg")
    );
  }
}

@media (max-width: 767.98px) {
  .art--hero {
    width: 190%;
    left: -78%;
  }
  .hm-hero {
    min-height: min(165vw, 720px);
  }
  .hm-hero::before {
    background: linear-gradient(0deg, rgba(7, 7, 7, 0.92) 0%, rgba(7, 7, 7, 0.6) 45%, transparent 75%);
  }

  /* About (phone): eye centred on screen, centred copy below it.
     The iris sits at 33.6% / 52% of the artwork, so the image is scaled to 140%
     and shifted so the iris lands at the screen centre; the dark right side is cropped. */
  .hm-about {
    padding-top: 0;
  }
  .art--eye {
    position: relative;
    top: auto;
    left: calc(50% - 140% * 0.336);
    width: 140%;
    margin-top: -3rem;
    -webkit-mask-image: radial-gradient(ellipse 34% 50% at 33.6% 50%, #000 55%, transparent 100%);
            mask-image: radial-gradient(ellipse 34% 50% at 33.6% 50%, #000 55%, transparent 100%);
  }
  .hm-about .container-xxl {
    padding-inline: var(--pad-x);
    margin-top: -6vw;      /* only the fully faded edge; text never covers the eye */
  }
  .hm-about__copy {
    margin: 0 auto;
    max-width: 34em;
    padding-right: 0;
    text-align: center;
  }

  .hm-why__grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-inline: auto;
    gap: 1.5rem;
  }
  .hm-wcard {
    min-height: 0;
  }
}

@media (max-width: 575.98px) {
  .hm-editions__grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
  .hm-ecard {
    min-height: 0;
  }
  .hm-hero__actions > a {
    flex: 1 1 auto;
  }

  /* phones: slightly wider crop (comp x 340–1580) so one-line subtitles fit */
  .hm-intel__canvas {
    width: calc(100% * 1920 / 1240);
    margin-left: calc(-100% * 340 / 1240);
  }
  /* keep each node subtitle on one line so it never runs into a dot */
  .hm-node {
    --node-w: 118px;
    --icon-h: 22px;
  }
  .hm-node__label {
    margin-top: 3px;
    font-size: 11px;
  }
  .hm-node__sub {
    margin-top: 1px;
    font-size: clamp(9px, 2.6vw, 10px);   /* 10px from 385px wide; never past the screen edge */
    letter-spacing: -0.01em;
    white-space: nowrap;
  }
}

/* Short desktop screens: hero no taller than the screen, so the
   LOG IN / BOOK A DEMO buttons sit on the first screen. */
@media (min-width: 992px) and (max-height: 920px) {
  .hm-hero {
    min-height: max(520px, 100vh - 40px);
  }
}
