:root {
  color-scheme: light;
  --ink: #28485a;
  --deep: #183547;
  --paper: rgba(255, 252, 244, 0.82);
  --cream: #fff9ed;
  --coral: #f28f7c;
  --blue: #77bdd4;
  --gold: #f0c86a;
  --mint: #91d7c1;
  --baby-pink: #ffc9c0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background: #ffe6d8;
}

.invite {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  perspective: 1200px;
}

.envelope {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.7), transparent 23%),
    linear-gradient(160deg, #ffd8cf 0%, #d9f4f7 48%, #fff1c9 100%);
  cursor: pointer;
  transition:
    opacity 0.7s ease 0.78s,
    visibility 0.7s ease 0.78s;
}

.envelope::before {
  content: "";
  position: absolute;
  width: min(86vw, 380px);
  aspect-ratio: 1.48;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 49%, rgba(255, 255, 255, 0.48) 50%, transparent 51%) left / 50% 100% no-repeat,
    linear-gradient(225deg, transparent 49%, rgba(255, 255, 255, 0.48) 50%, transparent 51%) right / 50% 100% no-repeat,
    linear-gradient(180deg, #fff8e8 0%, #ffe2d9 100%);
  border: 5px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 0 0 2px rgba(240, 200, 106, 0.28),
    0 24px 58px rgba(39, 70, 88, 0.22);
}

.envelope::after {
  content: "";
  position: absolute;
  width: min(78vw, 340px);
  height: 24px;
  top: calc(50% + min(21vw, 88px));
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(39, 70, 88, 0.18);
  filter: blur(10px);
}

.envelope__wing {
  position: absolute;
  top: 50%;
  width: 50vw;
  max-width: 310px;
  height: min(58vw, 260px);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.58), transparent 20%),
    linear-gradient(160deg, #fff4dc 0%, #ffcfc5 58%, #f9b8ad 100%);
  border: 4px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 40px rgba(39, 70, 88, 0.18);
  transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.envelope__wing-left {
  right: 50%;
  transform: translateY(-50%) rotateY(0deg);
  transform-origin: right center;
  border-radius: 8px 0 0 8px;
}

.envelope__wing-right {
  left: 50%;
  transform: translateY(-50%) rotateY(0deg);
  transform-origin: left center;
  border-radius: 0 8px 8px 0;
  background:
    radial-gradient(circle at 68% 30%, rgba(255, 255, 255, 0.58), transparent 20%),
    linear-gradient(200deg, #fff4dc 0%, #c9eff4 56%, #9edbe8 100%);
}

.envelope__bottom {
  position: absolute;
  width: min(86vw, 380px);
  aspect-ratio: 1.48;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  clip-path: polygon(0 44%, 50% 82%, 100% 44%, 100% 100%, 0 100%);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 248, 232, 0.92), rgba(255, 214, 205, 0.96));
  box-shadow: inset 0 -8px 0 rgba(240, 200, 106, 0.16);
}

.envelope__seal {
  position: relative;
  z-index: 2;
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  margin-top: 10px;
  color: #2d7189;
  background: linear-gradient(180deg, #fffaf0, #fff0be);
  border: 5px solid #ffffff;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 4px rgba(255, 201, 192, 0.36),
    0 14px 28px rgba(39, 70, 88, 0.18);
}

.envelope__seal strong {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 2.7rem;
  line-height: 0.86;
  text-shadow: 0 2px 0 #ffffff;
}

.envelope__seal small {
  width: min-content;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.05;
  color: #ef7f70;
}

body.envelope-open .envelope {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.envelope-open .envelope__wing-left {
  transform: translateY(-50%) rotateY(-112deg) translateX(-12px);
}

body.envelope-open .envelope__wing-right {
  transform: translateY(-50%) rotateY(112deg) translateX(12px);
}

body.envelope-open .envelope__bottom {
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  transition:
    opacity 0.38s ease 0.2s,
    transform 0.38s ease 0.2s;
}

body.envelope-open .envelope__seal {
  transform: scale(0.84);
  opacity: 0;
  transition:
    opacity 0.38s ease 0.2s,
    transform 0.38s ease 0.2s;
}

.card {
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.8s cubic-bezier(0.19, 1, 0.22, 1) 0.35s,
    opacity 0.6s ease 0.35s;
}

body.envelope-open .card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.card {
  position: relative;
  width: min(100vw, 440px);
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto auto;
  padding: clamp(28px, 7svh, 60px) 22px 22px;
  isolation: isolate;
  background:
    radial-gradient(circle at 15% 16%, rgba(255, 201, 192, 0.38) 0 22px, transparent 23px),
    radial-gradient(circle at 87% 30%, rgba(145, 215, 193, 0.34) 0 18px, transparent 19px),
    radial-gradient(circle at 20% 66%, rgba(240, 200, 106, 0.26) 0 16px, transparent 17px),
    linear-gradient(180deg, rgba(255, 252, 244, 0.78) 0%, rgba(255, 252, 244, 0.2) 42%, rgba(255, 252, 244, 0.04) 62%, rgba(255, 252, 244, 0.86) 100%),
    url("assets/ege-birthday-bg.png") center / cover no-repeat;
  border: 8px solid rgba(255, 250, 238, 0.95);
  box-shadow:
    inset 0 0 0 2px rgba(240, 200, 106, 0.36),
    inset 0 0 0 9px rgba(255, 255, 255, 0.38),
    0 22px 70px rgba(39, 70, 88, 0.24);
}

.card::before {
  content: "";
  position: absolute;
  inset: 13px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(214, 168, 88, 0.36),
    inset 0 0 0 7px rgba(255, 249, 237, 0.22);
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  inset: 23px;
  z-index: 2;
  background:
    linear-gradient(var(--blue), var(--blue)) left top / 34px 2px no-repeat,
    linear-gradient(var(--blue), var(--blue)) left top / 2px 34px no-repeat,
    linear-gradient(var(--coral), var(--coral)) right top / 34px 2px no-repeat,
    linear-gradient(var(--coral), var(--coral)) right top / 2px 34px no-repeat,
    linear-gradient(var(--coral), var(--coral)) left bottom / 34px 2px no-repeat,
    linear-gradient(var(--coral), var(--coral)) left bottom / 2px 34px no-repeat,
    linear-gradient(var(--blue), var(--blue)) right bottom / 34px 2px no-repeat,
    linear-gradient(var(--blue), var(--blue)) right bottom / 2px 34px no-repeat;
  opacity: 0.72;
  pointer-events: none;
}

.soften {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 19%, rgba(255, 255, 255, 0.9), transparent 32%),
    radial-gradient(circle at 10% 42%, rgba(255, 201, 192, 0.2), transparent 20%),
    radial-gradient(circle at 93% 54%, rgba(119, 189, 212, 0.22), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 32%);
}

.hero-copy {
  align-self: start;
  display: grid;
  justify-items: center;
  padding-top: clamp(10px, 2svh, 28px);
  text-align: center;
}

.eyebrow {
  margin: 0;
  padding: 7px 16px 8px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #266278;
  background: rgba(255, 248, 231, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  box-shadow:
    0 5px 0 rgba(240, 200, 106, 0.28),
    0 12px 22px rgba(24, 53, 71, 0.1);
}

h1 {
  width: 100%;
  margin: 10px 0 0;
  display: grid;
  justify-items: center;
  line-height: 0.88;
  overflow: visible;
}

.name {
  display: block;
  width: 100%;
  padding: 0 18px;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: clamp(5.5rem, 27vw, 8rem);
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
  color: rgba(41, 111, 136, 0.9);
  background: none;
  -webkit-text-fill-color: rgba(41, 111, 136, 0.9);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.98);
  text-shadow:
    0 3px 0 #fff4d9,
    0 6px 0 rgba(240, 200, 106, 0.76),
    0 11px 20px rgba(41, 111, 136, 0.24);
}

.age {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: clamp(138px, 39vw, 170px);
  aspect-ratio: 1;
  margin-top: 18px;
  color: var(--deep);
}

.age::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 249, 237, 0.88);
  border: 6px solid rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 0 0 8px rgba(255, 201, 192, 0.24),
    0 0 0 5px rgba(119, 189, 212, 0.2),
    0 14px 34px rgba(24, 53, 71, 0.15);
}

.age img,
.age small {
  position: relative;
}

.age img {
  width: calc(100% - 18px);
  height: calc(100% - 18px);
  object-fit: cover;
  object-position: center 34%;
  border-radius: 50%;
  border: 1px solid rgba(214, 168, 88, 0.2);
}

.age small {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: max-content;
  max-width: 118px;
  padding: 5px 12px 6px;
  transform: translateX(-50%);
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(0.74rem, 3.2vw, 0.9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(145deg, #ff9d8d, #f27c6c);
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 7px 16px rgba(24, 53, 71, 0.14);
}

.invite-line {
  position: relative;
  width: min(100%, 310px);
  margin: 16px 0 0;
  padding: 11px 18px 12px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(1.02rem, 4.4vw, 1.22rem);
  font-style: normal;
  font-weight: 800;
  line-height: 1.32;
  color: #2d7189;
  background: rgba(255, 249, 237, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow:
    inset 0 -6px 0 rgba(255, 201, 192, 0.32),
    0 10px 24px rgba(24, 53, 71, 0.1);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.92);
}

.invite-line::before,
.invite-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d6a858, transparent);
}

.invite-line::before {
  left: -10px;
}

.invite-line::after {
  right: -10px;
}

.event {
  align-self: end;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 0 auto 12px;
  padding: 13px;
  background: rgba(255, 249, 237, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(24, 53, 71, 0.13);
  backdrop-filter: blur(8px);
}

.date {
  width: 84px;
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff, #fff2df);
  border-radius: 8px;
  border: 2px solid rgba(240, 200, 106, 0.42);
  box-shadow: inset 0 -5px 0 rgba(255, 201, 192, 0.22);
}

.date span {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 0.8;
  color: #5daec8;
}

.date strong {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--coral);
}

.event-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.event-copy p,
.event-copy span {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.event-copy strong {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 2.85rem;
  font-weight: 800;
  line-height: 0.95;
  color: var(--deep);
}

.event-copy span {
  line-height: 1.25;
  color: #3f6578;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  padding: 4px;
  background: rgba(255, 249, 237, 0.56);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(24, 53, 71, 0.11);
  backdrop-filter: blur(7px);
}

.action {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 10px;
  position: relative;
  overflow: hidden;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 900;
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(145deg, #86cde0 0%, #4fa8c3 100%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 8px 0 rgba(24, 53, 71, 0.16),
    0 16px 24px rgba(24, 53, 71, 0.13);
}

.action::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.34), transparent 42%);
  pointer-events: none;
}

.action-call {
  background: linear-gradient(145deg, #ffa99a 0%, #ef7f70 100%);
}

.action svg {
  width: 30px;
  height: 30px;
  padding: 6px;
  fill: currentColor;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  flex: 0 0 auto;
}

.action:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 4px 0 rgba(24, 53, 71, 0.16),
    0 10px 18px rgba(24, 53, 71, 0.12);
}

@media (min-width: 480px) {
  .invite {
    padding: 22px;
  }

  .card {
    min-height: min(860px, calc(100svh - 44px));
    border-radius: 8px;
  }
}

@media (max-height: 720px) {
  .card {
    padding-top: 20px;
  }

  .name {
    font-size: clamp(4.6rem, 22vw, 6.4rem);
  }

  .age {
    margin-top: 12px;
    width: 122px;
  }

  .invite-line {
    width: min(100%, 292px);
    padding: 9px 15px 10px;
    font-size: 1rem;
  }
}
