/* style.css */
:root {
  --bg-gradient: linear-gradient(135deg, #fdfbf7 0%, #f3ebe1 100%);
  --card-bg: rgba(255, 255, 255, 0.85);
  --gold: #b89352;
  --gold-light: #d8be8b;
  --gold-dark: #8e6d34;
  --wax-red: #9e2a2b;
  --text-main: #2c2520;
  --text-muted: #75685e;
  --env-front: #efe6da;
  --env-side: #e5d8c7;
  --env-back: #d6c5b0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Cairo", sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Floating Particles */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  bottom: -20px;
  color: var(--gold-light);
  opacity: 0.4;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-110vh) scale(1.2);
    opacity: 0;
  }
}

/* Envelope Screen */
.envelope-wrapper {
  position: fixed;
  inset: 0;
  background: var(--bg-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}

.envelope-wrapper.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.envelope-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 35px;
}

.envelope {
  position: relative;
  width: 320px;
  height: 210px;
  background-color: var(--env-back);
  border-radius: 10px;
  box-shadow: 0 25px 50px rgba(44, 37, 32, 0.15);
  perspective: 1000px;
}

.letter {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 10px;
  height: 185px;
  background: #fffdf9;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s;
  z-index: 2;
}

.letter-border {
  border: 1px solid var(--gold-light);
  height: 100%;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px;
  text-align: center;
}

.letter-names {
  font-family: "Playfair Display", serif;
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.letter-text {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.6;
}

.envelope.open .letter {
  transform: translateY(-115px);
}

.pocket {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  border-radius: 10px;
}

.pocket::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 160px solid var(--env-side);
  border-right: 160px solid var(--env-side);
  border-bottom: 110px solid var(--env-front);
  border-top: 100px solid transparent;
}

.flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
  border-top: 120px solid var(--env-front);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
  transform-origin: top;
  transition: transform 0.6s ease;
  z-index: 4;
}

.envelope.open .flap {
  transform: rotateX(180deg);
  z-index: 1;
}

/* Wax Seal Button */
.wax-seal {
  position: absolute;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  background: radial-gradient(circle at 30% 30%, #c13839, var(--wax-red));
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  box-shadow:
    0 6px 15px rgba(158, 42, 43, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fdfbf7;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 5;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  animation: pulseSeal 2s infinite;
}

.envelope.open .wax-seal {
  opacity: 0;
  pointer-events: none;
}

@keyframes pulseSeal {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.07);
  }
}

.tap-hint {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Main Content */
.container {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  padding: 45px 20px 60px;
  text-align: center;
  animation: fadeInUp 1s ease forwards;
}

.container.hidden {
  display: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.photo-frame {
  position: relative;
  width: 155px;
  height: 155px;
  margin: 0 auto 22px;
  padding: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 12px 30px rgba(184, 147, 82, 0.25);
}

.envelope-badge {
  position: absolute;
  top: -8px;
  right: 5px;
  background: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
}

.names {
  font-family: "Playfair Display", serif;
  color: var(--text-main);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  direction: ltr;
}

.names .amp {
  color: var(--gold);
  font-style: italic;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 6px;
  margin-bottom: 30px;
}

/* Glass Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 24px 18px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(44, 37, 32, 0.05);
}

.counter-section h2 {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.eng-date {
  font-family: "Playfair Display", serif;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 18px;
  direction: ltr;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.counter-box {
  background: #fdfbf7;
  border: 1px solid rgba(184, 147, 82, 0.2);
  padding: 14px 4px;
  border-radius: 14px;
}

.counter-box span {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold-dark);
}

.counter-box small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Message Section */
.message-section {
  position: relative;
  padding: 28px 22px;
}

.quote-icon {
  font-size: 2.2rem;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 8px;
}

.love-msg {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-main);
  font-weight: 600;
}

/* Timeline */
.timeline-section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 15px;
}

.timeline-line {
  position: absolute;
  top: 20px;
  bottom: 20px;
  right: 39px;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  z-index: 0;
}

.timeline-card {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 18px;
  border-radius: 18px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  text-align: right;
  box-shadow: 0 8px 25px rgba(44, 37, 32, 0.04);
}

.card-icon {
  font-size: 1.4rem;
  background: #fdfbf7;
  border: 2px solid var(--gold-light);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.card-info .date {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--gold-dark);
  background: rgba(184, 147, 82, 0.12);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-info h3 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.card-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer {
  max-width: 500px;
  margin: 40px auto 0;
  padding: 20px 0 10px;
  border-top: 1px solid rgba(184, 147, 82, 0.3);
  text-align: center;
  color: #8c7a6b;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.8px;
  direction: ltr;
}
