:root {
  --honey: #f6c453;
  --honey-deep: #e3921a;
  --honey-soft: #fff1c9;
  --red: #d7262e;
  --ink: #5a3a1e;
  --ink-soft: #8a6a4a;
  --glass: rgba(255, 255, 255, .55);
  --glass-border: rgba(255, 255, 255, .8);
  --shadow: 0 20px 50px -20px rgba(140, 84, 20, .35);
  --radius: 28px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: "Fredoka", "Vazirmatn", system-ui, sans-serif;
  color: var(--ink);
  background: #fff7e3;
  padding: 84px 16px 220px;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}
html[lang="ckb"] body { font-family: "Vazirmatn", "Fredoka", system-ui, sans-serif; }
html[lang="ar"] body  { font-family: "Noto Naskh Arabic", "Vazirmatn", serif; }

main {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  opacity: .75;
  will-change: transform;
  animation: drift 18s ease-in-out infinite alternate;
}
.b1 { width: 55vmax; height: 55vmax; background: radial-gradient(circle, #ffd56b 0%, transparent 65%); top: -20vmax; left: -15vmax; }
.b2 { width: 45vmax; height: 45vmax; background: radial-gradient(circle, #ffb4a2 0%, transparent 65%); bottom: -15vmax; right: -15vmax; animation-delay: -6s; }
.b3 { width: 35vmax; height: 35vmax; background: radial-gradient(circle, #c9e8b0 0%, transparent 65%); top: 40%; left: 50%; animation-delay: -12s; opacity: .5; }
.honeycomb {
  position: absolute; inset: 0;
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0 32V66' fill='none' stroke='%23b8730f' stroke-width='2'/%3E%3C/svg%3E");
  animation: pan 60s linear infinite;
}
.sparkles { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.sparkles i {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffd56b 60%, transparent 70%);
  animation: twinkle 3s ease-in-out infinite;
}
#confetti { position: fixed; inset: 0; z-index: 20; pointer-events: none; width: 100%; height: 100%; }

/* ---------- Language switcher ---------- */
.langs {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px -10px rgba(140, 84, 20, .4);
  z-index: 30;
  direction: ltr;
}
.langs button {
  position: relative;
  z-index: 1;
  font: 600 14px "Vazirmatn", "Fredoka", sans-serif;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .35s var(--ease);
}
.langs button.active { color: #fff; }
.langs .pill {
  position: absolute;
  top: 5px; bottom: 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4a4a, var(--red));
  box-shadow: 0 4px 12px -2px rgba(215, 38, 46, .5);
  transition: left .45s var(--ease), width .45s var(--ease);
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding-top: 8px; }
.pooh { display: block; width: min(220px, 60%); margin: 0 auto 8px; animation: bob 4s ease-in-out infinite; }

.badge {
  position: relative;
  width: 200px; height: 200px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
}
.ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--honey), var(--red), #ffb4a2, var(--honey));
  animation: spin 8s linear infinite;
  filter: blur(.5px);
}
.ring::after {
  content: ""; position: absolute; inset: 8px;
  border-radius: 50%; background: #fff7e3;
}
.one {
  position: relative;
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font: 700 110px/1 "Fredoka", sans-serif;
  color: #fff;
  background: radial-gradient(circle at 32% 28%, #ffe08a, var(--honey) 45%, var(--honey-deep));
  text-shadow: 0 5px 0 rgba(138, 90, 51, .25);
  box-shadow: inset 0 -10px 20px rgba(160, 90, 10, .25), 0 18px 40px -12px rgba(227, 146, 26, .7);
  animation: pulse 2.6s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .2s var(--ease);
}
.one:active { transform: scale(.92); }
.pot {
  position: absolute;
  width: 78px; height: 78px;
  bottom: -10px;
  inset-inline-end: -18px;
  filter: drop-shadow(0 8px 10px rgba(140, 84, 20, .3));
  animation: wobble 3s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.orbit {
  position: absolute; inset: -22px;
  animation: spin 6s linear infinite;
}
.orbit span {
  position: absolute; top: 0; left: 50%;
  font-size: 26px;
  transform: translateX(-50%);
  display: inline-block;
  animation: flap .25s ease-in-out infinite alternate;
}

h1 {
  font-size: clamp(24px, 6vw, 34px);
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.35;
  color: var(--honey-deep);
  text-shadow: 0 2px 0 rgba(255, 255, 255, .8), 0 6px 18px rgba(227, 146, 26, .35);
}
.lead { font-size: 17px; color: var(--ink-soft); margin: 0 0 6px; }
.headline {
  font-size: clamp(24px, 6.5vw, 34px);
  line-height: 1.45;
  color: var(--red);
  margin: 6px 0 0;
}

/* ---------- Glass cards ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px;
  text-align: center;
}
.glass p { font-size: 17px; line-height: 1.9; margin: 0; }
.presence { margin-top: 12px !important; font-weight: 600; color: var(--red); }

/* ---------- Detail tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
@media (hover: hover) { .tile:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 28px 50px -20px rgba(140, 84, 20, .45); }
  .tile:hover .ico { animation: jelly .6s var(--ease); } }
.tile-wide { grid-column: 1 / -1; }
.tile .ico {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 26px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff3cf, #ffe08a);
  box-shadow: inset 0 -3px 0 rgba(227, 146, 26, .25);
  margin-bottom: 4px;
}

.tile:active { transform: scale(.97); }
.tile .label { font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.tile strong { font-size: 19px; line-height: 1.5; }
.maps {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px; font-weight: 600;
  text-decoration: none;
  transition: transform .3s var(--ease), background .3s;
}
@media (hover: hover) { .maps:hover { transform: scale(1.05); background: var(--red); } }
.maps { min-height: 44px; }

/* ---------- Countdown ---------- */
.cd-title { font-weight: 600; color: var(--ink-soft); margin-bottom: 14px !important; }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; direction: ltr; }
html[dir="rtl"] .cd { direction: rtl; }
.cd div {
  background: linear-gradient(180deg, #fff, var(--honey-soft));
  border-radius: 18px;
  padding: 12px 4px 10px;
  box-shadow: inset 0 -3px 0 rgba(227, 146, 26, .2);
  display: flex; flex-direction: column; gap: 2px;
}
.cd b {
  font: 700 clamp(26px, 7vw, 36px)/1.1 "Fredoka", "Vazirmatn", sans-serif;
  color: var(--honey-deep);
  display: inline-block;
}
.cd b.tick { animation: tick .5s var(--ease); }
.cd span { font-size: 13px; color: var(--ink-soft); }

/* ---------- Sign-off ---------- */
.sign { text-align: center; padding: 8px 0; }
.sign p { margin: 0; }
.memories { font-size: 19px; font-weight: 600; line-height: 1.7; margin-bottom: 18px !important; }
.love { color: var(--ink-soft); }
.from {
  font-size: 24px; font-weight: 700; color: var(--red);
  display: inline-block;
  animation: heartbeat 2.4s ease-in-out infinite;
}

/* ---------- Decorations ---------- */
.wood { position: absolute; left: 0; bottom: 0; width: 100%; height: 200px; z-index: 1; }
.trees { transform-origin: bottom; animation: sway 6s ease-in-out infinite; transform-box: fill-box; }

.balloon { position: fixed; z-index: 3; pointer-events: none; }
.balloon-1 { width: 56px; top: 110px; inset-inline-start: 4vw; animation: float 7s ease-in-out infinite; }
.balloon-2 { width: 40px; top: 46vh; inset-inline-end: 3vw; animation: float 9s ease-in-out infinite -3s; opacity: .9; }

.bee { position: fixed; z-index: 4; font-size: 26px; pointer-events: none; }
.bee-1 { top: 22%; animation: fly1 14s linear infinite; }
.bee-2 { top: 68%; animation: fly2 18s linear infinite -7s; font-size: 22px; }

/* ---------- Reveal + language swap ---------- */
.hero > * { animation: pop .8s var(--ease) both; }
.hero > :nth-child(2) { animation-delay: .05s; }
.hero > :nth-child(3) { animation-delay: .15s; }
.hero > :nth-child(4) { animation-delay: .25s; }
.hero > :nth-child(5) { animation-delay: .35s; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(26px) scale(.98); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.swap { transition: opacity .25s ease, transform .25s ease; }
body.switching .swap { opacity: 0; transform: translateY(6px); }

/* ---------- Keyframes ---------- */
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@keyframes pan { to { background-position: 560px 980px; } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes flap { to { transform: translateX(-50%) translateY(-3px) rotate(8deg); } }
@keyframes shine { to { background-position: 200% center; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes jelly { 30% { transform: scale(1.2, .85); } 50% { transform: scale(.9, 1.1); } 70% { transform: scale(1.05, .95); } }
@keyframes tick { 0% { transform: translateY(-40%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.08); } 30% { transform: scale(1); } 45% { transform: scale(1.05); } }
@keyframes sway { 0%, 100% { transform: skewX(-1.5deg); } 50% { transform: skewX(1.5deg); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-26px) rotate(5deg); } }
@keyframes fly1 {
  0%   { transform: translate(-10vw, 0) scaleX(-1); }
  25%  { transform: translate(25vw, -40px) scaleX(-1); }
  50%  { transform: translate(55vw, 30px) scaleX(-1); }
  75%  { transform: translate(85vw, -20px) scaleX(-1); }
  100% { transform: translate(110vw, 10px) scaleX(-1); }
}
@keyframes fly2 {
  0%   { transform: translate(110vw, 0); }
  30%  { transform: translate(70vw, -50px); }
  60%  { transform: translate(35vw, 30px); }
  100% { transform: translate(-10vw, -10px); }
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  body {
    padding: calc(70px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 170px max(14px, env(safe-area-inset-left));
  }
  /* language bar scrolls away instead of covering the text */
  .langs { position: absolute; top: calc(12px + env(safe-area-inset-top)); }
  .langs button { padding: 10px 14px; font-size: 14px; min-height: 40px; }

  main { gap: 16px; }
  .glass { padding: 22px 18px; border-radius: 24px; }
  .glass p { font-size: 16px; line-height: 1.85; }
  .glass, .tile, .langs { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

  .badge { width: 168px; height: 168px; margin-bottom: 14px; }
  .one { width: 126px; height: 126px; font-size: 90px; }
  .pot { width: 62px; height: 62px; inset-inline-end: -10px; }
  .orbit { inset: -16px; }
  .orbit span { font-size: 22px; }

  h1 { font-size: 24px; }
  .headline { font-size: 25px; }
  .lead { font-size: 16px; }

  .tiles { gap: 12px; }
  .tile { padding: 16px 12px; border-radius: 22px; }
  .tile .ico { width: 46px; height: 46px; font-size: 23px; border-radius: 15px; }
  .tile strong { font-size: 17px; }

  .cd { gap: 8px; }
  .cd div { border-radius: 14px; padding: 10px 2px 8px; }
  .cd b { font-size: 26px; }
  .cd span { font-size: 12px; }

  .memories { font-size: 18px; }
  .from { font-size: 22px; }

  /* decorations stay out of the text */
  .balloon { position: absolute; }
  .balloon-1 { width: 38px; top: 96px; inset-inline-start: 10px; }
  .balloon-2 { display: none; }
  .bee-2 { display: none; }
  .bee-1 { position: absolute; top: 300px; font-size: 20px; }
  .wood { height: 140px; }
}

@media (max-width: 340px) {
  .tiles { grid-template-columns: 1fr; }
  .langs button { padding: 9px 10px; font-size: 13px; }
  .cd b { font-size: 22px; }
  .headline { font-size: 22px; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .badge { width: 140px; height: 140px; }
  .one { width: 104px; height: 104px; font-size: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

.party { grid-column: 1 / -1; font-size: 24px; font-weight: 700; color: var(--red); margin: 0; }
