@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Outfit:wght@300;400;500;600&display=swap');

:root {
  /* Default rustic tone */
  --scrap-bg: #f5f2eb;
  --scrap-tape: rgba(210, 180, 140, 0.7);
  --scrap-tape-border: rgba(180, 150, 110, 0.3);
  --scrap-text: #4a3b32;
  --scrap-accent: #8b5a2b;
  --scrap-polaroid: #fff;
  --scrap-shadow: rgba(0,0,0,0.15);
  
  --font-script: 'Caveat', cursive;
  --font-typewriter: 'Courier Prime', monospace;
  --font-sans: 'Outfit', sans-serif;
}

[data-tone="pastel"] {
  --scrap-bg: #fff0f5;
  --scrap-tape: rgba(255, 182, 193, 0.7);
  --scrap-tape-border: rgba(219, 112, 147, 0.3);
  --scrap-text: #5d4037;
  --scrap-accent: #d87093;
}

[data-tone="monochrome"] {
  --scrap-bg: #e5e5e5;
  --scrap-tape: rgba(80, 80, 80, 0.6);
  --scrap-tape-border: rgba(0, 0, 0, 0.4);
  --scrap-text: #1a1a1a;
  --scrap-accent: #000;
  --scrap-shadow: rgba(0,0,0,0.25);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--scrap-bg);
  /* Sublte noise/paper texture */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
  color: var(--scrap-text);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

.scrap-container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 30px rgba(0,0,0,0.05);
  background-color: var(--scrap-bg);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
  overflow: hidden;
}

/* Washi Tape Generator */
.washi-tape {
  position: absolute;
  width: 100px;
  height: 28px;
  background-color: var(--scrap-tape);
  border: 1px solid var(--scrap-tape-border);
  opacity: 0.9;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  /* Rough edges clip path to mimic torn tape */
  clip-path: polygon(4% 0, 96% 2%, 100% 10%, 97% 20%, 100% 30%, 96% 40%, 100% 50%, 97% 60%, 100% 70%, 96% 80%, 100% 90%, 96% 100%, 4% 98%, 0 90%, 3% 80%, 0 70%, 4% 60%, 0 50%, 3% 40%, 0 30%, 4% 20%, 0 10%);
}

.tape-top-left { top: -10px; left: -10px; transform: rotate(-35deg); }
.tape-top-right { top: -10px; right: -10px; transform: rotate(30deg); }
.tape-top-center { top: -12px; left: 50%; transform: translateX(-50%) rotate(-4deg); width: 120px; }
.tape-bottom-center { bottom: -12px; left: 50%; transform: translateX(-50%) rotate(2deg); width: 90px; }

/* Polaroid Frame */
.polaroid {
  background: var(--scrap-polaroid);
  padding: 12px 12px 50px 12px;
  box-shadow: 2px 8px 20px var(--scrap-shadow);
  position: relative;
  display: block;
  margin: 30px auto;
  width: 80%;
  max-width: 320px;
  transform: rotate(-3deg);
  transition: transform 0.4s ease;
}
.polaroid:nth-child(even) {
  transform: rotate(4deg);
}
.polaroid:hover {
  transform: scale(1.05) rotate(0deg);
  z-index: 50;
}

.polaroid img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
  filter: sepia(10%) contrast(110%);
}

.polaroid-caption {
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-script);
  font-size: 1.8rem;
  color: var(--scrap-text);
  line-height: 1;
}

/* Torn Paper / Sticky Note */
.paper-note {
  background: #fff;
  padding: 30px 25px;
  margin: 40px 20px;
  position: relative;
  box-shadow: 2px 5px 15px var(--scrap-shadow);
  transform: rotate(1deg);
  font-family: var(--font-typewriter);
  font-size: 0.95rem;
  color: var(--scrap-text);
  line-height: 1.6;
}
.paper-note:nth-of-type(even) {
  transform: rotate(-1.5deg);
}

.paper-title {
  font-family: var(--font-script);
  font-size: 2.5rem;
  color: var(--scrap-accent);
  text-align: center;
  margin: 0 0 15px 0;
  line-height: 1.1;
  font-weight: 700;
}

/* Cover Section */
.cover-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 20px;
  z-index: 100;
}

.cover-polaroid {
  width: 85%;
  max-width: 340px;
  transform: rotate(-2deg);
  margin-bottom: 20px;
}

.badge-date {
  position: absolute;
  bottom: -20px;
  right: -10px;
  background: var(--scrap-accent);
  color: #fff;
  font-family: var(--font-typewriter);
  padding: 10px;
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: bold;
  font-size: 0.85rem;
  transform: rotate(15deg);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 20;
}

.btn-open {
  background: transparent;
  border: 2px dashed var(--scrap-accent);
  color: var(--scrap-accent);
  font-family: var(--font-typewriter);
  font-weight: bold;
  font-size: 1.1rem;
  padding: 12px 30px;
  cursor: pointer;
  margin-top: 30px;
  transition: all 0.3s;
  background-color: rgba(255,255,255,0.5);
  transform: rotate(-1deg);
}
.btn-open:hover {
  background: var(--scrap-accent);
  color: #fff;
  transform: scale(1.05) rotate(0deg);
}

.stamp {
  position: absolute;
  opacity: 0.5;
  transform: rotate(-20deg);
  pointer-events: none;
  z-index: 0;
}
.stamp-1 { top: 10%; right: -20px; width: 120px; }
.stamp-2 { bottom: 20%; left: -30px; width: 150px; }

/* Timeline / Events */
.event-box {
  border-left: 2px dashed var(--scrap-tape-border);
  padding-left: 20px;
  margin-bottom: 30px;
  position: relative;
}
.event-box::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--scrap-accent);
}

.event-title {
  font-family: var(--font-script);
  font-size: 1.8rem;
  color: var(--scrap-accent);
  margin: 0 0 5px 0;
}

/* Button Global */
.btn-scrap {
  display: inline-block;
  background: var(--scrap-accent);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-typewriter);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 2px 4px 0 rgba(0,0,0,0.2);
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn-scrap:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(0,0,0,0.2);
}

/* Form RSVP */
.form-scrap {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.form-scrap input, .form-scrap select, .form-scrap textarea {
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--scrap-tape-border);
  font-family: var(--font-typewriter);
  font-size: 0.9rem;
  color: var(--scrap-text);
  box-sizing: border-box;
}
.form-scrap input:focus, .form-scrap select:focus, .form-scrap textarea:focus {
  outline: none;
  border-color: var(--scrap-accent);
  background: #fff;
}

/* Animations */
.popup-active { overflow: hidden; }
#mainApp { display: none; opacity: 0; transition: opacity 1s; padding-bottom: 50px; }
#introOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--scrap-bg);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}
.open-anim {
  transform: translateY(-100%);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.gallery-grid .polaroid {
  width: 100%;
  margin: 0;
  padding: 8px 8px 30px 8px;
}
.gallery-grid .polaroid-caption {
  font-size: 1.2rem;
}
