:root {
  --cream: #FFF1D6;
  --paper: #FFF8EA;
  --sun: #FFB627;
  --sun-2: #FF9F1C;
  --orange: #F3722C;
  --red: #E4572E;
  --crimson: #B3122B;
  --avocado: #6F8A2E;
  --teal: #17A398;
  --plum: #6B2D5C;
  --brown: #3B1E12;

  --f-display: "Shrikhand", "Cooper Black", Georgia, serif;
  --f-mono: "Rubik Mono One", "Arial Black", system-ui, sans-serif;
  --f-neon: "Monoton", "Shrikhand", serif;
  --f-hand: "Caveat Brush", "Comic Sans MS", cursive;

  --vh: 1dvh;
  --gap: clamp(6px, 1.4dvh, 16px);
}

@supports not (height: 1dvh) {
  :root { --vh: 1vh; }
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--sun);
  color: var(--brown);
  font-family: var(--f-mono);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Background: rotating sunburst + grain ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sunburst {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 300vmax;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, var(--sun) 0 7.5deg, var(--sun-2) 7.5deg 15deg);
  animation: spin 160s linear infinite;
}

.glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 45% at 50% 34%, rgb(255 241 214 / .55), transparent 70%);
}

body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: .22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .23 0 0 0 0 .12 0 0 0 0 .07 0 0 0 1.1 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}

/* ---------- Layout ---------- */
.stage {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--gap);
  padding-bottom: max(env(safe-area-inset-bottom), calc(1.6 * var(--vh)));
  overflow: hidden;
}

/* ---------- Marquee ---------- */
.marquee {
  background: var(--brown);
  color: var(--cream);
  overflow: hidden;
  white-space: nowrap;
  padding-top: env(safe-area-inset-top);
  border-bottom: 4px solid var(--orange);
  box-shadow: 0 4px 0 var(--teal);
  font-family: var(--f-display);
  font-size: clamp(13px, 2 * var(--vh), 19px);
  letter-spacing: .04em;
}

.marquee-track {
  display: inline-flex;
  animation: marquee 26s linear infinite;
}

.marquee-item {
  display: inline-block;
  padding: .45em 0 .55em .8em;
  word-spacing: .2em;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(1 * var(--vh));
  padding: calc(1 * var(--vh)) 16px 0;
}

.tape {
  margin: 0;
  max-width: min(88vw, 520px);
  padding: .1em .9em .15em;
  font-family: var(--f-hand);
  font-size: clamp(18px, min(6.4vw, 3.8 * var(--vh)), 40px);
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
  color: var(--brown);
  background: rgb(255 248 234 / .88);
  rotate: -2.5deg;
  clip-path: polygon(0 8%, 3% 0, 6% 10%, 9% 0, 12% 8%, 100% 0, 97% 12%, 100% 25%, 97% 40%, 100% 55%, 97% 70%, 100% 85%, 97% 100%, 0 100%, 3% 85%, 0 70%, 3% 55%, 0 40%, 3% 25%);
  box-shadow: 0 2px 0 rgb(59 30 18 / .1);
  animation: drop .7s cubic-bezier(.2, 1.6, .4, 1) .1s both;
}

.title-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}

.title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: .9;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
}

.title > span { display: block; }

.t-save {
  font-family: var(--f-display);
  font-size: clamp(30px, min(13vw, 7.4 * var(--vh)), 92px);
  color: var(--cream);
  -webkit-text-stroke: .03em var(--brown);
  paint-order: stroke fill;
  text-shadow: .05em .05em 0 var(--brown);
  rotate: -4deg;
  translate: -6% 0;
  animation: drop .7s cubic-bezier(.2, 1.6, .4, 1) .25s both;
}

.t-fuck {
  position: relative;
  z-index: 2;
  margin: .28em 0 .18em;
  padding: .22em .5em .18em;
  font-family: var(--f-mono);
  font-size: clamp(18px, min(8.2vw, 4.4 * var(--vh)), 52px);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--crimson);
  border: .14em solid currentColor;
  border-radius: .18em;
  background: rgb(255 248 234 / .35);
  rotate: -7deg;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='120'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 2.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23d)'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='120'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 2.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23d)'/%3E%3C/svg%3E");
  -webkit-mask-size: 300px 120px;
          mask-size: 300px 120px;
  animation: stamp .45s cubic-bezier(.5, 0, .75, 0) .85s both;
}

.t-date {
  font-family: var(--f-display);
  font-size: clamp(64px, min(36vw, 19 * var(--vh)), 230px);
  position: relative;
  z-index: 3;
  line-height: .95;
  margin-top: -.1em;
  padding-right: .12em;
  color: var(--cream);
  -webkit-text-stroke: .018em var(--brown);
  paint-order: stroke fill;
  text-shadow:
    .035em .035em 0 var(--orange),
    .07em .07em 0 var(--red),
    .105em .105em 0 var(--teal),
    .14em .14em 0 var(--brown);
  rotate: -3deg;
  animation: drop .8s cubic-bezier(.2, 1.6, .4, 1) .45s both;
}

/* ---------- Badge (Mit Schlafplatz / Food, Bar und Disco) ---------- */
.badge {
  position: absolute;
  right: -7%;
  top: -6%;
  width: clamp(76px, min(25vw, 14 * var(--vh)), 150px);
  aspect-ratio: 1;
  z-index: 3;
  animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) 1.35s both;
}

.badge-ring {
  width: 100%;
  height: 100%;
  animation: spin 14s linear infinite;
  filter: drop-shadow(3px 3px 0 var(--brown));
}

.badge-bg { fill: var(--teal); stroke: var(--brown); stroke-width: 3; }
.badge-inner { fill: var(--cream); stroke: var(--brown); stroke-width: 3; }

.badge-text {
  font-family: var(--f-mono);
  font-size: 16px;
  fill: var(--cream);
}

.badge-mill {
  position: absolute;
  inset: 29%;
  width: 42%;
  height: 42%;
}

.mill-sails {
  transform-box: view-box;
  transform-origin: 50px 44px;
  animation: spin 6s linear infinite;
}

/* ---------- Details ---------- */
.details {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 0;
}

/* Ticket */
.ticket-wrap {
  width: min(100% - 32px, 560px);
  margin-inline: auto;
  filter: drop-shadow(4px 4px 0 var(--brown));
  animation: rise .7s cubic-bezier(.2, 1.4, .4, 1) 1.1s both;
}

.ticket {
  --notch: clamp(9px, 1.4 * var(--vh), 14px);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  background: var(--paper);
  color: var(--brown);
  -webkit-mask:
    radial-gradient(circle var(--notch) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask:
    radial-gradient(circle var(--notch) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}

.ticket::before {
  /* striped header band */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: calc(.9 * var(--vh) + 4px);
  background: linear-gradient(90deg, var(--red) 0 25%, var(--orange) 25% 50%, var(--sun) 50% 75%, var(--teal) 75%);
}

.ticket-label {
  display: block;
  font-family: var(--f-mono);
  font-size: clamp(8px, 1.15 * var(--vh), 11px);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--plum);
  opacity: .8;
}

.ticket-when,
.ticket-where {
  padding: calc(1.8 * var(--vh) + 4px) clamp(14px, 4vw, 26px) calc(1.2 * var(--vh) + 2px);
}

.ticket-when {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 3px dashed rgb(59 30 18 / .35);
  padding-left: calc(var(--notch) + clamp(8px, 2.5vw, 18px));
}

.ticket-day,
.ticket-month {
  font-family: var(--f-mono);
  font-size: clamp(9px, min(2.8vw, 1.5 * var(--vh)), 14px);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ticket-num {
  font-family: var(--f-neon);
  font-size: clamp(34px, min(13vw, 7.2 * var(--vh)), 72px);
  line-height: 1.05;
  color: var(--red);
}

.ticket-where {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(.5 * var(--vh));
  padding-right: calc(var(--notch) + clamp(8px, 2.5vw, 18px));
}

.pin {
  width: 1.3em;
  height: 1.3em;
  margin-left: -.05em;
  vertical-align: -.35em;
  fill: var(--red);
}

/* Add-to-calendar sticker button */
.ticket-wrap { position: relative; }

.cal-btn {
  position: absolute;
  z-index: 2;
  top: calc(-1 * clamp(24px, 2.2 * var(--vh) + 10px, 32px));
  right: clamp(10px, 4vw, 24px);
  display: inline-flex;
  align-items: center;
  gap: .45em;
  padding: .6em .95em .6em .8em;
  min-height: 40px;
  font-family: var(--f-mono);
  font-size: clamp(10px, min(3vw, 1.6 * var(--vh)), 14px);
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  background: var(--crimson);
  border: 3px solid var(--brown);
  border-radius: 99px;
  box-shadow: 3px 3px 0 var(--brown);
  rotate: 5deg;
  animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) 1.7s both, jiggle 5s ease-in-out 3s infinite;
  transition: translate .12s, box-shadow .12s, background .2s;
}

.cal-btn svg {
  width: 1.5em;
  height: 1.5em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.cal-btn:hover { background: #8E0E22; }

.cal-btn:active {
  translate: 3px 3px;
  box-shadow: 0 0 0 var(--brown);
}

.cal-btn:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}

.ticket-place {
  font-family: var(--f-display);
  font-size: clamp(19px, min(6.6vw, 3.7 * var(--vh)), 36px);
  line-height: 1.02;
  color: var(--brown);
}

.perk {
  align-self: flex-start;
  font-family: var(--f-mono);
  font-size: clamp(9px, min(2.7vw, 1.45 * var(--vh)), 13px);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  padding: .35em .7em;
  border-radius: 99px;
  background: var(--teal);
  color: var(--cream);
}

/* Gallery */
.gallery-wrap {
  /* Polaroid size: ~2.3 slides fit the screen width, capped by --ph-max so
     the whole page still fits the viewport height. */
  --ggap: clamp(14px, 4vw, 30px);
  --ph-max: calc(24 * var(--vh));
  --pw: min((100vw - 16px + var(--ggap)) / 2.3 - var(--ggap), var(--ph-max) * .82);
  --ph: calc(var(--pw) / .82);
  position: relative;
  height: calc(var(--ph) / .86);
  animation: rise .7s cubic-bezier(.2, 1.4, .4, 1) 1.3s both;
}

.gallery-wrap::before {
  /* retro racing stripes behind the polaroids */
  content: "";
  position: absolute;
  inset: 26% 0 18%;
  background: linear-gradient(to bottom,
    var(--red) 0 25%, var(--orange) 25% 50%, var(--avocado) 50% 75%, var(--plum) 75%);
}

.gallery {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--ggap);
  padding-inline: 16px;
  scroll-padding-inline: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  outline: none;
}

.gallery::-webkit-scrollbar { display: none; }
.gallery.dragging { cursor: grabbing; scroll-snap-type: none; }

.polaroid {
  --r: 0deg;
  position: relative;
  flex: 0 0 auto;
  height: var(--ph);
  width: var(--pw);
  margin: 0;
  padding: calc(var(--pw) * .06) calc(var(--pw) * .06) 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: 4px 5px 0 var(--brown);
  rotate: var(--r);
  scroll-snap-align: start;
  transition: rotate .3s ease, scale .3s ease;
  cursor: zoom-in;
}

.polaroid.no-caption { padding-bottom: calc(var(--pw) * .2); }

.polaroid:hover,
.polaroid:focus-visible { rotate: 0deg; scale: 1.04; outline: none; }

.polaroid::before {
  /* tape */
  content: "";
  position: absolute;
  top: -6%;
  left: 50%;
  width: 42%;
  height: 12%;
  translate: -50% 0;
  rotate: calc(var(--r) * -2);
  background: rgb(255 241 214 / .7);
  box-shadow: 0 1px 2px rgb(59 30 18 / .15);
}

.polaroid img {
  width: 100%;
  height: 0;
  flex: 1;
  object-fit: cover;
  background: var(--sun-2);
  filter: sepia(.18) saturate(1.2) contrast(1.05);
  pointer-events: none;
  -webkit-user-drag: none;
}

.polaroid figcaption {
  height: 22%;
  display: grid;
  place-items: center;
  font-family: var(--f-hand);
  font-size: clamp(13px, 2.5 * var(--vh), 26px);
  color: var(--brown);
  white-space: nowrap;
  overflow: hidden;
}

.swipe-hint {
  position: absolute;
  right: 16px;
  top: 2%;
  font-family: var(--f-hand);
  font-size: clamp(14px, 2.3 * var(--vh), 22px);
  color: var(--cream);
  background: var(--brown);
  padding: .05em .55em .15em;
  rotate: 4deg;
  pointer-events: none;
  animation: nudge 1.6s ease-in-out infinite;
  transition: opacity .4s;
  z-index: 2;
}

.swipe-hint.hidden { opacity: 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100dvh;
  overflow: visible;
}

.lightbox,
.lightbox figure { touch-action: none; user-select: none; }

.lightbox img { -webkit-user-drag: none; pointer-events: none; }

.lb-nav {
  position: fixed;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  translate: 0 -50%;
  color: var(--cream);
  background: var(--brown);
  border: 3px solid var(--cream);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--sun);
  cursor: pointer;
}

.lb-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lb-nav:hover { background: var(--red); }
.lb-nav:active { translate: 2px calc(-50% + 2px); box-shadow: 1px 1px 0 var(--sun); }
.lb-nav:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.lb-prev { left: max(10px, env(safe-area-inset-left)); }
.lb-next { right: max(10px, env(safe-area-inset-right)); }

.lightbox::backdrop {
  background: rgb(59 30 18 / .85);
  backdrop-filter: blur(4px);
}

.lightbox figure {
  margin: 0;
  padding: 14px 14px 0;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--sun);
  rotate: -2deg;
  animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both;
  cursor: zoom-out;
}

.lightbox img {
  display: block;
  max-width: min(88vw, 900px);
  max-height: 72dvh;
  object-fit: contain;
  filter: sepia(.12) saturate(1.15);
}

.lightbox figcaption {
  font-family: var(--f-hand);
  font-size: 28px;
  text-align: center;
  padding: 8px 0 14px;
  color: var(--brown);
}

/* ---------- Confetti ---------- */
.confetti {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ---------- Short landscape phones: side by side ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  :root { --gap: 10px; }
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .marquee { grid-column: 1 / -1; }
  .hero { padding-top: 0; }
  .details { justify-content: center; padding-right: max(env(safe-area-inset-right), 12px); }
  .t-save { font-size: min(7vw, 10 * var(--vh)); }
  .t-fuck { font-size: min(4.2vw, 6 * var(--vh)); }
  .t-date { font-size: min(16vw, 27 * var(--vh)); }
  .tape { font-size: min(3.4vw, 6 * var(--vh)); }
  .badge { width: min(12vw, 20 * var(--vh)); right: -24%; top: -10%; }
  .ticket-wrap { width: 100%; }
  .ticket-num { font-size: min(6vw, 11 * var(--vh)); }
  .ticket-place { font-size: min(3.2vw, 5.4 * var(--vh)); }
  .gallery-wrap { --ph-max: calc(38 * var(--vh)); --pw: min((50vw - 28px + var(--ggap)) / 2.3 - var(--ggap), var(--ph-max) * .82); }
  .gallery { padding-inline: 16px; scroll-padding-inline: 16px; }
}

/* ---------- Short portrait phones: tighten everything a bit ---------- */
@media (orientation: portrait) and (max-height: 720px) {
  .hero { gap: calc(.6 * var(--vh)); padding-top: calc(.6 * var(--vh)); }
  .tape { font-size: clamp(16px, min(6vw, 3.4 * var(--vh)), 40px); }
  .t-save { font-size: clamp(26px, min(13vw, 6.4 * var(--vh)), 92px); }
  .t-fuck { margin: .2em 0 .12em; font-size: clamp(16px, min(8vw, 4 * var(--vh)), 52px); }
  .t-date { font-size: clamp(56px, min(36vw, 15 * var(--vh)), 230px); }
  .badge { width: clamp(70px, min(24vw, 13 * var(--vh)), 150px); right: max(-24%, calc((100% - 100vw) / 2 + 8px)); top: -8%; }
  .ticket-when, .ticket-where { padding-top: calc(1.4 * var(--vh) + 4px); padding-bottom: calc(.8 * var(--vh) + 2px); }
  .ticket-num { font-size: clamp(30px, min(13vw, 6 * var(--vh)), 72px); line-height: 1; }
  .gallery-wrap { --ph-max: calc(28 * var(--vh)); }
  .cal-btn { top: -24px; min-height: 34px; padding: .45em .85em .45em .7em; }
}

/* ---------- Big screens: a bit more breathing room ---------- */
@media (min-width: 900px) and (min-height: 700px) {
  .gallery-wrap { --ph-max: min(25 * var(--vh), 330px); }
  .gallery { padding-inline: 24px; scroll-padding-inline: 24px; }
}

/* ---------- Animations ---------- */
@keyframes spin { to { rotate: 360deg; } }

@keyframes marquee { to { transform: translateX(-50%); } }

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-4%, 3%); }
  50% { transform: translate(3%, -5%); }
  75% { transform: translate(-2%, -2%); }
  100% { transform: translate(5%, 4%); }
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-60px) scale(.8); }
  to { opacity: 1; transform: none; }
}

@keyframes stamp {
  0% { opacity: 0; transform: scale(3.2) rotate(8deg); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0) rotate(-90deg); }
  to { opacity: 1; transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}

@keyframes wobble {
  0%, 100% { transform: none; }
  25% { transform: rotate(4deg) scale(1.06); }
  50% { transform: rotate(-3deg) scale(.97); }
  75% { transform: rotate(2deg) scale(1.02); }
}

@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(4px, -4px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(2px, 3px); }
}

@keyframes jiggle {
  0%, 88%, 100% { transform: none; }
  91% { transform: rotate(-8deg) scale(1.08); }
  94% { transform: rotate(6deg) scale(1.08); }
  97% { transform: rotate(-3deg); }
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-6px); }
}

.stage.shake { animation: shake .35s linear; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
  }
}
