@font-face { font-family: "Oranienbaum"; src: url("fonts/oranienbaum-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Oranienbaum"; src: url("fonts/oranienbaum-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; font-display: swap; }
@font-face { font-family: "Old Standard TT"; src: url("fonts/old-standard-tt-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Old Standard TT"; src: url("fonts/old-standard-tt-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; font-display: swap; }
@font-face { font-family: "Old Standard TT"; font-style: italic; src: url("fonts/old-standard-tt-cyrillic-400-italic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Old Standard TT"; font-style: italic; src: url("fonts/old-standard-tt-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; font-display: swap; }
@font-face { font-family: "Marck Script"; src: url("fonts/marck-script-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Marck Script"; src: url("fonts/marck-script-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; font-display: swap; }

:root {
  --stone: #26282d;
  --stone-deep: #111316;
  --marble: #eceae6;
  --paper: #fdfdfb;
  --ink: #1d1f23;
  --ink-soft: #4b4d53;
  --gold: #a8883f;
  --pen: #1f3a93;
  --error: #8a1c1c;
  --stamp: #6a1f4f;

  --font-display: "Oranienbaum", "Times New Roman", serif;
  --font-text: "Old Standard TT", Georgia, "Times New Roman", serif;
  --font-hand: "Marck Script", "Segoe Script", cursive;

  --size-sm: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  --size-base: clamp(1.15rem, 1.08rem + 0.3vw, 1.3rem);
  --size-lg: clamp(1.45rem, 1.3rem + 0.7vw, 1.9rem);
  --size-xl: clamp(2.1rem, 1.7rem + 1.8vw, 3.4rem);
  --size-title: clamp(3.3rem, 2.2rem + 5vw, 5.5rem);

  --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1.125rem);
  --space-md: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  --space-lg: clamp(2rem, 1.6rem + 2vw, 3rem);
  --space-xl: clamp(3.5rem, 2.6rem + 5vw, 7rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--marble);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--size-base);
  line-height: 1.5;
  font-feature-settings: "liga", "kern";
}

html[lang="ru"] [lang="de"], html[lang="de"] [lang="ru"] { display: none; }

[hidden] { display: none !important; }

h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; }

ul { list-style: none; }

a { color: inherit; text-underline-offset: 0.18em; }

:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }

/* Language switch */

.lang {
  position: absolute;
  z-index: 2;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--gold);
  background: var(--paper);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.18);
}

.lang button {
  min-height: 48px;
  padding: 0.1rem 1.1rem 0.25rem;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--size-lg);
  line-height: 1;
  cursor: pointer;
}

.lang button:hover { background: var(--marble); }

.lang button[aria-pressed="true"] { background: var(--stone); color: var(--paper); }

.lang button:focus-visible { outline-offset: 2px; }

/* Stage: the invitation lying on marble */

.stage {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: clamp(5.25rem, 3rem + 5vw, 6.5rem) 1rem;
  background: var(--marble) url("marble.webp") center / cover no-repeat;
}

.invite {
  position: relative;
  width: min(100%, 50rem);
  padding: clamp(2.5rem, 1.6rem + 3vw, 3.4rem) clamp(1.75rem, 0.8rem + 5vw, 5rem);
  background: var(--paper);
  text-align: center;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 24px 50px -20px rgb(0 0 0 / 0.3);
}

/* Double gilt rule of an engraved card */
.invite::before {
  content: "";
  position: absolute;
  inset: 0.7rem;
  border: 1px solid var(--gold);
  outline: 3px double var(--gold);
  outline-offset: 3px;
  pointer-events: none;
}

.cross { display: block; width: 1.6rem; margin: 0 auto 0.6rem; fill: var(--gold); }

.hosts { font-style: italic; color: var(--ink-soft); }

h1 {
  margin: 0.15em 0 0.2em;
  font-family: var(--font-display);
  font-size: var(--size-title);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--stone);
  text-wrap: balance;
}

.when { font-size: var(--size-lg); line-height: 1.25; }

.where { color: var(--ink-soft); }

/* The form is the blank of the invitation: writing on ruled lines */

.blank { margin-top: var(--space-md); text-align: left; }

.blank__lead { margin-bottom: 0.3rem; font-style: italic; color: var(--ink-soft); text-align: center; }

.blank__names { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-md); }

.field { display: flex; flex-direction: column; margin-bottom: var(--space-sm); min-width: 0; }

.field input, .field textarea {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.4rem 0.1rem 0.05rem;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: none;
  color: var(--pen);
  font-family: var(--font-hand);
  font-size: 1.85rem;
  line-height: 1.2;
  appearance: none;
}

.field textarea { field-sizing: content; resize: none; overflow-wrap: anywhere; }

.field input:focus, .field textarea:focus { outline: 0; border-bottom: 2px solid var(--pen); padding-bottom: 0; }

.field input:read-only, .field textarea:read-only { cursor: default; }

.field [aria-invalid="true"] { border-bottom: 2px solid var(--error); padding-bottom: 0; }

/* Questions answered with a tick */

.choice { margin: var(--space-sm) 0 0; padding: 0; border: 0; min-width: 0; text-align: center; }

.choice legend { width: 100%; padding: 0; font-style: italic; color: var(--ink-soft); }

.choice__options { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--space-lg); }

.tick { display: inline-flex; align-items: center; gap: 0.55rem; min-height: 48px; cursor: pointer; }

.tick input { width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--stone); cursor: pointer; }

.tick input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 2px; }

.tick input:disabled, .tick input:disabled + span { cursor: default; }

.choice .field__error { margin-top: 0.1rem; }

.perform { margin-top: var(--space-md); text-align: center; }

.perform__lead { max-width: 34rem; margin: 0 auto 0.15rem; font-size: var(--size-sm); line-height: 1.4; color: var(--ink-soft); }

.perform__field { margin-top: 0.2rem; text-align: left; }

.field label { font-size: var(--size-sm); font-style: italic; color: var(--ink-soft); text-align: center; }

.field__error { font-size: var(--size-sm); color: var(--error); line-height: 1.3; }

.trap { position: absolute; left: -100vw; width: 1px; height: 1px; overflow: hidden; }

.blank__actions { margin-top: var(--space-md); text-align: center; }

.send {
  min-height: 3.4rem;
  padding: 0.55rem 2.4rem 0.7rem;
  border: 0;
  background: var(--stone);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: var(--size-lg);
  line-height: 1.1;
  cursor: pointer;
  transition: background-color 160ms ease, transform 90ms ease;
}

.send:hover { background: var(--stone-deep); }

.send:active { transform: scale(0.97); }

.send__busy { display: none; }

.send[aria-busy="true"] { cursor: progress; background: var(--ink-soft); }

.send[aria-busy="true"] .send__idle { display: none; }

.send[aria-busy="true"] .send__busy { display: inline; }

.blank__hint { max-width: 26rem; margin: var(--space-sm) auto 0; font-size: var(--size-sm); line-height: 1.35; color: var(--ink-soft); }

.notice { margin-top: var(--space-sm); font-size: var(--size-sm); line-height: 1.35; color: var(--error); text-align: center; }

noscript .notice { color: var(--ink); }

/* After registering the card keeps the written name and takes a stamp */

.is-sent .blank__actions, .is-sent .blank__lead, .is-sent .perform__lead { display: none; }

.sent { position: relative; z-index: 1; margin-top: var(--space-sm); max-width: 24rem; text-align: left; line-height: 1.35; }

.sent:focus { outline: 0; }

.sent__lead { margin-bottom: 0.35rem; font-family: var(--font-display); font-size: var(--size-lg); color: var(--stone); line-height: 1.2; }

.sent strong { font-weight: 400; color: var(--pen); overflow-wrap: anywhere; }

.again {
  min-height: 44px;
  margin-top: 0.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--size-sm);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.stamp {
  display: none;
  position: absolute;
  right: clamp(1.25rem, 5vw, 3rem);
  bottom: clamp(1.5rem, 5vw, 3.2rem);
  width: clamp(7.5rem, 4rem + 11vw, 10rem);
  color: var(--stamp);
  mix-blend-mode: multiply;
  opacity: 0.86;
  transform: rotate(-12deg);
}

.is-sent .stamp { display: block; animation: stamp 240ms cubic-bezier(0.3, 1.4, 0.5, 1) both; }

.stamp text { fill: currentColor; font-family: var(--font-display); }

.stamp__ring { font-size: 19px; }

.stamp__date { font-size: 30px; }

@keyframes stamp {
  from { opacity: 0; transform: rotate(-4deg) scale(1.7); }
  to { opacity: 0.86; transform: rotate(-12deg) scale(1); }
}

/* Details sheet */

.sheet {
  background: var(--paper);
  padding: var(--space-xl) clamp(1rem, 5vw, 4rem);
  display: grid;
  gap: var(--space-xl);
}

.part {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-lg);
  width: min(100%, 68rem);
  margin-inline: auto;
}

.part h2 {
  font-family: var(--font-display);
  font-size: var(--size-xl);
  font-weight: 400;
  line-height: 1.05;
  color: var(--stone);
  overflow-wrap: anywhere;
  hyphens: auto;
}

.part__body { max-width: 38rem; min-width: 0; }

.programme h3 { font-size: var(--size-base); font-weight: 400; font-style: italic; color: var(--ink-soft); }

.programme h3:not(:first-child) { margin-top: var(--space-md); }

/* Dance-card lines: name, dotted leader, time or sum */

.leaders li { display: flex; align-items: baseline; gap: 0.5rem; font-size: var(--size-lg); line-height: 1.5; }

.leaders i { flex: 1; min-width: 1.5rem; border-bottom: 2px dotted var(--gold); transform: translateY(-0.2em); }

.leaders span:last-child:not(:first-child) { white-space: nowrap; }

.prose p + p { margin-top: 0.85em; }

.prose { line-height: 1.6; }

.prose a { display: inline-block; padding-block: 0.7rem; }

.prose__big { font-family: var(--font-display); font-size: var(--size-lg); line-height: 1.25; color: var(--stone); }

.bank { margin-top: var(--space-lg); }

.bank > div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.15rem 1rem; padding: 0.3rem 0; }

.bank dt { font-style: italic; color: var(--ink-soft); }

.bank__iban { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.9rem; }

.copy {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--size-sm);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.copy__done { display: none; }

.copy.is-copied .copy__idle { display: none; }

.copy.is-copied .copy__done { display: inline; }

/* Footer */

.foot {
  padding: var(--space-lg) clamp(1rem, 5vw, 4rem);
  background: var(--marble);
  text-align: center;
}

.foot__sign { font-family: var(--font-display); font-size: var(--size-lg); line-height: 1.25; }

.foot__privacy { max-width: 40rem; margin: var(--space-md) auto 0; font-size: var(--size-sm); }

.foot__privacy summary { min-height: 44px; padding-top: 0.5rem; cursor: pointer; }

.foot__privacy p { margin-top: 0.5rem; text-align: left; line-height: 1.45; }

@media (max-width: 720px) {
  .part { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }

  .bank > div { grid-template-columns: minmax(0, 1fr); }

  .leaders li { font-size: var(--size-base); }
}

@media (max-width: 460px) {
  .blank__names { grid-template-columns: minmax(0, 1fr); }

  .send { width: 100%; padding-inline: 1rem; }

  .sent { max-width: none; padding-bottom: 8.5rem; }

  .stamp { bottom: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
