@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --pol-bg: #fff0d4; /* Soft warm yellow/retro cream background */
  --pol-printer: #e8e6e1; /* Off-white plastic */
  --pol-dark: #222;
  --pol-red: #ff3b30;
  
  --font-hand: 'Caveat', cursive;
  --font-text: 'Inter', sans-serif;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--pol-bg);
  color: var(--pol-dark);
  font-family: var(--font-text);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background Texture Pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(0,0,0,0.05) 2px, transparent 2px);
  background-size: 20px 20px;
  z-index: -1;
}

/* --- THE PHOTOREALISTIC PRINTER (CSS ART) --- */
.printer-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 480px;
  z-index: 1000;
  transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
  filter: drop-shadow(0 30px 50px rgba(0,0,0,0.5));
}

.printer-wrapper.printing-mode {
  top: 0;
  transform: translate(-50%, 0);
  position: fixed;
  filter: drop-shadow(0 15px 30px rgba(0,0,0,0.6));
}

.printer-body {
  width: 100%;
  height: 270px;
  /* Cream plastic top, dark grey textured bottom */
  background: linear-gradient(to bottom, #f2ead0 0%, #e8dec0 45%, #222 45.1%, #151515 100%);
  border-radius: 25px 25px 8px 8px;
  box-shadow: 
    inset 0 6px 15px rgba(255,255,255,0.8),
    inset 0 -4px 8px rgba(0,0,0,0.6),
    inset 10px 0 20px rgba(0,0,0,0.05),
    inset -10px 0 20px rgba(0,0,0,0.05);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(0,0,0,0.2);
  border-bottom: none;
  overflow: hidden;
}

/* Photorealistic Rainbow Stripe */
.printer-stripe {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 15%;
  background: linear-gradient(to right, #d92c2c 20%, #e68a2e 20% 40%, #e6ce2e 40% 60%, #46a846 60% 80%, #2e71b8 80%);
  mix-blend-mode: multiply; /* Makes it look painted onto the plastic */
  opacity: 0.85;
  z-index: 1;
}

/* Glass Viewfinder */
.printer-viewfinder {
  position: absolute;
  top: 25px;
  right: 15%;
  width: 48px;
  height: 38px;
  background: #000;
  border-radius: 6px;
  border: 4px solid #d5cbb0;
  box-shadow: 
    inset 0 0 15px rgba(0,0,0,1), 
    inset 0 10px 10px rgba(255,255,255,0.1),
    0 3px 6px rgba(0,0,0,0.2);
  z-index: 2;
  overflow: hidden;
}
.printer-viewfinder::before {
  content: '';
  position: absolute;
  top: -5px; left: -5px; right: -5px; bottom: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
  transform: rotate(-10deg);
}

/* Diamond Glass Flash */
.printer-flash {
  position: absolute;
  top: 25px;
  left: 15%;
  width: 65px;
  height: 55px;
  background: #fff;
  border-radius: 5px;
  border: 4px solid #d5cbb0;
  box-shadow: 
    inset 0 0 10px rgba(0,0,0,0.4), 
    0 3px 6px rgba(0,0,0,0.2);
  z-index: 2;
  background-image: 
    linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%, #ddd),
    linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%, #ddd);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
  overflow: hidden;
}
.printer-flash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 60%);
}

/* 3D Lens Mount */
.printer-lens-mount {
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, #333 0%, #111 100%);
  border-radius: 50%;
  margin-top: 55px;
  position: relative;
  box-shadow: 
    0 15px 25px rgba(0,0,0,0.6), 
    inset 0 8px 10px rgba(255,255,255,0.3),
    inset 0 -5px 15px rgba(0,0,0,0.8);
  border: 5px solid #2a2a2a;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Deep Optic Lens */
.printer-lens {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #2b0b3a 0%, #0c122e 40%, #050505 100%);
  border: 6px solid #0a0a0a;
  box-shadow: inset 0 0 25px #000, 0 5px 10px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}
.printer-lens::before {
  content: '';
  position: absolute;
  top: 5%; left: 15%;
  width: 45px; height: 35px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  transform: rotate(-30deg);
}
.printer-lens::after {
  content: '';
  position: absolute;
  bottom: 15%; right: 20%;
  width: 20px; height: 20px;
  background: radial-gradient(circle, rgba(50,200,100,0.3) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
}

/* Mechanical Shutter Button */
.btn-on {
  position: absolute;
  bottom: 30px;
  right: 15%;
  width: 55px;
  height: 55px;
  background: radial-gradient(circle at 30% 20%, #ff5252 0%, #b80000 100%);
  border-radius: 50%;
  border: 5px solid #1a1a1a;
  box-shadow: 
    0 8px 15px rgba(0,0,0,0.5), 
    inset 0 4px 6px rgba(255,255,255,0.4),
    inset 0 -4px 6px rgba(0,0,0,0.3),
    0 0 0 3px #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-text);
  font-weight: 800;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  letter-spacing: 1px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}
.btn-on:active {
  transform: scale(0.95) translateY(4px);
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.6),
    inset 0 6px 12px rgba(0,0,0,0.6),
    0 0 0 3px #333;
}

.btn-on.clicked {
  background: radial-gradient(circle at 30% 20%, #ff8080 0%, #8a0000 100%);
  box-shadow: 
    0 0 30px rgba(255,0,0,0.8), 
    inset 0 6px 15px rgba(0,0,0,0.7),
    0 0 0 3px #333;
  color: rgba(255,255,255,0.5);
  text-shadow: none;
  pointer-events: none;
  transform: translateY(4px);
}

/* The Output Slit */
.printer-slit {
  position: absolute;
  bottom: 0;
  left: 10%;
  width: 80%;
  height: 22px;
  background: linear-gradient(to bottom, #050505 0%, #151515 40%, #252525 100%);
  border-radius: 4px 4px 0 0;
  box-shadow: 
    inset 0 12px 15px rgba(0,0,0,1),
    0 -1px 2px rgba(255,255,255,0.1);
  z-index: 5;
}

/* Hint Text */
.printer-hint {
  position: absolute;
  top: 108%;
  left: 0; width: 100%;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 2rem;
  color: #777;
  text-shadow: 1px 1px 0 #fff;
  transition: opacity 0.5s;
}

/* --- THE PAPER (INVITATION CONTENT) --- */
.paper-wrapper {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  /* Printer is 90% max 480px. Slit is 80% of Printer = 72% max 384px.
     Paper must be strictly smaller than Slit: 68% max 365px. */
  width: 68%;
  max-width: 360px;
  z-index: 999;
  /* Paper starts hidden inside/behind the printer */
  height: 0;
  overflow: hidden;
  transition: height 3s ease-out; /* The initial print burst */
}

/* When printing starts, paper is allowed to extend infinitely */
.paper-wrapper.printing {
  height: auto;
  min-height: 100vh; /* Will expand with content */
  /* We use a margin top slightly less than printer height so it tucks into the slit */
  margin-top: 260px; 
}

.paper-content {
  background: #fff;
  width: 100%;
  min-height: 100vh;
  /* Polaroid frame styling */
  padding: 15px 15px 50px 15px;
  box-shadow: 
    inset 0 25px 20px -20px rgba(0,0,0,0.8), /* Shadow from inside the printer mouth */
    0 15px 35px rgba(0,0,0,0.1),
    0 5px 15px rgba(0,0,0,0.05);
  border: 1px solid #e0e0e0;
  /* Animate sliding out */
  transform: translateY(-100%);
  transition: transform 2s ease-out;
}

.paper-wrapper.printing .paper-content {
  transform: translateY(0);
}

/* --- INNER INVITATION SECTIONS --- */

.pol-section {
  padding: 40px 10px;
  border-bottom: 1px dashed #ccc;
  text-align: center;
}
.pol-section:last-child {
  border-bottom: none;
}

.pol-title {
  font-family: var(--font-hand);
  font-size: 3.5rem;
  color: var(--pol-dark);
  margin: 0 0 10px 0;
  line-height: 1;
}

.pol-subtitle {
  font-family: var(--font-text);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #777;
  margin-bottom: 20px;
}

.pol-text {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.8;
}

.pol-photo {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}

.pol-date-box {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}
.pol-date-item {
  background: #f9f9f9;
  border: 1px solid #eee;
  padding: 10px 15px;
  border-radius: 8px;
  min-width: 60px;
}
.pol-date-item span {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pol-dark);
}
.pol-date-item small {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 1px;
}

.btn-pol {
  display: inline-block;
  background: var(--pol-dark);
  color: #fff;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 15px;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-pol:hover {
  background: #444;
}

/* Event List */
.pol-event {
  background: #fafafa;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  text-align: left;
  border: 1px solid #eee;
}
.pol-event h3 {
  font-family: var(--font-hand);
  font-size: 2rem;
  margin: 0 0 10px 0;
  color: var(--pol-red);
}
.pol-event p {
  margin: 5px 0;
  font-size: 0.9rem;
}

/* Profile */
.pol-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin-top: 30px;
}
.pol-profile-card {
  width: 100%;
}
.pol-profile-card img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}
.pol-profile-card h3 {
  font-family: var(--font-hand);
  font-size: 2.5rem;
  margin: 0 0 5px 0;
}

/* Gallery Grid */
.pol-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.pol-gallery img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
}

/* Form RSVP */
.pol-form {
  text-align: left;
  background: #f9f9f9;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #eee;
}
.pol-input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: var(--font-text);
  font-size: 0.9rem;
}
.pol-input:focus {
  outline: none;
  border-color: var(--pol-dark);
}

/* Wishes */
.pol-wish {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #eee;
  margin-bottom: 10px;
  text-align: left;
}
.pol-wish strong {
  font-family: var(--font-text);
  font-size: 0.95rem;
}
.pol-wish p {
  font-size: 0.85rem;
  margin: 5px 0 0 0;
}
.pol-badge {
  font-size: 0.6rem;
  background: #eee;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  margin-left: 10px;
}

/* Footer signature */
.pol-signature {
  font-family: var(--font-hand);
  font-size: 2.5rem;
  margin-top: 40px;
  color: var(--pol-dark);
}
