@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Dancing+Script:wght@500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

/* ============================================
   Tokens
   A keepsake-scrapbook language: floating petals,
   polaroid photo corners, folded letter paper.
   Every added token is a tint/shade of the palette
   already defined for this project — no new hues.
   ============================================ */
:root {
  /* names kept from the original pink palette (internal token names only,
     not user-facing) — values now a forest-green family */
  --pink-blush: #e3f4e8;
  --pink-soft: #8fc9a0;
  --pink-deep: #167535;
  --lavender: #e5defa;
  --lavender-deep: #b9a8e8;
  --cream: #fff9f4;
  --text-dark: #5b4a52;

  /* derived tones, same family */
  --plum: #7d5468;
  --pink-deep-rgb: 22, 117, 53;
  --lavender-deep-rgb: 185, 168, 232;
  --plum-rgb: 125, 84, 104;

  --font-body: 'Quicksand', system-ui, sans-serif;
  --font-script: 'Dancing Script', cursive;
  --font-serif: 'Cormorant Garamond', Georgia, serif;

  /* spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;

  /* radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* motion */
  --ease-bloom: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: linear-gradient(180deg, var(--cream), var(--pink-blush) 55%, var(--lavender) 130%);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============================================
   Gate — a locked garden gate that blooms open.
   The form reads as a single soft capsule rather
   than two separate controls.
   ============================================ */
.gate {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
  transition: opacity 1.2s var(--ease-soft);
}

.gate::before,
.gate::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(38px);
  pointer-events: none;
  z-index: 0;
  animation: drift 16s ease-in-out infinite;
}

.gate::before {
  width: 260px;
  height: 260px;
  left: -60px;
  top: 8%;
  background: radial-gradient(circle at 35% 35%, rgba(var(--pink-deep-rgb), 0.45), transparent 70%);
}

.gate::after {
  width: 320px;
  height: 320px;
  right: -80px;
  bottom: 6%;
  background: radial-gradient(circle at 60% 40%, rgba(var(--lavender-deep-rgb), 0.4), transparent 70%);
  animation-delay: -8s;
  animation-duration: 20s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -22px) scale(1.06); }
}

.gate-title,
.gate-question,
.gate-form,
.gate-feedback {
  position: relative;
  z-index: 1;
}

.gate-title {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  color: var(--pink-deep);
  text-shadow: 0 2px 18px rgba(var(--pink-deep-rgb), 0.35);
  margin: 0 0 var(--space-5);
  opacity: 0;
  animation: bloom-in 1s var(--ease-bloom) 0.1s forwards;
}

.gate-question {
  font-size: 1.15rem;
  font-weight: 500;
  max-width: 32ch;
  margin: 0 0 var(--space-5);
  opacity: 0;
  animation: bloom-in 0.9s var(--ease-bloom) 0.35s forwards;
}

.gate-question::before {
  content: '❀';
  display: block;
  color: var(--lavender-deep);
  font-size: 0.9rem;
  margin-bottom: var(--space-3);
}

.gate-progress {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(91, 74, 82, 0.55);
  margin: 0 0 var(--space-3);
  opacity: 0;
  animation: bloom-in 0.9s var(--ease-bloom) 0.25s forwards;
}

@keyframes bloom-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.gate-success { opacity: 0; }

.gate-form {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(var(--pink-deep-rgb), 0.25);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.4rem 0.4rem 1.25rem;
  box-shadow: 0 8px 24px rgba(var(--plum-rgb), 0.12);
  backdrop-filter: blur(6px);
  opacity: 0;
  animation: bloom-in 0.9s var(--ease-bloom) 0.6s forwards;
}

.gate-form input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.25rem;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-dark);
}

.gate-form input::placeholder {
  color: rgba(91, 74, 82, 0.45);
}

.gate-form input:focus {
  outline: none;
}

.gate-form button {
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--pink-deep), var(--lavender-deep));
  color: white;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s var(--ease-soft), box-shadow 0.25s var(--ease-soft);
}

.gate-form button:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 16px rgba(var(--pink-deep-rgb), 0.35);
}

.gate-form input:focus-visible,
.gate-form button:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
}

.gate-feedback {
  margin-top: var(--space-4);
  color: var(--pink-deep);
  font-weight: 500;
  min-height: 1.2rem;
  opacity: 0;
  animation: bloom-in 0.6s var(--ease-bloom) 0.9s forwards;
}

/* ============================================
   Sections
   ============================================ */
.section {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-5);
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-soft), transform 0.8s var(--ease-soft);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section h2 {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.2rem);
  color: var(--pink-deep);
  margin: 0 0 var(--space-2);
}

#opening { padding-top: var(--space-12); }

#opening p {
  font-size: 1.1rem;
}

/* ============================================
   Gallery — polaroids pinned with washi tape
   ============================================ */
#gallery {
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-lg);
}

.media-stream {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  margin: var(--space-6) 0;
}

.stream-item {
  position: relative;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.35s var(--ease-bloom);
  transform: rotate(var(--tilt, -2deg));
}

.media-stream .stream-item:nth-child(3n+1) { --tilt: -2.5deg; }
.media-stream .stream-item:nth-child(3n+2) { --tilt: 2deg; }
.media-stream .stream-item:nth-child(3n) { --tilt: -1deg; }

.stream-item:hover,
.stream-item:focus-within {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
}

.stream-photo {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--cream);
  padding: 0.6rem 0.6rem 1.6rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(var(--plum-rgb), 0.22);
  transition: box-shadow 0.35s var(--ease-soft);
  outline: none;
}

.stream-item:hover .stream-photo,
.stream-photo:focus-visible {
  box-shadow: 0 16px 32px rgba(var(--plum-rgb), 0.3);
}

.stream-video {
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(var(--plum-rgb), 0.2);
}

.stream-caption {
  margin: var(--space-3) 0 0;
  max-width: 480px;
  font-family: var(--font-script);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--plum);
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(var(--plum-rgb), 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
  animation: fade-in 0.25s var(--ease-soft);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* ============================================
   Letter — folded keepsake paper
   ============================================ */
.letter-section {
  background: linear-gradient(165deg, var(--lavender), #ece7fb);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  box-shadow: 0 12px 30px rgba(var(--lavender-deep-rgb), 0.25);
}

.letter-section::after {
  content: '';
  position: absolute;
  top: 0;
  right: var(--radius-lg);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 22px 22px 0;
  border-color: transparent rgba(255, 255, 255, 0.6) transparent transparent;
  filter: drop-shadow(-2px 2px 3px rgba(var(--plum-rgb), 0.15));
}

.letter-text {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.75;
  white-space: pre-line;
  color: var(--plum);
}

.letter-text::before {
  content: '“';
  display: block;
  font-size: 3rem;
  line-height: 1;
  color: rgba(var(--lavender-deep-rgb), 0.55);
  margin-bottom: -0.5rem;
}

/* ============================================
   Wordle
   ============================================ */
.wordle-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 0.9rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}

.legend-swatch.correct { background: var(--pink-deep); }
.legend-swatch.present { background: var(--lavender-deep); }
.legend-swatch.absent { background: #e8e0e4; }

.wordle-board {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  margin: var(--space-5) 0;
}

.wordle-row {
  display: flex;
  gap: var(--space-2);
}

.wordle-tile {
  width: 48px;
  height: 48px;
  border: 2px solid var(--pink-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: uppercase;
  background: white;
  transition: transform 0.35s var(--ease-bloom), background 0.35s var(--ease-soft), border-color 0.35s var(--ease-soft);
}

.wordle-tile.correct { background: var(--pink-deep); color: white; border-color: var(--pink-deep); transform: scale(1.04); }
.wordle-tile.present { background: var(--lavender-deep); color: white; border-color: var(--lavender-deep); }
.wordle-tile.absent { background: #e8e0e4; border-color: #e8e0e4; color: var(--text-dark); }

.wordle-keyboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
}

.keyboard-row {
  display: flex;
  gap: 0.3rem;
}

.key {
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--pink-soft);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: transform 0.15s var(--ease-soft), background 0.15s var(--ease-soft);
}

.key:hover {
  background: var(--pink-deep);
  color: white;
  transform: translateY(-1px);
}

.key:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
}

.key-wide {
  padding: 0.6rem 1rem;
}

.wordle-message {
  margin-top: var(--space-4);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--pink-deep);
  min-height: 1.5rem;
}

/* ============================================
   Closing
   ============================================ */
.closing-section {
  font-family: var(--font-script);
  font-size: 1.8rem;
  color: var(--pink-deep);
  padding-bottom: var(--space-12);
}

.closing-section p {
  margin: 0;
  animation: pulse-soft 3.5s ease-in-out infinite;
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* ============================================
   Motion & accessibility floor
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .gate-title,
  .gate-progress,
  .gate-question,
  .gate-form,
  .gate-feedback {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .wordle-tile { width: 40px; height: 40px; font-size: 1.1rem; }
  .gate-form { flex-direction: column; align-items: stretch; border-radius: var(--radius-md); padding: var(--space-3); }
  .gate-form button { width: 100%; }
  .letter-text { font-size: 1.15rem; }
}
