@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("fonts/caveat-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --sun: #ffc70f;
  --sun-deep: #f5a800;
  --butter: #fff3bf;
  --cream: #fffaf0;
  --ink: #3a2a12;
  --ink-soft: #6b5327;
  --comb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 1 55 16.5v31L28 63 1 47.5v-31ZM28 63v33M1 47.500-26 63M55 47.5 82 63' fill='none' stroke='%23e89b00' stroke-opacity='.28' stroke-width='2'/%3E%3C/svg%3E");
  --hexagon: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: 520px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--sun);
  color: var(--ink);
  font-family: "Fredoka", ui-rounded, "Segoe UI", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

.defs {
  position: absolute;
}

h1,
h2,
p {
  margin: 0;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  padding: max(2.5rem, env(safe-area-inset-top)) 1.25rem 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  background: var(--comb), radial-gradient(120% 70% at 50% 0, #ffe066 0, var(--sun) 55%, var(--sun-deep) 100%);
  overflow: hidden;
}

.hero__kicker {
  font-family: "Caveat", cursive;
  font-size: 2.1rem;
  line-height: 1;
  transform: rotate(-4deg);
  color: var(--ink-soft);
}

.hero__title {
  font-size: clamp(3rem, 15.5vw, 4.6rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.55);
}

.hero__title span {
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--ink);
}

.hero__photo {
  position: relative;
  width: min(78vw, 330px);
  aspect-ratio: 1 / 1.12;
  margin: 1.5rem 0 0.75rem;
}

.hex {
  position: absolute;
  inset: 0;
  clip-path: var(--hexagon);
}

.hex--ring {
  background: var(--ink);
  transform: translate(7px, 9px);
}

.hex--img {
  background: #fff;
  padding: 7px;
}

.hex--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  clip-path: var(--hexagon);
  display: block;
}

.hero__sticker {
  position: absolute;
  right: -0.25rem;
  bottom: 0.5rem;
  font-size: 3rem;
  transform: rotate(12deg);
  filter: drop-shadow(0 4px 0 rgba(58, 42, 18, 0.25));
}

.hero__sub {
  font-size: 1.2rem;
  font-weight: 600;
}

.hero__scroll {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  translate: -50% 0;
  font-size: 1.75rem;
  text-decoration: none;
  animation: drip 1.8s ease-in-out infinite;
}

@keyframes drip {
  50% {
    transform: translateY(9px);
  }
}

/* ---------- Bees ---------- */

.bee {
  position: absolute;
  width: 62px;
  height: 46px;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 6px 4px rgba(58, 42, 18, 0.2));
}

.bee--a {
  top: 7%;
  left: -70px;
  animation: fly-a 13s linear infinite;
}

.bee--b {
  top: 46%;
  right: 4%;
  width: 46px;
  height: 34px;
  animation: hover 4.5s ease-in-out infinite;
}

.bee--c {
  bottom: 13%;
  left: 5%;
  width: 52px;
  height: 39px;
  transform: scaleX(-1);
  animation: hover 5.5s ease-in-out -2s infinite;
}

@keyframes fly-a {
  0% {
    translate: 0 0;
    rotate: 8deg;
  }
  25% {
    translate: 35vw 40px;
    rotate: -6deg;
  }
  50% {
    translate: 70vw -10px;
    rotate: 10deg;
  }
  100% {
    translate: 135vw 60px;
    rotate: -4deg;
  }
}

@keyframes hover {
  0%,
  100% {
    translate: 0 0;
    rotate: -6deg;
  }
  50% {
    translate: -10px -16px;
    rotate: 7deg;
  }
}

/* ---------- Greeting ---------- */

main {
  background: var(--comb), var(--butter);
}

.gruss {
  padding: 3rem 1.25rem 2.5rem;
}

.note {
  position: relative;
  padding: 2.25rem 1.5rem 1.75rem;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 7px 8px 0 var(--ink);
  transform: rotate(-0.4deg);
}

.note__tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 28px;
  translate: -50% 0;
  rotate: 2deg;
  background: repeating-linear-gradient(90deg, var(--sun) 0 14px, var(--ink) 14px 20px);
  opacity: 0.9;
  border-radius: 3px;
}

.note h2 {
  font-family: "Caveat", cursive;
  font-size: 2.4rem;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.note__text p + p {
  margin-top: 0.9em;
}

.note__text .signature {
  font-family: "Caveat", cursive;
  font-size: 1.9rem;
  line-height: 1.2;
  text-align: right;
}

.note__text .lead {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.note__text .divider {
  text-align: center;
  font-size: 1.4rem;
}

.insider {
  margin: 1.4em 0;
  padding: 0.9rem 1rem;
  background: var(--butter);
  border-left: 5px solid var(--sun);
  border-radius: 0 14px 14px 0;
  font-style: italic;
  rotate: 1deg;
}

.note__text .signature {
  margin-top: 1.2em;
  text-align: left;
}

.note__text .ps {
  margin-top: 1.4em;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Gallery ---------- */

.gallery-section {
  padding: 1.5rem 0.9rem 2rem;
}

.section-title {
  font-size: 1.9rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
}

.section-hint {
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0.25rem 0 1.5rem;
}

.gallery {
  columns: 2;
  column-gap: 0.9rem;
}

.polaroid {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 7px 7px 30px;
  break-inside: avoid;
  position: relative;
  background: #fff;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(58, 42, 18, 0.12), 0 10px 18px -6px rgba(58, 42, 18, 0.45);
  rotate: var(--tilt, 0deg);
  cursor: zoom-in;
  font: inherit;
  transition: rotate 0.25s ease, scale 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.polaroid:active {
  rotate: 0deg;
  scale: 1.03;
}

.polaroid:focus-visible,
.buzz:focus-visible,
.lightbox button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.polaroid img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--butter);
  border-radius: 2px;
}

.polaroid::after {
  content: attr(data-mark);
  position: absolute;
  bottom: 3px;
  right: 9px;
  font-size: 1rem;
  line-height: 24px;
}

/* ---------- Finale ---------- */

.finale {
  padding: 2rem 1.25rem max(3.5rem, env(safe-area-inset-bottom));
  text-align: center;
  background: var(--comb), linear-gradient(var(--butter), var(--sun) 60%);
}

.buzz {
  padding: 0.95rem 1.6rem;
  min-height: 52px;
  font: 600 1.15rem "Fredoka", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.buzz:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--ink);
}

.finale__text {
  margin-top: 2rem;
  font-family: "Caveat", cursive;
  font-size: 2rem;
  line-height: 1.15;
}

.finale__emojis {
  margin-top: 1rem;
  font-size: 1.6rem;
  letter-spacing: 0.2em;
}

/* ---------- Swarm (released bees) ---------- */

.swarm {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

.swarm span {
  position: absolute;
  bottom: -3rem;
  left: var(--x);
  font-size: var(--size);
  animation: rise var(--dur) ease-in forwards;
  animation-delay: var(--delay);
}

@keyframes rise {
  to {
    transform: translate(var(--drift), -120vh) rotate(var(--spin));
  }
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(40, 28, 8, 0.96);
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox::backdrop {
  background: rgba(40, 28, 8, 0.96);
}

.lightbox img {
  max-width: 100vw;
  max-height: 100dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  touch-action: pan-y;
  user-select: none;
}

.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  font: 600 1.6rem/1 "Fredoka", system-ui, sans-serif;
  color: var(--ink);
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
}

.lightbox__close {
  top: max(0.9rem, env(safe-area-inset-top));
  right: 0.9rem;
}

.lightbox__nav--prev {
  left: 0.6rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
}

.lightbox__nav--next {
  right: 0.6rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
}

.lightbox__count {
  position: absolute;
  bottom: max(1.6rem, calc(env(safe-area-inset-bottom) + 0.6rem));
  left: 50%;
  translate: -50% 0;
  padding: 0.15rem 0.8rem;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .bee,
  .hero__scroll {
    animation: none;
  }
  .bee--a {
    left: 6%;
  }
}
