:root {
  --cream: #f9f3e7;
  --paper: #fdf9f0;
  --green: #546840;
  --green-soft: #8a9a6c;
  --pink: #e9a1b6;
  --meadow: #cdc997;

  --font-hand: "Delicious Handrawn", "Segoe Print", "Bradley Hand", cursive;
  --font-script: "Sacramento", "Snell Roundhand", cursive;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: clamp(12px, 4vw, 3.5rem) clamp(12px, 3vw, 2rem);
  background: var(--meadow);
  color: var(--green);
  font-family: var(--font-hand);
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem);
  line-height: 1.35;
  word-spacing: 0.1em;
  text-align: center;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--pink) 80%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: var(--pink);
}

h1,
h2,
p,
ul {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.nowrap {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Tulip meadow behind the whole page, like the back of the invite; a fixed
   layer instead of background-attachment: fixed, which iOS ignores */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--meadow) url("img/tulipany.jpg") center top / clamp(320px, 40vw, 560px) auto repeat;
}

.panel {
  max-width: 44rem;
  margin: 0 auto;
  background: var(--cream);
  border-radius: 28px;
  box-shadow: 0 24px 60px -24px rgb(64 76 36 / 0.5);
}

/* Hero: the invitation front melts into the panel */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 2vh, 1.5rem);
  padding: clamp(0.5rem, 2vw, 1.5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
}

.hero__img {
  width: min(100%, 64svh, 680px);
  --fade: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-image: var(--fade);
  -webkit-mask-composite: source-in;
  mask-image: var(--fade);
  mask-composite: intersect;
}

.countdown {
  padding: 0 16px;
}

.countdown__title {
  font-size: 1em;
  font-weight: 400;
  color: var(--green-soft);
  margin-bottom: 0.4rem;
}

.countdown__grid {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 2.5vw, 1.25rem);
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(4.25rem, 19vw, 6.5rem);
  padding: 0.5rem 0 0.4rem;
  background: var(--paper);
  border: 1.5px solid color-mix(in srgb, var(--green) 22%, transparent);
  border-radius: 18px;
}

.countdown__num {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  font-size: 0.8em;
  color: var(--green-soft);
}

.countdown__done {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
}

.invite {
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1.25rem, 6vw, 3rem) 0;
}

/* Short line between the countdown and the invitation text */
.invite::before {
  content: "";
  display: block;
  width: 4rem;
  height: 1.5px;
  margin: 0 auto clamp(1.5rem, 5vw, 2.5rem);
  background: color-mix(in srgb, var(--green) 25%, transparent);
}

.invite__greeting {
  font-size: 1.3em;
  margin-bottom: 0.75rem;
}

.invite__text {
  text-wrap: balance;
}

.heart {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: -0.2em;
  fill: none;
  stroke: var(--pink);
  stroke-width: 2;
}

.invite__details {
  list-style: none;
  padding: 0;
  margin-top: clamp(1.75rem, 5vw, 2.5rem);
  display: grid;
  gap: 0.6rem;
  font-size: 1.15em;
  text-wrap: balance;
}

.icon {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-right: 0.3em;
  vertical-align: -0.05em;
  fill: var(--green);
}

.invite__map {
  margin-top: 1.25rem;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--meadow);
  border: 1.5px solid color-mix(in srgb, var(--green) 22%, transparent);
  border-radius: 18px;
}

.invite__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.footer {
  padding: clamp(2rem, 6vw, 3rem) 16px clamp(1.5rem, 5vw, 2.5rem);
}

.footer__names {
  font-family: var(--font-script);
  font-size: clamp(2.75rem, 2rem + 4vw, 4.25rem);
  line-height: 1.2;
}

/* White JPEG background disappears on the cream panel */
.footer__couple {
  width: clamp(140px, 38vw, 190px);
  margin: 0.5rem auto 0;
  mix-blend-mode: multiply;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__img {
    animation: rise 1.2s ease-out both;
  }

  .countdown {
    animation: rise 1.2s 0.3s ease-out both;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
  }
}
