/* Design tokens — taken from the Claude Design invitation (artboard 720 × 1008) */
:root {
  --paper: #fcfcfb;
  --ink: #8a8a8a;
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-script: 'Great Vibes', 'Segoe Script', cursive;

  /* 1 design pixel: scales the whole invitation down on screens narrower than 720px */
  --u: min(1px, calc(100vw / 720));
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 500;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

.invitation {
  width: calc(720 * var(--u));
  min-height: calc(1008 * var(--u));
  margin: 0 auto;
  padding: calc(75 * var(--u)) 0 calc(80 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
}

:where(.invitation) :where(p, h1, address) { margin: 0; font-style: normal; font-weight: inherit; font-size: inherit; }

.invitation__cross { display: block; margin-left: calc(15 * var(--u)); }
.invitation__cross img {
  display: block;
  width: calc(437 * var(--u));
  height: calc(514 * var(--u));
  object-fit: contain;
}

.invitation__lead {
  margin-top: calc(19 * var(--u));
  font-size: calc(22 * var(--u));
  line-height: calc(24 * var(--u));
  letter-spacing: 0.14em;
}

.invitation__title { display: flex; flex-direction: column; align-items: center; }

.invitation__caps {
  margin-top: calc(15 * var(--u));
  font-size: calc(25 * var(--u));
  line-height: calc(28 * var(--u));
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invitation__name {
  margin-top: calc(10 * var(--u));
  font-family: var(--font-script);
  font-weight: 400;
  font-size: calc(72 * var(--u));
  line-height: calc(83 * var(--u));
  white-space: nowrap;
}

.invitation__when {
  margin-top: calc(12 * var(--u));
  font-size: calc(25 * var(--u));
  line-height: calc(28 * var(--u));
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.invitation__where {
  margin-top: calc(18 * var(--u));
  font-size: calc(23 * var(--u));
  line-height: calc(31 * var(--u));
  letter-spacing: 0.12em;
}

.invitation__party { margin-top: calc(34 * var(--u)); }

.invitation__party-when,
.invitation__party-time {
  font-size: calc(25 * var(--u));
  line-height: calc(28 * var(--u));
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* One empty line between the heading and the time; the time sits right on top of the venue, like 12:00 over «Суббота» */
.invitation__party-time { margin-top: calc(28 * var(--u)); }
.invitation__party-where { margin-top: 0; }

/* Gentle reveal on load */
@media (prefers-reduced-motion: no-preference) {
  .invitation > * { animation: rise 0.9s ease-out both; }
  .invitation > *:nth-child(2) { animation-delay: 0.25s; }
  .invitation > *:nth-child(3) { animation-delay: 0.4s; }
  .invitation > *:nth-child(4) { animation-delay: 0.55s; }
  .invitation > *:nth-child(5) { animation-delay: 0.7s; }
  .invitation > *:nth-child(6) { animation-delay: 0.85s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ——— Below the invitation: countdown, route, closing ——— */

:where(.block, .closing) :where(p, h2) { margin: 0; font-weight: inherit; font-size: inherit; }

.block,
.closing {
  width: calc(720 * var(--u));
  margin: 0 auto;
  padding: 0 0 calc(80 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.block__rule {
  display: block;
  width: calc(120 * var(--u));
  height: 1px;
  background: var(--ink);
  opacity: 0.45;
}

.block__title {
  margin-top: calc(40 * var(--u));
  font-size: calc(25 * var(--u));
  line-height: calc(28 * var(--u));
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.block__text {
  margin-top: calc(22 * var(--u));
  font-size: calc(23 * var(--u));
  line-height: calc(31 * var(--u));
  letter-spacing: 0.12em;
}

/* Countdown */
.countdown__grid {
  margin-top: calc(30 * var(--u));
  display: flex;
  justify-content: center;
  gap: calc(36 * var(--u));
}

.countdown__cell {
  width: calc(96 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown__num {
  font-size: calc(56 * var(--u));
  line-height: calc(60 * var(--u));
  font-variant-numeric: lining-nums tabular-nums;
}

.countdown__label {
  margin-top: calc(6 * var(--u));
  font-size: calc(16 * var(--u));
  line-height: calc(20 * var(--u));
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.countdown__done {
  margin-top: calc(30 * var(--u));
  font-style: italic;
  font-size: calc(26 * var(--u));
  line-height: calc(34 * var(--u));
  letter-spacing: 0.06em;
}

/* Quiet outline button */
.button {
  margin-top: calc(36 * var(--u));
  padding: calc(14 * var(--u)) calc(30 * var(--u));
  border: 1px solid currentColor;
  color: var(--ink);
  text-decoration: none;
  font-size: calc(17 * var(--u));
  line-height: calc(20 * var(--u));
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background-color 0.3s, color 0.3s;
}
.button:hover,
.button:focus-visible { background: var(--ink); color: var(--paper); }
.button:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* Map */
.route__map {
  margin-top: calc(30 * var(--u));
  width: calc(600 * var(--u));
  height: calc(400 * var(--u));
  border: 1px solid rgba(138, 138, 138, 0.35);
}
.route__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.85) contrast(0.95);
}

/* Closing */
.closing { padding-bottom: calc(90 * var(--u)); }

.closing__text {
  margin-top: calc(40 * var(--u));
  font-style: italic;
  font-size: calc(24 * var(--u));
  line-height: calc(30 * var(--u));
  letter-spacing: 0.06em;
}

/* Background music toggle: quiet round button in the corner, bars move while playing */
.music {
  position: fixed;
  right: max(14px, calc(28 * var(--u)));
  bottom: max(14px, calc(28 * var(--u)));
  z-index: 10;
  width: max(40px, calc(52 * var(--u)));
  height: max(40px, calc(52 * var(--u)));
  padding: 0;
  border: 1px solid rgba(138, 138, 138, 0.5);
  border-radius: 50%;
  background: rgba(252, 252, 251, 0.85);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.music:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.music__bars { display: flex; align-items: flex-end; gap: 3px; height: 14px; }
.music__bars span { width: 1.5px; background: currentColor; opacity: 0.7; }
.music__bars span:nth-child(1) { height: 6px; }
.music__bars span:nth-child(2) { height: 11px; }
.music__bars span:nth-child(3) { height: 8px; }
.music.is-playing .music__bars span { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .music.is-playing .music__bars span { animation: bar 1.4s ease-in-out infinite; }
  .music.is-playing .music__bars span:nth-child(2) { animation-delay: -0.5s; }
  .music.is-playing .music__bars span:nth-child(3) { animation-delay: -0.9s; }
  @keyframes bar {
    0%, 100% { height: 4px; }
    50%      { height: 14px; }
  }
}

/* Lower blocks fade in as they scroll into view (class set by script.js) */
@media (prefers-reduced-motion: no-preference) {
  .js .block,
  .js .closing { opacity: 0; transform: translateY(12px); transition: opacity 0.9s ease-out, transform 0.9s ease-out; }
  .js .block.is-visible,
  .js .closing.is-visible { opacity: 1; transform: none; }
}
