/* Пресет J: Retro Vintage + Badge Seals. Тема: light (кремовий папір, ржавий акцент) */
:root {
  --rule-paper: #F5EEDD;
  --rule-surface: #FBF7EE;
  --rule-ink: #2A2118;
  --rule-muted: #5E4E3F;
  --rule-tone: #7A3E1D;
  --rule-tone-hover: #5C2D13;
  --rule-gold: #A67C2E;
  --rule-gold-deep: #7D5C1E;
  --rule-line: #CDB994;
  --rule-deep: #3A2A1C;
  --rule-deep-text: #F1E8D6;
  --rule-olive: #4E6236;
  --rule-plum: #6B3F5E;
  --rule-shadow: rgba(42, 33, 24, 0.18);
  --rule-gradient: linear-gradient(135deg, #7A3E1D 0%, #A0582C 60%, #A67C2E 100%);
  --font-display: 'Playfair Display', 'Noto Naskh Arabic', 'Noto Nastaliq Urdu', Georgia, serif;
  --font-body: 'Lato', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
}

/* ---------- Базові ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--rule-paper);
  color: var(--rule-ink);
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.75;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-display); color: var(--rule-ink); line-height: 1.3; }
a { color: var(--rule-tone); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--rule-gold);
  outline-offset: 3px;
}

/* ---------- Міжсторінкові переходи ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.35s ease both rule-vt-out; }
::view-transition-new(root) { animation: 0.45s ease both rule-vt-in; }
@keyframes rule-vt-out { to { opacity: 0; } }
@keyframes rule-vt-in { from { opacity: 0; } }

/* ---------- Header ---------- */
.rule-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--rule-paper);
  border-bottom: 1px solid var(--rule-tone);
  box-shadow: 0 4px 0 -3px var(--rule-paper), 0 5px 0 -3px var(--rule-gold);
}
.rule-header-inner {
  position: relative;
  width: min(1100px, 92%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
}
.rule-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--rule-ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.rule-brand-mark { width: 40px; height: 40px; color: var(--rule-tone); flex: none; }
.rule-nav { display: flex; gap: 1.4rem; align-items: center; }
.rule-nav-link {
  color: var(--rule-ink);
  text-decoration: none;
  font-weight: 700;
  padding-block: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.rule-nav-link:hover { color: var(--rule-tone); border-bottom-color: var(--rule-gold); }
.rule-burger {
  display: none;
  cursor: pointer;
  color: var(--rule-ink);
  border: 1px solid var(--rule-tone);
  padding: 0.35rem 0.9rem;
  border-radius: 2px;
  font-weight: 700;
}
.rule-burger-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.rule-progress {
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 3px;
  background: var(--rule-gradient);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .rule-progress {
    animation: rule-progress-grow linear both;
    animation-timeline: scroll(root block);
  }
}
@keyframes rule-progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 860px) {
  .rule-burger { display: inline-block; }
  .rule-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    background: var(--rule-paper);
    padding: 0.8rem 6% 1rem;
    border-bottom: 1px solid var(--rule-tone);
  }
  .rule-nav-link { padding: 0.7rem 0; border-bottom: 1px dotted var(--rule-line); }
  .rule-burger-input:focus-visible ~ .rule-header-inner .rule-burger { outline: 3px solid var(--rule-gold); outline-offset: 3px; }
  .rule-burger-input:checked ~ .rule-header-inner .rule-nav { display: flex; }
}

/* ---------- Hero ---------- */
.rule-hero {
  position: relative;
  overflow: clip;
  isolation: isolate;
  padding-block: 12dvh 10dvh;
}
.rule-hero-plain { padding-block: 9dvh 5dvh; }
.rule-hero-photo {
  position: absolute;
  inset: -8% 0;
  z-index: 0;
  pointer-events: none;
  background: url(img/bg.webp) center / cover no-repeat;
  filter: sepia(20%) brightness(0.9);
}
.rule-hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(245, 238, 221, 0.88), rgba(245, 238, 221, 0.95));
}
.rule-seal {
  position: absolute;
  inset-inline-end: 4%;
  top: 14%;
  width: clamp(110px, 24vw, 220px);
  aspect-ratio: 1;
  z-index: 0;
  pointer-events: none;
  color: var(--rule-tone);
  opacity: 0.45;
  font-family: var(--font-body);
}
.rule-hero-inner {
  position: relative;
  z-index: 1;
  width: min(1100px, 92%);
  margin-inline: auto;
  max-width: 44rem;
}
.rule-kicker {
  color: var(--rule-tone);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.6rem;
}
.rule-title {
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.2;
  margin: 0 0 0.8rem;
}
.rule-lead {
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  color: var(--rule-muted);
  margin: 0 0 1.6rem;
}

/* ---------- CTA pill ---------- */
.rule-pill {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  border: 3px double var(--rule-tone);
  background: var(--rule-tone);
  color: var(--rule-surface);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.rule-pill:hover {
  background: var(--rule-tone-hover);
  box-shadow: 0 0 0 4px rgba(122, 62, 29, 0.18);
}

/* ---------- Секції та утиліти ---------- */
.rule-section {
  position: relative;
  padding-block: 10dvh;
  overflow: clip;
}
.rule-section-alt { background: var(--rule-surface); }
.rule-wrap {
  position: relative;
  width: min(1100px, 92%);
  margin-inline: auto;
}
.rule-narrow { max-width: 760px; }
.rule-split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 860px) {
  .rule-split { grid-template-columns: 1fr 1fr; }
}
.rule-h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  margin: 0 0 1rem;
}
.rule-card-title {
  font-size: 1.2rem;
  margin: 0.4rem 0 0.6rem;
}
.rule-ornament {
  text-align: center;
  color: var(--rule-gold-deep);
  letter-spacing: 0.6em;
  margin: 0 0 1.4rem;
}
.rule-dotted {
  border: 0;
  border-top: 1px dotted var(--rule-gold);
  width: 60%;
  margin: 1rem auto;
}
.rule-section p { margin: 0 0 1rem; }

/* Рамки (vintage frame) */
.rule-frame {
  position: relative;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--rule-line);
  background: var(--rule-surface);
  box-shadow: 4px 4px 0 var(--rule-tone), 0 10px 22px var(--rule-shadow);
}
.rule-frame img {
  border: 2px double var(--rule-tone);
  width: 100%;
  height: auto;
}
.rule-frame-center {
  width: 55%;
  margin: 0 auto 3rem;
}
@media (max-width: 640px) {
  .rule-frame-center { width: 88%; }
}

/* Маркований список із ✦ */
.rule-bullets {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.rule-bullets li {
  position: relative;
  padding-inline-start: 1.7rem;
  margin-bottom: 0.7rem;
}
.rule-bullets li::before {
  content: "✦";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  color: var(--rule-tone);
}

/* Картки з печаткою */
.rule-badge-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.rule-seal-card {
  background: var(--rule-surface);
  border: 1px solid var(--rule-line);
  border-radius: 4px;
  padding: 2.2rem 1.4rem 1.8rem;
  text-align: center;
  box-shadow: 0 6px 18px var(--rule-shadow);
}
.rule-seal-card p { margin: 0; color: var(--rule-muted); }
.rule-badge {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: var(--rule-paper);
  border: 3px double var(--rule-tone);
}
.rule-badge::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px dotted var(--rule-gold);
  pointer-events: none;
}
.rule-badge::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px solid var(--rule-line);
  pointer-events: none;
}

/* Інфо-картки (reserve) */
.rule-info-grid {
  display: grid;
  gap: 1.4rem;
}
@media (min-width: 760px) {
  .rule-info-grid { grid-template-columns: 1fr 1fr; }
}
.rule-info-card {
  background: var(--rule-surface);
  border: 1px solid var(--rule-line);
  border-radius: 4px;
  padding: 1.6rem;
  box-shadow: 0 6px 18px var(--rule-shadow);
}
.rule-info-icon { font-size: 1.8rem; line-height: 1; }
.rule-dots {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 0;
}
.rule-dots li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}
.rule-dot {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--rule-tone);
}
.rule-dots li:nth-child(2) .rule-dot { background: var(--rule-olive); }
.rule-dots li:nth-child(3) .rule-dot { background: var(--rule-plum); }
.rule-dots li:nth-child(4) .rule-dot { background: var(--rule-deep); }

/* Кроки */
.rule-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2.2rem;
}
@media (min-width: 760px) {
  .rule-steps { grid-template-columns: repeat(3, 1fr); }
  .rule-steps .rule-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 32px;
    inset-inline-start: calc(50% + 40px);
    width: calc(100% - 80px);
    border-top: 2px dashed var(--rule-tone);
  }
}
.rule-step {
  position: relative;
  text-align: center;
}
.rule-step p { color: var(--rule-muted); margin: 0; }
.rule-step-num {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  border: 3px double var(--rule-tone);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--rule-tone);
  background: var(--rule-surface);
}

/* Цитата */
.rule-pull {
  margin: 0 auto;
  max-width: 760px;
  text-align: center;
  padding: 2rem 1.4rem;
  border-top: 2px double var(--rule-tone);
  border-bottom: 2px double var(--rule-tone);
}
.rule-pull blockquote { margin: 0; }
.rule-pull p {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin: 0 0 0.6rem;
}
.rule-pull figcaption { color: var(--rule-muted); font-weight: 700; }

/* CTA strip */
.rule-cta-strip {
  background: var(--rule-deep);
  color: var(--rule-deep-text);
  padding-block: 8dvh;
  overflow: clip;
}
.rule-cta-strip .rule-h2 { color: var(--rule-deep-text); }
.rule-cta-strip p { color: var(--rule-deep-text); }
.rule-cta-box {
  border: 2px double var(--rule-gold);
  padding: 2.2rem 1.6rem;
  text-align: center;
  border-radius: 2px;
}
.rule-cta-strip .rule-pill {
  background: var(--rule-surface);
  color: var(--rule-deep);
  border-color: var(--rule-gold);
}
.rule-cta-strip .rule-pill:hover {
  background: #E9DCC0;
  box-shadow: 0 0 0 4px rgba(166, 124, 46, 0.35);
}

/* Форма */
.rule-form-card {
  background: var(--rule-surface);
  border: 3px double var(--rule-tone);
  padding: clamp(1.2rem, 4vw, 2.4rem);
  border-radius: 4px;
  box-shadow: 0 6px 18px var(--rule-shadow);
}
.rule-field {
  display: block;
  margin-bottom: 1.2rem;
}
.rule-field > span,
.rule-check > span {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--rule-ink);
}
.rule-input {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--rule-tone);
  border-radius: 0;
  padding: 0.6rem 0.1rem;
  font: inherit;
  color: var(--rule-ink);
}
.rule-input:focus {
  outline: 2px solid var(--rule-gold);
  outline-offset: 2px;
  background: rgba(166, 124, 46, 0.08);
}
textarea.rule-input { resize: vertical; min-height: 110px; }
.rule-check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 1rem 0 1.4rem;
  line-height: 1.7;
}
.rule-check > input {
  width: 20px;
  height: 20px;
  margin-top: 0.3rem;
  accent-color: var(--rule-tone);
  flex: none;
}
.rule-check > span { font-weight: 400; margin: 0; }
.rule-submit { font-size: 1rem; }

/* FAQ */
.rule-faq details {
  border-bottom: 1px dotted var(--rule-gold);
  padding: 1rem 0;
}
.rule-faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--rule-ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.rule-faq details p { margin: 0.6rem 0 0; color: var(--rule-muted); }

/* Legal */
.rule-legal-main {
  min-height: 100vh;
  padding-block: 8dvh;
}
.rule-legal p { line-height: 1.85; }
.rule-legal .rule-h2 { margin-top: 2rem; font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.rule-cookie-section {
  margin-top: 2.4rem;
  padding: 1.6rem;
  border: 2px double var(--rule-tone);
  background: var(--rule-surface);
}

/* Thanks */
.rule-thanks {
  min-height: 70dvh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 8dvh;
}
.rule-thanks .rule-wrap { display: grid; justify-items: center; }
.rule-thanks .rule-lead { margin-inline: auto; max-width: 40rem; }
.rule-thanks-figure {
  width: min(420px, 90%);
  margin: 1.5rem auto 2rem;
}

/* ---------- Footer ---------- */
.rule-footer {
  background: var(--rule-deep);
  color: var(--rule-deep-text);
  padding-block: 6dvh 4dvh;
}
.rule-footer-inner {
  width: min(1100px, 92%);
  margin-inline: auto;
  display: grid;
  gap: 1.4rem;
  justify-items: start;
}
.rule-brand-foot { color: var(--rule-deep-text); }
.rule-brand-foot .rule-brand-mark { color: var(--rule-gold); }
.rule-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
}
.rule-foot-links a {
  color: var(--rule-deep-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rule-disclaimer {
  margin: 0;
  color: #E7D9BC;
  border-inline-start: 3px solid var(--rule-gold);
  padding-inline-start: 0.9rem;
}
.rule-copy {
  margin: 0;
  color: #E7D9BC;
  font-size: 0.95rem;
}

/* ---------- Cookie banner ---------- */
.rule-cookie {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 9999;
  background: var(--rule-deep);
  color: var(--rule-deep-text);
  padding: 1rem 5%;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  border-top: 2px double var(--rule-gold);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.25);
}
.rule-cookie[hidden] { display: none; }
.rule-cookie p { margin: 0; flex: 1 1 320px; font-size: 0.97rem; }
.rule-cookie a { color: var(--rule-deep-text); text-underline-offset: 3px; }
.rule-cookie-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.rule-cookie-btn {
  font: inherit;
  font-weight: 700;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  border: 2px double var(--rule-gold);
  background: var(--rule-surface);
  color: var(--rule-deep);
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.rule-cookie-btn:hover { background: #E9DCC0; }
.rule-cookie-btn-alt {
  background: transparent;
  color: var(--rule-deep-text);
}
.rule-cookie-btn-alt:hover { background: rgba(241, 232, 214, 0.12); }

/* ---------- Анімаційний шар ---------- */
/* Ефект 1 (CSS): clip-reveal зображень через view() */
@supports (animation-timeline: view()) {
  .rule-clip {
    animation: rule-clip-in linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 35%;
  }
}
@keyframes rule-clip-in {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* Ефект 2 (JS): stagger-reveal. Початковий стан тільки з класом .js на html */
.js .rule-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .rule-fade {
  opacity: 0;
  transition: opacity 0.7s ease;
}
.js .rule-reveal.is-in,
.js .rule-fade.is-in {
  opacity: 1;
  transform: none;
}

/* Ефект 3 (JS): parallax декоративних шарів — лише transform через rAF у скрипті */
.rule-parallax { will-change: transform; }

/* Декор не має перехоплювати кліки */
.rule-hero-photo,
.rule-seal {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  html { view-transition-name: none; }
  .rule-parallax { will-change: auto; }
}