/* Backwoods Carpentry | Crown Trail & Carpenter's Hammer | 2026-10-20 */
:root {
  --royal-line: rgba(205, 162, 91, .34);
  --royal-glow: #f2d49c;
}

/* The right-side rail echoes the two-crown hammer crest without replacing the native scrollbar. */
.royal-scroll-rail {
  position: fixed;
  top: max(102px, 12vh);
  right: 14px;
  bottom: 38px;
  width: 30px;
  z-index: 45;
  pointer-events: none;
  opacity: .94;
  transition: opacity .25s ease;
  contain: layout style;
}
.royal-scroll-rail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--royal-line) 9%, var(--royal-line) 91%, transparent);
  transform: translateX(-50%);
}
.royal-rail-fill {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 0;
  transform: translateX(-50%);
  border-radius: 10px;
  background: linear-gradient(to bottom, #926837, #f3d7a3 54%, #b88342);
  box-shadow: 0 0 9px rgba(246, 201, 122, .52);
  will-change: height;
}
.royal-rail-stamp {
  position: absolute;
  left: 50%;
  width: 17px;
  height: 15px;
  opacity: .21;
  color: #caa067;
  transform: translate(-50%, -50%) scale(.88);
  transition: opacity .35s ease, transform .35s ease, filter .35s ease;
}
.royal-rail-stamp svg { width: 100%; height: 100%; overflow: visible; }
.royal-rail-stamp.is-passed {
  opacity: .76;
  filter: drop-shadow(0 0 4px rgba(239, 194, 116, .42));
  transform: translate(-50%, -50%) scale(1);
}
.royal-rail-rider {
  position: absolute;
  left: 50%;
  top: 0;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: #f0cb8b;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px rgba(246, 196, 107, .46));
  will-change: top;
}
.royal-rail-rider::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, #17140e 22%, rgba(17, 14, 9, .90) 48%, rgba(17, 14, 9, .0) 74%);
}
.royal-rail-rider svg { width: 28px; height: 22px; overflow: visible; }

/* The hammer is a real SVG illustration, scrubbed directly by scroll position. */
.royal-hammer-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 44;
  visibility: hidden;
  contain: layout style;
}
.royal-hammer-stage.is-visible { visibility: visible; }
.royal-hammer-actor {
  position: absolute;
  left: 0;
  top: 40%;
  width: clamp(155px, 18vw, 240px);
  height: auto;
  opacity: 0;
  transform: translate3d(-230px, -50%, 0);
  will-change: transform, opacity;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .28)) drop-shadow(0 0 8px rgba(218, 170, 93, .16));
}
.royal-hammer-illustration { width: 100%; height: auto; display: block; transform: rotate(-17deg); }
.royal-hammer-actor.is-reversed .royal-hammer-illustration { transform: scaleX(-1) rotate(-17deg); }
.royal-hammer-streak {
  position: absolute;
  width: min(16vw, 175px);
  min-width: 54px;
  height: 2px;
  top: 54%;
  right: 67%;
  border-radius: 20px;
  background: linear-gradient(90deg, transparent 2%, rgba(194, 142, 73, .16) 25%, rgba(246, 203, 135, .8) 90%, transparent);
  box-shadow: 0 0 12px rgba(228, 181, 105, .2);
  transform: rotate(-12deg);
}
.royal-hammer-actor.is-reversed .royal-hammer-streak { right: auto; left: 67%; transform: rotate(12deg); background: linear-gradient(270deg, transparent 2%, rgba(194, 142, 73, .16) 25%, rgba(246, 203, 135, .8) 90%, transparent); }
.royal-hammer-impact {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 88px;
  height: 88px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}
.royal-hammer-impact::before,
.royal-hammer-impact::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(237, 190, 113, .7);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(241, 183, 94, .24), inset 0 0 17px rgba(241, 183, 94, .13);
}
.royal-hammer-impact::after { inset: 30px; background: rgba(255, 216, 141, .24); border-color: rgba(255, 216, 141, .85); }
.royal-hammer-impact i {
  position: absolute;
  left: 50%; top: 50%;
  width: 2px; height: 22px;
  border-radius: 4px;
  transform-origin: center -4px;
  background: linear-gradient(transparent, #f6d39a, transparent);
  filter: drop-shadow(0 0 3px #c79851);
}
.royal-hammer-impact i:nth-child(1) { transform: rotate(0deg) translateY(-37px); }
.royal-hammer-impact i:nth-child(2) { transform: rotate(45deg) translateY(-37px); }
.royal-hammer-impact i:nth-child(3) { transform: rotate(90deg) translateY(-37px); }
.royal-hammer-impact i:nth-child(4) { transform: rotate(135deg) translateY(-37px); }
.royal-hammer-impact i:nth-child(5) { transform: rotate(180deg) translateY(-37px); }
.royal-hammer-impact i:nth-child(6) { transform: rotate(225deg) translateY(-37px); }
.royal-hammer-impact i:nth-child(7) { transform: rotate(270deg) translateY(-37px); }
.royal-hammer-impact i:nth-child(8) { transform: rotate(315deg) translateY(-37px); }

@media (max-width: 800px) {
  .royal-scroll-rail { right: 5px; top: 82px; bottom: 27px; width: 23px; opacity: .8; }
  .royal-rail-rider { width: 25px; height: 25px; }
  .royal-rail-rider svg { width: 23px; height: 19px; }
  .royal-rail-stamp { width: 12px; height: 11px; }
  .royal-hammer-actor { width: clamp(112px, 25vw, 162px); }
  .royal-hammer-impact { width: 60px; height: 60px; }
}
@media (max-width: 420px) {
  .royal-scroll-rail { right: 1px; top: 72px; bottom: 22px; opacity: .72; }
  .royal-rail-stamp { opacity: .12; }
  .royal-hammer-actor { width: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .royal-hammer-stage { display: none !important; }
  .royal-rail-rider, .royal-rail-fill, .royal-rail-stamp { transition: none !important; }
}

/* Photoreal, split-claw carpenter hammer: retain the original crown progress rail. */
.royal-hammer-actor { width: clamp(136px, 16.5vw, 225px); }
.royal-hammer-illustration {
  display: block; width: 100%; height: auto;
  transform: none;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.40)) drop-shadow(0 0 8px rgba(214,163,87,.17));
}
.royal-hammer-actor.is-reversed .royal-hammer-illustration { transform: scaleX(-1); }
@media(max-width:800px) { .royal-hammer-actor { width: clamp(110px, 26vw, 157px); } }
@media(max-width:420px) { .royal-hammer-actor { width: 117px; } }
