/* v15-invite — Приглашение и открытка-ответ: card stock, one ink */
:root {
  --stock: #f4f6f4;
  --ground: #d9dfe2;
  --env: #c3ccd0;
  --env-deep: #a9b5ba;
  --ink: #1e3a2f;
  --ink-soft: #4d6358;
  --rule: rgba(30, 58, 47, 0.32);
  --measure: 66ch;
  --env-h: clamp(8rem, 36vw, 14rem);
  --font: "Brygada 1918", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--stock); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2 { font-weight: 600; line-height: 1.3; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 7.2vw, 3.25rem); line-height: 1.12; }
h2 { font-size: 1.5rem; }
p { margin: 0 0 0.9em; max-width: var(--measure); }
.muted { color: var(--ink-soft); }
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 1.1rem 0; }

main { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* card stock */
.card {
  background: var(--stock);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(30, 58, 47, 0.12), 0 10px 28px rgba(30, 58, 47, 0.1);
}

/* ---------- hero: envelope + invitation + reply card ---------- */
.hero { display: grid; gap: 2rem; align-items: start; }

.mail {
  position: relative;
  padding: 1.25rem 0 calc(var(--env-h) * 0.35);
}
.env-back, .env-pocket {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--env-h);
  border-radius: 4px;
}
.env-back { background: var(--env); z-index: 1; }
.env-flap {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 48%;
  background: var(--env-deep);
  transform: translateY(-100%);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}
.env-pocket {
  z-index: 3;
  height: calc(var(--env-h) * 0.62);
  background: var(--env);
  clip-path: polygon(0 0, 50% 36%, 100% 0, 100% 100%, 0 100%);
  border-radius: 0 0 4px 4px;
}
.invite {
  position: relative;
  z-index: 2;
  margin: 0 clamp(0.75rem, 4vw, 2rem);
  padding: 1.5rem 1.25rem calc(var(--env-h) * 0.72);
}
@media (prefers-reduced-motion: no-preference) {
  .invite { animation: slide-out 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both; }
  @keyframes slide-out {
    from { transform: translateY(14%); }
    to { transform: translateY(0); }
  }
}
.invite__lead { font-size: 1.2rem; line-height: 1.4; }
.invite__note { color: var(--ink-soft); }
.lines { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.lines li { padding: 0.3rem 0; border-bottom: 1px solid var(--rule); }
.lines li:last-child { border-bottom: 0; }
.sep { color: var(--ink-soft); margin: 0 0.15em; }
.invite__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; }

/* buttons: one ink */
.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--stock);
  text-decoration: none;
  font-weight: 600;
  padding: 0.85rem 1.4rem;
  border-radius: 3px;
  border: 1px solid var(--ink);
  line-height: 1.3;
  transition: background 0.2s ease-out, color 0.2s ease-out;
}
.btn:hover { background: #142a22; }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--stock); }
.textlink { color: var(--ink); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.linkbtn[aria-pressed="true"] { text-decoration: none; font-weight: 600; }

/* ---------- reply card (the form) ---------- */
.reply-slot { position: relative; }
.reply {
  position: relative;
  padding: 1.5rem 1.25rem 1.25rem;
}
.reply__title { font-size: 1.35rem; margin-right: 12rem; }
.reply__lead { margin-right: 12rem; }
.preview-note { font-size: 0.9rem; color: var(--ink-soft); border: 1px dashed var(--rule); padding: 0.35rem 0.6rem; display: inline-block; }

.stamp {
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  width: 10.5rem; height: 4.75rem;
  border: 1px dashed var(--ink);
  padding: 0.3rem;
  display: flex;
}
.stamp__btn {
  flex: 1;
  background: var(--ink);
  color: var(--stock);
  border: 0;
  border-radius: 2px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  cursor: pointer;
  padding: 0.3rem;
  white-space: nowrap;
  transition: background 0.2s ease-out;
}
.stamp__btn:hover { background: #142a22; }
.stamp__btn:disabled, .stamp__btn[data-loading] { opacity: 0.6; cursor: progress; }
.stamp--sent { align-items: center; justify-content: center; font-weight: 600; letter-spacing: 0.02em; transform: rotate(-4deg); }

fieldset { border: 0; padding: 0; margin: 1.1rem 0 0; min-width: 0; }
legend { padding: 0; margin-bottom: 0.45rem; font-weight: 600; }
.ticks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.ticks legend { width: 100%; }
.tick { display: inline-flex; align-items: flex-start; gap: 0.55rem; cursor: pointer; line-height: 1.4; }
.tick input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.15rem; height: 1.15rem;
  margin: 0.12rem 0 0;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--stock);
  position: relative;
  cursor: pointer;
}
.tick input:checked::after {
  content: "";
  position: absolute;
  left: 0.32rem; top: 0.08rem;
  width: 0.32rem; height: 0.62rem;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
.tick--consent { margin-top: 1.1rem; max-width: var(--measure); }

.field { margin-top: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field input, .field textarea {
  display: block;
  width: 100%;
  max-width: 34rem;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.4rem 0;
}
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-soft); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-bottom-width: 2px; box-shadow: 0 2px 0 var(--ink); }
.microcopy { font-size: 0.9rem; color: var(--ink-soft); margin-top: 1rem; }
.reply--sent p { margin-bottom: 0.6em; }

/* ---------- enclosed sheets ---------- */
.sheet { margin-top: 1.5rem; padding: 1.75rem 1.25rem; }
.concepts, .faq { margin: 1.25rem 0 0; }
.concepts div, .faq div { display: grid; gap: 0.15rem 1.5rem; padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.concepts div:last-child, .faq div:last-child { border-bottom: 1px solid var(--rule); }
dt { font-weight: 600; }
dd { margin: 0; }
.steps { padding-left: 1.4rem; margin: 0 0 1rem; max-width: var(--measure); }
.steps li { padding: 0.3rem 0; }
.steps li::marker { font-weight: 600; }
.people { display: grid; gap: 1.25rem; }
.photo {
  width: 100%; max-width: 14rem; aspect-ratio: 3 / 4;
  border: 1px dashed var(--ink);
  display: grid; place-items: center;
  color: var(--ink-soft); padding: 1rem;
}
.person-name { font-weight: 600; font-size: 1.15rem; }

.countdown { text-align: center; }
.countdown__label { font-size: 1.1rem; font-weight: 400; color: var(--ink-soft); }
.countdown__nums { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0.5rem auto 0.75rem; max-width: none; }
.countdown__nums b { font-size: clamp(2.2rem, 7vw, 3.5rem); font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; display: block; }
.countdown__nums small { font-size: 0.95rem; color: var(--ink-soft); }
.countdown__state { display: none; font-size: 1.6rem; font-weight: 600; margin: 0.5rem 0; }
.countdown[data-state="live"] .countdown__nums, .countdown[data-state="ended"] .countdown__nums { display: none; }
.countdown[data-state="live"] .countdown__state--live { display: block; }
.countdown[data-state="ended"] .countdown__state--ended { display: block; }

.foot { max-width: 72rem; margin: 0 auto; padding: 1rem 1rem 3rem; font-size: 0.95rem; }
.foot p { margin-bottom: 0.4em; }

/* ---------- wider screens ---------- */
@media (min-width: 40rem) {
  main { padding: 2.5rem 1.5rem 4rem; }
  .invite { padding: 2rem 2rem calc(var(--env-h) * 0.72); }
  .reply { padding: 2rem; }
  .stamp { top: 1.5rem; right: 1.5rem; }
  .sheet { padding: 2.25rem 2rem; }
  .concepts div, .faq div { grid-template-columns: 12rem 1fr; }
  .people { grid-template-columns: 14rem 1fr; align-items: start; }
}
@media (min-width: 64rem) {
  :root { --env-h: 13rem; }
  .hero { grid-template-columns: 1.1fr 1fr; gap: 2.5rem; }
  .mail { padding-top: 2.5rem; }
}

/* Phones: the stamp sits in the flow above the title instead of floating over it. Must come after every .stamp rule. */
@media (max-width: 640px) {
  .reply { display: flex; flex-direction: column; }
  .stamp { position: static; order: 99; align-self: flex-start; margin: 1.25rem 0 0; }
  .reply__title, .reply__lead { margin-right: 0; }
}
[hidden] { display: none !important; }
