:root {
  --background: #ebebeb;
  --surface: #ffffff;
  --text: #0f0f0f;
  --muted: #6d6a64;
  --road: #3e4148;
  --road-line: #f6d85d;

  --alex: #f05a47;
  --irina: #7857d8;
  --vlad: #199d83;

  --viewport-padding: clamp(16px, 4vw, 64px);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  font-size: 100%;
}

body {
  overflow-x: hidden;
  background: var(--background);
  color: var(--text);
  font-size: 1.6rem;
}

main {
  max-width: 100rem;
}

button,
input,
textarea,
select {
  font: inherit;
}

.intro,
.outro,
.methodology,
.expenses {
  display: flex;
  flex-direction: column;
  gap: 5rem;

  padding: 48px var(--viewport-padding);
}

.credits {
  padding: 48px var(--viewport-padding);
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.expense {
  display: flex;
  align-items: center;
}

.expense:nth-child(odd) {
  flex-direction: row-reverse;
}

.expense h3 {
  font-size: 2rem;
  margin-bottom: 1.4rem;
  line-height: 1.1;
}

.expense img {
  width: 20rem;
}

.expense__content {
  max-width: 50rem;
}

.intro__content,
.outro > div,
.methodology > div,
.expenses > div {
  width: min(90rem, 100%);
}

.intro__eyebrow {
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro h1,
.outro h2,
.methodology h2,
.expenses h2 {
  max-width: 85rem;
  margin: 0;
  margin-bottom: 2rem;
  font-size: clamp(2rem, 4vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.outro strong {
  color: #dc0510;
  font-weight: 900;
  font-size: 1.7rem;
}

.intro p:not(.intro__eyebrow),
.outro p:not(.intro__eyebrow),
.methodology p:not(.intro__eyebrow),
.expenses p:not(.intro__eyebrow) {
  margin: 2rem 0 0;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.5;
}

.intro__scroll {
  display: inline-block;
  margin-top: 48px;
  font-weight: 700;
}

.background-content {
  margin: 0 auto;

  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.5;
  margin-bottom: 2rem;
}

strong {
  font-weight: 800;
  color: #dc0510;
  font-size: 1.3rem;
}

.journey {
  position: relative;
}

.journey__viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    #bfe6ff 0%,
    #e7f5ff 58%,
    #d9d0b8 80%,
    #d9d0b8 100%
  );
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

.scene__background {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.skyline {
  position: absolute;
  left: 0;
  bottom: 32%;
  width: 100%;
  height: 18%;
  opacity: 0.18;
  /* background: linear-gradient(
    90deg,
    #222 0 8%,
    transparent 8% 10%,
    #222 10% 17%,
    transparent 17% 19%,
    #222 19% 28%,
    transparent 28% 31%,
    #222 31% 44%,
    transparent 44% 48%,
    #222 48% 62%,
    transparent 62% 65%,
    #222 65% 75%,
    transparent 75% 78%,
    #222 78% 92%,
    transparent 92%
  ); */
}

.cloud {
  position: absolute;
  width: 180px;
  height: 50px;
  border-radius: 999px;
  background: rgb(255 255 255 / 70%);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  width: 70px;
  height: 70px;
  left: 25px;
  bottom: 0;
}

.cloud::after {
  width: 95px;
  height: 95px;
  right: 25px;
  bottom: 0;
}

.cloud--one {
  top: 12%;
  left: 18%;
}

.cloud--two {
  top: 24%;
  right: 15%;
  scale: 0.7;
}

.world {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;

  width: max-content;
  min-width: 100vw;
  height: 66%;

  will-change: transform;
}

.road {
  position: absolute;
  left: 0;
  bottom: -150px;
  height: 88%;
  background: var(--road);
  border-top: 12px solid #cac2ae;
}

.road__line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 70px,
    var(--road-line) 70px 140px
  );
}

.road__line--one {
  top: 25%;
}

.road__line--two {
  top: 52%;
}

.road__line--three {
  top: 79%;
}

.buildings {
  position: relative;

  display: flex;
  align-items: flex-end;

  height: 57%;
  width: max-content;

  padding-left: 75vw;
  padding-right: 75vw;

  gap: 50rem;
}

.building {
  position: relative;
  flex: 0 0 auto;

  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 22px;

  transform-origin: center bottom;
}

.building__number {
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: rgb(255 255 255 / 80%);
  font-weight: 900;
}

.building__label {
  position: absolute;
  z-index: 1;
  top: 50%;
  padding: 1.2rem;

  border-radius: 8px;
  background: #fff;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}

.building.is-active {
  outline: 8px solid rgb(255 255 255 / 75%);
  transform: scale(1.06);
}

.building__image {
  display: block;
  width: 50rem;
  height: auto;
  object-fit: contain;

  user-select: none;
  pointer-events: none;
  filter: drop-shadow(12px -6px 3px rgb(0 0 0 / 30%)) saturate(150%);
}

.building--telecom .building__image {
  width: 20rem;
}

.building--food .building__image {
  width: 60rem;
}

.building--health .building__image {
  width: 35rem;
}

.building--shopping .building__image {
  width: 40rem;
}

.building--holidays .building__image {
  width: 70rem;
}

.characters {
  position: absolute;
  left: clamp(80px, 16vw, 270px);
  bottom: 5%;
  z-index: 5;
  width: 110px;
  height: 44%;
  pointer-events: none;
}

.character {
  position: absolute;
  left: 0;
  width: 110px;
  height: 120px;
}

.character--alex {
  bottom: 45%;
  color: var(--alex);
}

.character--irina {
  bottom: 22%;
  left: 80%;
  color: var(--irina);
}

.character--vlad {
  bottom: 0;
  left: 200%;
  color: var(--vlad);
}

.balance {
  position: absolute;
  right: -13rem;
  bottom: 3px;
  min-width: 150px;
  transform: translateX(-50%);
  padding: 9px 9px;
  border: 2px solid var(--text);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 5px 5px 0 rgb(0 0 0 / 12%);
  text-align: center;
}

.balance__name {
  display: block;
  margin-bottom: 2px;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.balance__amount {
  display: block;
  font-size: 1.6rem;
  white-space: nowrap;
}

.character__body {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 54px;
  height: 95px;
  transform: translateX(-50%);
}

.character__head {
  position: absolute;
  top: 0;
  left: 50%;
  width: 29px;
  height: 29px;
  border: 3px solid var(--text);
  border-radius: 50%;
  background: #f0c7a5;
  transform: translateX(-50%);
}

.character__torso {
  position: absolute;
  top: 27px;
  left: 50%;
  width: 42px;
  height: 43px;
  border: 3px solid var(--text);
  border-radius: 12px 12px 5px 5px;
  background: currentColor;
  transform: translateX(-50%);
}

.character__arm {
  position: absolute;
  top: 32px;
  left: 50%;

  width: 8px;
  height: 34px;

  border: 2px solid var(--text);
  border-radius: 999px;

  background: currentColor;

  transform-origin: top center;
}

.character__arm--left {
  transform: translateX(-22px) rotate(25deg);
}

.character__arm--right {
  transform: translateX(14px) rotate(-25deg);
}

.character__leg {
  position: absolute;
  top: 67px;
  left: 50%;
  width: 9px;
  height: 30px;
  border: 2px solid var(--text);
  border-radius: 999px;
  background: var(--text);
  transform-origin: top center;
}

.character__leg--left {
  transform: translateX(-13px) rotate(8deg);
}

.character__leg--right {
  transform: translateX(4px) rotate(-8deg);
}

.character.is-tired {
  filter: saturate(0.75);
}

.character.is-tired .balance {
  transform: translateX(-50%) rotate(-2deg);
}

.character.is-tired .character__torso {
  border-radius: 15px 15px 5px 5px;
}

/* Expense Message */

.expense-message {
  position: absolute;
  top: 20%;
  left: 50%;
  z-index: 10;
  min-width: min(360px, calc(100% - 32px));
  transform: translate(-50%, -20px);
  padding: 12px 18px;
  border: 2px solid var(--text);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 6px 6px 0 rgb(0 0 0 / 12%);
  opacity: 0;
  text-align: center;
  pointer-events: none;
}

.expense-message__category {
  display: block;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.expense-message__value {
  display: block;
  margin-top: 4px;
  font-size: 1.6rem;
  font-weight: 700;
}

.progress {
  position: absolute;
  right: 24px;
  bottom: 20px;
  left: 24px;
  z-index: 10;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 60%);
}

.progress__bar {
  width: 100%;
  height: 100%;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left center;
}

/* PROFILES */
.profiles {
  padding: clamp(80px, 10vw, 150px) 24px;
  background: #ebebeb;
}

.profiles__container {
  width: min(120rem, 100%);
  margin: 0 auto;
}

.profiles__header {
  margin-bottom: clamp(40px, 2vw, 72px);
}

.profiles__eyebrow {
  margin: 0 0 1.6rem;
  color: #dc0510;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.profiles__title {
  max-width: 95rem;
  margin: 0 0 3rem;
  font-size: clamp(2.2rem, 4vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.profiles__title span {
  display: block;
  margin-top: 1rem;
  font-size: clamp(2rem, 3vw, 2.5rem);
  color: #dc0510;
}

.profiles__intro {
  max-width: 90rem;
  margin: 0;
  margin-bottom: 1.6rem;
  line-height: 1.5;
}

.profiles__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3rem;
}

.profile-card {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  border: 3px solid #171717;
  border-radius: 22px;
  background: #fff;
  box-shadow: 10px 10px 0 rgb(0 0 0 / 12%);
}

.profile-card__visual {
  min-height: 190px;
  display: grid;
  place-items: center;
  border-bottom: 3px solid #171717;
}

.profile-card--alex .profile-card__visual {
  background: #f18b6d;
}

.profile-card--irina .profile-card__visual {
  background: #9c82d8;
}

.profile-card--vlad .profile-card__visual {
  background: #58bdb2;
}

.profile-card__avatar {
  display: grid;
  place-items: center;
  width: 12rem;
  height: 12rem;
  border: 3px solid #171717;
  border-radius: 50%;

  box-shadow: 7px 7px 0 rgb(0 0 0 / 15%);
}

.profile-card--alex .profile-card__avatar {
  background: url(assets/alex-bust.svg);
  background-repeat: no-repeat;
  background-position: top;
  background-size: cover;
}

.profile-card--vlad .profile-card__avatar {
  background: url(assets/vlad-bust.svg);
  background-repeat: no-repeat;
  background-position: top;
  background-size: cover;
}

.profile-card--irina .profile-card__avatar {
  background: url(assets/irina-bust.svg);
  background-repeat: no-repeat;
  background-position: top;
  background-size: cover;
}

.profile-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px;
}

.profile-card h3 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.profile-card__job {
  margin: 8px 0 26px;
  font-size: 1.3rem;
  font-weight: 400;
}

.profile-card__income {
  padding: 18px 0;
  border-top: 2px solid #171717;
  border-bottom: 2px solid #171717;
}

.profile-card__income span {
  display: block;
  margin-bottom: 6px;
  color: #6d6a64;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-card__income strong {
  display: block;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1;
}

.profile-card__description {
  margin: 24px 0 0;
  font-size: 1rem;
  line-height: 1.5;
}

.profiles__scroll-hint {
  margin: 54px 0 0;
  text-align: center;
  font-weight: 700;
}

/* BACKGROUND CITY */
.background-city {
  position: absolute;
  left: 0;
  bottom: 32%;

  width: 300vw;
  height: 24rem;

  background: url("./assets/bucharest-background.svg") repeat-x left bottom;

  background-size: auto 100%;
  will-change: transform;
  opacity: 60%;
}

/* OUTRO CHARACTER */
.outro__character {
  display: flex;
  gap: 2rem;
}

.outro__character img {
  width: 15rem;
  height: 15rem;
}

/* RESPONSIVE */

@media (min-width: 1200px) {
  .road {
    height: 80%;
  }
}

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

  .profile-card {
    min-height: auto;
  }

  .profile-card__description {
    font-size: 1.3rem;
  }

  .road {
    height: 65%;
  }
}

@media (max-width: 700px) {
  .characters {
    left: 70px;
    scale: 0.78;
    transform-origin: left bottom;
  }

  .buildings {
    gap: 30rem;
    padding-left: 90vw;
    padding-right: 70vw;
  }

  /* .building {
    width: 170px;
    height: 200px;
  } */

  .expense {
    gap: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .expense:nth-child(odd) {
    flex-direction: column;
    align-items: flex-end;
  }

  .expense__content {
    max-width: 100%;
  }

  .intro p:not(.intro__eyebrow),
  .outro p:not(.intro__eyebrow),
  .methodology p:not(.intro__eyebrow),
  .expenses p:not(.intro__eyebrow) {
    margin: 1rem 0 0;
  }

  .expense-message {
    width: 95%;
    line-height: 1.2;
  }

  .outro__character {
    flex-direction: column;
    gap: 0;
    margin-bottom: 2rem;
  }
}

@media (max-width: 500px) {
  .profile-card__description {
    font-size: 1rem;
  }
  .road {
    height: 88%;
  }

  .character--alex {
    bottom: 60%;
  }

  .character--irina {
    bottom: 29%;
    left: 30%;
  }

  .character--vlad {
    bottom: -4%;
    left: 80%;
  }

  .expense-message {
    top: 10%;
    width: 90%;
    font-size: 1rem;
  }

  .expense-message__value {
    font-size: 1.3rem;
  }

  .background-city {
    bottom: 30%;
    width: 900vw;
    height: 20rem;
  }

  .building--housing .building__image {
    width: 40rem;
  }

  .building--utilities .building__image {
    width: 40rem;
  }

  .building--telecom .building__image {
    width: 18rem;
  }

  .building--transport .building__image {
    width: 26rem;
  }

  .building--health .building__image {
    width: 30rem;
  }

  .building--shopping .building__image {
    width: 30rem;
  }

  .building__label {
    padding: 0.8rem;
    font-size: 1.4rem;
  }

  .building--transport .building__label {
    top: -2rem;
  }

  .expense img {
    width: 16rem;
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
