.story-main { min-height: 65vh; }
.story-yarn-trail { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 15; overflow: hidden; pointer-events: none; fill: none; stroke-linecap: round; }
.yarn-orbit { stroke: #b37b76; stroke-width: 1.4; stroke-dasharray: 3 11; opacity: .2; animation: yarn-orbit 32s linear infinite !important; }
.yarn-orbit-sage { stroke: #71836e; stroke-dasharray: 2 17; opacity: .15; animation-direction: reverse !important; animation-duration: 43s !important; }
.yarn-cursor-segment { fill: none; stroke: #a76f69; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body[data-story-motion-paused="true"] .yarn-orbit { animation-play-state: paused !important; }
@keyframes yarn-orbit { to { stroke-dashoffset: -448; } }
.story-section { padding: 30px 20px 88px; }
.story-heading { max-width: 700px; margin: 0 auto 28px; text-align: center; }
.story-heading h1 { margin: 0 0 14px; font-size: clamp(42px, 6.4vw, 68px); line-height: 1.02; }
.story-intro { max-width: 480px; margin: 0 auto; color: #697065; line-height: 1.8; }
.story-play-area { width: min(100%, 900px); margin-inline: auto; }
.sticker-guidance { margin: 0 auto 13px; color: var(--sage); font-family: var(--serif); font-size: 15px; font-style: italic; text-align: center; }
.story-board {
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(100%, 860px);
  grid-template-columns: minmax(64px, 1fr) minmax(0, 540px) minmax(64px, 1fr);
  grid-template-rows: 68px auto 68px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-inline: auto;
  padding: clamp(20px, 3.2vw, 36px);
  border: 1px solid rgba(53, 70, 59, .2);
  background: #eee7dc;
  box-shadow: 0 16px 38px rgba(53, 70, 59, .08);
}
.story-board::before {
  position: absolute;
  z-index: 0;
  inset: 10px;
  border: 1px dashed rgba(179, 123, 118, .68);
  content: '';
  pointer-events: none;
}
.story-board::after {
  position: absolute;
  z-index: 0;
  top: -9px;
  left: 50%;
  width: 74px;
  height: 20px;
  background: rgba(213, 161, 154, .62);
  content: '';
  transform: translateX(-50%) rotate(-2deg);
  clip-path: polygon(4% 0, 97% 4%, 100% 100%, 0 94%);
  pointer-events: none;
}
.instagram-panel { position: relative; z-index: 1; grid-area: 2 / 2; width: min(100%, 540px); min-width: 0; margin-inline: auto; text-align: center; }
.embed-status { min-height: 1.7em; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.instagram-media, .instagram-panel > iframe.instagram-media { display: block; width: 100% !important; max-width: 540px !important; min-width: 0 !important; margin: 0 auto 18px !important; overflow: hidden; border: 1px solid rgba(53, 70, 59, .12) !important; border-radius: 3px; background: #fff !important; box-shadow: 0 12px 35px rgba(53, 70, 59, .07); }
.instagram-media iframe, .instagram-panel > iframe.instagram-media { width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
.instagram-fallback { min-height: 235px; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 28px 18px; color: var(--ink); }
.instagram-fallback img { width: 54px; height: 54px; object-fit: contain; }
.instagram-fallback p { margin: 0; color: #697065; font-family: var(--serif); font-size: 20px; }
.instagram-fallback a, .instagram-direct-link { color: var(--rose-dark); font-size: 13px; font-weight: 600; text-decoration: none; }
.instagram-fallback a:hover, .instagram-direct-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.instagram-direct-link { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid rgba(179, 123, 118, .48); border-radius: 2px; }
.story-sticker {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 66px);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  padding: 5px;
  translate: var(--pointer-sticker-x, 0px) var(--pointer-sticker-y, 0px);
  rotate: var(--pointer-sticker-rotation, 0deg);
  border: 1px dashed rgba(146, 93, 89, .58);
  border-radius: 48% 52% 45% 55%;
  background: var(--sticker-paper, #fffaf1);
  box-shadow: 0 5px 13px rgba(53, 70, 59, .11);
  cursor: pointer;
  transition: translate 220ms ease-out, rotate 220ms ease-out, transform 240ms cubic-bezier(.3, 1.45, .45, 1), box-shadow 220ms ease;
}
.story-sticker:hover { z-index: 2; transform: translateY(-4px) rotate(5deg) scale(1.08); box-shadow: 0 9px 17px rgba(53, 70, 59, .14); }
.story-sticker:active { transform: translateY(0) rotate(-4deg) scale(.96); }
.story-sticker:focus-visible { z-index: 3; outline: 2px solid var(--rose-dark); outline-offset: 4px; }
.sticker-art { display: grid; width: 100%; height: 100%; place-items: center; animation: sticker-float 4.6s ease-in-out infinite; }
.sticker-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sticker-yarn { grid-area: 1 / 1; --sticker-paper: #f7e5df; }
.sticker-loop-heart { grid-area: 1 / 2; border-radius: 44% 56% 53% 47%; --sticker-paper: #fbf0e9; }
.sticker-daisy { grid-area: 1 / 3; border-radius: 55% 45% 48% 52%; --sticker-paper: #f6edda; }
.sticker-star { grid-area: 2 / 1; border-radius: 54% 46% 51% 49%; --sticker-paper: #f8edda; }
.sticker-hook { grid-area: 2 / 3; border-radius: 46% 54% 44% 56%; --sticker-paper: #e8ede3; }
.sticker-loop { grid-area: 3 / 1; border-radius: 55% 45% 55% 45%; --sticker-paper: #e8ede3; }
.sticker-bloom { grid-area: 3 / 2; border-radius: 48% 52% 53% 47%; --sticker-paper: #f7e5df; }
.sticker-skein { grid-area: 3 / 3; border-radius: 53% 47% 45% 55%; --sticker-paper: #f6edda; }
.sticker-yarn { --parallax-x-factor: -.78; --parallax-y-factor: -1; --parallax-rotation-factor: 1; }
.sticker-loop-heart { --parallax-x-factor: .92; --parallax-y-factor: -.72; --parallax-rotation-factor: -.8; }
.sticker-daisy { --parallax-x-factor: -1.12; --parallax-y-factor: -.84; --parallax-rotation-factor: .9; }
.sticker-star { --parallax-x-factor: 1.12; --parallax-y-factor: .76; --parallax-rotation-factor: -1.1; }
.sticker-hook { --parallax-x-factor: -.92; --parallax-y-factor: .64; --parallax-rotation-factor: .9; }
.sticker-loop { --parallax-x-factor: .78; --parallax-y-factor: 1.08; --parallax-rotation-factor: -.8; }
.sticker-bloom { --parallax-x-factor: 1.08; --parallax-y-factor: .86; --parallax-rotation-factor: 1.1; }
.sticker-skein { --parallax-x-factor: -.82; --parallax-y-factor: 1; --parallax-rotation-factor: -.9; }
.sticker-yarn .sticker-art { animation-duration: 4.2s; animation-delay: -1.4s; }
.sticker-loop-heart .sticker-art { animation-duration: 5.1s; animation-delay: -.5s; }
.sticker-daisy .sticker-art { animation-duration: 4.6s; animation-delay: -2.2s; }
.sticker-star .sticker-art { animation-duration: 3.8s; animation-delay: -1s; }
.sticker-hook .sticker-art { animation-duration: 5.4s; animation-delay: -2.8s; }
.sticker-loop .sticker-art { animation-duration: 4.4s; animation-delay: -.2s; }
.sticker-bloom .sticker-art { animation-duration: 5s; animation-delay: -3.1s; }
.sticker-skein .sticker-art { animation-duration: 4.1s; animation-delay: -2.5s; }
.story-board[data-motion-paused="true"] .sticker-art { animation-play-state: paused; }
.story-board[data-motion-paused="true"] .stitch-burst { animation-play-state: paused; }
.story-board[data-motion-paused="true"] .story-sticker { transition-duration: 0s; }
.stitch-burst {
  position: absolute;
  z-index: 4;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: var(--rose-dark);
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 1px 0 #fffaf1;
  transform: translate(-50%, -50%);
  animation: stitch-pop 760ms cubic-bezier(.2, .85, .25, 1) both;
  pointer-events: none;
}
.stitch-burst::before, .stitch-burst::after { position: absolute; color: var(--sage); font-size: 12px; content: '✦'; }
.stitch-burst::before { top: -9px; left: -7px; }
.stitch-burst::after { right: -7px; bottom: -7px; color: var(--rose); content: '✧'; }
.story-controls { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 18px; width: min(100%, 860px); margin: 10px auto 0; }
.sticker-feedback { min-height: 1.6em; margin: 0; color: #697065; font-family: var(--serif); font-size: 14px; font-style: italic; }
.motion-toggle { min-height: 44px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; border: 1px solid rgba(179, 123, 118, .55); border-radius: 999px; background: #fffaf1; color: var(--rose-dark); font-size: 11px; font-weight: 600; cursor: pointer; }
.motion-toggle:hover { background: #f8eae4; }
.motion-toggle:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: 3px; }
.motion-toggle-icon { width: 17px; color: var(--sage); font-size: 13px; line-height: 1; text-align: center; }
@keyframes sticker-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
@keyframes stitch-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.35) rotate(-15deg); } 25% { opacity: 1; transform: translate(-50%, -65%) scale(1.2) rotate(8deg); } 100% { opacity: 0; transform: translate(-50%, -135%) scale(.84) rotate(16deg); } }
@media (max-width: 800px) {
  .story-board { grid-template-columns: repeat(4, minmax(44px, 1fr)); grid-template-rows: auto auto auto; gap: 8px; padding: 18px 14px; }
  .instagram-panel { grid-area: 2 / 1 / 3 / -1; }
  .sticker-yarn { grid-area: 1 / 1; }
  .sticker-loop-heart { grid-area: 1 / 2; }
  .sticker-daisy { grid-area: 1 / 3; }
  .sticker-star { grid-area: 1 / 4; }
  .sticker-hook { grid-area: 3 / 1; }
  .sticker-loop { grid-area: 3 / 2; }
  .sticker-bloom { grid-area: 3 / 3; }
  .sticker-skein { grid-area: 3 / 4; }
}
@media (max-width: 650px) {
  .story-section { padding: 26px 14px 64px; }
  .story-heading { margin-bottom: 23px; }
  .story-heading h1 { font-size: clamp(42px, 10vw, 54px); }
  .story-intro { max-width: 340px; }
  .story-board { gap: 7px; padding: 16px 12px; }
  .instagram-media { border-radius: 3px; }
  .story-sticker { padding: 4px; }
  .story-controls { align-items: flex-start; flex-direction: column-reverse; gap: 8px; padding-inline: 2px; }
  .sticker-feedback { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html.motion-opt-in .sticker-art { animation-duration: 4.6s !important; animation-iteration-count: infinite !important; }
  html.motion-opt-in .stitch-burst { animation-duration: 760ms !important; animation-iteration-count: 1 !important; }
  html:not(.motion-opt-in) .story-sticker { transition: none; }
  html:not(.motion-opt-in) .sticker-art, html:not(.motion-opt-in) .stitch-burst { animation: none; }
}
