@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400&family=DM+Sans:wght@400;500&display=swap');

:root {
  color-scheme: light;
  --paper: #fbf9f3;
  --ink: #293b47;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-width: 280px;
  min-height: 100%;
  background: var(--paper);
}

body {
  color: var(--ink);
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.invitation {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.artwork {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

/* A light paper wash keeps the details clear over the painting. */
.invitation::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0 0 auto;
  height: min(42vh, 360px);
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgb(251 249 243 / 98%) 0%,
    rgb(251 249 243 / 90%) 28%,
    rgb(251 249 243 / 52%) 65%,
    rgb(251 249 243 / 0%) 100%
  );
}

.details {
  position: relative;
  z-index: 1;
  padding: clamp(30px, 5.5vh, 78px) 24px 28px;
  text-align: center;
}

h1, p { margin: 0; }

h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(4rem, 6.4vw, 6.6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.045em;
}

h1 span {
  display: inline-block;
  margin: 0 .035em;
  font-size: .78em;
  font-style: italic;
  font-weight: 400;
}

.date {
  margin-top: 20px;
  font-size: .875rem;
  line-height: 1.5;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.venue {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .025em;
}

/* Retain the couple and cat on tall, narrow screens. */
@media (max-aspect-ratio: 1 / 1) {
  .artwork {
    inset: auto auto 0;
    left: 44%;
    width: clamp(100%, calc(150svh - 270px), 180%);
    height: auto;
    max-width: none;
    transform: translateX(-50%);
  }

  .details { padding-top: clamp(38px, 8svh, 100px); }

  h1 {
    font-size: clamp(3.4rem, 12vw, 6rem);
    white-space: nowrap;
  }

  .date { margin-top: 24px; }
  .venue { margin-top: 9px; }
}

@media (max-height: 540px) and (min-aspect-ratio: 1 / 1) {
  .details {
    width: fit-content;
    padding: 24px 32px;
    text-align: left;
  }

  h1 { font-size: 3.4rem; }

  .date { margin-top: 12px; }
  .venue { font-size: .875rem; }

  .invitation::after {
    width: min(50%, 460px);
    height: 100%;
    background: linear-gradient(to right, rgb(251 249 243 / 96%), rgb(251 249 243 / 0%));
  }
}

@media (max-width: 340px) {
  .details { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 3.2rem; }
  .date { letter-spacing: .15em; }
  .venue { font-size: .875rem; }
}
