/* =========================================================
   Patterns section — "You promise yourself..."
   ========================================================= */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.patterns {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(45% 70% at 28% 50%, rgba(110, 30, 210, .35), transparent 70%),
    radial-gradient(30% 35% at 100% 58%, rgba(90, 20, 170, .32), transparent 70%),
    linear-gradient(180deg, rgba(5, 3, 7, 0) 0px, rgba(5, 3, 7, 0) 150px, #0b0416 380px, #0d0519 60%, #07030d 100%);   /* transparent top lets the hero's zodiac circle complete behind it */
  isolation: isolate;
}
.patterns::before {           /* faint star dust */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 34% 78%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 58% 14%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1px 1px at 82% 86%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1px 1px at 92% 30%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1px 1px at 46% 46%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 6% 64%, rgba(255,255,255,.45), transparent 60%);
  animation: pTwinkle 6s ease-in-out infinite alternate;
}

.patterns__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(16px, 3vw, 40px) clamp(24px, 3vw, 48px);   /* top was 96–130px to make room for the (removed) thread */
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);   /* image left, copy right */
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

/* ---------- copy ---------- */
.patterns__title {
  font-family: "Crimson Text", Georgia, serif;
  font-weight: 400;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1.16;
  letter-spacing: -.01em;
  color: #f7f3fb;
}
.pline { display: block; overflow: hidden; padding-bottom: .06em; }
.pline > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease, cubic-bezier(.22,1,.36,1));
}
.pline:nth-child(2) > span { transition-delay: .12s; }
.pline:nth-child(3) > span { transition-delay: .24s; }
.patterns.is-in .pline > span { transform: none; }

/* word-level interaction (headline split by patterns.js) */
.patterns__title { perspective: 900px; }
.patterns__title.is-split { transform-style: preserve-3d; transition: transform .6s var(--ease, ease); }
.patterns__title.is-split .pline { overflow: visible; }
.patterns__title.is-split .pline > span { transform: none; transition: none; }
.pword {
  position: relative;
  display: inline-block;
  cursor: default;
  opacity: 0;
  transform: translateY(.45em) rotateX(-55deg);   /* no blur in the reveal: a blur transition per element re-rasterises every frame and made reveals stutter */
  transform-origin: 50% 100%;
  transition:
    opacity .9s var(--ease, ease) calc(var(--w) * 70ms),
    transform .9s var(--ease, ease) calc(var(--w) * 70ms),
    color .35s, text-shadow .5s var(--ease, ease);
}
.patterns.is-in .pword { opacity: 1; filter: none; transform: none; }
/* hover: lift, gold, and a trail of repeating echoes */
.patterns.is-in .pword:hover {
  color: #ffe2ad;
  transform: translateY(-6px);
  transition-delay: 0s;
  text-shadow:
    0 0 18px rgba(247, 196, 124, .55),
    10px 6px 0 rgba(170, 100, 255, .35),
    20px 12px 0 rgba(170, 100, 255, .2),
    30px 18px 0 rgba(170, 100, 255, .1);
}
/* accent word */
.pword--accent {
  font-style: italic;
  color: #f6d9a4;
  padding-right: .06em;
}
.pword--accent svg {
  position: absolute;
  left: -2%; bottom: -.12em;
  width: 104%; height: .32em;
  overflow: visible;
  pointer-events: none;
}
.pword--accent svg path {
  fill: none;
  stroke: #f7c47c;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  filter: drop-shadow(0 0 4px rgba(247, 196, 124, .7));
  transition: stroke-dashoffset 1.3s var(--ease, ease) 1.1s;
}
.patterns.is-in .pword--accent svg path { stroke-dashoffset: 0; }
.patterns.is-in .pword--accent:hover svg path { animation: pRedraw 1s var(--ease, ease); }

.patterns__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 26px;
  color: #e9d6ff;
}
.patterns__divider svg {
  width: 12px; height: 12px;
  opacity: 0;
  transform: scale(0) rotate(-90deg);
  transition: transform .8s .5s var(--ease, ease), opacity .5s .5s;
  filter: drop-shadow(0 0 6px rgba(200, 150, 255, .9));
}
.patterns__divider span {
  display: block;
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, rgba(233, 214, 255, .9), rgba(233, 214, 255, 0));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s .65s var(--ease, ease);
}
.patterns.is-in .patterns__divider svg { opacity: 1; transform: none; animation: pSpark 3s 1.6s ease-in-out infinite; }
.patterns.is-in .patterns__divider span { transform: scaleX(1); }

.patterns__text {
  font-family: var(--sans, "Inter", sans-serif);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.5;
  color: #e4dcec;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s .9s, transform 1s .9s var(--ease, ease);
}
.patterns.is-in .patterns__text { opacity: 1; transform: none; }
.patterns__text em {
  font-style: normal;
  background: linear-gradient(90deg, #e4dcec 0%, #e4dcec 40%, #ffd89a 50%, #e4dcec 60%, #e4dcec 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.patterns.is-in .patterns__text em { animation: pSweep 4.5s 2s ease-in-out infinite; }
.dots i { font-style: normal; display: inline-block; animation: pDot 1.6s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }

/* ---------- infinity visual ---------- */
.patterns__visual {
  order: -1;
  position: relative;
  perspective: 1200px;
}
.infinity {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 480;
  transform-style: preserve-3d;
  transform: rotateX(18deg);
  cursor: pointer;
  opacity: 0;
  scale: .92;
  transition: opacity 1.4s .2s var(--ease, ease), scale 1.6s .2s var(--ease, ease);
  will-change: transform;
}
.patterns.is-in .infinity { opacity: 1; scale: 1; }
.infinity__back, .infinity__svg {
  position: absolute; inset: 0;
  display: block; width: 100%; height: 100%;
  overflow: visible; pointer-events: none;
}
.infinity__back { z-index: 0; }
.infinity__svg { z-index: 2; }
.infinity__art {
  position: absolute;
  z-index: 1;
  left: 5%; top: 0;
  width: 90%;
  aspect-ratio: 1200 / 799;
  transform-style: preserve-3d;
  animation: pFloat 6s ease-in-out infinite;
}
.infinity__img {
  display: block;
  width: 100%; height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 0 26px rgba(138, 61, 255, .4));
  transition: filter .6s var(--ease, ease);
}
/* light sweep travelling across the artwork, clipped to its shape */
.infinity__sweep {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 236, 200, .55) 48%, rgba(255, 255, 255, .8) 50%, rgba(255, 236, 200, .55) 52%, transparent 65%);
  background-size: 260% 100%;
  background-position: 130% 0;
  -webkit-mask: var(--art) center / 100% 100% no-repeat;
  mask: var(--art) center / 100% 100% no-repeat;
  mix-blend-mode: screen;
  animation: pSheen 5.5s 1.5s ease-in-out infinite;
}
/* chakra pulse over the meditating figure */
.infinity__chakra {
  position: absolute;
  left: 50%; top: 27%;
  width: 11%; aspect-ratio: 1 / 1.6;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 220, 160, .55), rgba(190, 120, 255, .25) 55%, transparent);
  mix-blend-mode: screen;
  animation: pChakra 3.2s ease-in-out infinite;
}
.infinity:hover .infinity__img {
  filter: brightness(1.12) saturate(1.1) drop-shadow(0 0 34px rgba(170, 100, 255, .7)) drop-shadow(0 0 10px rgba(255, 200, 120, .35));
}
.infinity:hover .infinity__sweep { animation-duration: 2.2s; }
.infinity.is-burst .infinity__img {
  filter: brightness(1.4) drop-shadow(0 0 44px rgba(255, 210, 150, .8));
  transition-duration: .15s;
}

.infinity__back circle, .infinity__back line { fill: none; stroke: rgba(210, 180, 255, .12); stroke-width: 1; }
.infinity__back .tick { stroke: rgba(210, 180, 255, .2); }
.inf-sparks circle { fill: #ffe7b8; }

.inf-burst {
  fill: none;
  stroke: #ffe1a8;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: pBurst 1.1s var(--ease, ease) forwards;
}

/* ---------- keyframes ---------- */
@keyframes pTwinkle { from { opacity: .5; } to { opacity: 1; } }
@keyframes pSpark   { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.35) rotate(45deg); } }
@keyframes pSweep   { 0% { background-position: 100% 0; } 60%, 100% { background-position: 0% 0; } }
@keyframes pDot     { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes pFloat   { 0%, 100% { translate: 0 var(--rise, 0px); } 50% { translate: 0 calc(var(--rise, 0px) - 10px); } }
@keyframes pSheen   { 0% { background-position: 130% 0; } 55%, 100% { background-position: -30% 0; } }
@keyframes pChakra  { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes pRedraw  { 0% { stroke-dashoffset: 220; } 100% { stroke-dashoffset: 0; } }
@keyframes pBurst   { from { opacity: 1; transform: scale(.2); } to { opacity: 0; transform: scale(3.2); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .patterns__inner { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .patterns__visual { order: 0; max-width: 620px; width: 100%; margin: 0 auto; }   /* text first on mobile */
}

@media (prefers-reduced-motion: reduce) {
  .pword { opacity: 1 !important; filter: none !important; transform: none !important; }
  .pword--accent svg path { stroke-dashoffset: 0 !important; }
  .pline > span, .patterns__text, .patterns__divider svg, .patterns__divider span, .infinity {
    transform: none !important; opacity: 1 !important; scale: 1 !important;
  }
}
