/* Custom CSS Variables & Core Design Tokens */
:root {
  --bg-warm-tint: rgba(220, 140, 80, 0.12);
  --cinematic-vignette: radial-gradient(circle, transparent 30%, rgba(10, 5, 0, 0.85) 100%);
  --paper-color: #fcfbf7;
  --polaroid-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.15);
  --receipt-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  --notebook-ruled: #e8e6df;
  --ink-color: #2b3a4a;
  --whatsapp-bg: #e5ddd5;
  --whatsapp-green: #075e54;
  --whatsapp-bubble-sent: #dcf8c6;
  --whatsapp-bubble-recv: #ffffff;

  --font-handwriting: 'Caveat', cursive;
  --font-minimal: 'Inter', sans-serif;
  --font-caption: 'Homemade Apple', cursive;
}

/* Reset & Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0b0704;
  font-family: var(--font-minimal);
  color: #333333;
}

/* Permanent Background */
#bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  overflow: hidden;
  background-color: #0b0704;
}

#bg-image {
  position: absolute;
  top: -10px;
  left: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  background-image: url('Assets/Background/Laptop.png');
  background-size: cover;
  background-position: center;
  filter: blur(1.8px);
  opacity: 0.95;
}

@media (max-width: 767px) {
  #bg-image {
    background-image: url('Assets/Background/Mobile.png');
  }
}

/* Particle System (Stars & Fireflies) */
#ambient-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  pointer-events: none;
}

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #ffe677 20%, rgba(255, 230, 119, 0) 70%);
  border-radius: 50%;
  box-shadow: 0 0 10px #ffe677, 0 0 20px #ffd000;
  opacity: 0;
  animation: floatFirefly 12s infinite ease-in-out;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: twinkleStar 4s infinite ease-in-out;
}

/* Ambient Keyframes */
@keyframes floatFirefly {
  0% {
    transform: translate(0, 105vh) scale(0.8);
    opacity: 0;
  }

  10%,
  90% {
    opacity: 0.8;
  }

  50% {
    transform: translate(var(--dx), var(--dy)) scale(1.2);
    opacity: 0.9;
  }

  100% {
    transform: translate(var(--ex), -10vh) scale(0.8);
    opacity: 0;
  }
}

@keyframes twinkleStar {

  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.2);
  }
}

/* Daisy Transition Effect Overlay */
#daisy-overlay {
  position: fixed;
  width: 80px;
  height: 80px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  display: none;
  mix-blend-mode: multiply;
}

#daisy-gif {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#transition-curtain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  opacity: 0;
  pointer-events: none;
  z-index: 9000;
  transition: opacity 0.5s ease;
}

/* Viewport Layout */
#viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 5;
}

#card-container {
  position: relative;
  width: 100%;
  max-width: 390px;
  height: 100%;
  max-height: 720px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Core Card Base Styles (Absolute Stack) */
.card-wrapper {
  position: absolute;
  width: 100%;
  height: auto;
  max-height: 100%;
  opacity: 0;
  transform: scale(0.9) translate3d(0, 30px, 0);
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 10;
}

.card-wrapper.active {
  opacity: 1;
  transform: scale(1) translate3d(0, 0, 0);
  pointer-events: all;
  z-index: 20;
}

/* Physical Card Object Types */

/* 1. Polaroid Card styling */
.card-polaroid {
  background: var(--paper-color);
  padding: 16px 16px 40px 16px;
  border-radius: 4px;
  box-shadow: var(--polaroid-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.polaroid-media-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
}

.polaroid-img,
.polaroid-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ken-burns {
  animation: kenBurns 12s infinite alternate ease-in-out;
}

@keyframes kenBurns {
  0% {
    transform: scale(1.0);
  }

  100% {
    transform: scale(1.08) translate(1%, -1%);
  }
}

.polaroid-caption {
  margin-top: 16px;
  font-family: var(--font-handwriting);
  font-size: 24px;
  color: var(--ink-color);
  text-align: center;
  max-width: 90%;
  line-height: 1.2;
}

/* Tape decoration for Polaroid */
.polaroid-tape {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 120px;
  height: 30px;
  background: rgba(240, 230, 200, 0.5);
  transform: translateX(-50%) rotate(-2deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(1px);
  z-index: 5;
}

/* 2. Notebook Page Card styling */
.card-notebook {
  background: #fbf9f4;
  padding: 30px 24px 30px 36px;
  border-radius: 8px;
  box-shadow: var(--polaroid-shadow);
  position: relative;
  overflow: hidden;
  border-left: 6px solid #e0d9cc;
}

/* Ruled lines inside notebook */
.card-notebook::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 1px;
  background: rgba(220, 70, 70, 0.4);
}

.notebook-lines {
  background-image: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 95%, var(--notebook-ruled) 96%);
  background-size: 100% 28px;
  line-height: 28px;
  padding-top: 14px;
}

.notebook-title {
  font-family: var(--font-handwriting);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1a2a3a;
  line-height: 1.2;
}

.notebook-text {
  font-family: var(--font-handwriting);
  font-size: 22px;
  color: var(--ink-color);
  min-height: 120px;
}

/* 3. WhatsApp Interface Card styling */
.card-whatsapp {
  background: var(--whatsapp-bg);
  border-radius: 12px;
  box-shadow: var(--polaroid-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 9 / 16;
}

.whatsapp-header {
  background: var(--whatsapp-green);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.whatsapp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ccc;
  background-image: url('Assets/You/Cute lago cho....jpeg');
  background-size: cover;
  background-position: center;
}

.whatsapp-info {
  display: flex;
  flex-direction: column;
}

.whatsapp-name {
  font-size: 16px;
  font-weight: 600;
}

.whatsapp-status {
  font-size: 11px;
  opacity: 0.8;
}

.whatsapp-chat-area {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  overflow: hidden;
}

.whatsapp-screenshot-img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: block;
}

.whatsapp-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  animation: popBubble 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes popBubble {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.whatsapp-bubble.sent {
  background: var(--whatsapp-bubble-sent);
  align-self: flex-end;
  border-top-right-radius: 0;
}

.whatsapp-bubble.recv {
  background: var(--whatsapp-bubble-recv);
  align-self: flex-start;
  border-top-left-radius: 0;
}

.whatsapp-bubble-text {
  margin-bottom: 4px;
  line-height: 1.4;
}

.whatsapp-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.45);
}

.whatsapp-ticks {
  color: #8696a0;
  display: flex;
}

.whatsapp-ticks.blue {
  color: #53bdeb;
}

.whatsapp-footer {
  background: #f0f0f0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e0e0e0;
  position: relative;
}

.whatsapp-input-overlay {
  flex: 1;
  background: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  color: #999;
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
}

.whatsapp-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #00a884;
  border: none;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
}

.whatsapp-send-btn:active {
  background: #008f72;
}

/* 4. Thermal Paper Receipt Card styling */
.card-receipt {
  background: #fafaf5;
  width: 100%;
  padding: 30px 20px 40px 20px;
  box-shadow: var(--receipt-shadow);
  border-radius: 2px;
  position: relative;
  font-family: 'Courier New', Courier, monospace;
  color: #2b2b2b;
  overflow: hidden;
  border-top: 4px dashed #ddd;
}

/* Zig-zag edge on receipt bottom */
.card-receipt::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background-image: linear-gradient(135deg, #fafaf5 25%, transparent 25%), linear-gradient(225deg, #fafaf5 25%, transparent 25%);
  background-position: 0 0;
  background-size: 16px 32px;
  transform: translateY(2px) scaleY(-1);
  z-index: 5;
}

.receipt-unfold {
  max-height: 0px;
  animation: unfoldReceipt 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes unfoldReceipt {
  0% {
    max-height: 0px;
    opacity: 0;
  }

  100% {
    max-height: 600px;
    opacity: 1;
  }
}

.receipt-header {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 1px dashed #999;
  padding-bottom: 15px;
}

.receipt-logo {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.receipt-item-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}

.receipt-separator {
  border-top: 1px dashed #999;
  margin: 15px 0;
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 16px;
  margin-top: 10px;
}

/* 5. Sticky Note Card styling */
.card-sticky {
  background: #fdf5c4;
  padding: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  transform: rotate(-1.5deg);
}

.card-sticky::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 25px;
  height: 25px;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.15) 100%);
  box-shadow: -4px -4px 6px rgba(0, 0, 0, 0.05);
}

.sticky-text {
  font-family: var(--font-handwriting);
  font-size: 26px;
  text-align: center;
  line-height: 1.3;
  color: #4a3c10;
}

/* 6. Letter & Envelope styling */
.letter-envelope-container {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
}

.card-envelope {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #e6dfd3;
  border-radius: 8px;
  box-shadow: var(--polaroid-shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 15;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s;
  overflow: hidden;
}

.envelope-seal {
  width: 60px;
  height: 60px;
  background: #a83232;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  color: gold;
  font-size: 20px;
  transition: transform 0.3s;
}

.card-envelope:active .envelope-seal {
  transform: scale(0.9);
}

.card-letter {
  background: var(--paper-color);
  padding: 36px 30px;
  border-radius: 6px;
  box-shadow: var(--polaroid-shadow);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(50px) scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.letter-text {
  font-family: var(--font-handwriting);
  font-size: 21px;
  line-height: 1.6;
  color: var(--ink-color);
  white-space: pre-wrap;
  text-shadow: 0 0 1px rgba(43, 58, 74, 0.15);
  /* Ink bleed effect */
}

/* 7. Checklist Card styling */
.card-checklist {
  background: #fdfdfa;
  padding: 24px 20px;
  border-radius: 6px;
  box-shadow: var(--polaroid-shadow);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.checklist-title {
  font-family: var(--font-handwriting);
  font-size: 28px;
  font-weight: bold;
  border-bottom: 2px solid #eaeae5;
  padding-bottom: 8px;
  margin-bottom: 16px;
  color: #333;
}

.checklist-scroll-area {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
}

.checklist-section-title {
  font-size: 12px;
  font-weight: bold;
  color: #888;
  margin: 12px 0 6px 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #444;
}

.checklist-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #aaa;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

.checklist-checkbox.checked {
  border-color: #55a630;
  background: rgba(85, 166, 48, 0.1);
}

.checklist-checkmark {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #55a630;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}

.checklist-item.checked .checklist-checkmark {
  animation: drawCheck 0.5s ease forwards;
}

.checklist-item.checked span {
  text-decoration: line-through;
  color: #888;
}

@keyframes drawCheck {
  0% {
    stroke-dashoffset: 20;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

/* 8. Sketchbook Card & Pencil Sketch Animation overlay */
.card-sketchbook {
  background: #f5f3eb;
  padding: 16px 16px 36px 16px;
  border-radius: 4px;
  box-shadow: var(--polaroid-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.sketchbook-canvas-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  width: calc(100% - 32px);
  aspect-ratio: 1 / 1;
  z-index: 10;
  pointer-events: none;
  border-radius: 2px;
}

/* Interactive Components inside Cards */

/* 1. Welcome Card Elements */
.welcome-line {
  font-family: var(--font-handwriting);
  font-size: 26px;
  text-align: center;
  opacity: 0;
  transform: translateY(15px);
  margin-bottom: 12px;
  transition: opacity 0.8s ease, transform 0.8s ease;
  color: var(--ink-color);
}

.welcome-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.welcome-line.main-title {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #1a2a3a;
}

.welcome-btn {
  margin-top: 30px;
  padding: 12px 24px;
  font-family: var(--font-minimal);
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #ae382b, #8a2a1e);
  border: none;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(174, 56, 43, 0.4);
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s ease, transform 0.8s ease, box-shadow 0.2s, transform 0.2s;
}

.welcome-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

.welcome-btn:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 2px 8px rgba(174, 56, 43, 0.3);
}

/* 2. Adobe Crash Overlay Trigger */
.adobe-interactive-container {
  width: 100%;
  position: relative;
  cursor: pointer;
}

.adobe-note {
  margin-top: 15px;
  font-family: var(--font-handwriting);
  font-size: 22px;
  color: var(--ink-color);
  text-align: center;
}

/* 3. Steam animation */
.steam-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.steam-particle {
  position: absolute;
  bottom: 0;
  width: 15px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 70%);
  filter: blur(4px);
  border-radius: 50%;
  opacity: 0;
  animation: steamRise 3.5s infinite ease-out;
}

@keyframes steamRise {
  0% {
    transform: translateY(0) scaleX(1) translateX(0);
    opacity: 0;
  }

  15% {
    opacity: 0.6;
  }

  50% {
    transform: translateY(-80px) scaleX(1.8) translateX(var(--wind));
    opacity: 0.4;
  }

  100% {
    transform: translateY(-160px) scaleX(2.5) translateX(calc(var(--wind) * 2));
    opacity: 0;
  }
}

/* 4. Ending Card specific styling */
.ending-text-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-handwriting);
  font-size: 38px;
  color: white;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.4);
  text-align: center;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
  filter: blur(1px);
}

.ending-text-overlay.visible {
  opacity: 1;
}

/* Scrollbar styles for list and scrollable text */
.checklist-scroll-area::-webkit-scrollbar,
.card-letter::-webkit-scrollbar {
  width: 4px;
}

.checklist-scroll-area::-webkit-scrollbar-thumb,
.card-letter::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

/* Passcode Screen Overlay */
#passcode-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 7, 4, 0.85);
  backdrop-filter: blur(15px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.passcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
  max-width: 320px;
}

.passcode-title {
  font-family: var(--font-handwriting);
  font-size: 36px;
  color: #fbf9f4;
  margin-bottom: 24px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.passcode-dots-wrapper {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.passcode-dot {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transition: background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.passcode-dot.filled {
  background-color: #ffd000;
  border-color: #ffd000;
  box-shadow: 0 0 8px #ffd000;
}

.passcode-dot.error {
  border-color: #ae382b;
  box-shadow: 0 0 8px #ae382b;
  animation: shakeDot 0.15s ease-in-out infinite alternate;
}

@keyframes shakeDot {
  0% {
    transform: translateX(-3px);
  }

  100% {
    transform: translateX(3px);
  }
}

.passcode-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.keypad-btn {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: white;
  font-size: 22px;
  font-family: var(--font-minimal);
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}

.keypad-btn:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(0.92);
}

.delete-btn,
.clear-btn {
  font-size: 18px;
  background: rgba(255, 255, 255, 0.01);
}