/* =========================================================
   Single CSS Flower – Chrome-safe scroll trigger version
   - Animations start STOPPED by default
   - View Timeline path = .has-view-timeline (added by JS)
   - Fallback path     = .in-view (added by JS via IO)
   ========================================================= */

/* Scoped to .scf so it won't affect the entire site */
.scf *, .scf *::after, .scf *::before{
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.scf{
  /* local stage to center the flower */
  background-image: var(--color-bg);
  min-height: 200px;
  display: flex;
  justify-content: center;
  align-items: end;
  overflow: hidden;
  /* IMPORTANT: no content-visibility here, it breaks view timelines in Chrome */
}

.scf .flower{
  position: relative;
}

/* (glass kept for completeness; not rendered in the shortcode) */
.scf .flower__glass{
  width:20vmin;
  height: 30vmin;
  background-image: var(--color-glass);
  clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
  opacity: .8;
  position: relative;
}
.scf .flower__glass::after{
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2vmin;
}
.scf .flower__glass::before{
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  background-image: var(--color-water);
  width: 100%;
  height: 15vmin;
}

.scf .f-wrapper{
  position: absolute;
  bottom: 2vmin;
}

.scf .f-wrapper--2{
  left: 50%;
  bottom: 5%;
  transform-origin: 10% left;
  transform: rotate(20deg);
}

.scf .f-wrapper--3{
  left: 30%;
  bottom: 5%;
  transform-origin: 10% left;
  transform: rotate(-10deg);
}

.scf .f-wrapper--3 .flower__line{
  height: 45vmin;
  position: relative;
}
.scf .f-wrapper--3 .flower__line::after{
  content: '';
  position: absolute;
  left:0;
  top: 0;
  width: 6vmin;
  height: 6vmin;
  transform: translate(-69%,-30%) rotate(-5deg);
  border-radius:10vmin 10vmin 0 0;
  border: 2vmin solid  #104d4e;
  border-bottom: transparent;
  border-left: transparent;
}
.scf .f-wrapper--3 .flower__line::before{
  content: '';
  position: absolute;
  left:-40%;
  top: -1%;
  width: 6vmin;
  height: 2vmin;
  transform-origin: right;
  transform: translate(-100%,-80%) rotate(-20deg);
  border-radius: 2vmin;
}
.scf .f-wrapper--3 .flower__line{
  background-image: linear-gradient(to top,#142544,#104d4e);
}

.scf .f-wrapper--2 .flower__line{ height: 45vmin; }
.scf .f-wrapper--2 .f{ transform: translateX(-50%) rotate(20deg); }
.scf .f-wrapper--3 .f{ transform: translate(-350%,-50%) rotate(-120deg); }

.scf .f-wrapper--2 .flower__leaf:not(:first-child){
  width: 3.8vmin;
  height: 10vmin;
  background-image: linear-gradient(to bottom, #ff43b6 ,#c22887, #1a233a 99%);
}
.scf .f-wrapper--3 .flower__leaf:not(:first-child){
  width: 3.8vmin;
  height: 10vmin;
  background-image: linear-gradient(to bottom, #ad2be0 ,#712291, #1a233a 99%);
}
.scf .f-wrapper--3 .flower__leaf--1{
  width: 8vmin;
  height: 10vmin;
  bottom: 2vmin;
  background-color: #ad2be0;
}
.scf .f-wrapper--2 .flower__leaf--1{
  width: 8vmin;
  height: 10vmin;
  bottom: 2vmin;
  background-color: #de118b;
}

.scf .flower__line{
  width: 2vmin;
  height: 56vmin;
  background-image: linear-gradient(to left top,#82fdff 20%,#142544,#104d4e);
  border-radius: 4vmin;
}

.scf .f{
  position: absolute;
  top: 1vmin;
  left: 50%;
  transform: translateX(-50%) rotate(-10deg);
  width: 2vmin;
  height: 2vmin;
}

/* --------- START STOPPED (no animation until triggered) --------- */
.scf .flower__leaf{
  position: absolute;
  left: 50%;
  bottom: 2vmin;
  transform: translateX(-50%);
  width: 6vmin;
  height: 14vmin;
  background-image: linear-gradient(to bottom, #ffa085 ,#fa7373, #8c181b 99%);
  clip-path: ellipse(50% 50% at 50% 50%);
  transform-origin: center bottom;
  animation: none !important; /* was: open-flower 2s 1s backwards */
}

.scf .flower__leaf--1{
  width: 8vmin;
  height: 12vmin;
  bottom: 3vmin;
  border-radius: 50% 50% 50% 50% / 80% 80% 20% 20%;
  background-image: linear-gradient(to bottom, #fa7373 ,#d14d2f, #731b1e, #8c181b 99%);
  /* background-color: #e24f5f; */
  animation: none !important; /* was: open-flowe--middle 1.4s 1s backwards */
}
.scf .flower__leaf--2{ transform: translateX(-50%) rotate(-30deg); }
.scf .flower__leaf--3{ transform: translateX(-50%) rotate(-50deg); }
.scf .flower__leaf--4{ transform: translateX(-50%) rotate(-70deg); }
.scf .flower__leaf--5{ transform: translateX(-50%) rotate(30deg);  }
.scf .flower__leaf--6{ transform: translateX(-50%) rotate(50deg);  }
.scf .flower__leaf--7{ transform: translateX(-50%) rotate(70deg);  }

.scf .flower__leaf--8{
  width: 13vmin;
  height: 11vmin;
  bottom: 6vmin;
  left: -30%;
  clip-path: none;
  border-radius: 10vmin 2vmin 10vmin 2vmin;
  transform: rotate(-55deg);
  background-image: linear-gradient(to left bottom, #ffa085 ,#eb8b8b,#492f2f 98%);
}

/* Optional extra animations (falling petals) – unchanged */
.scf .flower__fall-down--yellow{
  animation: flower-fall-down-yellow  8s 1.2s linear forwards;
}
.scf .flower__fall-down--pink{
  animation: flower-fall-down-pink  5s 1.2s linear forwards;
}
.scf .flower__fall-down--purple{
  bottom: 4vmin;
  animation:flower-fall-down-purple  6s 1.2s linear forwards, flower-falling 6s 7.2s linear infinite;
}

/* --- one-blossom overrides (kept) --- */
.scf .flower__glass,
.scf .flower__line,
.scf .f-wrapper--2,
.scf .f-wrapper--3 { display: none !important; }

.scf .f-wrapper{ position: static !important; }
.scf .f{
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: 2vmin;
  height: 2vmin;
}

/* Mobile: make the flower much larger (~80% of container) */
@media (max-width: 768px) {
  .scf {
    min-height: 45vh;           /* give it room so it doesn't get clipped */
  }
  .scf .flower {
    transform-origin: center bottom;
    transform: scale(1.8);      /* tweak 1.6–2.0 to theme */
  }
}

/* =========================================================
   Scroll trigger – View Timeline path (Chrome/Edge)
   JS adds .has-view-timeline on .scf when supported
   ========================================================= */
.scf.has-view-timeline{
  view-timeline-name: --scf;
  view-timeline-axis: block;
}

.scf.has-view-timeline .flower__leaf{
  animation-name: open-flower !important;
  animation-duration: 1s !important;
  animation-fill-mode: both !important;
  animation-timeline: --scf !important;
  /* Finish around halfway covered for a smoother feel */
  animation-range: entry 0% cover 50% !important;
}
.scf.has-view-timeline .flower__leaf--1{
  animation-name: open-flowe--middle !important;
  animation-duration: .8s !important;
  animation-fill-mode: both !important;
  animation-timeline: --scf !important;
  animation-range: entry 0% cover 35% !important;
}

/* =========================================================
   Scroll trigger – Fallback path (Firefox/Safari today)
   IO adds .in-view; only runs when NOT using view timeline
   ========================================================= */
.scf.in-view:not(.has-view-timeline) .flower__leaf{
  animation: open-flower 1s ease-out both !important;
}
.scf.in-view:not(.has-view-timeline) .flower__leaf--1{
  animation: open-flowe--middle .8s ease-out both !important;
}

/* ================== Keyframes (unchanged) ================== */
@keyframes open-flower{
  0%{ transform: translateX(-50%) rotate(0); }
}
@keyframes open-flowe--middle {
  0%{
    opacity: 0;
    transform: translateX(-50%) scale(0);
  }
}
@keyframes flower-fall-down-pink {
  0%{ transform: rotate(-55deg); }
  50%{ transform: rotateX(-100deg); }
  100%{ transform:translate(2vmin,28vmin); }
}
@keyframes flower-fall-down-yellow {
  0%{ transform: rotate(-55deg); }
  50%{ bottom: 3vmin; transform: rotateX(-100deg); }
  100%{ transform:translate(2vmin,70vmin) rotate(150deg); }
}
@keyframes flower-fall-down-purple {
  0%{ transform: rotate(-50deg); }
  25%{ bottom: 1vmin ; transform: rotateX(-100deg); perspective: 0px; }
  50%{ perspective: 0px; transform:translate(-30vmin,2vmin) rotate(90deg); }
  75%{ perspective: 0px; transform:translate(-34vmin,-2vmin); }
  100%{ transform-origin: center; transform:translate(-34vmin,-2vmin) rotateY(-80deg) rotateX(35deg); }
}
@keyframes flower-falling {
  0%,100%{ transform-origin: center; transform:translate(-34vmin,-2vmin) rotateY(-80deg) rotateX(35deg); }
  25%{    transform-origin: center; transform:translate(-34.4vmin,-2vmin) rotateY(-84deg) rotateX(35deg); }
  50%{    transform-origin: center; transform:translate(-32vmin,-4.2vmin) rotateY(-80deg) rotateX(35deg); }
  75%{    transform-origin: center; transform:translate(-36vmin,1.1vmin) rotateY(-80deg) rotateX(35deg); }
}
