:root {
  --cream: #fffcdc;
  --paper: #ece1cb;
  --sand: #e1d4ca;
  --teal: #1e786a;
  --teal-light: #38a594;
  --clay: #c35d54;
  --ink: #5b4942;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(56, 165, 148, 0.25), transparent 30%),
    radial-gradient(circle at 85% 82%, rgba(195, 93, 84, 0.18), transparent 30%),
    linear-gradient(140deg, #fff 0%, var(--paper) 44%, var(--sand) 100%);
}

.voucher-fit {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.voucher {
  position: relative;
  width: 1100px;
  height: 700px;
  margin: 0;
  border-radius: 30px;
  background: linear-gradient(155deg, var(--teal) 0%, var(--teal-light) 58%, #48b6a4 100%);
  color: var(--white);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  box-shadow: 0 28px 60px rgba(7, 80, 69, 0.35);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(var(--voucher-scale, 1));
  transform-origin: center center;
}

.bg-shape {
  position: absolute;
  border-radius: 999px;
  filter: blur(0.5px);
  opacity: 0.35;
}

.bg-shape-a {
  width: 380px;
  height: 380px;
  background: #fff;
  top: -170px;
  right: -90px;
}

.bg-shape-c {
  width: 160px;
  height: 160px;
  background: var(--cream);
  top: 42%;
  left: 8%;
}

.voucher__header,
.voucher__content,
.voucher__footer {
  position: relative;
  z-index: 1;
}

.voucher__photo {
  position: absolute;
  right: 1.6rem;
  top: 4.8rem;
  width: clamp(118px, 18vw, 196px);
  aspect-ratio: 4 / 5;
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 16px 28px rgba(7, 80, 69, 0.34);
  transform: rotate(4deg);
  animation: photo-in 0.75s ease 0.1s both;
}

.voucher__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30, 120, 106, 0.22), rgba(30, 120, 106, 0));
}

.voucher__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.voucher__icon-stamp {
  position: absolute;
  left: -64px;
  bottom: -98px;
  width: clamp(180px, 22vw, 280px);
  opacity: 0.32;
  z-index: 0;
  pointer-events: none;
  transform: rotate(-10deg);
  filter: saturate(0.9) contrast(1.05);
  animation: stamp-in 0.8s ease 0.14s both;
}

.voucher__header {
  padding: 1.5rem 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.voucher__logo {
  width: clamp(160px, 24vw, 260px);
  height: auto;
}

.voucher__tag {
  margin: 0;
  padding: 0.4rem 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.voucher__content {
  padding: 0.4rem 1.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.surtitle {
  margin: 0;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  text-transform: uppercase;
  opacity: 0.95;
  animation: title-fade 0.5s ease both;
}

h1 {
  margin: 0;
  font-family: "Amatic SC", cursive;
  font-size: clamp(2.3rem, 5.8vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  animation: title-fade 0.7s ease 0.08s both;
}

.subtitle {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.45rem);
  font-weight: 600;
  animation: title-fade 0.7s ease 0.16s both;
}

.info-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.info-card {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  padding: 0.75rem;
  backdrop-filter: blur(2px);
  animation: rise-in 0.6s ease both;
}

.info-card:nth-child(2) { animation-delay: 0.08s; }
.info-card:nth-child(3) { animation-delay: 0.16s; }
.info-card:nth-child(4) { animation-delay: 0.24s; }

.info-card h2 {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.info-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
}

.info-link {
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
}

.voucher__footer {
  padding: 0 2rem 1.6rem;
  text-align: center;
  display: grid;
  gap: 0.45rem;
}

.voucher__footer p {
  margin: 0;
  font-size: 0.9rem;
}

.voucher__links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.voucher__link {
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
}

/* Portrait / mobile layout — card becomes 390 × 700 */
.voucher--portrait {
  width: 390px;
  height: 700px;
  /* Kill the stretchy middle row — use three auto rows, centered */
  grid-template-rows: auto auto auto;
  align-content: space-between;
}

.voucher--portrait .voucher__header {
  padding: 1rem 1.1rem 0;
}

.voucher--portrait .voucher__logo {
  width: 130px;
}

.voucher--portrait .voucher__tag {
  font-size: 0.65rem;
  padding: 0.28rem 0.55rem;
  letter-spacing: 0.06em;
}

.voucher--portrait .voucher__photo {
  width: 108px;
  right: 0.85rem;
  top: 3.5rem;
  border-radius: 12px;
}

.voucher--portrait .voucher__icon-stamp {
  width: 180px;
  left: -44px;
  bottom: -70px;
}

.voucher--portrait .voucher__content {
  padding: 0.5rem 1.2rem 0;
  gap: 0.3rem;
  /* Override: don't center vertically, just stack from top */
  justify-content: flex-start;
}

.voucher--portrait .surtitle {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
}

.voucher--portrait h1 {
  font-size: 2.3rem;
  line-height: 1;
}

.voucher--portrait .subtitle {
  font-size: 0.9rem;
}

.voucher--portrait .info-grid {
  grid-template-columns: 1fr 1fr;
  gap: 0.42rem;
  margin-top: 0.45rem;
}

.voucher--portrait .info-card {
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
}

.voucher--portrait .info-card h2 {
  font-size: 0.68rem;
  margin-bottom: 0.14rem;
}

.voucher--portrait .info-card p {
  font-size: 0.75rem;
  line-height: 1.25;
}

.voucher--portrait .voucher__footer {
  padding: 0 1.2rem 1rem;
  gap: 0.3rem;
}

.voucher--portrait .voucher__footer p {
  font-size: 0.72rem;
  line-height: 1.28;
}

.voucher--portrait .voucher__link {
  font-size: 0.72rem;
}

.voucher--portrait .voucher__links {
  gap: 0.5rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes title-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes photo-in {
  from {
    opacity: 0;
    transform: translateY(-12px) rotate(-2deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(4deg) scale(1);
  }
}

@keyframes stamp-in {
  from {
    opacity: 0;
    transform: translateY(14px) rotate(-18deg) scale(0.88);
  }
  to {
    opacity: 0.32;
    transform: translateY(0) rotate(-10deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .voucher__photo,
  .voucher__icon-stamp,
  .surtitle,
  h1,
  .subtitle,
  .info-card,
  .info-card:nth-child(2),
  .info-card:nth-child(3),
  .info-card:nth-child(4) {
    animation: none;
  }
}
