﻿/* =========================================================
   STEPS
========================================================= */

.steps {
  display: grid;
  gap: 18px;
  margin: 56px 0;
}

/* =========================================================
   CARD
========================================================= */

.step-card {
  position: relative;
  isolation: isolate;

  display: grid;
  grid-template-columns:
    minmax(0, 1fr) minmax(220px, 300px);

  align-items: center;
  gap: 32px;

  min-height: 200px;
  padding: 34px 34px 34px 42px;

  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: 22px;

  background: radial-gradient(circle at 92% 50%, rgba(255, 59, 48, 0.075), transparent 32%), linear-gradient(120deg, rgba(255, 255, 255, 0.025), transparent 48%), var(--surface);

  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .step-card:hover {
    transform: translateY(-2px);

    border-color: rgba(255, 255, 255, 0.12);

    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.035);
  }
}

/* =========================================================
   DECORATIVE ACCENT
========================================================= */

.step-card::before {
  content: '';

  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;

  width: 3px;

  background: linear-gradient(180deg, transparent 5%, var(--accent) 35%, var(--accent-2) 65%, transparent 95%);

  opacity: 0.8;
}

/* =========================================================
   NUMBER
========================================================= */

.step-card__number {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 3;

  display: grid;
  place-items: center;

  width: 42px;
  height: 42px;

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;

  background: linear-gradient(145deg, var(--accent-2), var(--accent));

  color: #fff;

  box-shadow: 0 8px 22px rgba(255, 59, 48, 0.2);

  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

/* =========================================================
   CONTENT
========================================================= */

.step-card__content {
  position: relative;
  z-index: 2;

  min-width: 0;

  padding-left: 54px;
}

.steps .step-card__title {
  margin: 0 0 10px;

  color: var(--text);

  font-size: clamp(22px, 2vw, 27px);
  font-weight: 750;
  line-height: 1.2;

  letter-spacing: -0.02em;
}

.step-card__description {
  max-width: 640px;
  margin: 0;

  color: var(--text-soft);

  font-size: 15px;
  line-height: 1.7;
}

.step-card__description> :first-child {
  margin-top: 0;
}

.step-card__description> :last-child {
  margin-bottom: 0;
}

/* =========================================================
   MEDIA
========================================================= */

.step-card__media {
  position: relative;
  z-index: 2;

  justify-self: end;

  display: grid;
  place-items: center;

  width: min(100%, 280px);
  height: 170px;

  margin-right: -4px;

  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;

  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)), rgba(255, 255, 255, 0.015);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 24px rgba(0, 0, 0, 0.14);

  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

/* light behind image */
.step-card__media::before {
  content: '';

  position: absolute;
  inset: 18% 10%;

  border-radius: 50%;

  background: rgba(255, 59, 48, 0.09);
  filter: blur(34px);

  pointer-events: none;
}

.step-card__image {
  position: relative;
  z-index: 1;

  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: center;

  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.25));

  transform: scale(1);
  transition: transform 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .step-card:hover .step-card__media {
    border-color: rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)), rgba(255, 255, 255, 0.02);
  }

  .step-card:hover .step-card__image {
    transform: scale(1.06);
  }
}

/* =========================================================
   VISUAL VARIATION
========================================================= */

/*
 * Slightly alternate the visual balance.
 * Content remains structurally identical.
 */

.step-card:nth-child(even) {
  background: radial-gradient(circle at 88% 50%, rgba(111, 76, 255, 0.055), transparent 30%), linear-gradient(120deg, rgba(255, 255, 255, 0.022), transparent 48%), var(--surface);
}

/* =========================================================
   CARD WITHOUT IMAGE
========================================================= */

.step-card:not(:has(.step-card__media)) {
  grid-template-columns: minmax(0, 1fr);
}

.step-card:not(:has(.step-card__media)) .step-card__content {
  max-width: 760px;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1023px) {
  .steps {
    gap: 16px;
    margin: 50px 0;
  }

  .step-card {
    grid-template-columns:
      minmax(0, 1fr) 210px;

    gap: 24px;

    min-height: 180px;

    padding: 28px 28px 28px 32px;
  }

  .step-card__number {
    top: 18px;
    left: 18px;

    width: 38px;
    height: 38px;

    border-radius: 12px;

    font-size: 14px;
  }

  .step-card__content {
    padding-left: 48px;
  }

  .steps .step-card__title {
    font-size: 21px;
  }

  .step-card__description {
    font-size: 14px;
  }

  .step-card__media {
    width: 200px;
    height: 145px;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {
  .steps {
    gap: 14px;
    margin: 40px 0;
  }

  .step-card {
    grid-template-columns: 1fr;

    gap: 18px;

    min-height: 0;

    padding: 18px;

    border-radius: 18px;
  }

  .step-card::before {
    top: 14px;
    bottom: 14px;

    width: 2px;
  }

  .step-card__number {
    top: 16px;
    left: 16px;

    width: 36px;
    height: 36px;

    border-radius: 11px;

    font-size: 13px;
  }

  /*
   * On mobile:
   * image first, text after image.
   */
  .step-card__media {
    grid-column: 1;
    grid-row: 1;

    justify-self: stretch;

    width: 100%;
    height: auto;
    min-width: 0;
    aspect-ratio: 16 / 8;

    margin: 0;

    padding: 0;
  }

  .step-card__content {
    grid-column: 1;
    grid-row: 2;

    max-width: none;
    padding-left: 0;
  }

  .steps .step-card__title {
    margin-bottom: 7px;

    font-size: 19px;
  }

  .step-card__description {
    max-width: none;

    font-size: 14px;
    line-height: 1.6;
  }

  .step-card:not(:has(.step-card__media)) {
    padding-top: 66px;
  }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 390px) {
  .step-card {
    padding: 16px;
  }

  .step-card__number {
    top: 14px;
    left: 14px;
  }

  .step-card__media {
    height: auto;
    padding: 0;
  }

  .steps .step-card__title {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .step-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .step-card__number {
    position: static;
    flex: 0 0 36px;
    align-self: flex-start;
    order: 0;
  }

  .step-card__media {
    order: 1;
  }

  .step-card__content {
    order: 2;
  }

  .step-card__image {
    position: absolute;
    inset: 0;
  }

  .step-card:not(:has(.step-card__media)) {
    padding-top: 18px;
  }
}