@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/manrope-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: Lora;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/lora-latin-400-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --canvas: #e9ece4;
  --paper: #fffdf7;
  --ink: #233b32;
  --muted: #5a6c60;
  --cycle: 4.8s;
}

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

html {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  display: grid;
  place-items: center;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: clamp(1rem, 4vw, 3rem);
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: Manrope, sans-serif;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

.postcard {
  width: min(100%, 40rem);
  overflow: hidden;
  border: 1px solid rgb(35 59 50 / 4%);
  border-radius: 1.5rem;
  background: var(--paper);
  box-shadow: 0 24px 70px -32px rgb(24 53 41 / 22%);
  animation: arrive 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.illustration {
  position: relative;
  background: #203f32;
}

.scene {
  display: block;
  width: 100%;
  height: auto;
}

.message {
  padding: clamp(1.75rem, 4.5vh, 3rem) 1.25rem clamp(2rem, 5vh, 3.5rem);
  text-align: center;
}

h1 {
  margin: 0;
  font-family: Lora, Georgia, serif;
  font-size: clamp(2.375rem, 6.6vw, 4rem);
  font-weight: 400;
  line-height: 1.12;
  animation: reveal 700ms 130ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

h1 span { display: block; }

p {
  position: relative;
  display: inline-block;
  margin: clamp(1rem, 2.5vh, 1.5rem) 0 0;
  color: var(--muted);
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  line-height: 1.4;
  animation: reveal 700ms 230ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cooking-dots {
  position: absolute;
  inset-inline-start: calc(100% + 0.45rem);
  bottom: 0.3em;
  display: flex;
  gap: 3px;
}

.cooking-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b87744;
  animation: simmer 1.6s ease-in-out infinite;
}
.cooking-dots i:nth-child(2) { animation-delay: 140ms; }
.cooking-dots i:nth-child(3) { animation-delay: 280ms; }

.lid {
  transform-origin: 320px 152px;
  animation: lid-lift var(--cycle) ease-in-out infinite;
}
.steam-wisp { opacity: 0; animation: steam-rise var(--cycle) ease-out infinite; }
.steam-two { animation-delay: 250ms; }
.steam-three { animation-delay: 500ms; }
.bubble {
  transform-box: fill-box;
  transform-origin: center;
  animation: simmer 1.6s ease-in-out infinite;
}
.bubble-two { animation-delay: 500ms; }
.bubble-three { animation-delay: 900ms; }
.plant { animation: sway 6s ease-in-out infinite alternate; }
.plant-left { transform-origin: 187px 240px; }
.plant-right { transform-origin: 459px 243px; animation-delay: -3s; }
.bird { animation: drift 8s ease-in-out infinite alternate; }
.spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: twinkle 3.8s ease-in-out infinite alternate;
}
.spark-two { animation-delay: -1.3s; }
.spark-three { animation-delay: -2.7s; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes lid-lift {
  0%, 10%, 90%, 100% { transform: translateY(0) rotate(0); }
  17% { transform: translateY(-3px) rotate(-2deg); }
  23% { transform: translateY(0) rotate(1deg); }
  38%, 56% { transform: translateY(-23px) rotate(-7deg); }
  76% { transform: translateY(-2px) rotate(2deg); }
}
@keyframes steam-rise {
  0%, 22%, 85%, 100% { opacity: 0; transform: translateY(8px); }
  35% { opacity: 0.6; }
  63% { opacity: 0; transform: translateY(-28px); }
}
@keyframes simmer {
  0%, 100% { opacity: 0.55; transform: translateY(0) scale(0.85); }
  50% { opacity: 1; transform: translateY(-3px) scale(1.05); }
}
@keyframes sway {
  from { transform: rotate(-2deg); }
  to { transform: rotate(3deg); }
}
@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(9px, -5px); }
}
@keyframes twinkle {
  from { opacity: 0.4; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
  .postcard { border-radius: 1.25rem; }
  .scene { height: clamp(185px, 56vw, 240px); object-fit: cover; }
}
@media (max-height: 600px) and (min-width: 640px) {
  .postcard { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 52rem); }
  .illustration { min-width: 0; }
  .scene { height: 100%; min-height: 230px; object-fit: cover; }
  .message { align-self: center; padding: 2rem 1rem; }
  h1 { font-size: clamp(2.125rem, 5vw, 3rem); }
  p { font-size: 0.875rem; }
}
@media (max-height: 500px) and (max-width: 639px) {
  .scene { height: 140px; object-fit: cover; }
  .message { padding: 1rem; }
  h1 { font-size: 2rem; }
  p { margin-top: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cooking-dots { display: none; }
  .steam-wisp { opacity: 0.35; }
}
