:root {
  --content-background: #ebe4f6;
  --text-color: #4a3733;
  --page-width: 440px;
}

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

html {
  background: var(--content-background);
  color: var(--text-color);
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--content-background);
  color: var(--text-color);
  font-family:
    "A-OTF Shin Maru Go Pr6",
    "A-OTF Shin Maru Go Pr6N",
    "Hiragino Maru Gothic ProN",
    "ヒラギノ丸ゴ ProN W4",
    "Yu Gothic",
    sans-serif;
  font-weight: 600;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-loading {
  overflow: hidden;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #6d7991;
  opacity: 1;
  visibility: visible;
  transition: opacity 500ms ease, visibility 0s linear 500ms;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(14px);
}

.loading-screen__cat {
  width: clamp(240px, 21.8vw, 314px);
  height: auto;
  transform-origin: 55% 72%;
  animation: loading-cat-breathe 2.6s ease-in-out infinite;
}

.loading-screen__text {
  margin: -10px 0 0;
  color: #fff;
  font-size: clamp(1.5rem, 1.95vw, 1.75rem);
  font-weight: 700;
  line-height: 1.4;
}

.loading-screen__letters {
  display: inline-flex;
  gap: 0.12em;
}

.loading-screen__letter {
  display: inline-block;
  animation: loading-letter-wave 1.25s ease-in-out infinite;
  animation-delay: calc(var(--letter-index) * 90ms);
}

.loading-screen__letter:nth-child(1) { --letter-index: 0; }
.loading-screen__letter:nth-child(2) { --letter-index: 1; }
.loading-screen__letter:nth-child(3) { --letter-index: 2; }
.loading-screen__letter:nth-child(4) { --letter-index: 3; }
.loading-screen__letter:nth-child(5) { --letter-index: 4; }
.loading-screen__letter:nth-child(6) { --letter-index: 5; }
.loading-screen__letter:nth-child(7) { --letter-index: 6; }
.loading-screen__letter:nth-child(8) { --letter-index: 7; }
.loading-screen__letter:nth-child(9) { --letter-index: 8; }
.loading-screen__letter:nth-child(10) { --letter-index: 9; }

@keyframes loading-cat-breathe {
  0%,
  100% {
    transform: translateY(0) rotate(-0.2deg) scale(1, 1);
  }

  50% {
    transform: translateY(3px) rotate(0.3deg) scale(1.005, 0.985);
  }
}

@keyframes loading-letter-wave {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-5px);
  }
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.page {
  border: 6px solid #fff;
  width: 100%;
  max-width: var(--page-width);
  min-height: 100vh;
  margin-inline: auto;
  overflow: hidden;
  background: var(--content-background);
}

.hero {
  position: relative;
  height: 550px;
  overflow: hidden;
  background-color: #fff1cc;
  background-image: url("img/sp_background.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

.hero__cat {
  --cat-direction: 1;
  --walk-duration: 4s;
  position: absolute;
  z-index: 1;
  top: 300px;
  left: 50%;
  width: min(48vw, 212px);
  height: auto;
  transform: translateX(-50%) scaleX(var(--cat-direction));
  transform-origin: center bottom;
  pointer-events: none;
  user-select: none;
  will-change: left, transform;
}

.hero__cat.is-walking {
  transition: left var(--walk-duration) linear;
  animation: cat-walk-bob 420ms ease-in-out infinite;
}

@keyframes cat-walk-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scaleX(var(--cat-direction));
  }

  50% {
    transform: translateX(-50%) translateY(-4px) scaleX(var(--cat-direction));
  }
}

.app-store-link {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 20px;
  display: block;
  width: 130px;
  border-radius: 8px;
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-store-link img {
  width: 100%;
  height: auto;
}

.app-store-link:focus-visible,
.footer__links a:focus-visible {
  outline: 3px solid #8b6fc7;
  outline-offset: 4px;
}

@media (hover: hover) {
  .app-store-link:hover {
    opacity: 0.82;
    transform: translateY(-2px);
  }

  .footer__links a:hover {
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
  }
}

.content {
  padding: 36px 20px 0;
}

.main-logo {
  margin: 0;
}

.main-logo img {
  width: 100%;
  height: auto;
}

.intro {
  margin-top: 42px;
  text-align: center;
}

.intro__title,
.section__title,
.intro__note,
.section__text {
  margin: 0;
}

.intro__title {
  font-size: clamp(1.28rem, 5.45vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.95;
}

.intro__note {
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.7;
}

.section {
  margin-top: 62px;
}

.section--ads {
  margin-top: 60px;
}

.section__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.flags {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 7px;
  margin: 24px 0 22px;
  padding: 0;
  list-style: none;
}

.flags li {
  min-width: 0;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: clamp(1.25rem, 5.2vw, 1.45rem);
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.section__text {
  font-size: clamp(1rem, 3.86vw, 1.0625rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.95;
}

.footer {
  position: relative;
  min-height: 198px;
  padding: 55px 20px 42px;
}

.footer__links {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links li + li {
  margin-top: 12px;
}

.footer__links a {
  display: inline-block;
  min-height: 28px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-decoration: none;
}

.footer__cat {
  position: absolute;
  right: 16px;
  bottom: 24px;
  width: 144px;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 374px) {
  .content {
    padding-inline: 16px;
  }

  .hero {
    height: 125vw;
    min-height: 500px;
    max-height: 550px;
  }

  .hero__cat {
    top: 61%;
  }

  .app-store-link {
    right: 16px;
    bottom: 16px;
    width: 120px;
  }

  .flags {
    gap: 3px;
  }

  .footer__cat {
    width: 124px;
  }
}

@media (min-width: 1200px) and (min-height: 720px) {
  :root {
    --panel-right: clamp(40px, 4.65vw, 68px);
    --panel-width: clamp(430px, 35.3vw, 508px);
    --panel-top: clamp(44px, 6.65vh, 68px);
    --panel-bottom: clamp(48px, 7.5vh, 77px);
    --panel-padding: clamp(40px, 4.15vw, 60px);
  }

  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    background: #fff1cc;
  }

  .page {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 720px;
    margin: 0;
    background-color: #fff1cc;
    background-image: url("img/background.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
  }

  .page::before {
    position: absolute;
    z-index: 1;
    top: var(--panel-top);
    right: var(--panel-right);
    bottom: var(--panel-bottom);
    width: var(--panel-width);
    border: 6px solid #fff;
    border-radius: 34px;
    background: var(--content-background);
    content: "";
  }

  .hero {
    position: absolute;
    z-index: 0;
    inset: 0 auto 0 0;
    width: 60%;
    height: 100%;
    background: transparent;
  }

  .hero__cat {
    top: auto;
    bottom: clamp(94px, 13.2vh, 136px);
    width: min(30vw, 430px);
  }

  .app-store-link {
    right: auto;
    bottom: clamp(28px, 4.3vh, 44px);
    left: clamp(32px, 3.7vw, 54px);
    width: clamp(190px, 16vw, 230px);
  }

  .content {
    position: absolute;
    z-index: 2;
    top: var(--panel-top);
    right: var(--panel-right);
    width: var(--panel-width);
    padding: clamp(44px, 5.65vh, 58px) var(--panel-padding) 0;
  }

  .main-logo img {
    width: 100%;
  }

  .intro {
    margin-top: clamp(36px, 4.9vh, 50px);
    text-align: left;
  }

  .intro__title {
    font-size: clamp(1.25rem, 1.67vw, 1.5rem);
    letter-spacing: 0.025em;
    line-height: 1.8;
  }

  .intro__note {
    margin-top: 5px;
    font-size: clamp(0.875rem, 1.1vw, 1rem);
  }

  .section {
    margin-top: clamp(42px, 5.9vh, 60px);
  }

  .section--ads {
    margin-top: clamp(38px, 5.2vh, 54px);
  }

  .section__title {
    font-size: clamp(1.25rem, 1.8vw, 1.625rem);
  }

  .flags {
    gap: 7px;
    margin: clamp(16px, 2vh, 21px) 0 clamp(14px, 1.8vh, 19px);
  }

  .flags li {
    font-size: clamp(1.15rem, 1.55vw, 1.4rem);
  }

  .section__text {
    font-size: clamp(0.9rem, 1.2vw, 1.0625rem);
    line-height: 1.9;
  }

  .footer {
    position: absolute;
    z-index: 2;
    right: var(--panel-right);
    bottom: var(--panel-bottom);
    width: var(--panel-width);
    min-height: 165px;
    padding: 22px var(--panel-padding) 28px;
  }

  .footer__links li + li {
    margin-top: 8px;
  }

  .footer__links a {
    min-height: 25px;
    font-size: clamp(0.8rem, 1.05vw, 0.95rem);
  }

  .footer__cat {
    right: 18px;
    bottom: 18px;
    width: clamp(125px, 11vw, 160px);
  }
}

@media (min-width: 1200px) and (min-height: 720px) and (max-height: 1019px) {
  /* .content {
    padding-top: 34px;
  } */

  .intro {
    margin-top: 26px;
  }

  .section {
    margin-top: 34px;
  }

  .section--ads {
    margin-top: 30px;
  }

  .flags {
    margin-top: 12px;
    margin-bottom: 10px;
  }

  .section__text {
    line-height: 1.75;
  }

  .footer {
    /* min-height: 145px; */
    padding-top: 12px;
    padding-bottom: 20px;
  }

  .footer__links li + li {
    margin-top: 4px;
  }
}

@media (min-width: 1200px) and (min-height: 720px) and (max-height: 859px) {
  .content {
    padding-top: 24px;
  }

  .intro {
    margin-top: 18px;
  }

  .intro__title,
  .section__title {
    font-size: 1.25rem;
  }

  .intro__note {
    font-size: 0.875rem;
  }

  .section {
    margin-top: 26px;
  }

  .section--ads {
    margin-top: 22px;
  }

  .flags {
    margin-top: 8px;
    margin-bottom: 6px;
  }

  .flags li {
    font-size: 1.125rem;
  }

  .section__text {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .footer {
    min-height: 105px;
    padding-top: 0;
    padding-bottom: 12px;
  }

  .footer__cat {
    width: 120px;
  }

  .footer__links a {
    font-size: 0.8rem;
  }
}

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

  .loading-screen__cat,
  .loading-screen__letter {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }

  .app-store-link {
    transition: none;
  }

  .hero__cat.is-walking {
    transition: none;
    animation: none;
  }
}
