@charset "utf-8";
* {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #2c3e50 0%, #000 80%);
  font-family: 'Georgia', serif;
  color: #fff;
  overflow: hidden;
  flex-direction: column; /* 모바일에서는 위아래 배치 */
  padding: 10px;
}

/* ===== ECG 심장박동 배경 ===== */
.ecg_line {
  position: relative; /* 모바일에서는 fixed 대신 relative */
  width: 100%;
  height: 80px; /* 조금 줄이기 */
  margin-bottom: 20px;
  overflow: hidden;
}

.ecg_line svg {
  width: 200%;
  height: 100%;
  stroke: #00ff88;
  stroke-width: 2;
  fill: none;
  animation: moveECG 7s linear infinite;
  filter: drop-shadow(0 0 6px #00ff88);
}

@keyframes moveECG {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ECG 위 텍스트 */
.ecg_text {
  position: absolute;
  top: 35%;
  left: 100%;
  white-space: nowrap;
  font-size: 1rem; /* 모바일에서는 작은 글씨 */
  color: #00ff88;
  text-shadow: 0 0 6px #00ff88;
  transform: translateY(-50%);
}

/* ===== 봉투 ===== */
.envelope {
  width: 95%;     /* 모바일 화면에 맞게 줄임 */
  max-width: 350px;
  height: auto;   /* 자동 높이 */
  aspect-ratio: 3/2; /* 비율 유지 */
  position: relative;
  perspective: 1000px;
  cursor: pointer;
  animation: float 3s ease-in-out infinite;
  z-index: 10;
  color: #3d4b2d;
  text-align: center;
}

.front, .back {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  backface-visibility: hidden;
  transition: transform 1s ease;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(255,255,255,0.2);
}

.front {
  background: radial-gradient(#b6a49a 40%, #8b8476 100%);
  box-shadow: 1px 3px 8px rgba(87,46,3,0.6);
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
}

.front_text {
  font-size: 1.2rem;
  padding: 8px 0;
}

.back {
  background-color: #b2a197;
  transform: rotateY(-180deg);
  z-index: 1;
  position: relative;
}

.front_show
{
	 position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.front_show .date_text {
  font-size: 1rem;
  padding: 5px 0;
}

.logo_area
{
	position:relative;
	height:40%;
}

.logo_area img
{
  height: 100%;   /* envelope 높이의 40% 까지만 차지 */
}

.flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
 background-color:#3d4a2d;
  transform-origin: top center;
  transition: transform 1s ease 0.5s;
  z-index: 2;
  box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

.flap > div {
  width: 95%;
  height: 95%;
  margin: auto;
  position: absolute;
  top: 0; left: 0; right: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background-color: #b2a197;
}


  .bottom_tool 
  {   
    position:absolute;
    top:50%;
    left:0;
    width:100%;
    height:50%;
	background-color:#3d4a2d;
	clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    z-index: 15; 
  } 
  
 .bottom_tool>div 
 { 
    width:98%;
    height:95%;
    margin:auto;
    position:absolute;
    bottom:0; 
	left:0; 
	right:0;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    background-color:#b2a197;
  } 

  .left_tool 
  { 
    position:absolute;
    top:0%;
    left:0;
    width:50%;
    height:100%;
	background-color:#3d4a2d;
	clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
    z-index: 15; 
  } 
  
  .left_tool > div
  {
    width:95%;
    height:97%;
    margin:auto;
    position:absolute;
    bottom:0px; 
	left:0; 
	top:0px;
    clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
    background-color:#b2a197;	  
  }
  
  
  .right_tool
  { 
    position:absolute;
    top:0%;
    right:0;
    width:50%;
    height:100%;
	background-color:#3d4a2d;
	clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
    z-index: 15; 
  }
  
  .right_tool > div
  {
		width:95%;
		height:97%;
		margin:auto;
		position:absolute;
		bottom:0px; 
		right:0; 
		top:0px;
		clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
		background-color:#b2a197;	  
  }

.letter {
  position: absolute;
  top: 0;
  left: 5%;
  width: 90%;
  height: 90%;
  background: #fffdf8;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.1);
  text-align: center;
  font-weight: bold;
  color: #333;
  transition: top 1s ease 1.5s, opacity 1s ease 1.5s;
  opacity: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.letter > div {
  font-size: 1rem;
  padding: 10px 0;
}

.flash {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  z-index: 999;
}

.flash.active { opacity: 1; }

.envelope.open .front { transform: rotateY(180deg); }
.envelope.open .back { transform: rotateY(0deg); }
.envelope.open .flap { transform: rotateX(180deg); }
.envelope.open .letter { top: -100px; opacity: 1; }

@keyframes float {
  0%,100%{transform:translateY(0);}
  50%{transform:translateY(-5px);}
}
