/* Казкова Ніч: a dark winter bedroom lit by festive projections.
   Plum night ground, snow ink, candy red as the one accent, mint and gold as rare sparks. */
:root {
  --night: #17112B;
  --night-2: #221A3D;
  --night-3: #2C2350;
  --snow: #FFF8F0;
  --frost: #C9C1DF;
  --red: #E8344E;
  --red-deep: #C4213A;
  --mint: #8FE3C6;
  --gold: #F6C453;
  --line: rgba(255, 248, 240, 0.14);
  --display: "Montserrat Alternates", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--snow); font-family: var(--body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(to bottom, rgba(23, 17, 43, 0.9), rgba(23, 17, 43, 0));
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; text-decoration: none; }
.logo__mark { width: 16px; height: 16px; border-radius: 50%; background: var(--snow); box-shadow: 0 -9px 0 -3px var(--snow), 9px -14px 0 -6px var(--gold); }
.cta-nav { padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 800; font-size: 14px; backdrop-filter: blur(8px); transition: border-color .2s, background .2s; }
.cta-nav:hover { border-color: var(--red); background: rgba(232, 52, 78, 0.14); }

/* Film (scroll-scrubbed) */
.film { position: relative; height: 420vh; }
.film__stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--night); }
.film__video { width: 100%; height: 100%; object-fit: cover; display: block; }
.film__shade { position: absolute; inset: 0; background: radial-gradient(ellipse at center 70%, rgba(23, 17, 43, 0) 35%, rgba(23, 17, 43, 0.5) 100%), linear-gradient(to bottom, rgba(23, 17, 43, 0.8), rgba(23, 17, 43, 0) 50%); pointer-events: none; }
.chapter__title { font-size: clamp(28px, 4.4vw, 52px) !important; }
.film__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 248, 240, 0.12); }
.film__progress span { display: block; height: 100%; background: var(--red); transform-origin: left; transform: scaleX(var(--p, 0)); }
.film__chapters { position: sticky; top: 0; height: 100vh; height: 100dvh; margin-top: -100vh; margin-top: -100dvh; pointer-events: none; overflow: hidden; }
body { overflow-x: clip; }
.chapter {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 12px;
  max-width: 600px;
  padding: calc(env(safe-area-inset-top, 0px) + 84px) max(20px, env(safe-area-inset-left, 0px)) 0;
  transition: opacity .35s ease, transform .35s ease;
}
.chapter[data-active="false"] > * { pointer-events: none; }
.chapter::before { content: ""; position: absolute; inset: 0 -20% -30% 0; z-index: -1; background: radial-gradient(ellipse at 25% 35%, rgba(23, 17, 43, 0.82) 0%, rgba(23, 17, 43, 0.55) 45%, rgba(23, 17, 43, 0) 75%); pointer-events: none; }
.chapter--right::before { inset: 0 0 -30% -20%; background: radial-gradient(ellipse at 75% 35%, rgba(23, 17, 43, 0.82) 0%, rgba(23, 17, 43, 0.55) 45%, rgba(23, 17, 43, 0) 75%); }
.chapter { padding-bottom: 48px; isolation: isolate; }
.chapter[data-active="false"] { opacity: 0; transform: translateY(16px); }
.chapter > * { pointer-events: auto; }
.chapter--right { left: auto; right: 0; text-align: right; align-items: flex-end; padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.chapter__kicker { margin: 0; color: var(--gold); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.chapter__title { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5.2vw, 58px); line-height: 1.06; text-wrap: balance; text-shadow: 0 2px 24px rgba(23, 17, 43, 0.6); }
.chapter__body { margin: 0; color: var(--snow); opacity: .9; max-width: 46ch; font-size: 18px; text-shadow: 0 1px 12px rgba(23, 17, 43, 0.8); }
.chapter__tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chapter--right .chapter__tags { justify-content: flex-end; }
.chapter__tags li { padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255, 248, 240, 0.3); background: rgba(23, 17, 43, 0.4); font-size: 14px; font-weight: 600; }

.cta-hero { align-self: flex-start; display: inline-block; padding: 16px 28px; border-radius: 16px; background: var(--red); font-weight: 800; text-decoration: none; box-shadow: 0 12px 30px -10px rgba(232, 52, 78, 0.8); transition: transform .2s, background .2s; }
.cta-hero:hover { background: var(--red-deep); transform: translateY(-2px); }
.cta-closing { align-self: flex-start; display: inline-flex; align-items: center; gap: 12px; padding: 14px 24px; border-radius: 999px; background: var(--snow); color: var(--night); font-weight: 800; text-decoration: none; transition: gap .2s; }
.cta-closing:hover { gap: 18px; }
.cta-closing__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(232, 52, 78, 0.25); }

/* Sections */
.offer, .gift, .steps, .order, .faq, .footer {
  max-width: 1120px; margin: 0 auto; padding-block: 76px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.h2 { margin: 0 0 20px; font-family: var(--display); font-weight: 700; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.12; text-wrap: balance; }
.lead { margin: 0; color: var(--frost); max-width: 60ch; }

.offer { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.offer__media img { border-radius: 32px; width: 100%; height: auto; }
.specs { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.specs li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.specs span { color: var(--frost); }
.specs b { text-align: right; }
.note { margin: 0 0 24px; color: var(--frost); font-size: 15px; }
.price-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.price-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--night-2); }
.price-card--best { outline: 2px solid var(--mint); }
.price-card__label { color: var(--frost); font-size: 14px; line-height: 1.3; }
.price-card__value { font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cta-offer { display: inline-block; padding: 15px 26px; border-radius: 14px 14px 14px 3px; border: 2px solid var(--red); font-weight: 800; text-decoration: none; transition: background .2s; }
.cta-offer:hover { background: var(--red); }

.gift { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.gift__img { border-radius: 220px 220px 32px 32px; order: 2; width: 100%; height: auto; }
.gift__copy { order: 1; }
.uses { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.uses li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.uses li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; }

.steps__list { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.steps__list li { counter-increment: s; display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 22px; background: var(--night-2); }
.steps__list li::before { content: counter(s); font-family: var(--display); font-size: 30px; color: var(--red); }
.steps__list span { color: var(--frost); }

/* Order */
.order { max-width: 780px; }
.order__head { margin-bottom: 28px; }
.order-form { display: flex; flex-direction: column; gap: 20px; padding: 28px; border-radius: 30px; background: var(--night-2); border: 1px solid var(--line); }
.qty { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.qty__legend { font-weight: 800; margin-bottom: 10px; }
.qty__opt { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s; }
.qty__opt:has(input:checked) { border-color: var(--red); background: rgba(232, 52, 78, 0.1); }
.qty__opt:has(input:focus-visible) { outline: 2px solid var(--snow); outline-offset: 2px; }
.qty__opt input { position: absolute; opacity: 0; pointer-events: none; }
.qty__name { font-weight: 800; }
.qty__price { font-family: var(--display); font-size: 20px; }
.qty__note { color: var(--mint); font-size: 13px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field__label { font-size: 14px; color: var(--frost); }
.field__input { height: 50px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--night); color: var(--snow); font: inherit; }
.field__input:focus { outline: none; border-color: var(--snow); }
.field__input[aria-invalid="true"] { border-color: var(--red); }
.field__error { display: none; color: var(--red); font-size: 14px; }
.field__input[aria-invalid="true"] + .field__error { display: block; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin: 0; color: var(--red); }
.order-submit { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px; border: 0; border-radius: 18px; background: var(--red); color: var(--snow); font: inherit; font-weight: 800; font-size: 19px; cursor: pointer; transition: background .2s, transform .1s; }
.order-submit:hover { background: var(--red-deep); }
.order-submit:active { transform: scale(.99); }
.order-submit:disabled { opacity: .7; cursor: progress; }
.order-submit:focus-visible { outline: 2px solid var(--snow); outline-offset: 3px; }
.order-submit__sub { font-weight: 600; font-size: 13px; }
.fine { margin: 0; text-align: center; color: var(--frost); font-size: 14px; }
.order-done { padding: 32px; border-radius: 30px; background: var(--night-2); border: 2px solid var(--mint); }
.order-done__title { margin: 0 0 8px; font-family: var(--display); font-size: 24px; }
.order-done__text { margin: 0; color: var(--frost); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--red); font-family: var(--display); }
.faq details[open] summary::after { content: "-"; }
.faq p { margin: 10px 0 0; color: var(--frost); }

.footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding-block: 32px 48px; border-top: 1px solid var(--line); color: var(--frost); font-size: 14px; }
.cta-footer { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; color: var(--snow); }

.nav { transition: background .2s; }
.nav.is-solid { background: rgba(23, 17, 43, 0.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
/* Bigger tap targets */
.logo, .cta-nav { min-height: 44px; }
.cta-nav { display: inline-flex; align-items: center; }
.faq summary { min-height: 44px; align-items: center; }
.cta-footer { display: inline-flex; align-items: center; min-height: 44px; }

/* Sticky order bar (phones only) */
.sticky-cta { display: none; }
@media (max-width: 820px) {
  .sticky-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    background: rgba(23, 17, 43, 0.94); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); text-decoration: none;
    transform: translateY(110%); transition: transform .25s ease;
  }
  .sticky-cta.is-visible { transform: translateY(0); }
  .sticky-cta__text { display: flex; flex-direction: column; line-height: 1.25; font-size: 14px; min-width: 0; }
  .sticky-cta__text span { color: var(--frost); font-size: 13px; }
  .sticky-cta__btn { flex: none; padding: 13px 18px; border-radius: 14px; background: var(--red); font-weight: 800; white-space: nowrap; }
  .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .sticky-cta { transition: none; } }

@media (max-width: 820px) {
  .offer, .gift { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .gift__img { order: 0; border-radius: 140px 140px 26px 26px; }
  .steps__list, .fields { grid-template-columns: minmax(0, 1fr); }
  .price-cards { grid-template-columns: minmax(0, 1fr); }
  .qty { grid-template-columns: minmax(0, 1fr); }
  .order-form { padding: 20px; }
  .chapter, .chapter--right { left: 0; right: 0; text-align: left; align-items: flex-start; padding-top: calc(env(safe-area-inset-top, 0px) + 72px); }
  .film__video { object-position: 50% 60%; }
  .chapter--right .chapter__tags { justify-content: flex-start; }
  .chapter__body { font-size: 16px; }
  .offer, .gift, .steps, .order, .faq { padding-block: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .film { height: auto; }
  .film__stage { position: relative; height: 70vh; }
  .film__chapters { position: static; height: auto; margin: 0; }
  .chapter { position: static; padding-block: 32px; opacity: 1 !important; transform: none !important; }
  .chapter > * { pointer-events: auto !important; }
  .cta-hero, .cta-closing, .cta-nav, .cta-offer, .order-submit, .chapter { transition: none; }
}
