@font-face {
  font-family: "La Storia";
  src: url("../font/La storia Demo.otf") format("opentype");
  font-display: swap;
}

:root {
  --side-space: clamp(18px, 5.5vw, 72px);
  --top-space: clamp(12px, 2.4svh, 24px);
  --bottom-space: clamp(16px, 3svh, 28px);
  --section-gap: clamp(9px, 1.4svh, 16px);
  --photo-height: clamp(188px, 31svh, 310px);
  --date-bottom: clamp(18px, 4.5svh, 42px);
  --date-size: clamp(72px, 12svh, 132px);
  --name-gap: clamp(3px, 0.7svh, 8px);
  --name-size: clamp(32px, min(13.5vw, 7svh), 76px);
  --date-line-size: clamp(20px, 2.85svh, 29px);
  --count-number-size: clamp(34px, 5.7svh, 62px);
  --count-label-size: clamp(13px, 1.95svh, 20px);
  --ink: #050505;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: "Cormorant Garamond", Garamond, Georgia, serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.save-the-date {
  display: grid;
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  padding: var(--top-space) var(--side-space) var(--bottom-space);
  place-items: center;
  background: #ffffff;
}

.card {
  display: grid;
  width: min(100%, 760px);
  height: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto auto auto;
  align-items: center;
  justify-items: center;
  align-content: space-evenly;
  gap: var(--section-gap);
  text-align: center;
}

h1,
.event,
.name,
.identity-block,
.date-line,
.countdown {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
  max-width: 100%;
}

h1,
.name {
  width: 100%;
  font-family: "La Storia", "Cormorant Garamond", Garamond, serif;
  font-weight: 400;
  line-height: 1.55;
  overflow: visible;
  white-space: nowrap;
}

h1 {
  align-self: start;
  padding-block: 0.18em 0.08em;
  font-family: "Great Vibes", "Cormorant Garamond", Garamond, cursive;
  font-size: clamp(44px, 7svh, 78px);
  line-height: 1.08;
}

.photo-strip {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: center;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2.2vw, 22px);
}

.photo-card {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 2px;
}

.photo-card img {
  display: block;
  width: 100%;
  height: var(--photo-height);
  min-width: 0;
  object-fit: cover;
  object-position: center;
}

.photo-card:first-child img {
  transform: translate(clamp(-14px, -2.4vw, -6px), clamp(4px, 1.6vw, 12px)) scale(1.12);
  transform-origin: center;
}

.photo-card:nth-child(2) img {
  transform: translateY(clamp(18px, 3.4vw, 36px)) scale(1.12);
  transform-origin: center;
}

.photo-card:last-child img {
  object-position: 35% center;
}

.photo-card figcaption {
  position: absolute;
  right: 0;
  bottom: var(--date-bottom);
  left: 0;
  z-index: 1;
  color: #ffffff;
  font-family: "Cormorant Garamond", Garamond, Georgia, serif;
  font-size: var(--date-size);
  font-weight: 400;
  line-height: 0.82;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.event {
  font-family: "Cormorant Garamond", Garamond, Georgia, serif;
  font-size: clamp(23px, 5.5vw, 38px);
  font-weight: 500;
  line-height: 1.05;
}

.identity-block {
  display: grid;
  width: 100%;
  gap: clamp(22px, 2.8svh, 34px);
  justify-items: center;
}

.name {
  display: grid;
  gap: var(--name-gap);
  margin-top: clamp(6px, 1.1svh, 14px);
  padding-block: 0.05em 0.08em;
  font-family: "Great Vibes", "Cormorant Garamond", Garamond, cursive;
  font-size: var(--name-size);
  line-height: 1.05;
}

.name span {
  display: block;
}

.countdown-block {
  display: grid;
  width: min(100%, 560px);
  gap: clamp(3px, 0.55svh, 7px);
  justify-items: center;
}

.date-line {
  font-family: "Cormorant Garamond", Garamond, Georgia, serif;
  font-size: var(--date-line-size);
  font-weight: 500;
  line-height: 1;
}

.countdown {
  display: grid;
  width: min(100%, 560px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 2vw, 14px);
  font-family: "Cormorant Garamond", Garamond, Georgia, serif;
}

.countdown-item {
  display: grid;
  min-width: 0;
  gap: 2px;
  place-items: center;
}

.countdown-item strong {
  display: block;
  min-width: 2ch;
  font-size: var(--count-number-size);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-item span {
  display: block;
  font-size: var(--count-label-size);
  font-weight: 500;
  line-height: 1;
}

.music-toggle {
  position: fixed;
  right: clamp(12px, 3.6vw, 24px);
  bottom: clamp(12px, 3.6vw, 24px);
  z-index: 20;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  color: #ffffff;
  background: #050505;
  border: 1px solid #050505;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.music-toggle:hover,
.music-toggle:focus-visible {
  color: #050505;
  background: #ffffff;
}

.music-toggle:focus-visible {
  outline: 2px solid #050505;
  outline-offset: 3px;
}

.music-toggle:active {
  transform: scale(0.96);
}

.music-toggle__icon {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.music-toggle__icon--pause,
.music-toggle.is-playing .music-toggle__icon--play {
  display: none;
}

.music-toggle.is-playing .music-toggle__icon--pause {
  display: block;
}

@media (min-width: 760px) {
  :root {
    --side-space: clamp(48px, 8vw, 120px);
    --section-gap: clamp(12px, 1.8svh, 22px);
    --photo-height: clamp(330px, 44svh, 470px);
    --date-bottom: clamp(28px, 4svh, 46px);
    --date-size: clamp(118px, 15svh, 160px);
    --name-gap: clamp(4px, 0.8svh, 10px);
    --name-size: clamp(54px, min(9vw, 7.8svh), 86px);
    --date-line-size: clamp(24px, 3svh, 32px);
    --count-number-size: clamp(46px, 6svh, 72px);
    --count-label-size: clamp(15px, 2svh, 22px);
  }

  .card {
    width: min(100%, 900px);
  }

  .photo-strip {
    width: min(100%, 820px);
  }
}

@media (max-width: 480px) and (max-height: 700px) {
  :root {
    --top-space: 10px;
    --bottom-space: 12px;
    --section-gap: 7px;
    --photo-height: clamp(184px, 28.5svh, 198px);
    --date-bottom: clamp(16px, 3.7svh, 24px);
    --date-size: clamp(68px, 11.5svh, 82px);
    --name-gap: 4px;
    --date-line-size: 17px;
    --count-number-size: 34px;
    --count-label-size: 12px;
  }
}

@media (max-width: 360px) {
  :root {
    --side-space: 14px;
    --top-space: 10px;
    --bottom-space: 14px;
    --section-gap: 8px;
  }

  h1 {
    font-size: 42px;
  }
}
