@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

:root {
  --navy: #0f3f8f;
  --blue: #1c56a8;
  --blue-light: #eff7fc;
  --blue-halo: #d6e6f8;
  --line: #d9dee6;
  --card-bg: #ffffff;
  --card-w: clamp(470px, 30vw, 620px);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", sans-serif;
  background-color: #fafafa;
  background-image: url("./assets/bg-tile.png");
  background-repeat: repeat;
  background-size:
    min(840px, max(48.611vw, 75.201vh))
    min(721px, max(41.725vw, 64.548vh));
  background-position: center;
  background-attachment: fixed;
  color: #003f8c;
  overflow-x: hidden;
}
.page {
  position: relative;
  max-width: 1800px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ribbon {
  position: relative;
  width: calc(var(--card-w) * 0.4);
  aspect-ratio: 170 / 220;
  background: var(--navy);
  border-radius: 0 0 50% 50% / 0 0 38.6% 38.6%;
  display: flex;
  justify-content: center;
}

.ribbon .seal {
  position: absolute;
  left: 50%;
  top: 25.8%;
  width: 92%;
  height: auto;
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 18px rgba(0, 63, 140, 0.25));
}

.hero-row {
  position: relative;
  margin-top: clamp(50px, 8vw, 190px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cards {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(24px, 9vw, 160px);
}

.card {
  position: relative;
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  max-width: 620px;
  container-type: inline-size;
  aspect-ratio: 500 / 362;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(15, 63, 143, 0.12);
  overflow: hidden;
  isolation: isolate;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(15, 63, 143, 0.2);
}

.card__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.card__shape--m {
  display: none;
}

.card__watermark {
  position: absolute;
  right: -4cqw;
  bottom: -3cqw;
  width: 44cqw;
  height: auto;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom right, transparent 10%, #000 60%);
  mask-image: linear-gradient(to bottom right, transparent 10%, #000 60%);
}

.card__ribbon {
  position: absolute;
  left: 0;
  top: 0;
  width: 21cqw;
  height: auto;
  pointer-events: none;
}

.card__icon {
  position: absolute;
  left: 2.2cqw;
  top: 6.6cqw;
  width: 16.64cqw;
  height: auto;
  pointer-events: none;
}

.card__content {
  position: absolute;
  top: 13%;
  left: 26%;
  right: 8%;
}

.card__title {
  font-size: max(18px, 5.2cqw);
  font-weight: 500;
  line-height: 1.25;
  box-sizing: content-box;
  min-height: 3.75em;
  color: var(--blue);
  padding-bottom: 2.4cqw;
  border-bottom: 1px solid var(--line);
}

.card__subtitle {
  margin-top: 2.6cqw;
  margin-bottom: 0;
  font-size: max(11px, 2.6cqw);
  font-weight: 400;
  color: var(--blue);
}

.card__button {
  position: absolute;
  left: 26%;
  bottom: 6%;
  width: max(44px, 10cqw);
  height: max(44px, 10cqw);
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 7px var(--blue-halo);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover .card__button {
  transform: translateX(3px);
  box-shadow: 0 0 0 9px var(--blue-halo);
}

.card:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 4px;
}

.card__button svg {
  width: max(18px, 4.4cqw);
  height: max(18px, 4.4cqw);
}

@media (prefers-reduced-motion: reduce) {
  .card__button {
    transition: none;
  }
}

@media (max-width: 1225px) {
  .hero-row {
    width: 100%;
  }

  .cards {
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .card {
    flex: 0 0 auto;
  }
}

@media (max-width: 500px) {
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-row {
    margin-top: 50px;
  }

  .cards {
    gap: 40px;
    display: grid;
    grid-template-columns: min(100%, 470px);
    grid-auto-rows: 1fr;
    justify-content: center;
    align-items: stretch;
  }

  .card {
    width: 100%;
    max-width: 470px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    min-height: calc(min(100vw - 32px, 470px) * 370 / 500);
    overflow: clip;
  }

  .card__shape {
    display: none;
  }

  .card__shape.card__shape--m {
    display: block;
  }

  .card__content {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin: 8.84cqw 8cqw 4cqw 26cqw;
  }

  .card__button {
    position: relative;
    left: auto;
    bottom: auto;
    margin: auto 0 4.08cqw 26cqw;
  }
}

.side-bichig {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 28px;
  pointer-events: none;
}

.side-bichig-left {
  right: calc(100% + 150px);
}

.side-bichig-right {
  left: calc(100% + 150px);
}

.side-bichig img {
  height: clamp(0px, 22.1vw, 420px);
  width: auto;
  opacity: 0.9;
}
.side-bichig .sidescript{
  height: clamp(0px, 28.42vw, 540px);
  width: auto;
  opacity: 0.9;
}

@media (max-width: 714px) {
  .side-bichig {
    display: none;
  }
}

@media (min-width: 715px) and (max-width: 2200px) {
  .hero-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
  }

  .cards {
    grid-column: 2;
  }

  .side-bichig {
    position: static;
    top: auto;
    transform: none;
  }

  .side-bichig-left,
  .side-bichig-right {
    right: auto;
    left: auto;
  }

  .side-bichig-left {
    justify-self: end;
  }

  .side-bichig-right {
    justify-self: start;
  }
}

@media (min-width: 830px) and (max-width: 1225px) {
  .hero-row {
    gap: 48px;
  }
}

.site-footer {
  margin-top: auto;
  padding: 60px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(15, 63, 143, 0.25);
}

.social-icon svg {
  width: 20px;
  height: 20px;
}

.copyright {
  margin-bottom: 0;
  font-size: 12px;
  color: var(--blue);
  opacity: 0.8;
  text-align: center;
}

@media (max-height: 1010px) and (min-width: 501px) {
  .hero-row {
    margin-top: clamp(16px, 6vh, 80px);
  }

  :root {
    --card-w: clamp(420px, min(62vh, 30vw), 620px);
  }

  .side-bichig img {
    height: min(calc(var(--card-w) * 0.73), 22.1vw);
  }

  .side-bichig .sidescript {
    height: min(calc(var(--card-w) * 0.94), 28.42vw);
  }

  .site-footer {
    padding: 24px 16px 16px;
    gap: 10px;
  }

  .social-icon {
    width: 32px;
    height: 32px;
  }

  .social-icon svg {
    width: 16px;
    height: 16px;
  }
}
