.weekly-story {
  --story-ink: #111116;
  --story-paper: #fff8ea;
  --story-accent: #f3ff57;
  --story-secondary: #6bf6ff;
  --story-coral: #ff4f72;
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
  color: var(--story-paper);
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(243, 255, 87, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(255, 79, 114, 0.13), transparent 38%),
    rgba(255, 250, 240, 0.06);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.15);
}

.weekly-story::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 250, 240, 0.8) 0.7px, transparent 0.7px);
  background-size: 13px 13px;
}

.weekly-story > * {
  position: relative;
  z-index: 1;
}

.weekly-story__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.weekly-story__kicker {
  margin: 0 0 5px;
  color: var(--story-accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weekly-story__title {
  max-width: 28ch;
  margin: 0;
  color: var(--story-paper);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 950;
}

.weekly-story__meta {
  margin: 6px 0 0;
  color: rgba(255, 250, 240, 0.58);
  font-size: 11px;
}

.weekly-story__badge {
  flex: 0 0 auto;
  padding: 6px 8px;
  color: var(--story-ink);
  font-size: 10px;
  font-weight: 950;
  border-radius: 6px;
  background: var(--story-accent);
}

.weekly-story__identity {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 250, 240, 0.13);
  border-radius: 9px;
  background: rgba(11, 11, 13, 0.45);
}

.weekly-identity-art {
  position: relative;
  display: grid;
  width: 84px;
  height: 70px;
  place-items: center;
  overflow: hidden;
  color: var(--story-ink);
  border-radius: 8px;
  background: var(--story-secondary);
}

.weekly-identity-art::before,
.weekly-identity-art::after {
  position: absolute;
  content: "";
}

.weekly-identity-art::before {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--story-paper);
  box-shadow: 26px 14px 0 var(--story-coral);
  transform: rotate(-12deg);
}

.weekly-identity-art::after {
  width: 30px;
  height: 9px;
  border: 4px solid var(--story-ink);
  border-top: 0;
  border-radius: 0 0 20px 20px;
  transform: translateY(6px) rotate(-12deg);
}

.weekly-story[data-story-category="city"] .weekly-identity-art {
  background: #79d8cf;
}

.weekly-story[data-story-category="city"] .weekly-identity-art::before {
  width: 62px;
  height: 34px;
  border-radius: 5px 5px 0 0;
  background: var(--story-paper);
  box-shadow: 17px -15px 0 #f3b33d, 34px 7px 0 #4a6f9d;
  transform: translateY(16px) rotate(-4deg);
}

.weekly-story[data-story-category="city"] .weekly-identity-art::after {
  width: 70px;
  height: 4px;
  border: 0;
  border-radius: 0;
  background: var(--story-coral);
  transform: translateY(26px) rotate(-4deg);
}

.weekly-story[data-story-category="sm"] .weekly-identity-art {
  background: #c87a91;
}

.weekly-story[data-story-category="sm"] .weekly-identity-art::before {
  width: 43px;
  height: 43px;
  background: #f4d8c3;
  box-shadow: 24px 17px 0 #9d2637;
  transform: rotate(10deg);
}

.weekly-story[data-story-category="sm"] .weekly-identity-art::after {
  width: 52px;
  height: 14px;
  border: 4px solid var(--story-ink);
  border-radius: 8px;
  transform: translateY(9px) rotate(10deg);
}

.weekly-story__identity small,
.weekly-story__identity strong,
.weekly-story__identity p {
  display: block;
}

.weekly-story__identity small {
  margin-bottom: 4px;
  color: var(--story-accent);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.weekly-story__identity strong {
  color: var(--story-paper);
  font-size: 15px;
  line-height: 1.2;
}

.weekly-story__identity p {
  margin: 5px 0 0;
  color: rgba(255, 250, 240, 0.6);
  font-size: 11px;
  line-height: 1.45;
}

.weekly-story__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.weekly-story__frame {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 188px;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: 8px;
  background: #17171c;
}

.weekly-story__frame:nth-child(2) {
  transform: translateY(8px);
}

.weekly-story__frame:nth-child(3) {
  transform: translateY(-4px);
}

.weekly-story__frame:nth-child(4) {
  transform: translateY(5px);
}

.weekly-story__scene {
  position: relative;
  min-height: 114px;
  overflow: hidden;
  background: var(--story-secondary);
}

.weekly-story__scene::before {
  position: absolute;
  inset: 14px -20px auto auto;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  content: "";
  background: var(--story-accent);
}

.weekly-story__scene::after {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 68px;
  height: 22px;
  content: "";
  border: 3px solid rgba(17, 17, 22, 0.8);
  border-top: 0;
  border-radius: 0 0 50% 50%;
  transform: rotate(-12deg);
}

.weekly-doodle {
  position: absolute;
  inset: 0;
}

.weekly-doodle::before,
.weekly-doodle::after {
  position: absolute;
  content: "";
}

.weekly-doodle::before {
  left: 22px;
  bottom: 14px;
  width: 38px;
  height: 49px;
  border: 5px solid var(--story-ink);
  border-radius: 21px 21px 11px 11px;
  background: var(--story-paper);
  box-shadow: 16px 8px 0 var(--story-coral);
  transform: rotate(-9deg);
  animation: weekly-bob 3.8s ease-in-out infinite;
}

.weekly-doodle::after {
  left: 31px;
  bottom: 60px;
  width: 24px;
  height: 24px;
  border: 5px solid var(--story-ink);
  border-radius: 50%;
  background: var(--story-paper);
  transform: rotate(-9deg);
}

.weekly-story__frame:nth-child(2) .weekly-doodle::before {
  left: auto;
  right: 28px;
  background: var(--story-accent);
  box-shadow: -13px 7px 0 var(--story-paper);
  transform: rotate(12deg);
  animation-delay: -1.3s;
}

.weekly-story__frame:nth-child(2) .weekly-doodle::after {
  left: auto;
  right: 35px;
  transform: rotate(12deg);
}

.weekly-story__frame:nth-child(3) .weekly-doodle::before {
  width: 50px;
  height: 34px;
  bottom: 20px;
  border-radius: 8px;
  background: var(--story-coral);
  box-shadow: 13px -17px 0 var(--story-paper);
  transform: rotate(-5deg);
}

.weekly-story__frame:nth-child(3) .weekly-doodle::after {
  left: 30px;
  bottom: 52px;
  width: 15px;
  height: 15px;
  border-width: 4px;
}

.weekly-story__frame:nth-child(4) .weekly-doodle::before {
  left: 50%;
  bottom: 10px;
  width: 42px;
  height: 58px;
  background: var(--story-secondary);
  box-shadow: 17px 7px 0 var(--story-accent);
  transform: translateX(-50%) rotate(4deg);
}

.weekly-story__frame:nth-child(4) .weekly-doodle::after {
  left: 50%;
  bottom: 66px;
  width: 27px;
  height: 27px;
  transform: translateX(-50%) rotate(4deg);
}

.weekly-story[data-story-category="city"] .weekly-story__scene {
  background: #5f8b61;
}

.weekly-story[data-story-category="city"] .weekly-story__scene::before {
  border-radius: 7px 7px 0 0;
  background: #f3b33d;
  box-shadow: -40px 27px 0 #fff8ea, -80px 44px 0 #4a6f9d;
  transform: rotate(-8deg);
}

.weekly-story[data-story-category="city"] .weekly-story__scene::after {
  width: 110px;
  height: 40px;
  border: 0;
  border-top: 5px solid #fff8ea;
  border-radius: 50%;
  transform: rotate(-10deg);
}

.weekly-story[data-story-category="city"] .weekly-doodle::before {
  width: 58px;
  height: 36px;
  border-radius: 7px 7px 0 0;
  background: #fff8ea;
  box-shadow: 20px -19px 0 #c96552;
  transform: rotate(-7deg);
}

.weekly-story[data-story-category="city"] .weekly-doodle::after {
  left: 37px;
  bottom: 49px;
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 0;
  background: var(--story-ink);
  box-shadow: 20px 0 0 var(--story-ink), 40px 0 0 var(--story-ink);
}

.weekly-story[data-story-category="sm"] .weekly-story__scene {
  background: #79556f;
}

.weekly-story[data-story-category="sm"] .weekly-story__scene::before {
  background: #c87a91;
  box-shadow: -20px 21px 0 #b3833c;
}

.weekly-story[data-story-category="sm"] .weekly-story__scene::after {
  right: 25px;
  bottom: 22px;
  width: 76px;
  height: 38px;
  border-color: #fff8ea;
  transform: rotate(14deg);
}

.weekly-story[data-story-category="sm"] .weekly-doodle::before {
  border-radius: 16px 16px 8px 8px;
  background: #f4d8c3;
  box-shadow: 16px 8px 0 #9d2637;
}

.weekly-story[data-story-category="sm"] .weekly-doodle::after {
  border-radius: 8px;
  background: #b3833c;
}

.weekly-story__caption {
  display: grid;
  gap: 4px;
  padding: 8px 9px 9px;
  background: rgba(11, 11, 13, 0.88);
}

.weekly-story__number {
  color: var(--story-accent);
  font-size: 9px;
  font-weight: 950;
}

.weekly-story__caption strong {
  color: var(--story-paper);
  font-size: 12px;
  line-height: 1.2;
}

.weekly-story__caption p {
  margin: 0;
  color: rgba(255, 250, 240, 0.62);
  font-size: 10px;
  line-height: 1.45;
}

.weekly-story__bubble {
  position: absolute;
  top: 9px;
  left: 9px;
  max-width: 78%;
  padding: 5px 7px;
  color: var(--story-ink);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.2;
  border: 2px solid var(--story-ink);
  border-radius: 6px 6px 6px 1px;
  background: var(--story-paper);
  transform: rotate(-3deg);
}

.weekly-story__frame:nth-child(2) .weekly-story__bubble {
  right: 9px;
  left: auto;
  transform: rotate(3deg);
  border-radius: 6px 6px 1px 6px;
}

.weekly-story__foot {
  margin: 0;
  color: rgba(255, 250, 240, 0.48);
  font-size: 10px;
}

@keyframes weekly-bob {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: 5px; }
}

@media (max-width: 680px) {
  .weekly-story {
    padding: 12px;
  }

  .weekly-story__title {
    font-size: 16px;
  }

  .weekly-story__frame {
    min-height: 174px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .weekly-doodle::before {
    animation: none;
  }
}
