:root {
  --blue: #86b3c8;
  --blue-deep: #6f9fb6;
  --navy: #235f8a;
  --navy-deep: #1c4d70;
  --cream: #ede6dd;
  --white: #ffffff;
  --content-w: 520px;
  --font-script: 'Bad Script', cursive;
  --font-serif: 'PT Serif', Georgia, serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--navy);
  background: #dfe7ea;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site {
  max-width: var(--content-w);
  margin: 0 auto;
  background: var(--white);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(20, 40, 55, .25);
}

@media (min-width: 560px) {
  body { padding: 32px 0; }
}

/* ---------- shared type ---------- */

.script { font-family: var(--font-script); font-weight: 400; }

.script--accent {
  font-size: clamp(2rem, 8vw, 2.6rem);
  text-align: center;
  margin: 0 0 18px;
  line-height: 1.15;
}

.script--title {
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  text-align: center;
  margin: 0 0 28px;
  line-height: 1;
}

/* exact pixel crop from the client's own anketa mockup — not a font substitute */
.anketa-title {
  margin: 0 0 20px;
  text-align: center;
}
.anketa-title img {
  display: inline-block;
  width: clamp(220px, 62vw, 300px);
  height: auto;
}

section { position: relative; padding: 64px 32px; }

/* ---------- paper texture ---------- */

.section-blue,
.modal__panel {
  background-color: var(--blue);
  color: #fff;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.10), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: auto, 180px 180px;
}

.section-white { background: var(--white); color: var(--navy); }

/* ---------- reveal-on-scroll (scrubbed by scroll position, see script.js) ---------- */

.reveal {
  opacity: var(--p, 0);
  transform: translateY(calc((1 - var(--p, 0)) * 18px));
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ================= SCENE (single continuous background, exact PDF crop, no seams) ================= */

.scene { position: relative; line-height: 0; overflow: hidden; }
.scene-bg {
  width: 100%;
  height: auto;
  display: block;
  animation: scene-bg-in 1.4s cubic-bezier(.16,1,.3,1) both;
}
@keyframes scene-bg-in {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: scale(1); }
}

/* content pieces: positioned by --top/--h (% of the scene's total height) */
.content {
  position: absolute;
  left: 0;
  width: 100%;
  top: var(--top, 0);
  height: var(--h, auto);
}

/* hero title: timed on page load (already visible on arrival, not scroll-tied) */
.hero-intro {
  opacity: 0;
  animation: hero-fg-fade 1s cubic-bezier(.16,1,.3,1) 1.1s both;
}
@keyframes hero-fg-fade { to { opacity: 1; } }

.pearl-live {
  position: absolute;
  pointer-events: none;
  top: var(--top, 10%);
  left: var(--left, 10%);
  width: var(--size, 22px);
  animation: pearl-drift var(--drift-dur, 7s) ease-in-out var(--drift-delay, 0s) infinite;
}

/* intro variant: timed on page load (used only in the hero, which is visible immediately) */
.pearl-live--intro {
  opacity: 0;
  animation:
    pearl-in .9s cubic-bezier(.16,1,.3,1) var(--delay-in, .6s) both,
    pearl-drift var(--drift-dur, 7s) ease-in-out var(--drift-delay, 1.5s) infinite;
}

/* scroll variant: fades in with its section, scrubbed by scroll position (see script.js) */
.pearl-live--scroll { opacity: var(--p, 0); }

@keyframes pearl-in { to { opacity: 1; } }
@keyframes pearl-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(var(--dx, 4px), var(--dy, -3px)); }
}

@media (prefers-reduced-motion: reduce) {
  .scene-bg { animation: none; }
  .hero-intro { animation: none; opacity: 1; }
  .pearl-live { animation: none; opacity: .85; }
  .cta-hit { animation: none; }
}

.cta-wrap {
  position: absolute;
  left: 0; right: 0;
  top: var(--top, 0); height: var(--h, auto);
}
.cta-hit {
  position: absolute;
  left: 8%; top: 0; width: 84%; height: 100%;
  background: transparent;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  transition: transform .2s var(--ease);
  animation: cta-pulse 5s ease-in-out infinite;
}
.cta-hit:hover { transform: scale(1.03); animation-play-state: paused; }
.cta-hit:active { transform: scale(.97); animation-play-state: paused; }

@keyframes cta-pulse {
  0%, 21%, 100% { box-shadow: 0 0 0 0 rgba(35,95,138,0); transform: scale(1); }
  3%  { box-shadow: 0 0 0 7px rgba(35,95,138,.22); transform: scale(1.02); }
  6%  { box-shadow: 0 0 0 0 rgba(35,95,138,0); transform: scale(1); }
  9%  { box-shadow: 0 0 0 7px rgba(35,95,138,.22); transform: scale(1.02); }
  12% { box-shadow: 0 0 0 0 rgba(35,95,138,0); transform: scale(1); }
  15% { box-shadow: 0 0 0 7px rgba(35,95,138,.22); transform: scale(1.02); }
  18% { box-shadow: 0 0 0 0 rgba(35,95,138,0); transform: scale(1); }
}

.cta-hit:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }

/* ================= MODAL / ANKETA ================= */

.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(15,35,50,.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .35s var(--ease);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: var(--content-w);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 26px 26px 0 0;
  padding: 40px 30px 36px;
  transform: translateY(100%);
  transition: transform .4s var(--ease);
}

@media (min-width: 560px) {
  .modal { align-items: center; }
  .modal__panel { border-radius: 26px; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .4s var(--ease), opacity .4s var(--ease); }
  .modal.is-open .modal__panel { opacity: 1; }
}

.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__panel { transform: translateY(0) scale(1); }

.modal__close {
  position: absolute;
  top: 14px; right: 16px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.modal__close:hover { background: rgba(255,255,255,.3); }

#anketaTitle { color: #fff; margin-top: 4px; }

.modal__rule {
  border: none;
  border-top: 1px solid rgba(255,255,255,.4);
  margin: 0 auto 28px;
  width: 80%;
}

.field {
  display: block;
  margin-bottom: 30px;
}
.field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.55);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  padding: 6px 2px 10px;
  outline: none;
  transition: border-color .2s;
}
.field input::placeholder { color: rgba(255,255,255,.75); }
.field input:focus { border-color: #fff; }

.fieldset {
  border: none;
  padding: 0;
  margin: 0 0 30px;
}
.fieldset legend {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 14px;
  padding: 0;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  cursor: pointer;
  font-size: .96rem;
  line-height: 1.4;
}
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.option__box {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 1px;
  border: 1.5px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.06);
  position: relative;
  transition: background .2s, border-color .2s;
}
.option__box--check { border-radius: 4px; }
.option input:not([type=checkbox]) + .option__box { border-radius: 50%; }

.option__box::after {
  content: '';
  position: absolute; inset: 3px;
  background: #fff;
  opacity: 0;
  transition: opacity .15s;
}
.option input:not([type=checkbox]) + .option__box::after { border-radius: 50%; }

.option input:checked + .option__box { border-color: #fff; }
.option input:checked + .option__box::after { opacity: 1; }

.option input:focus-visible + .option__box { outline: 2px solid #fff; outline-offset: 2px; }

#drinksField {
  overflow: hidden;
  max-height: 400px;
  transition: max-height .4s var(--ease), opacity .3s var(--ease), margin .4s var(--ease);
  opacity: 1;
}
#drinksField.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  pointer-events: none;
}

.form__error {
  color: #ffe1e1;
  background: rgba(150,30,30,.35);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .9rem;
  margin: 0 0 20px;
}

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  color: var(--navy);
  border: none;
  border-radius: 999px;
  padding: 17px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(10,30,45,.3);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(10,30,45,.35); }
.submit-btn:active { transform: translateY(0) scale(.98); }
.submit-btn:disabled { opacity: .7; cursor: default; transform: none; }

.submit-btn__spinner {
  display: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(35,95,138,.3);
  border-top-color: var(--navy);
  animation: spin .7s linear infinite;
}
.submit-btn.is-loading .submit-btn__spinner { display: inline-block; }
.submit-btn.is-loading .submit-btn__label { opacity: .7; }

@keyframes spin { to { transform: rotate(360deg); } }

.submit-btn--ghost {
  background: rgba(255,255,255,.12);
  color: #fff;
  box-shadow: none;
  margin-top: 8px;
}
.submit-btn--ghost:hover { background: rgba(255,255,255,.2); }

/* success state */

.modal__success {
  text-align: center;
  padding: 20px 6px 6px;
  color: #fff;
}
.modal__success[hidden] { display: none; }

.success__check {
  width: 76px; height: 76px;
  margin: 0 auto 22px;
}
.success__check svg { width: 100%; height: 100%; }
.success__check circle {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw-circle .5s var(--ease) forwards;
}
.success__check path {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw-check .35s var(--ease) .45s forwards;
}
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

.success__text { line-height: 1.6; margin-bottom: 26px; }

/* ---------- misc ---------- */

::selection { background: var(--navy); color: #fff; }

/* ---------- music toggle ---------- */

.music-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(35,95,138,.72);
  backdrop-filter: blur(6px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15,35,50,.28);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.music-toggle:hover { transform: scale(1.06); }
.music-toggle:active { transform: scale(.95); }
.music-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.music-toggle__icon { width: 20px; height: 20px; }
.music-toggle__icon--pause { display: none; }
.music-toggle.is-playing .music-toggle__icon--note { display: none; }
.music-toggle.is-playing .music-toggle__icon--pause { display: block; }

.music-toggle.is-playing {
  animation: music-pulse 2.4s ease-in-out infinite;
}
@keyframes music-pulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(15,35,50,.28), 0 0 0 0 rgba(255,255,255,.35); }
  50% { box-shadow: 0 6px 18px rgba(15,35,50,.28), 0 0 0 8px rgba(255,255,255,0); }
}

@media (prefers-reduced-motion: reduce) {
  .music-toggle.is-playing { animation: none; }
}
