@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Poppins:wght@300;500&display=swap');

body {
    margin: 0;
    min-height: 100vh; /* changed from height: 100vh */
    display: flex;
    flex-direction: column;
    gap: 100px;
    justify-content: center;
    align-items: center;

    /* Background fix */
    background: linear-gradient(135deg, #fff8e7, #ffe082);
    background-repeat: no-repeat;
    background-attachment: fixed; 
    background-size: cover;
    background-position: center;
    
    overflow-x: hidden; /* only hide horizontal overflow */
    font-family: 'Poppins', sans-serif;
}

/* Particle background */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    /* text-align: center; */
    color: #4e342e;
}

/* Envelope container */
.envelope {
  width: 220px;
  height: 150px;
  margin: auto;
  position: relative;
  cursor: pointer;
  perspective: 800px; /* for 3D flip later */
}

/* Base rectangle */
.envelope .base {
  width: 100%;
  height: 100%;
  background: #fff176;
  border: 2px solid #fbc02d;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
  border-radius: 4px;
  overflow: hidden;
}


/* Top flap */
.envelope .top {
  position: absolute;
  top: 0;
  left: 0;
  border-width: 75px 110px 75px 110px;
  border-style: solid;
  border-color: #fbc02d transparent transparent transparent;
  z-index: 3;
  transform-origin: top;
  transition: transform 0.8s ease;
}
.envelope.open .top {
  transform: rotateX(-180deg); /* opens like a flap */
}

.letter {
    display: none;
    background: white;
    color: #4e342e;
    padding: 20px;
    max-width: 500px;
    border-radius: 10px;
    margin: 20px;
    font-size: 18px;
    line-height: 1.5;
    animation: fadeIn 1.5s forwards;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hidden surprise */
.hidden {
    display: none;
    margin-top: 20px;
    animation: fadeIn 1.5s forwards;
}

.hidden img {
    display: flex;
    align-self: center;
    justify-self: center;
    border-radius: 10px;
    box-shadow: 0px 5px 20px #ff4800, 0px -5px 20px #ff4800;
    margin-bottom: 10px;
    aspect-ratio: 3/4;
    height: 200px;
}

.button {
    display: flex;
    align-self: center;
    justify-self: center;
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    background: #ffb300;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

.button:hover {
    transform: scale(1.1);
    background: #ffa000;
}
