/* ════════════════════════════════════════════════════════════════
   SHUI THREAD — Stitched intro · poster layout
   Top: wordmark · Left: butterfly · Right: copy · Bottom: hint
   Palette + type matched to homepage.
   ════════════════════════════════════════════════════════════════ */
.stitch-intro {
  position: fixed; inset: 0;
  z-index: 99999;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #F7F3ED;
  color: #0D0D0D;
  font-family: 'DM Serif Display', 'Noto Serif SC', Georgia, serif;
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.95s cubic-bezier(0.85, 0, 0.15, 1),
              transform 0.95s cubic-bezier(0.85, 0, 0.15, 1);
}
.stitch-intro.is-leaving {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

/* ─── Parchment cloth ground ─── */
.stitch-intro__cloth {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 45%, #FBF7EE 0%, #F0E9D9 65%, #E7DECC 100%),
    repeating-linear-gradient(90deg, rgba(13,13,13,0.018) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(0deg,  rgba(13,13,13,0.018) 0 1px, transparent 1px 4px);
  background-blend-mode: normal, multiply, multiply;
  z-index: 0;
}

/* ─── Drifting orange thread particles ─── */
.stitch-intro__particles {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
}
.stitch-intro__particles span {
  position: absolute;
  bottom: -10px; left: var(--x);
  width: 2px; height: 2px;
  background: #D94E1F;
  border-radius: 50%;
  opacity: 0;
  filter: blur(0.4px);
  animation: driftUp 14s linear infinite;
  animation-delay: var(--d);
  transform: scale(var(--s));
}
@keyframes driftUp {
  0%   { opacity: 0; transform: translateY(0) scale(var(--s,1)); }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.45; }
  100% { opacity: 0; transform: translateY(-110vh) translateX(20px) scale(var(--s,1)); }
}

/* ─── HEADER (top wordmark) ─── */
.stitch-intro__header {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  gap: 1.2rem;
  padding: 4vh 2rem 0;
  opacity: 0; transform: translateY(-6px);
  transition: opacity 1.2s ease 0.2s, transform 1.2s ease 0.2s;
}
.stitch-intro.is-running .stitch-intro__header {
  opacity: 1; transform: translateY(0);
}
.stitch-intro__brand-en {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.35rem;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: #0D0D0D;
  padding-left: 0.55em;
}
.stitch-intro__brand-sep { color: #D94E1F; font-style: italic; }
.stitch-intro__brand-zh {
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-size: 0.78rem;
  letter-spacing: 0.7em;
  color: #6B6558;
  padding-left: 0.7em;
}

/* ─── POSTER (main two-column split) ─── */
.stitch-intro__poster {
  position: relative; z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 2vh clamp(2rem, 6vw, 6rem);
  min-height: 0;
}

.stitch-intro__col { min-width: 0; }

.stitch-intro__col--art {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.stitch-intro__svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  filter: drop-shadow(0 6px 20px rgba(217,78,31,0.18));
}

.stitch-intro__caption {
  margin-top: 1.2rem;
  font-family: 'Inconsolata', 'Courier New', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #6B6558;
  opacity: 0;
  transition: opacity 1.2s ease 1.1s;
}
.stitch-intro.is-armed .stitch-intro__caption { opacity: 1; }

/* Vertical divider */
.stitch-intro__divider {
  align-self: stretch;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(13,13,13,0.18) 20%, rgba(13,13,13,0.18) 80%, transparent 100%);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 1.6s cubic-bezier(0.85,0,0.15,1) 0.6s;
}
.stitch-intro.is-running .stitch-intro__divider { transform: scaleY(1); }

/* Right column: type */
.stitch-intro__col--copy {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 1.4rem;
  max-width: 32rem;
  pointer-events: none;
}

.stitch-intro__overline {
  font-family: 'Inconsolata', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: #D94E1F;
  opacity: 0;
  transition: opacity 1.1s ease 0.6s;
}
.stitch-intro.is-running .stitch-intro__overline { opacity: 1; }

.stitch-intro__lede {
  margin: 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  line-height: 1.05;
  color: #0D0D0D;
}
.stitch-intro__lede .l1,
.stitch-intro__lede .l2,
.stitch-intro__lede .l3 {
  display: block;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.stitch-intro__lede .l1,
.stitch-intro__lede .l3 {
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  letter-spacing: 0.005em;
  color: #2A2A2A;
}
.stitch-intro__lede .l2 {
  font-style: italic;
  font-size: clamp(3rem, 6vw, 5.4rem);
  letter-spacing: -0.01em;
  color: #D94E1F;
  margin: 0.2rem 0;
  line-height: 1;
}
.stitch-intro.is-armed .l1 { opacity: 1; transform: translateY(0); transition-delay: 0.05s; }
.stitch-intro.is-armed .l2 { opacity: 1; transform: translateY(0); transition-delay: 0.25s; }
.stitch-intro.is-armed .l3 { opacity: 1; transform: translateY(0); transition-delay: 0.45s; }

.stitch-intro__sub {
  margin: 0;
  font-family: 'Noto Serif SC', 'Songti SC', Georgia, serif;
  font-size: clamp(0.85rem, 1.05vw, 0.95rem);
  line-height: 1.7;
  color: #6B6558;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.1s ease 0.85s, transform 1.1s ease 0.85s;
}
.stitch-intro.is-armed .stitch-intro__sub { opacity: 0.92; transform: translateY(0); }

.stitch-intro__enter {
  pointer-events: auto;
  align-self: flex-start;
  margin-top: 0.6rem;
  display: inline-flex; align-items: center; gap: 0.7rem;
  padding: 0.95rem 2.2rem;
  background: #D94E1F;
  color: #FAFAF7;
  border: 1px solid #D94E1F;
  border-radius: 1px;
  font-family: 'Inconsolata', 'Courier New', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.9s ease, transform 0.9s ease,
              background 0.3s, border-color 0.3s, letter-spacing 0.3s, color 0.3s;
}
.stitch-intro__enter:disabled { opacity: 0; cursor: default; }
.stitch-intro.is-armed .stitch-intro__enter {
  opacity: 1; transform: translateY(0); transition-delay: 1.05s;
}
.stitch-intro__enter:hover:not(:disabled) {
  background: #E85D2F;
  border-color: #E85D2F;
  letter-spacing: 0.5em;
}

/* ─── FOOTER hint ─── */
.stitch-intro__footer {
  position: relative; z-index: 3;
  display: flex; justify-content: center;
  padding: 0 2rem 3vh;
  font-family: 'Inconsolata', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #6B6558;
  opacity: 0;
  transition: opacity 1.2s ease 1.3s;
}
.stitch-intro.is-armed .stitch-intro__footer { opacity: 1; }

/* ─── Butterfly stitch animation ─── */
.stitch-intro__butterfly .seg {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
}
.stitch-intro.is-running .stitch-intro__butterfly .seg {
  animation: stitchDraw 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes stitchDraw {
  0%   { stroke-dashoffset: 100; opacity: 0; }
  10%  { opacity: 1; }
  100% { stroke-dashoffset: 0;   opacity: 1; }
}
.stitch-intro.is-running .s-body  { animation-delay: 0.2s; }
.stitch-intro.is-running .s-upL   { animation-delay: 0.9s; }
.stitch-intro.is-running .s-upR   { animation-delay: 0.9s; }
.stitch-intro.is-running .s-loL   { animation-delay: 1.6s; }
.stitch-intro.is-running .s-loR   { animation-delay: 1.6s; }
.stitch-intro.is-running .s-accL  { animation-delay: 2.4s; animation-duration: 0.9s; }
.stitch-intro.is-running .s-accR  { animation-delay: 2.4s; animation-duration: 0.9s; }
.stitch-intro.is-running .s-antL  { animation-delay: 2.8s; animation-duration: 0.8s; }
.stitch-intro.is-running .s-antR  { animation-delay: 2.8s; animation-duration: 0.8s; }

.stitch-intro__butterfly .dot {
  fill: #D94E1F;
  opacity: 0;
  transform-origin: center;
}
.stitch-intro.is-running .stitch-intro__butterfly .dot {
  animation: dotIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.stitch-intro.is-running .d1 { animation-delay: 2.5s; }
.stitch-intro.is-running .d2 { animation-delay: 2.55s; }
.stitch-intro.is-running .d3 { animation-delay: 2.9s; }
.stitch-intro.is-running .d4 { animation-delay: 2.95s; }
.stitch-intro.is-running .d5 { animation-delay: 3.4s; }
.stitch-intro.is-running .d6 { animation-delay: 3.45s; }
@keyframes dotIn {
  0%   { opacity: 0; transform: scale(0); }
  60%  { opacity: 1; transform: scale(1.6); }
  100% { opacity: 1; transform: scale(1); }
}

.stitch-intro.is-armed .stitch-intro__svg {
  animation: butterflyBreathe 4.5s ease-in-out infinite;
}
@keyframes butterflyBreathe {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(217,78,31,0.18)) drop-shadow(0 6px 22px rgba(217,78,31,0.16)); }
  50%      { filter: drop-shadow(0 0 14px rgba(217,78,31,0.4))  drop-shadow(0 8px 28px rgba(217,78,31,0.28)); }
}

/* ─── Film grain (light) ─── */
.stitch-intro__grain {
  position: absolute; inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.6s steps(3) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0,0); }
  33%  { transform: translate(-4%, 3%); }
  66%  { transform: translate(3%, -3%); }
  100% { transform: translate(0,0); }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .stitch-intro, .stitch-intro * {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  .stitch-intro__butterfly .seg { stroke-dashoffset: 0; opacity: 1; }
  .stitch-intro__butterfly .dot { opacity: 1; }
}

/* ─── Mobile: stack to vertical ─── */
@media (max-width: 760px) {
  .stitch-intro__poster {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 2vh 1.4rem;
    gap: 1.4rem;
  }
  .stitch-intro__divider {
    width: 60%; height: 1px;
    justify-self: center;
    background: linear-gradient(90deg, transparent, rgba(13,13,13,0.2), transparent);
    transform: scaleX(0);
  }
  .stitch-intro.is-running .stitch-intro__divider { transform: scaleX(1); }
  .stitch-intro__col--copy {
    align-items: center;
    text-align: center;
    max-width: none;
  }
  .stitch-intro__enter { align-self: center; }
  .stitch-intro__svg { max-width: 280px; }
  .stitch-intro__brand-en  { font-size: 1rem; letter-spacing: 0.45em; }
  .stitch-intro__brand-zh  { font-size: 0.62rem; letter-spacing: 0.55em; }
  .stitch-intro__brand-sep { display: none; }
}
