/* Temporary homepage celebration for Aryan's 20th birthday (js/birthday-celebration.js). */
.bday {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.bday.is-in {
  opacity: 1;
}

.bday.is-leaving {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.bday__veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(110% 85% at 50% 45%, rgba(28, 44, 96, 0.86) 0%, rgba(10, 16, 40, 0.93) 55%, rgba(3, 6, 18, 0.96) 100%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  backdrop-filter: blur(6px) saturate(120%);
}

.bday__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bday__canvas--fx {
  z-index: 1;
}

.bday__canvas--confetti {
  z-index: 3;
}

/* ---- Message ------------------------------------------------------------- */
.bday__stage {
  position: relative;
  z-index: 2;
  max-width: 100%;
  padding: 0 16px;
  text-align: center;
  transition: opacity 700ms ease, transform 900ms cubic-bezier(0.4, 0, 0.2, 1), filter 700ms ease;
}

.bday.is-leaving .bday__stage {
  opacity: 0;
  transform: scale(1.04);
  filter: blur(6px);
}

.bday__message {
  position: relative;
  margin: 0;
  color: #fff6e4;
}

.bday__halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(92vw, 60rem);
  height: min(70vh, 34rem);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 200, 120, 0.2), rgba(255, 170, 110, 0.06) 60%, rgba(255, 170, 110, 0));
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  pointer-events: none;
}

.bday__numeral {
  position: absolute;
  top: 50%;
  left: 50%;
  font: 700 min(64vmin, 32rem)/1 'Bodoni Moda SC', 'Bodoni 72', Didot, Georgia, serif;
  color: rgba(255, 214, 140, 0.06);
  opacity: 0;
  transform: translate(-50%, -52%) scale(0.86);
  pointer-events: none;
  user-select: none;
}

.bday__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  font: 600 clamp(0.72rem, 0.5rem + 1.1vw, 1.05rem)/1.2 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #f2dfb6;
  opacity: 0;
}

.bday__eyebrow::before,
.bday__eyebrow::after {
  content: '';
  width: clamp(1.25rem, 6vw, 3.5rem);
  height: 1px;
  background: linear-gradient(90deg, rgba(233, 196, 122, 0), #e9c47a);
  transform: scaleX(0);
}

.bday__eyebrow::before {
  transform-origin: right center;
}

.bday__eyebrow::after {
  background: linear-gradient(90deg, #e9c47a, rgba(233, 196, 122, 0));
  transform-origin: left center;
}

.bday__eyebrow-text {
  letter-spacing: 0.42em;
  margin-right: -0.42em; /* Balance the trailing letter-space. */
}

.bday__title {
  display: block;
  margin: 0.32em 0 0.26em;
  font: 700 clamp(2.3rem, 8.4vw, 7rem)/1.02 'Bodoni Moda SC', 'Bodoni 72', Didot, Georgia, serif;
  letter-spacing: 0.02em;
  perspective: 900px;
}

.bday__word {
  display: inline-block;
  white-space: nowrap;
}

.bday__char {
  display: inline-block;
  background: linear-gradient(110deg, #e2ae55 0%, #f6d993 32%, #fffaf0 50%, #f6d993 68%, #dfa64a 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  transform: translateY(0.42em) rotateX(-75deg);
  transform-origin: 50% 100%;
  filter: blur(12px) drop-shadow(0 0 0 rgba(255, 196, 110, 0));
}

.bday__tail {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font: italic 500 clamp(1.3rem, 0.9rem + 2.4vw, 2.6rem)/1.2 'Bodoni Moda SC', 'Bodoni 72', Didot, Georgia, serif;
  letter-spacing: 0.08em;
  color: #fff3dc;
}

.bday__tail-text {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
}

.bday__emoji {
  display: inline-block;
  font-style: normal;
  opacity: 0;
  transform: scale(0) rotate(-30deg);
}

.bday__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Entrance (full motion) ------------------------------------------------ */
.bday.is-message .bday__halo {
  animation: bday-halo 1600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bday.is-message .bday__numeral {
  animation: bday-numeral 2600ms cubic-bezier(0.16, 1, 0.3, 1) 150ms forwards;
}

.bday.is-message .bday__eyebrow {
  animation: bday-fade 700ms ease forwards;
}

.bday.is-message .bday__eyebrow::before,
.bday.is-message .bday__eyebrow::after {
  animation: bday-rule 900ms cubic-bezier(0.16, 1, 0.3, 1) 250ms forwards;
}

.bday.is-message .bday__eyebrow-text {
  animation: bday-tracking 1100ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bday.is-message .bday__char {
  animation:
    bday-char 950ms cubic-bezier(0.16, 1, 0.3, 1) calc(260ms + var(--i) * 45ms) forwards,
    bday-glint 1500ms ease-in-out calc(1150ms + var(--i) * 55ms) forwards;
}

.bday.is-message .bday__tail-text {
  animation: bday-rise 800ms cubic-bezier(0.16, 1, 0.3, 1) 1000ms forwards;
}

.bday.is-message .bday__emoji {
  animation: bday-pop 750ms cubic-bezier(0.34, 1.56, 0.64, 1) 1300ms forwards;
}

@keyframes bday-fade {
  to { opacity: 1; }
}

@keyframes bday-halo {
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes bday-numeral {
  to { opacity: 1; transform: translate(-50%, -52%) scale(1); }
}

@keyframes bday-rule {
  to { transform: scaleX(1); }
}

@keyframes bday-tracking {
  from { letter-spacing: 1.1em; margin-right: -1.1em; }
  to { letter-spacing: 0.42em; margin-right: -0.42em; }
}

@keyframes bday-char {
  to {
    opacity: 1;
    transform: none;
    filter: blur(0) drop-shadow(0 0 18px rgba(255, 196, 110, 0.35));
  }
}

@keyframes bday-glint {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

@keyframes bday-rise {
  to { opacity: 1; transform: none; }
}

@keyframes bday-pop {
  0% { opacity: 0; transform: scale(0) rotate(-30deg); }
  60% { opacity: 1; transform: scale(1.25) rotate(8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* ---- Calm version (prefers-reduced-motion) --------------------------------- */
.bday--calm .bday__veil {
  background: radial-gradient(110% 85% at 50% 45%, rgba(28, 44, 96, 0.8) 0%, rgba(10, 16, 40, 0.88) 100%);
}

.bday--calm.is-in {
  transition-duration: 900ms;
}

.bday--calm .bday__stage,
.bday--calm.is-leaving .bday__stage {
  transform: none;
  filter: none;
}

.bday--calm .bday__halo,
.bday--calm .bday__numeral {
  transform: translate(-50%, -50%);
}

.bday--calm .bday__eyebrow::before,
.bday--calm .bday__eyebrow::after,
.bday--calm .bday__char,
.bday--calm .bday__tail-text,
.bday--calm .bday__emoji {
  transform: none;
  filter: none;
}

.bday--calm.is-message .bday__halo,
.bday--calm.is-message .bday__numeral,
.bday--calm.is-message .bday__eyebrow,
.bday--calm.is-message .bday__eyebrow-text,
.bday--calm.is-message .bday__char,
.bday--calm.is-message .bday__tail-text,
.bday--calm.is-message .bday__emoji {
  animation: bday-fade 1200ms ease forwards;
}

.bday--calm.is-message .bday__eyebrow::before,
.bday--calm.is-message .bday__eyebrow::after {
  animation: none;
}

/* ---- Skip control ---------------------------------------------------------- */
.bday__skip {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 4;
  padding: 0.6rem 1.05rem;
  border: 1px solid rgba(255, 228, 176, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: rgba(255, 244, 222, 0.78);
  font: 600 0.72rem/1 'Segoe UI', system-ui, -apple-system, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity 600ms ease 900ms, background-color 200ms ease, color 200ms ease;
}

.bday.is-in .bday__skip {
  opacity: 1;
}

.bday__skip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.bday__skip:focus-visible {
  outline: 2px solid #f3d38a;
  outline-offset: 3px;
}
