* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  position: relative;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  background:
    url("stream-background.png")
    center center / cover no-repeat;
}

#stream {
  position: absolute;
  inset: 0;

  z-index: 2;

  overflow: hidden;
}


/* =========================================
   MEMORIAL CARD
   ========================================= */

.name-card {
  position: absolute;
  left: 50%;

  width: min(72vw, 760px);
  min-height: 78px;

  padding: 14px 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 18px;

  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.38);

  border:
    1px solid
    rgba(255, 255, 255, 0.38);

  box-shadow:
    0 8px 22px rgba(25, 45, 65, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  transform:
    translateX(-50%);

  opacity: 0;

  will-change:
    transform,
    top,
    opacity;
}


/* =========================================
   RIBBON + NAME
   ========================================= */

.left-group {
  display: flex;
  align-items: center;

  gap: 20px;

  flex: 1;

  min-width: 0;
}


/* Ribbon */

.ribbon-icon {
  width: 46px;
  height: 68px;

  flex-shrink: 0;

  object-fit: contain;

  display: block;
}


/* Main text */

.main-text {
  flex: 1;

  text-align: center;

  min-width: 0;
}


/* Name */

.person-name {
  color: #173765;

  font-size: 28px;

  line-height: 1.05;

  font-weight: 500;
}


/* Dates */

.person-dates {
  margin-top: 3px;

  color: #9a7a3b;

  font-size: 13px;

  font-style: italic;

  letter-spacing: 1px;
}


/* Tribute */

.person-tribute {
  margin-top: 6px;

  color: #4f5f73;

  font-size: 14px;

  line-height: 1.3;

  font-style: italic;

  max-width: 430px;

  margin-left: auto;
  margin-right: auto;

  overflow-wrap: anywhere;
}


/* Cancer type */

.cancer-type {
  min-width: 180px;

  padding-left: 20px;

  border-left:
    1px solid
    rgba(165, 125, 55, 0.65);

  color: #33445c;

  font-size: 18px;

  font-style: italic;

  text-align: left;
}


/* =========================================
   TABLET
   ========================================= */

@media (max-width: 900px) {

  .name-card {
    width: min(84vw, 720px);

    padding: 12px 18px;

    gap: 14px;
  }

  .ribbon-icon {
    width: 40px;
    height: 60px;
  }

  .person-name {
    font-size: 23px;
  }

  .person-tribute {
    font-size: 13px;

    max-width: 360px;
  }

  .cancer-type {
    min-width: 145px;

    font-size: 16px;
  }
}


/* =========================================
   PHONE
   ========================================= */

@media (max-width: 650px) {

  body {
    background-image:
      url("stream-background-mobile.png");

    background-position:
      center top;

    background-size:
      cover;

    background-repeat:
      no-repeat;
  }


  /* Mobile cards */

  .name-card {
    width: 88vw;

    min-height: 66px;

    padding: 10px 14px;

    gap: 10px;

    border-radius: 30px;
  }


  .left-group {
    gap: 10px;
  }


  .ribbon-icon {
    width: 34px;

    height: 50px;
  }


  .person-name {
    font-size: 18px;

    line-height: 1.1;
  }


  .person-dates {
    margin-top: 2px;

    font-size: 10px;

    letter-spacing: 0.5px;
  }


  .person-tribute {
    margin-top: 4px;

    font-size: 10px;

    line-height: 1.2;

    max-width: 210px;
  }


  .cancer-type {
    min-width: 95px;

    padding-left: 9px;

    font-size: 12px;

    line-height: 1.15;
  }


  /* =========================================
     MOBILE RIVER ANIMATION
     ========================================= */

  .mobile-card {
    top: auto;

    bottom: -90px;

    opacity: 0;

    animation-name:
      mobileRiverFlow;

    animation-timing-function:
      linear;

    animation-fill-mode:
      both;

    animation-iteration-count:
      1;

    will-change:
      transform,
      opacity;
  }


  @keyframes mobileRiverFlow {

    0% {
      bottom: -90px;

      transform:
        translateX(-50%)
        scale(1);

      opacity: 0;
    }


    5% {
      opacity: 1;
    }


    25% {
      bottom: 18%;

      transform:
        translateX(-49%)
        scale(0.90);

      opacity: 1;
    }


    50% {
      bottom: 38%;

      transform:
        translateX(-51%)
        scale(0.80);

      opacity: 1;
    }


    75% {
      bottom: 55%;

      transform:
        translateX(-49%)
        scale(0.70);

      opacity: 1;
    }


    92% {
      opacity: 1;
    }


    100% {
      bottom: 70%;

      transform:
        translateX(-50%)
        scale(0.62);

      opacity: 0;
    }
  }
}


/* =========================================
   VERY SMALL PHONES
   ========================================= */

@media (max-width: 430px) {

  .name-card {
    width: 90vw;

    padding: 9px 11px;
  }


  .ribbon-icon {
    width: 30px;

    height: 44px;
  }


  .person-name {
    font-size: 16px;
  }


  .person-tribute {
    font-size: 9px;

    max-width: 180px;
  }


  .cancer-type {
    min-width: 78px;

    font-size: 11px;
  }
}


/* =========================================
   ENTER SCREEN
   ========================================= */

#enter-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  background:
    rgba(10, 28, 45, 0.38);

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  transition:
    opacity 0.8s ease,
    visibility 0.8s ease;
}

#enter-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.enter-content {
  text-align: center;

  padding: 30px;

  color: white;

  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.45);
}

.enter-content h1 {
  margin: 0;

  font-size: clamp(34px, 7vw, 64px);

  font-weight: 500;
}

.enter-content p {
  margin: 10px 0 28px;

  font-size: clamp(18px, 4vw, 28px);

  font-style: italic;
}

#enter-button {
  padding: 14px 28px;

  border: 1px solid rgba(255, 255, 255, 0.7);

  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.82);

  color: #173765;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 18px;

  cursor: pointer;

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.18);
}

#enter-button:hover {
  background: white;
}