@font-face {
  font-family: 'OngleipParkDahyeon';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2411-3@1.0/Ownglyph_ParkDaHyun.woff2') format('woff2');
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SchoolSafetyRecorder';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2402_keris@1.0/TTHakgyoansimRikodeoR.woff2') format('woff2');
  font-weight: normal;
  font-display: swap;
}

:root {
  --font-note-title: 'OngleipParkDahyeon', cursive;
  --font-note-body: 'OngleipParkDahyeon', cursive;
  --font-title: 'SchoolSafetyRecorder', cursive;

  --paper-bg: #f4f7ea;
  --paper-lines: #e2d9d2;
  --paper-text: #2d3748;
  --paper-border: #cbd5e0;

  --stack-scale: 1;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-note-body);
  background: url('img/back.png') center / cover no-repeat;
  color: var(--paper-text);
  user-select: none;
}

.site-watermark {
  position: fixed;
  top: 10px;
  right: 14px;
  font-size: calc(1rem * var(--stack-scale));
  line-height: 1.4;
  text-align: right;
  letter-spacing: 0.03em;
  color: rgba(45, 55, 72, 0.35);
  pointer-events: none;
  user-select: none;
  z-index: 10000;
}

.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
}

.viewport-stage {
  flex: 1;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 30px 20px;
}

.stack-frame {
  flex-shrink: 0;
  padding: 68px 20px 40px;
  zoom: var(--stack-scale);
}

.stack-notebook {
  position: relative;
  width: 460px;
  height: 660px;
}

.stack-clip {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  width: 160px;
  height: auto;
  z-index: 100;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.stack-board-wrap {
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  width: calc(100% + 60px);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.stack-board {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  filter: saturate(1.4) contrast(1.1) brightness(1.03);
}

.stack-board-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  opacity: 0.35;
  pointer-events: none;
}

.stack-floor {
  position: absolute;
  inset: 0;
  top: 0px;
}

.floor-sheet {
  position: absolute;
  inset: 0;
  background-color: var(--paper-bg);
  border: 1px solid var(--paper-border);
  border-radius: 10px;
  box-shadow: -4px 12px 18px rgba(0, 0, 0, 0.3);
}

.stack-pages {
  position: relative;
  top: -4px;
  width: 100%;
  height: 100%;
}

.stack-sheet {
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: none;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

@media (hover: hover) {
  .stack-sheet.is-front:hover {
    transform: translate(calc(-10px / var(--stack-scale)), calc(18px / var(--stack-scale))) rotate(-3deg);
  }
}

.stack-sheet:active {
  cursor: grabbing;
}

.stack-sheet.no-transition {
  transition: none;
}

.sheet-paper {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--paper-bg);
  color: var(--paper-text);
  border: 1px solid var(--paper-border);
  border-radius: 10px;
  box-shadow: -4px 12px 18px rgba(0, 0, 0, 0.3), inset 0 0 25px rgba(0, 0, 0, 0.03);
  padding: 28px 22px;
  overflow: hidden;
  background-image:
    repeating-linear-gradient(transparent, transparent 25px, var(--paper-lines) 25px, var(--paper-lines) 26px);
}

.scrap-item {
  position: absolute;
  max-width: 100%;
  pointer-events: none;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.18));
}

.profile-card {
  position: absolute;
  pointer-events: none;
  padding-top: 6px;
}

.profile-name {
  font-family: var(--font-title);
  font-size: 2.9rem;
  line-height: 34px;
  color: #41478B;
}

.profile-line {
  font-size: 1.2rem;
  line-height: 26px;
  color: #000229;
}

.profile-line.profile-gap {
  margin-top: 26px;
}

@keyframes mark1-wiggle {

  0%,
  49.9% {
    transform: rotate(20deg) translateX(-6px);
  }

  50%,
  100% {
    transform: rotate(20deg) translateX(6px);
  }
}

.mark1-wiggle {
  animation: mark1-wiggle 0.8s steps(1, end) infinite;
}

@keyframes mark2-rotate {

  0%,
  49.9% {
    transform: rotate(-16deg);
  }

  50%,
  100% {
    transform: rotate(0deg);
  }
}

.mark2-wiggle {
  animation: mark2-rotate 0.8s steps(1, end) infinite;
}

@keyframes mark-rotate-wiggle {

  0%,
  49.9% {
    transform: rotate(calc(var(--wiggle-base, 0deg) - var(--wiggle-amp, 8deg)));
  }

  50%,
  100% {
    transform: rotate(calc(var(--wiggle-base, 0deg) + var(--wiggle-amp, 8deg)));
  }
}

.mark-wiggle {
  animation: mark-rotate-wiggle var(--wiggle-duration, 0.8s) steps(1, end) infinite;
}

.link-row {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.link-icon {
  position: absolute;
  display: block;
  width: 120px;
  height: 120px;
  cursor: pointer;
}

.link-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(2px 3px 5px rgba(0, 0, 0, 0.18));
  transition: transform 0.15s ease;
  animation: link-icon-pulse 0.8s steps(1, end) infinite;
}

@keyframes link-icon-pulse {

  0%,
  49.9% {
    transform: scale(1);
  }

  50%,
  100% {
    transform: scale(1.1);
  }
}

.link-icon:nth-child(2) img {
  animation-delay: 0.15s;
}

.link-icon:nth-child(3) img {
  animation-delay: 0.3s;
}

.link-icon:nth-child(4) img {
  animation-delay: 0.45s;
}

.link-icon:nth-child(5) img {
  animation-delay: 0.6s;
}

.link-icon:hover img {
  animation-play-state: paused;
  transform: scale(1.25);
}

.img-carousel {
  position: absolute;
  overflow: hidden;
  border-radius: 10px;
  cursor: grab;
  touch-action: none;
  background: rgba(0, 0, 0, 0.04);
}

.carousel-track {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 10px;
}

.carousel-slide {
  flex: 0 0 auto;
  height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  pointer-events: none;
}

.carousel-slide.carousel-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(45, 55, 72, 0.5);
  background: rgba(255, 255, 255, 0.4);
  border: 2px dashed rgba(45, 55, 72, 0.25);
  padding: 8px;
}

.polaroid {
  position: absolute;
  pointer-events: none;
  background: #fffef8;
  container-type: inline-size;
  box-shadow: 3px 6px 10px rgba(0, 0, 0, 0.25);
  border-radius: 2px;
}

.polaroid-mat {
  padding: 6cqi 6cqi 21cqi;
}

.polaroid-photo {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: #ddd;
}

.polaroid-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.polaroid-photo.is-animated img:nth-child(1) {
  animation: polaroid-blink-a 1s steps(1, end) infinite;
}

.polaroid-photo.is-animated img:nth-child(2) {
  animation: polaroid-blink-b 1s steps(1, end) infinite;
}

@keyframes polaroid-blink-a {

  0%,
  49.9% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes polaroid-blink-b {

  0%,
  49.9% {
    opacity: 0;
  }

  50%,
  100% {
    opacity: 1;
  }
}

.stack-tab {
  position: absolute;
  right: -26px;
  writing-mode: vertical-rl;
  height: 110px;
  padding: 9px;
  font-family: var(--font-note-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: #2d3748;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.2s ease, filter 0.2s ease;
  z-index: -1;
  --tab-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='91' height='225' viewBox='0 0 91 225'%3E%3Cg transform='translate(91,0) rotate(90)'%3E%3Cpath fill='white' d='M178.855 1.31781C193.984 -3.76906 209.94 6.43012 211.675 22.2963L215.979 61.6694C219.976 69.9407 222.935 79.8434 224.496 90.7387H0C1.60887 79.5109 4.70023 69.337 8.88379 60.9164L13.1074 22.2963C14.8423 6.43012 30.7983 -3.76906 45.9268 1.31781L88.7754 15.726C96.2532 14.3243 104.326 13.559 112.747 13.559C120.994 13.559 128.907 14.2951 136.255 15.642L178.855 1.31781Z'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: var(--tab-mask);
  mask-image: var(--tab-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  filter: drop-shadow(4px 4px 6px rgba(0, 0, 0, 0.25));
}

.stack-tab.active {
  transform: translateX(6px);
  filter: drop-shadow(6px 4px 8px rgba(0, 0, 0, 0.35));
}

.stack-tab[data-target="0"] {
  top: 24px;
  background-color: #fef08a;
}

.stack-tab[data-target="2"] {
  top: 114px;
  background-color: #a7f3d0;
}

.stack-tab[data-target="3"] {
  top: 204px;
  background-color: #fbcfe8;
}

.stack-tab[data-target="1"] {
  top: 294px;
  background-color: #bde0fe;
}

.click-heart {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  line-height: 0;
  user-select: none;
  animation: click-heart-pop 0.8s ease-out forwards;
}

.click-heart svg {
  display: block;
  width: 16px;
  height: 16px;
}

@keyframes click-heart-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
    opacity: 1;
  }

  30% {
    transform: translate(calc(-50% + var(--heart-drift, 0px)), -140%) scale(1.15) rotate(var(--heart-spin, 0deg));
    opacity: 1;
  }

  100% {
    transform: translate(calc(-50% + var(--heart-drift, 0px) * 1.6), -260%) scale(0.85) rotate(var(--heart-spin, 0deg));
    opacity: 0;
  }
}

.falling-icon {
  position: fixed;
  top: -20px;
  z-index: 5000;
  pointer-events: none;
  opacity: 0.3;
  animation-name: falling-icon-drop;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.falling-icon svg {
  display: block;
  width: 12px;
  height: 12px;
}

@keyframes falling-icon-drop {
  from {
    transform: translate(0, 0) rotate(0deg);
  }

  to {
    transform: translate(var(--fall-drift, 0px), 110vh) rotate(var(--fall-spin, 0deg));
  }
}