:root {
  --night: #11161a;
  --night-2: #1a2228;
  --bone: #efe4cf;
  --bone-dim: #c9bba1;
  --ink: #3a2a1b;
  --ink-soft: #5e4630;
  --ember: #e9893a;
  --ember-deep: #b4511f;
  --bronze: #a88a5c;
  --line: rgba(168, 138, 92, 0.45);
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--bone);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  background-color: var(--night);
  background-image:
    linear-gradient(rgba(12, 16, 20, 0.86), rgba(12, 16, 20, 0.93)),
    url("img/meadow.webp");
  background-size: auto, 256px;
  overflow-x: hidden;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.sky {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(233, 137, 58, 0.16), transparent 70%),
    radial-gradient(ellipse at 50% 120%, rgba(30, 44, 70, 0.55), transparent 60%);
}

.lang {
  position: fixed; top: 14px; right: 16px; z-index: 20;
  display: flex; gap: 4px;
  padding: 4px; border-radius: 999px;
  background: rgba(17, 22, 26, 0.78); border: 1px solid var(--line);
  backdrop-filter: blur(4px);
}
.lang[hidden] { display: none; }
.lang button {
  font: 600 13px/1 var(--sans); letter-spacing: 0.06em;
  color: var(--bone-dim); background: transparent;
  border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer;
  min-height: 34px;
}
.lang button[aria-pressed="true"] { color: var(--night); background: var(--bone); }
.lang button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.scroll {
  position: relative; z-index: 2;
  width: min(760px, calc(100% - 32px));
  margin: 40px auto 0;
}
.scroll-roll {
  display: block; position: relative; z-index: 3;
  width: min(112%, calc(100% + 32px)); max-width: none; margin-left: max(-6%, -16px);
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5));
}
.scroll-unroll {
  display: block;
  margin: -6% 6.5%;
  position: relative; z-index: 2;
}
.scroll-body {
  overflow: hidden;
  position: relative;
  color: var(--ink);
  background: #e8d6b4 url("img/parchment.webp") center / 384px;
  box-shadow:
    inset 14px 0 18px -14px rgba(90, 60, 30, 0.35),
    inset -14px 0 18px -14px rgba(90, 60, 30, 0.35);
  text-align: center;
}
.scroll-inner { padding: clamp(56px, 9vw, 72px) clamp(18px, 6vw, 64px) clamp(60px, 9.5vw, 76px); }
.scroll-body h1 {
  font: 600 clamp(1.7rem, 4.6vw, 2.5rem)/1.2 var(--serif);
  margin: 0 0 0.6em; color: var(--ink);
}
.scroll-body p {
  font-family: var(--serif);
  font-size: clamp(1.02rem, 2.3vw, 1.18rem);
  margin: 0 auto 0.8em; max-width: 38em; color: var(--ink-soft);
}
.scroll-body .sign { font-style: italic; margin-top: 1.2em; margin-bottom: 0; color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .scroll-inner > * { animation: fade-in 0.9s ease 0.5s both; }
}
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

main { position: relative; z-index: 2; }

.hero {
  position: relative;
  text-align: center;
  padding: clamp(56px, 9vw, 96px) 16px 24px;
}
.glow {
  position: absolute; left: 50%; top: 52%;
  width: min(900px, 100%); aspect-ratio: 2 / 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(233, 137, 58, 0.22), transparent 65%);
  pointer-events: none;
}
.logo {
  position: relative;
  width: min(760px, 92%);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}
.tagline {
  position: relative;
  font: 500 clamp(1.05rem, 2.6vw, 1.4rem)/1.4 var(--serif);
  color: var(--bone); margin: 18px 0 10px; letter-spacing: 0.02em;
}
.badge {
  position: relative; display: inline-block;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ember);
  padding: 6px 14px; border: 1px solid rgba(233, 137, 58, 0.5); border-radius: 999px;
  margin: 0 0 26px; background: rgba(233, 137, 58, 0.08);
}
.actions { position: relative; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: nowrap; }
.actions .btn { flex: 0 0 auto; }
.actions .btn-primary { flex: 0 1 auto; min-width: 0; text-align: center; line-height: 1.2; }
@media (max-width: 480px) {
  .actions { gap: 8px; }
  .actions .btn-primary { padding: 6px 12px; gap: 8px; font-size: 0.95rem; }
  .actions .btn.btn-icon { width: 44px; min-height: 44px; }
}
@media (max-width: 340px) {
  .actions .btn-primary { padding: 6px 10px; font-size: 0.88rem; }
  .actions .btn-primary small { padding: 2px 5px; letter-spacing: 0.06em; }
}
.no-scroll .scroll { display: none; }
html:not(.no-scroll) .hero { padding-top: clamp(28px, 4vw, 44px); }
.page-map {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.page-map button {
  width: 18px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.page-map button::before {
  content: ""; display: block; width: 3px; height: 26px; border-radius: 3px;
  background: rgba(201, 187, 161, 0.32);
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.page-map button:hover::before { background: rgba(232, 220, 196, 0.7); }
.page-map button.on::before {
  width: 5px; height: 32px; background: var(--ember);
  box-shadow: 0 0 10px rgba(233, 137, 58, 0.7);
}
.page-map button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 1279px) {
  .page-map { display: none; }
}
.scroll-hint {
  --hint-size: 52px;
  display: none;
  position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
  width: var(--hint-size); height: var(--hint-size); padding: 0; margin-left: calc(var(--hint-size) / -2);
  align-items: center; justify-content: center;
  color: #2a1608; background: linear-gradient(#f0a35a, #d9772f);
  border: 1px solid #f3b071; border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 22px rgba(233, 137, 58, 0.45);
  cursor: pointer; z-index: 3;
  transition: background 0.2s, box-shadow 0.2s;
}
.scroll-hint svg { display: block; width: 46%; height: 46%; stroke-width: 2.6; }
.scroll-hint:hover { background: linear-gradient(#f5ae68, #e0823a); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 30px rgba(233, 137, 58, 0.7); }
.scroll-hint:focus-visible { outline: 2px solid var(--bone); outline-offset: 4px; }
.scroll-hint::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid rgba(243, 176, 113, 0.9); opacity: 0; pointer-events: none;
}
.scroll-hint.pressed { animation: hint-press 0.45s ease-out; }
.scroll-hint.pressed::after { animation: hint-ring 0.6s ease-out; }
.scroll-hint.show { display: flex; }
@media (prefers-reduced-motion: no-preference) {
  .scroll-hint.show:not(.pressed) { animation: hint-bob 1.8s ease-in-out infinite; }
}
@keyframes hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(9px); }
}
@keyframes hint-press {
  0% { transform: scale(1); }
  35% { transform: scale(0.86); }
  100% { transform: scale(1); }
}
@keyframes hint-ring {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.9); }
}

html:not(.no-scroll) .logo { width: min(520px, 92%); }
.no-scroll .hero {
  box-sizing: border-box;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-top: 64px; padding-bottom: 40px;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 22px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  color: var(--bone); background: rgba(26, 34, 40, 0.85);
  border: 1px solid var(--line); border-radius: 10px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { border-color: var(--bone-dim); transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.btn-primary {
  color: #2a1608;
  background: linear-gradient(#f0a35a, #d9772f);
  border-color: #f3b071;
}
.btn-primary:hover { background: linear-gradient(#f5ae68, #e0823a); }
.btn small {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px; background: rgba(42, 22, 8, 0.18);
}
.btn-icon { width: 46px; padding: 0; justify-content: center; }
.btn-icon svg { display: block; }
.btn-icon:hover { color: #fff; border-color: #8a93f0; background: rgba(88, 101, 242, 0.32); }
.btn-mail:hover { color: #fff; border-color: #f3b071; background: rgba(217, 119, 47, 0.32); }
.btn.soon { cursor: default; }
.btn.soon:hover { transform: none; }

.embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.embers span {
  position: absolute; bottom: 18%;
  width: 4px; height: 4px; border-radius: 50%;
  background: #ffb36b; box-shadow: 0 0 8px 2px rgba(255, 140, 50, 0.65);
  opacity: 0;
  animation: rise var(--d, 7s) linear var(--delay, 0s) infinite;
}
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 0.9; }
  100% { transform: translate(var(--dx, 20px), -60vh); opacity: 0; }
}

.intro, .laws, .closing {
  width: min(760px, calc(100% - 32px));
  margin: 56px auto 0; text-align: center;
}
h2 {
  font: 600 clamp(1.5rem, 3.6vw, 2.1rem)/1.25 var(--serif);
  color: var(--bone); margin: 0 0 0.5em;
}
.intro p, .laws > p, .closing p { color: var(--bone-dim); margin: 0 auto; max-width: 36em; }

.features {
  width: min(1060px, calc(100% - 32px));
  margin: 48px auto 0;
  display: grid; gap: clamp(36px, 6vw, 64px);
}
.feature {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(20px, 4vw, 44px);
  align-items: center;
}
.feature:nth-child(even) { grid-template-columns: 1fr 1.25fr; }
.feature:nth-child(even) img { order: 2; }
.feature img {
  width: 100%; border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}
.feature h3 {
  font: 600 clamp(1.25rem, 2.8vw, 1.6rem)/1.25 var(--serif);
  margin: 0 0 0.4em; color: var(--bone);
}
.feature h3::before {
  content: ""; display: block; width: 36px; height: 2px; margin-bottom: 14px;
  background: linear-gradient(90deg, var(--ember), transparent);
}
.feature p { margin: 0; color: var(--bone-dim); }

.laws { width: min(1120px, calc(100% - 32px)); }
.eyebrow {
  margin: 0 auto 6px !important;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ember) !important;
}
.law-cards {
  list-style: none; padding: 0; margin: 34px 0 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px;
}
.law-card {
  position: relative; text-align: center;
  padding: 24px 16px 22px; border-radius: 14px;
  color: var(--ink);
  background: #e6d3b0 url("img/parchment.webp") center / 320px;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(120, 84, 48, 0.28),
    inset 0 0 28px rgba(120, 80, 40, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.law-card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(233, 137, 58, 0.55),
    inset 0 0 28px rgba(120, 80, 40, 0.28);
}
.law-card img { width: 88px; height: 88px; filter: drop-shadow(0 5px 5px rgba(60, 35, 15, 0.35)); }
.law-card h3 { font: 700 1.04rem/1.25 var(--serif); margin: 10px 0 8px; color: var(--ink); }
.law-card p { margin: 0; font: italic 0.93rem/1.45 var(--serif); color: var(--ink-soft); }
.law-dots { display: none; justify-content: center; gap: 8px; margin-top: 2px; }
.law-dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(201, 187, 161, 0.3); cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.law-dots button.on { background: var(--ember); transform: scale(1.15); }
.laws-note {
  margin-top: 24px !important; font-size: 0.93rem;
  color: var(--bronze) !important;
}

.closing { margin-top: 84px; }
.clearing {
  position: relative;
  max-width: 900px; margin: 0 auto 28px;
  aspect-ratio: 1000 / 440;
}
.clearing::before {
  content: ""; position: absolute; left: 50%; bottom: -4%;
  width: 104%; height: 72%; transform: translateX(-50%);
  border-radius: 50%;
  background: url("img/meadow.webp") center / 200px;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  filter: brightness(0.82) saturate(0.92);
}
.clearing::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  width: 46%; height: 60%; transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 70%, rgba(233, 137, 58, 0.22), transparent 70%);
  pointer-events: none;
}
.piece {
  position: absolute; left: var(--x); bottom: var(--b); width: var(--w); height: auto; z-index: var(--z, 1);
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.42));
}
.folk { filter: brightness(0.9) drop-shadow(0 5px 3px rgba(0, 0, 0, 0.5)); }
.smokehouse { --x: 0.5%; --b: 30%; --w: 17.1%; }
.lodge { --x: 78.5%; --b: 32%; --w: 20.8%; }
.tree { --x: 12%; --b: 21%; --w: 18.1%; --z: 2; }
.chop { --x: 24.5%; --b: 20%; --w: 6.05%; --z: 3; }
.dance { --x: 38.5%; --b: 26%; --w: 6.48%; --z: 3; }
.torch { --x: 46.5%; --b: 8%; --w: 6.67%; --z: 5; }
.bush { --x: 63%; --b: 16.5%; --w: 11.9%; --z: 4; }
.forage { --x: 55.8%; --b: 15.5%; --w: 8.05%; --z: 5; }
.flint { --x: 71%; --b: 5%; --w: 13.4%; --z: 4; }
.mine { --x: 82.2%; --b: 5%; --w: 9%; --z: 5; }
.closing-actions { margin-top: 24px; }

@media (max-width: 980px) {
  .law-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

footer {
  position: relative; z-index: 2;
  text-align: center; padding: 64px 16px 40px;
  font-size: 0.86rem; color: rgba(201, 187, 161, 0.7);
}

.leaves { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.leaves img {
  position: absolute; top: -60px; width: var(--w, 26px);
  opacity: 0.75;
  animation: fall var(--d, 18s) linear var(--delay, 0s) infinite;
}
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(var(--sway, 40px), 27vh) rotate(90deg); }
  50% { transform: translate(0, 55vh) rotate(180deg); }
  75% { transform: translate(var(--sway, 40px), 82vh) rotate(270deg); }
  100% { transform: translate(0, 110vh) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .embers, .leaves { display: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .scroll { margin-top: 70px; }
  .feature, .feature:nth-child(even) { grid-template-columns: 1fr; }
  .feature div { text-align: center; }
  .feature h3::before { margin-left: auto; margin-right: auto; }
  .feature img { width: 100%; }
  .feature:nth-child(even) img { order: 0; }
  .law-cards {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    scroll-padding-inline: 4px; scrollbar-width: none;
    margin: 26px -4px 0; padding: 6px 4px 24px;
  }
  .law-cards::-webkit-scrollbar { display: none; }
  .law-card { flex: 0 0 calc(50% - 6px); scroll-snap-align: start; padding: 18px 12px 16px; }
  .law-card:hover { transform: none; }
  .law-card img { width: 72px; height: 72px; }
  .law-dots { display: flex; }
  .clearing { aspect-ratio: 1000 / 580; }
  .hut, .dance { display: none; }
  .tree { --x: 1%; --b: 20%; --w: 25%; }
  .chop { --x: 18.5%; --b: 18%; --w: 8.4%; }
  .torch { --x: 33%; --b: 4%; --w: 9.3%; }
  .forage { --x: 45%; --b: 17%; --w: 11.2%; }
  .bush { --x: 55%; --b: 18%; --w: 16.5%; }
  .flint { --x: 66%; --b: 3%; --w: 18.6%; }
  .mine { --x: 82%; --b: 3%; --w: 12.5%; }
}
