@font-face { font-family: Galmuri14; src: url(fonts/Galmuri14.ttf); font-display: swap; }
@font-face { font-family: Galmuri11; src: url(fonts/Galmuri11.ttf); font-display: swap; }
:root { --sky: #aaddf0; --sky-dark: #6fa8bf; --sun: #ffd93b; --ink: #3a2c24; --paper: #e8dcb8; --night: #12101e; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sky); color: var(--ink); font: 12px/1.5 Galmuri11, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; word-break: keep-all; }
img { display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

/* 한 화면. 크기는 도트 배수(--pig-u, --logo-u, --g)로만 바꾼다. */
.page {
  --pig-u: 1; --logo-u: 2; --g: 1; --hill-u: 1; --grass: 36px; --feet: 8px; --plant: 22px; --dur: 15s; --phone-max: 860px; --bezel: 6px;
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto;
  height: 100vh; height: 100dvh; min-height: 560px;
}
/* 하늘과 구름. 게임의 그림을 그대로 쓴다. 방사형 무늬는 욱일기를 떠올리게 하므로 쓰지 않는다. */
.page::before {
  content: ""; position: absolute; inset: 0; z-index: -1; image-rendering: pixelated;
  /* 세로 화면은 위쪽이 글자라서 폰 옆에만 띄운다. */
  background:
    url(media/cloud.png) 0 46% / 80px 32px no-repeat,
    url(media/cloud.png) 100% 58% / 80px 32px no-repeat;
}
.stage { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; min-height: 0; padding: 12px 12px 0; }
.pitch { text-align: center; }
.title { display: flex; align-items: center; justify-content: center; gap: 4px; }
.pig {
  flex: none;
  width: calc(91px * var(--pig-u)); height: calc(67px * var(--pig-u));
  background: url(media/pig.png) 0 0 / calc(1820px * var(--pig-u)) 100%;
  image-rendering: pixelated;
  animation: pig 2s steps(20) infinite;
}
@keyframes pig { to { background-position-x: calc(-1820px * var(--pig-u)); } }
h1 { margin: 0; flex: none; }
h1 img { width: calc(118px * var(--logo-u)); height: calc(35px * var(--logo-u)); image-rendering: pixelated; }
.tag { margin: 6px 0 0; font: 20px/1.3 Galmuri14, Galmuri11, sans-serif; }
.lead { margin: 2px 0 0; font-size: 14px; }

.stores { display: flex; justify-content: center; gap: 16px; margin-top: 14px; }
.store {
  display: block; flex: 0 1 148px; padding: 6px 4px 7px; margin: 4px 0 8px;
  background: var(--ink); color: #fff; text-decoration: none; text-align: center;
  font: 16px/1.25 Galmuri14, Galmuri11, sans-serif;
  box-shadow: 0 -4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink), 0 4px 0 var(--ink), 0 8px 0 var(--sky-dark);
}
.store small { display: block; color: var(--sun); font: 12px/1.3 Galmuri11, sans-serif; }
.store:hover { background: #55413a; }
.store:active { transform: translateY(4px); box-shadow: 0 -4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink), 0 4px 0 var(--ink); }

/* 폰은 풀밭에 서 있고, 손님은 그 뒤로 지나간다. */
.film { position: relative; z-index: 3; min-height: 0; }
.phone {
  position: absolute; bottom: calc(var(--plant) * -1); left: 50%; transform: translateX(-50%);
  height: min(calc(100% + var(--plant)), var(--phone-max));
  aspect-ratio: 9 / 16; padding: var(--bezel); background: var(--night);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px), 0 8px, 4px 8px, 4px 4px, 8px 4px);
}
.phone video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--sky); }
.sound { position: absolute; right: calc(var(--bezel) + 4px); bottom: calc(var(--bezel) + 4px); width: 32px; height: 32px; padding: 7px; border: 0; background: var(--night); color: #fff; cursor: pointer; }
.sound svg { display: block; width: 100%; height: 100%; fill: currentColor; shape-rendering: crispEdges; }
.sound[aria-pressed="false"] .on, .sound[aria-pressed="true"] .off { display: none; }
.sound:focus-visible { outline-offset: -3px; }

.ground { position: relative; height: var(--grass); background: url(media/grass.png) 0 0 / 64px; image-rendering: pixelated; }
.ground::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; background: url(media/fringe.png) 0 0 / 64px 8px repeat-x; image-rendering: pixelated; }
.ground::after { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 100%; height: calc(110px * var(--hill-u)); background: url(media/hills.png) center bottom / auto 100% repeat-x; image-rendering: pixelated; }
.ground i {
  position: absolute; left: 0; bottom: var(--feet);
  width: calc(54px * var(--g)); height: calc(66px * var(--g));
  background: url(media/march.png) 0 calc(var(--r) * -66px * var(--g)) / calc(432px * var(--g)) auto;
  image-rendering: pixelated;
  animation: step .8s steps(8) infinite, go var(--dur) steps(240) infinite;
  animation-delay: 0s, calc(var(--at) * var(--dur) * -1);
}
@keyframes step { to { background-position-x: calc(-432px * var(--g)); } }
@keyframes go { from { transform: translateX(calc(-54px * var(--g))); } to { transform: translateX(100vw); } }

.soil { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; padding: 6px 12px 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); }
.soil a { display: inline-block; padding: 3px 0; text-underline-offset: 2px; }
.soil span { padding: 3px 0; }

/* 아주 좁은 폰은 로고만 남긴다. */
@media (max-width: 349px) {
  .pig { display: none; }
}
@media (min-width: 400px) and (min-height: 700px) {
  .page { --logo-u: 2.5; --grass: 44px; --plant: 28px; --feet: 12px; }
  .tag { font-size: 22px; }
  .stage { padding-top: 20px; gap: 16px; }
}

/* 가로 화면: 왼쪽 소개, 오른쪽 폰. */
@media (min-aspect-ratio: 1/1) {
  .page::before {
    background:
      url(media/cloud.png) 6% 7% / 120px 48px no-repeat,
      url(media/cloud.png) 40% 3% / 80px 32px no-repeat,
      url(media/cloud.png) 97% 12% / 160px 64px no-repeat,
      url(media/cloud.png) 3% 44% / 80px 32px no-repeat,
      url(media/cloud.png) 100% 58% / 80px 32px no-repeat;
  }
  .page { --logo-u: 3; --grass: 64px; --feet: 18px; --plant: 42px; --g: 1; --dur: 24s; --bezel: 8px; min-height: 360px; }
  .stage { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; width: min(1180px, 100%); margin: 0 auto; padding: 16px 24px 0; }
  .pitch { align-self: center; padding-bottom: 40px; }
  .title { flex-direction: column; gap: 8px; }
  .tag { margin-top: 14px; font-size: 26px; }
  .lead { margin-top: 4px; font-size: 16px; }
  .stores { margin-top: 20px; gap: 20px; }
  .store { flex-basis: 176px; padding: 7px 4px 8px; font-size: 18px; }
  .sound { width: 36px; height: 36px; padding: 8px; }
}
/* 눕힌 폰. 높이가 모자라니 제목을 한 줄로 놓는다. */
@media (min-aspect-ratio: 1/1) and (max-height: 519px) {
  .page { --logo-u: 2; --grass: 40px; --feet: 10px; --plant: 26px; }
  .title { flex-direction: row; gap: 4px; }
  .tag { margin-top: 4px; font-size: 20px; }
  .lead { margin-top: 2px; font-size: 14px; }
  .stores { margin-top: 10px; }
  .pitch { padding-bottom: 28px; }
}
@media (min-aspect-ratio: 1/1) and (min-height: 660px) {
  .page { --pig-u: 2; --g: 2; --feet: 14px; }
  .pitch { padding-bottom: 80px; }
}
@media (min-aspect-ratio: 1/1) and (min-height: 820px) and (min-width: 1100px) {
  .page { --pig-u: 3; --logo-u: 4; --hill-u: 2; --grass: 72px; --plant: 48px; }
  .tag { font-size: 30px; }
  .lead { font-size: 18px; }
  .stores { margin-top: 24px; }
  .store { flex-basis: 200px; padding: 9px 4px 10px; font-size: 22px; }
  .store small { font-size: 14px; }
}
@media (min-aspect-ratio: 1/1) and (min-height: 1100px) and (min-width: 1800px) {
  .page { --pig-u: 4; --logo-u: 5; --g: 3; --hill-u: 3; --grass: 96px; --feet: 22px; --plant: 64px; --phone-max: 1120px; --bezel: 10px; }
  .stage { width: min(1500px, 100%); }
  .pitch { padding-bottom: 140px; }
  .tag { font-size: 38px; }
  .lead { font-size: 22px; }
  .store { flex-basis: 240px; font-size: 26px; }
  .store small { font-size: 16px; }
  .soil { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .pig, .ground i { animation: none; }
  .ground i { transform: translateX(calc(var(--at) * 100vw)); }
}

.doc { background: #fff; font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; }
.doc main { max-width: 42em; margin: 0 auto; padding: 32px 16px 64px; }
.doc h1 { font-size: 28px; line-height: 1.35; margin: 12px 0 8px; }
.doc h2 { font-size: 18px; line-height: 1.35; margin: 28px 0 8px; }
.doc p { margin: 0 0 8px; }
.doc ul { margin: 0 0 8px; padding-left: 1.3em; }
.doc nav a { margin-right: 16px; }
