/* ── 14 · Embroidery: stitched by scroll ──────────────────────────────── */
#embroidery {
  isolation: isolate;            /* lets the thread sit behind the page content */
  padding: 0;
  overflow: clip;
}
/* a soft linen weave under everything */
#embroidery .emb__weave {
  position: absolute; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(122, 88, 58, .045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(122, 88, 58, .04) 0 1px, transparent 1px 4px);
}

/* the running stitch + needle */
#embroidery .emb__thread { position: absolute; left: 0; top: 0; z-index: -1; overflow: visible; pointer-events: none; }
#embroidery .emb__thread path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#embroidery .emb__thread-reveal { stroke: #fff; stroke-width: 16px; }
#embroidery .emb__thread-line { stroke: var(--pink); stroke-width: 4.2px; stroke-dasharray: 17 12; }
#embroidery .emb__thread-shade { stroke: var(--pink-deep); stroke-width: 4.2px; stroke-dasharray: 17 12; transform: translate(.6px, 1.8px); opacity: .45; }
#embroidery .emb__thread-shine { stroke: rgba(255, 255, 255, .6); stroke-width: 1.3px; stroke-dasharray: 9 20; stroke-dashoffset: -3; }

#embroidery .emb__needle {
  position: absolute; left: 0; top: 0; z-index: 3;
  width: clamp(84px, 8.4vw, 124px);
  pointer-events: none;
  filter: drop-shadow(1px 3px 2px rgba(58, 42, 42, .25));
}
#embroidery .emb__needle svg { width: 100%; height: auto; overflow: visible; }
#embroidery .nd-body { fill: url(#emb-steel); stroke: var(--ink); stroke-width: 1.2px; stroke-linejoin: round; }
#embroidery .nd-eye { fill: #f5ebdc; stroke: var(--ink); stroke-width: .9px; }
#embroidery .nd-shine { stroke: #fff; stroke-width: 1px; stroke-linecap: round; opacity: .9; fill: none; }
#embroidery .nd-tail { stroke: var(--pink); stroke-width: 3.4px; stroke-linecap: round; fill: none; }

/* ── blocks ── */
#embroidery .emb__block { position: relative; padding: clamp(100px, 13vh, 150px) var(--gutter) clamp(50px, 7vh, 90px); }
#embroidery .emb__block--adorned { min-height: 100vh; min-height: 100svh; }
#embroidery .emb__block--meadow { padding-top: clamp(50px, 8vh, 100px); padding-bottom: clamp(40px, 6vh, 70px); }

/* brush ribbons, like the PDF's pink swirls */
#embroidery .emb__ribbon { position: absolute; z-index: -2; opacity: .88; }
#embroidery .emb__ribbon path { stroke-width: 26; }
#embroidery .emb__ribbon--a { right: -2.5vw; top: 0; height: 100%; width: 22vw; }
#embroidery .emb__ribbon--b { left: -3vw; top: -2%; width: 19vw; height: 36%; }
#embroidery .emb__ribbon--c { right: -3vw; bottom: 3%; width: 18vw; height: 62%; }

/* ── title row ── */
#embroidery .emb__head { display: flex; align-items: flex-end; gap: clamp(16px, 2.4vw, 40px); }
#embroidery .emb__title {
  position: relative; display: inline-block;
  font-size: clamp(50px, 9.2vw, 148px);
  line-height: .9;
  padding-bottom: .16em; /* room for the cross-stitch row */
}
#embroidery .emb__title .ch { position: relative; }
#embroidery .emb__glyph {
  display: inline-block;
  /* satin-stitch thread texture inside each letter */
  background: repeating-linear-gradient(118deg, #e27ea1 0 2.6px, #ee9fbb 2.6px 3.8px, #d76d93 3.8px 5.4px);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  transform-origin: 50% 100%;
}
#embroidery .emb__x {
  position: absolute; left: 50%; top: calc(100% - .02em);
  width: .16em; height: .16em; translate: -50% 0;
  overflow: visible; fill: none; pointer-events: none;
  stroke: var(--pink-deep); stroke-width: 2.6px; stroke-linecap: round;
}
#embroidery .emb__x path { vector-effect: non-scaling-stroke; }

#embroidery .emb__spool {
  position: relative; z-index: 4;
  width: clamp(48px, 5vw, 76px); padding: 0; margin: 0 0 1.4vw;
  background: none; border: 0; cursor: pointer;
  rotate: 8deg;
  transition: rotate .5s var(--ease-bounce);
}
#embroidery .emb__spool:hover { rotate: -4deg; }
#embroidery .emb__spool svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(2px 5px 4px rgba(58, 42, 42, .22)); }
#embroidery .sp-wood { fill: #e8bb84; stroke: var(--ink); stroke-width: 2.4px; stroke-linejoin: round; }
#embroidery .sp-thread { fill: var(--pink); }
#embroidery .sp-edge { fill: none; stroke: var(--ink); stroke-width: 2.4px; }
#embroidery .sp-wind { fill: none; stroke: var(--pink-deep); stroke-width: 1.6px; stroke-linecap: round; }
#embroidery .sp-hole { fill: #8b5e3c; }
#embroidery .sp-shine { stroke: rgba(255, 255, 255, .55); stroke-width: 3px; stroke-linecap: round; fill: none; }

/* ── 18 · two columns ── */
#embroidery .emb__grid {
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: clamp(24px, 3vw, 56px); align-items: start;
  margin-top: clamp(14px, 3vh, 40px);
}
#embroidery .emb__copy { padding-top: clamp(8px, 3vh, 40px); position: relative; }
#embroidery .emb__name {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(26px, 2.5vw, 40px); line-height: 1.05;
  color: var(--ink); margin: 0 0 .55em;
}
#embroidery .emb__name--center { text-align: center; }
#embroidery .emb__text { font-size: var(--t-body); line-height: 1.6; max-width: 33em; margin: 0; }
#embroidery .emb__hint {
  display: flex; align-items: center; gap: 10px;
  margin: 1.4em 0 0; font-size: clamp(16px, 1.15vw, 19px); color: var(--ink-soft);
}
#embroidery .emb__hint .dd { width: 46px; height: 12px; flex: none; rotate: -12deg; }
#embroidery .emb__hint-tap { display: none; }
@media (hover: none) {
  #embroidery .emb__hint-hover { display: none; }
  #embroidery .emb__hint-tap { display: inline; }
}

/* ── stages: artwork + stitch callouts ── */
#embroidery .emb__stage { position: relative; }
#embroidery .emb__arrows { position: absolute; left: 0; top: 0; z-index: 2; overflow: visible; pointer-events: none; }
#embroidery .emb__arrows path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#embroidery .emb__arrows .halo { stroke: var(--card); stroke-width: 7px; opacity: .9; }
#embroidery .emb__arrows .ink { stroke: var(--ink); stroke-width: 2.6px; transition: stroke .3s; }
#embroidery .emb__arrows .is-on .ink { stroke: var(--pink-deep); }

#embroidery .emb__art { position: relative; margin: 0 auto; }
#embroidery .emb__art img { width: 100%; }
#embroidery .emb__art--adorned { width: 50%; rotate: -2.5deg; margin-top: 2%; }
#embroidery .emb__art--adorned img { filter: drop-shadow(0 18px 20px rgba(58, 42, 42, .3)) drop-shadow(0 3px 3px rgba(58, 42, 42, .16)); }

/* pearl-headed sewing pins holding the piece */
#embroidery .emb__pin {
  position: absolute; z-index: 3; top: 3.6%; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff 0 18%, var(--pink-soft) 40%, var(--pink) 100%);
  box-shadow: 0 0 0 1.5px var(--ink), 2px 4px 4px rgba(58, 42, 42, .3);
}
#embroidery .emb__pin::after { /* the shaft */
  content: ''; position: absolute; left: 50%; top: 60%; width: 2px; height: 26px;
  background: linear-gradient(#cfcbd2, #8f8995); transform-origin: 50% 0; rotate: 32deg;
  border-radius: 2px; z-index: -1;
}
#embroidery .emb__pin--l { left: 6%; }
#embroidery .emb__pin--r { right: 6%; background: radial-gradient(circle at 35% 32%, #fff 0 18%, #fbe7b0 40%, var(--butter) 100%); }
#embroidery .emb__pin--r::after { rotate: -28deg; }

/* hover-drawn scribble rings (hidden until a stitch is picked) */
#embroidery .emb__ring {
  position: absolute; z-index: 2; left: var(--l); top: var(--t); width: var(--w); height: var(--h);
  overflow: visible; visibility: hidden; pointer-events: none;
  stroke-width: 5px; filter: drop-shadow(0 0 1.5px rgba(255, 250, 243, .95));
}

/* callout tags: tiny sewn-on labels */
#embroidery .emb__tags { position: static; }
#embroidery .emb__tag {
  position: absolute; z-index: 3; left: var(--x); top: var(--y); rotate: var(--r);
  font-family: var(--font-hand); font-size: clamp(18px, 1.45vw, 23px); line-height: 1.1; color: var(--ink);
  white-space: nowrap; cursor: pointer;
  background: var(--card); border: 0; border-radius: 7px;
  padding: .42em .9em .48em;
  box-shadow: 0 1px 0 rgba(58, 42, 42, .06), 0 8px 16px -9px rgba(58, 42, 42, .38);
  transition: color .25s, background .25s, translate .45s var(--ease-bounce), box-shadow .3s;
}
#embroidery .emb__tag::before { /* stitched edge */
  content: ''; position: absolute; inset: 4px; border-radius: 4px;
  border: 1.6px dashed rgba(226, 126, 161, .8); pointer-events: none;
}
#embroidery .emb__tag--right { left: auto; right: var(--x); }
#embroidery .emb__tag:hover, #embroidery .emb__tag.is-on, #embroidery .emb__tag:focus-visible {
  color: var(--pink-deep); background: #fff; translate: 0 -3px;
  box-shadow: 0 1px 0 rgba(58, 42, 42, .06), 0 14px 22px -10px rgba(199, 90, 128, .5);
}

/* ── 19 · the meadow, on a linen mount hung from a nail ── */
#embroidery .emb__stage--meadow { padding-top: clamp(56px, 8vh, 84px); margin-top: clamp(6px, 2vh, 24px); }
#embroidery .emb__art--meadow { width: min(56%, 92vh); transform-origin: 50% calc(clamp(56px, 8vh, 84px) * -.82); }
#embroidery .emb__hang { position: absolute; left: 16%; right: 16%; bottom: 100%; height: calc(clamp(56px, 8vh, 84px) * .86); }
#embroidery .emb__string { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#embroidery .emb__string path { fill: none; stroke: var(--ink-soft); stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#embroidery .emb__nail {
  position: absolute; left: 50%; top: 0; width: 13px; height: 13px; translate: -50% -40%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f4f2f2, #8f8995 70%);
  box-shadow: 0 0 0 1.5px var(--ink), 1px 3px 3px rgba(58, 42, 42, .3);
}
#embroidery .emb__mount {
  position: relative;
  padding: 5.2%;
  background-color: #efe2cb;
  background-image:
    repeating-linear-gradient(0deg, rgba(122, 88, 58, .085) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(122, 88, 58, .07) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 60%);
  box-shadow: var(--shadow-paper);
  border-radius: 3px;
}
#embroidery .emb__mount::after { /* running stitch around the mount */
  content: ''; position: absolute; inset: 2.1%; border: 2px dashed var(--pink); border-radius: 2px; pointer-events: none; opacity: .9;
}
#embroidery .emb__frame { position: relative; }
#embroidery .emb__frame img { filter: drop-shadow(0 8px 8px rgba(58, 42, 42, .28)); }

#embroidery .emb__curl { position: absolute; z-index: 2; width: clamp(50px, 4.6vw, 72px); height: auto; right: 19%; bottom: -8%; rotate: 8deg; }

#embroidery .emb__text--center { text-align: center; margin: clamp(30px, 5vh, 56px) auto 0; max-width: 44em; }

/* the tomato pincushion at the end of the thread */
#embroidery .emb__cushion {
  position: relative; z-index: 4; display: block;
  width: clamp(96px, 9vw, 140px); margin: clamp(14px, 3vh, 30px) 9% 0 auto;
  padding: 0; background: none; border: 0; cursor: pointer;
}
#embroidery .emb__cushion svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(2px 8px 6px rgba(58, 42, 42, .22)); }
#embroidery .pc-body { fill: #e86f8f; stroke: var(--ink); stroke-width: 2.4px; }
#embroidery .pc-seam { fill: none; stroke: #c4506f; stroke-width: 1.8px; stroke-linecap: round; }
#embroidery .pc-leaf { fill: var(--sage); stroke: var(--ink); stroke-width: 2px; stroke-linejoin: round; }
#embroidery .pc-stem { fill: none; stroke: var(--ink); stroke-width: 2.4px; stroke-linecap: round; }
#embroidery .pc-shine { fill: none; stroke: rgba(255, 255, 255, .6); stroke-width: 4px; stroke-linecap: round; }
#embroidery .pc-pin { stroke: #8f8995; stroke-width: 2.2px; stroke-linecap: round; }
#embroidery .pc-head { stroke: var(--ink); stroke-width: 1.6px; }
#embroidery .pc-head--b { fill: var(--sky); }
#embroidery .pc-head--t { fill: var(--butter); }
#embroidery .pc-head--l { fill: var(--lavender); }

/* ── Phones & narrow tablets: stacked, callouts listed under the art ── */
@media (max-width: 899px) {
  #embroidery .emb__block { padding: 96px var(--gutter) 40px; }
  #embroidery .emb__block--adorned { min-height: 0; }
  #embroidery .emb__block--meadow { padding-top: 56px; }
  #embroidery .emb__head { position: relative; display: block; }
  #embroidery .emb__title { font-size: min(12.4vw, 92px); }
  #embroidery .emb__spool { position: absolute; right: 0; top: -58px; width: 42px; margin: 0; }
  #embroidery .emb__grid { grid-template-columns: 1fr; gap: 28px; margin-top: 10px; }
  #embroidery .emb__copy { padding-top: 0; }
  #embroidery .emb__name { font-size: 27px; }
  #embroidery .emb__text { font-size: 18px; }
  #embroidery .emb__text--center { text-align: left; }
  #embroidery .emb__hint { font-size: 16px; }

  #embroidery .emb__arrows, #embroidery .emb__curl { display: none; }
  #embroidery .emb__art--adorned { width: min(84%, 420px); margin-top: 6px; }
  #embroidery .emb__stage--meadow { padding-top: 54px; }
  #embroidery .emb__art--meadow { width: 100%; transform-origin: 50% -46px; }
  #embroidery .emb__hang { height: 46px; }
  #embroidery .emb__tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; margin-top: 22px; }
  #embroidery .emb__tag { position: relative; left: auto; right: auto; top: auto; font-size: 18px; }
  #embroidery .emb__ribbon--a { width: 34vw; height: 60%; right: -12vw; }
  #embroidery .emb__ribbon--b { width: 34vw; left: -12vw; height: 28%; }
  #embroidery .emb__ribbon--c { width: 30vw; right: -10vw; height: 40%; }
  #embroidery .emb__cushion { width: 92px; margin-right: 6%; }
}
