@font-face {
  font-family: "Mulmaru";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2601-4@1.1/Mulmaru.woff2") format("woff2");
  font-weight: normal;
  font-display: swap;
}

:root {
  --navy: #073e78;
  --blue: #1671b8;
  --sky: #9dd9f5;
  --ink: #092e54;
  --paper: #f8f3e8;
  --white: #fffdf8;
  --header-height: 126px;
  --mobile-nav-height: 82px;
  --mouse-x: 0;
  --mouse-y: 0;
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

body.is-loading {
  overflow: hidden;
}

.site-loader {
  display: flex;
  position: fixed;
  z-index: 2000;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  color: var(--navy);
  background: var(--paper);
  opacity: 1;
  visibility: visible;
  transition: opacity 620ms ease, visibility 620ms ease;
}

.site-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-loader__logo {
  width: min(720px, 76vw);
  height: auto;
  filter: drop-shadow(0 20px 34px rgba(7, 62, 120, 0.16));
  animation: loader-logo-in 720ms cubic-bezier(0.16, 0.86, 0.2, 1) both,
    loader-breathe 2.2s 720ms ease-in-out infinite;
}

.site-loader__dots {
  display: flex;
  gap: 9px;
}

.site-loader__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  animation: loader-dot 1.1s ease-in-out infinite;
}

.site-loader__dots i:nth-child(2) {
  animation-delay: 140ms;
}

.site-loader__dots i:nth-child(3) {
  animation-delay: 280ms;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  -webkit-user-drag: none;
  user-select: none;
}

img,
.site-header,
.admin-header {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 14px;
  left: 14px;
  padding: 12px 18px;
  color: var(--white);
  background: var(--navy);
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  height: var(--header-height);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 34px rgba(25, 39, 54, 0.1);
  backdrop-filter: blur(14px);
  transition: color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.main-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(210px, 0.95fr) repeat(3, minmax(150px, 1fr));
  align-items: center;
  width: min(1680px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
}

.nav-link {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  gap: 12px;
  padding: 0 16px;
  text-decoration: none;
  font-family: "Mulmaru", Pretendard, sans-serif;
  font-size: clamp(24px, 1.75vw, 32px);
  font-weight: normal;
  letter-spacing: -0.06em;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms ease;
}

.nav-link:hover {
  color: var(--blue);
  transform: translateY(-2px);
}

.nav-link:focus-visible,
.brand:focus-visible {
  outline: 3px solid #e89b43;
  outline-offset: 5px;
}

.nav-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
  transition: filter 220ms ease, transform 180ms ease;
}

.nav-link:hover .nav-icon {
  transform: translateY(-2px) scale(1.08);
}

.nav-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.24em;
}

.brand {
  display: grid;
  place-items: center;
  align-self: stretch;
  padding: 9px 14px;
}

.brand img {
  grid-area: 1 / 1;
  width: min(243px, 100%);
  height: 108px;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(7, 62, 120, 0.1));
}

.brand-logo--white {
  display: none;
}

.hero {
  position: relative;
  overflow: hidden;
  height: max(720px, 100svh);
  min-height: 720px;
  padding-top: var(--header-height);
  background: #d8e8f7;
  isolation: isolate;
}

.hero-stage {
  position: absolute;
  z-index: 0;
  inset: var(--header-height) 0 0;
  overflow: hidden;
  perspective: 1100px;
  transform-style: preserve-3d;
}

.hero-layer {
  --depth: 0;
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
}

.hero-layer[data-depth="0.12"] {
  --depth: 0.12;
}

.hero-layer[data-depth="0.38"] {
  --depth: 0.38;
}

.hero-layer[data-depth="0.58"] {
  --depth: 0.58;
}

.hero-layer[data-depth="0.82"] {
  --depth: 0.82;
}

.hero-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.hero-layer--background {
  z-index: 1;
  inset: -3%;
  animation: background-enter 1.25s cubic-bezier(0.18, 0.8, 0.18, 1) both;
  transform: translate3d(
    calc(var(--mouse-x) * var(--depth) * -1px),
    calc(var(--mouse-y) * var(--depth) * -1px),
    -45px
  ) scale(1.06);
}

.hero-layer--medicine {
  z-index: 3;
  inset: -3.5%;
  animation-duration: 1.4s, 7s;
  animation-fill-mode: both;
  animation-iteration-count: 1, infinite;
  animation-timing-function: cubic-bezier(0.16, 0.85, 0.24, 1), ease-in-out;
}

.hero-layer--medicine img {
  object-fit: cover;
}

.hero-layer--medicine-one {
  animation-name: medicine-enter-one, medicine-float-one;
  animation-delay: 180ms, 1.58s;
  transform: translate3d(
    calc(var(--mouse-x) * var(--depth) * 1px),
    calc(var(--mouse-y) * var(--depth) * 1px),
    35px
  );
}

.hero-layer--medicine-two {
  z-index: 4;
  animation-name: medicine-enter-two, medicine-float-two;
  animation-delay: 280ms, 1.68s;
  animation-duration: 1.45s, 8s;
  transform: translate3d(
    calc(var(--mouse-x) * var(--depth) * 1px),
    calc(var(--mouse-y) * var(--depth) * 1px),
    55px
  );
}

.hero-layer--character {
  z-index: 6;
  inset: auto 50% -2.5%;
  width: min(61vw, 810px);
  height: min(82vh, 900px);
  animation: character-enter 1.25s 260ms cubic-bezier(0.16, 0.86, 0.2, 1) both;
  transform: translate3d(
    calc(-50% + var(--mouse-x) * var(--depth) * 0.92px),
    calc(var(--mouse-y) * var(--depth) * 0.62px),
    80px
  );
}

.hero-layer--character img {
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 20px 18px rgba(11, 50, 92, 0.22));
}

.hero-message {
  position: absolute;
  z-index: 20;
  top: calc(50% + 63px);
  width: clamp(351px, 32.7vw, 545px);
  animation: label-enter 700ms 1.15s ease both;
  transform: translateY(-50%);
}

.hero-message--left {
  left: clamp(24px, 4vw, 76px);
}

.hero-message--right {
  right: clamp(24px, 4vw, 76px);
  text-align: right;
}

.hero-slogan {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(5, 43, 89, 0.2));
  image-rendering: auto;
}

.hero-message--left .hero-slogan {
  animation: slogan-float-left 5.2s ease-in-out infinite;
}

.hero-message--right .hero-slogan {
  animation: slogan-float-right 5.8s -2.3s ease-in-out infinite;
}

.next-section {
  display: grid;
  min-height: 40vh;
  place-content: center;
  padding: 84px 24px;
  text-align: center;
  background: var(--paper);
}

.next-section p {
  margin: 0;
  font-family: "Mulmaru", Pretendard, sans-serif;
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  font-weight: normal;
  letter-spacing: -0.065em;
}

.site-footer {
  padding: 52px 24px 46px;
  color: var(--white);
  background: var(--navy);
  text-align: center;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.social-link {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
  text-decoration: none;
  transition: background-color 180ms ease, transform 180ms ease;
}

.social-link:hover {
  background: var(--blue);
  transform: translateY(-3px);
}

.social-link:focus-visible {
  outline: 3px solid #f5bf4f;
  outline-offset: 4px;
}

.social-link img {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
}

.site-footer__copyright {
  margin: 24px 0 0;
  font-size: 0.88rem;
  letter-spacing: -0.015em;
  opacity: 0.82;
}

.floating-actions {
  display: flex;
  position: fixed;
  z-index: 95;
  right: 28px;
  bottom: 28px;
  flex-direction: column;
  gap: 10px;
}

.music-button {
  position: fixed;
  right: auto;
  bottom: 28px;
  left: 28px;
}

.floating-action-button {
  display: grid;
  width: 60px;
  height: 60px;
  padding: 0;
  place-items: center;
  color: var(--white);
  background: var(--navy);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(7, 40, 76, 0.28);
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.floating-action-button:hover {
  background: var(--blue);
  box-shadow: 0 18px 42px rgba(7, 40, 76, 0.34);
  transform: translateY(-3px);
}

.floating-action-button:active {
  transform: translateY(0) scale(0.96);
}

.floating-action-button:focus-visible {
  outline: 3px solid #f5bf4f;
  outline-offset: 4px;
}

.floating-action-button img {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
}

.floating-action-button img[hidden] {
  display: none;
}

.is-game-page .music-button {
  display: none;
}

.toast {
  display: flex;
  position: fixed;
  z-index: 80;
  right: 28px;
  bottom: 104px;
  align-items: center;
  gap: 11px;
  max-width: calc(100vw - 56px);
  padding: 13px 18px;
  color: var(--navy);
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(29, 42, 54, 0.18);
  font-family: "Mulmaru", Pretendard, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  font-size: 1rem;
  line-height: 1;
}

@keyframes loader-logo-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.88);
  }
}

@keyframes loader-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

@keyframes loader-dot {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-7px);
  }
}

@keyframes background-enter {
  from {
    opacity: 0;
    transform: translate3d(0, -14%, -45px) scale(1.12);
  }
}

@keyframes character-enter {
  from {
    opacity: 0;
    transform: translate3d(-50%, 24%, 80px) scale(0.93);
  }
}

@keyframes medicine-enter-one {
  from {
    opacity: 0;
    transform: translate3d(0, 0, 35px) scale(0.3) rotate(-4deg);
  }
}

@keyframes medicine-enter-two {
  from {
    opacity: 0;
    transform: translate3d(0, 0, 55px) scale(0.26) rotate(5deg);
  }
}

@keyframes medicine-float-one {
  0%,
  100% {
    margin-top: -7px;
  }
  50% {
    margin-top: 9px;
  }
}

@keyframes medicine-float-two {
  0%,
  100% {
    margin-top: 10px;
  }
  50% {
    margin-top: -8px;
  }
}

@keyframes label-enter {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
}

@keyframes slogan-float-left {
  0%,
  100% {
    transform: translateY(-5px);
  }
  50% {
    transform: translateY(7px);
  }
}

@keyframes slogan-float-right {
  0%,
  100% {
    transform: translateY(6px);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (min-width: 1181px) {
  .site-header {
    color: var(--white);
    background: linear-gradient(180deg, rgba(4, 31, 63, 0.82) 0%, rgba(4, 31, 63, 0.42) 65%, rgba(4, 31, 63, 0) 100%);
    box-shadow: none;
    backdrop-filter: none;
  }

  .site-header .nav-icon {
    filter: brightness(0) invert(1);
  }

  .site-header .nav-link {
    font-size: clamp(23px, 1.6vw, 29px);
  }

  .site-header:not(.is-scrolled) .nav-link:hover {
    color: #aee7ff;
  }

  .site-header .brand {
    align-self: center;
    height: calc(var(--header-height) - 14px);
    margin: 7px 5px;
    padding: 2px 10px;
    background: transparent;
    box-shadow: none;
  }

  .site-header .brand-logo--color {
    display: none;
  }

  .site-header .brand-logo--white {
    display: block;
    filter: drop-shadow(0 8px 18px rgba(4, 31, 63, 0.24));
  }

  .site-header.is-scrolled {
    color: var(--ink);
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 10px 34px rgba(25, 39, 54, 0.1);
    backdrop-filter: blur(14px);
  }

  .site-header.is-scrolled .nav-icon {
    filter: none;
  }

  .site-header.is-scrolled .brand {
    background: transparent;
    box-shadow: none;
  }

  .site-header.is-scrolled .brand-logo--color {
    display: block;
    filter: drop-shadow(0 3px 0 rgba(7, 62, 120, 0.1));
  }

  .site-header.is-scrolled .brand-logo--white {
    display: none;
  }

  .hero-stage {
    inset: 0;
  }
}

@media (max-width: 1180px) {
  :root {
    --header-height: 157px;
  }

  .main-nav {
    display: flex;
    align-items: flex-end;
    width: 100%;
    padding-top: 88px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 238px;
    min-height: 68px;
    padding: 0 16px;
    font-size: 25px;
    scroll-snap-align: start;
  }

  .brand {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 234px;
    height: 86px;
    padding: 4px 10px;
    transform: translateX(-50%);
  }

  .brand img {
    width: 225px;
    height: 83px;
  }

  .hero-message {
    top: auto;
    width: min(68vw, 440px);
    transform: none;
  }

  .hero-message--left {
    top: calc(var(--header-height) + 24px);
    left: 22px;
  }

  .hero-message--right {
    right: 22px;
    bottom: 28px;
  }

  .hero-layer--character {
    inset: auto 50% -1%;
    width: min(90vw, 670px);
    height: min(75vh, 790px);
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 82px;
  }

  .site-header {
    backdrop-filter: none;
  }

  .main-nav {
    display: grid;
    position: fixed;
    z-index: 90;
    right: 0;
    bottom: 0;
    left: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    margin: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    overflow: visible;
    background: rgba(255, 253, 248, 0.97);
    box-shadow: 0 -8px 28px rgba(25, 39, 54, 0.13);
    backdrop-filter: none;
    scroll-snap-type: none;
    transition: background-color 180ms ease, box-shadow 180ms ease;
  }

  .nav-link {
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: var(--mobile-nav-height);
    gap: 4px;
    padding: 9px 3px 7px;
    font-size: 12.5px;
    line-height: 1.08;
    letter-spacing: -0.04em;
    white-space: normal;
    scroll-snap-align: none;
    transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
  }

  body.is-virtual-keyboard-open .main-nav {
    background: transparent;
    box-shadow: none;
  }

  body.is-virtual-keyboard-open .nav-link--mobile-item {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + env(safe-area-inset-bottom)));
  }

  .nav-link--mobile-item:not(.nav-link--game)::after {
    position: absolute;
    top: 50%;
    right: -2px;
    color: rgba(7, 62, 120, 0.36);
    content: "/";
    font-family: ui-monospace, "Cascadia Mono", monospace;
    font-size: 18px;
    transform: translateY(-50%);
  }

  .nav-icon {
    width: 27px;
    height: 27px;
  }

  .nav-label {
    gap: 0.22em;
  }

  .nav-label--stack {
    flex-direction: column;
    gap: 0;
  }

  .brand {
    position: fixed;
    z-index: 51;
    top: 2px;
    left: 8px;
    width: 178px;
    height: 78px;
    padding: 4px 8px;
    transform: none;
  }

  .brand img {
    width: 170px;
    height: 72px;
  }

  .nav-link--notice {
    position: fixed;
    z-index: 92;
    top: 0;
    right: 4px;
    width: 92px;
    height: var(--header-height);
    min-height: 0;
    padding: 0;
    color: var(--navy);
  }

  .nav-link--notice .nav-icon {
    width: 32px;
    height: 32px;
  }

  .nav-notice-label {
    display: inline-flex;
    font-size: 12px;
    line-height: 1;
  }

  .hero {
    height: calc(100svh - var(--mobile-nav-height) - env(safe-area-inset-bottom));
    min-height: 580px;
  }

  .hero-layer--character {
    inset: auto 50% 1.5%;
    width: min(98vw, 500px);
    height: min(58svh, 540px);
  }

  .hero-layer--medicine {
    inset: 0;
  }

  .hero-layer--medicine img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 168%;
    max-width: none;
    height: auto;
    object-fit: contain;
    transform: translate(-50%, -48%);
  }

  .hero-layer--medicine-two img {
    top: 48%;
    width: 178%;
  }

  .hero-message {
    right: auto;
    left: 50%;
    width: min(80vw, 320px);
    transform: translateX(-50%);
  }

  .hero-message--left {
    top: calc(var(--header-height) + 12px);
  }

  .hero-message--right {
    bottom: 16px;
  }

  .toast {
    right: 18px;
    bottom: calc(var(--mobile-nav-height) + 86px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 36px);
  }

  .floating-actions {
    right: 16px;
    bottom: calc(var(--mobile-nav-height) + 16px + env(safe-area-inset-bottom));
  }

  .floating-action-button {
    width: 56px;
    height: 56px;
    border-radius: 17px;
  }

  .music-button {
    right: auto;
    bottom: calc(var(--mobile-nav-height) + 16px + env(safe-area-inset-bottom));
    left: 16px;
  }

  .site-footer {
    padding: 42px 18px calc(var(--mobile-nav-height) + 30px + env(safe-area-inset-bottom));
  }

  .social-links {
    gap: 12px;
  }

  .social-link {
    width: 48px;
    height: 48px;
  }

  .site-footer__copyright {
    font-size: 0.76rem;
    line-height: 1.55;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .hero-layer {
    --mouse-x: 0 !important;
    --mouse-y: 0 !important;
  }
}

