/* =====================================================================
   Sashin & Ornessa — Save the Date: the wedding card.
   Where its wording sits, how its artwork moves, and what continues the
   picture past the card's edges once it fills the screen.  Everything
   the two save-the-date pages share is in ../styles.css.
   ===================================================================== */

/* ---------------------------------------------------------------------
   Artwork layers (their boxes come from ../assets/art/layers.css)
   --------------------------------------------------------------------- */
.art-leaves { transform-origin: 0% 100%; }
.art-garland-left, .art-garland-right { transform-origin: 50% 0%; }

.sway-leaves      { animation: sway-leaves 9s ease-in-out infinite; }
.sway-leaves-b    { animation: sway-leaves 11s ease-in-out -4s infinite; }
.sway-garland-a   { animation: pendulum 5.2s ease-in-out infinite alternate; }
.sway-garland-b   { animation: pendulum 4.3s ease-in-out -1.6s infinite alternate; }
.sway-garland-c   { animation: pendulum 4.8s ease-in-out -3.1s infinite alternate; }
@keyframes sway-leaves {
  0%, 100% { transform: scale(1.03) rotate(0deg) skewX(0deg); }
  50%      { transform: scale(1.035) rotate(-.6deg) skewX(.5deg); }
}
@keyframes pendulum {
  from { transform: rotate(-1.4deg); }
  to   { transform: rotate(1.4deg); }
}

/* ---------------------------------------------------------------------
   Typography — measured from the original design
   --------------------------------------------------------------------- */
.card-text > * { padding-left: 2.2%; }
.lotus-top { top: 10.9%; left: 50.7%; right: auto; width: 7cqw;   height: 5.6cqw; margin-left: -3.5cqw; padding: 0; }
.lotus-mid { top: 50.0%; left: 50.7%; right: auto; width: 6.2cqw; height: 5cqw;   margin-left: -3.1cqw; padding: 0; }
.title  { top: 17.44%; font-size: 4.2cqw;  font-weight: 600; letter-spacing: .24em; text-indent: .24em; }
.sub    { top: 21.26%; font-size: 2.05cqw; letter-spacing: .34em; }
.name   { font-size: 4.6cqw; font-weight: 600; letter-spacing: .09em; text-indent: .09em; }
.name-1 { top: 25.87%; }
.name-2 { top: 33.23%; }
.amp    { top: 28.9%;  font-size: 6.4cqw; font-style: italic; font-weight: 500; text-transform: none; color: var(--gold-dark); letter-spacing: 0; }
.date   { top: 41.25%; font-size: 3.25cqw; letter-spacing: .22em; text-indent: .22em; }
.venue  { top: 44.3%;  font-size: 2.25cqw; letter-spacing: .19em; line-height: 1.34; }
.follow { top: 54.25%; font-size: 1.65cqw; letter-spacing: .335em; }
.tagline {
  top: 61.9%; left: 80.3%; right: auto; width: 30cqw; margin-left: -15cqw; padding: 0;
  font-size: 1.75cqw; letter-spacing: .35em; line-height: 1.95;
}
.rule { display: block; height: 1.5px; background: var(--gold-dark); padding: 0; right: auto; left: 50.7%; }
.rule-1 { top: 38.75%; width: 5.6cqw; margin-left: -2.8cqw; }
.rule-2 { top: 74.05%; left: 80.3%; width: 3.8cqw; margin-left: -1.9cqw; }

.lotus-top { --d: .08s; } .title { --d: .3s; } .sub { --d: .54s; } .name-1 { --d: .78s; }
.amp { --d: .99s; } .name-2 { --d: 1.17s; } .rule-1 { --d: 1.41s; } .date { --d: 1.59s; }
.venue { --d: 1.8s; } .lotus-mid { --d: 2.01s; } .follow { --d: 2.22s; } .tagline { --d: 2.46s; } .rule-2 { --d: 2.76s; }

/* ---------------------------------------------------------------------
   Full-bleed extensions (fade in as the card fills the screen)
   --------------------------------------------------------------------- */
.ext-wall {
  position: absolute;
  inset: 0;
  background-color: var(--wall-top);
  background-image:
    url('../assets/art/wall-strip.png'),
    linear-gradient(to bottom, var(--art-top) 0, var(--art-top) var(--card-top),
                    var(--art-bottom) var(--card-top), var(--art-bottom) calc(var(--card-top) + var(--card-h)),
                    var(--wall-bottom) 100%);
  background-repeat: no-repeat, no-repeat;
  background-size: 100% var(--card-h), 100% 100%;
  background-position: 0 var(--card-top), 0 0;
}
/* portrait phones: garland strands continue above the art box */
.ext-tile {
  position: absolute;
  top: 0;
  height: var(--card-top);
  background-repeat: repeat-y;
  background-size: 100% auto;
  display: none;
}
.ext-tile-left  { left: calc(var(--card-left) + var(--card-w) * var(--garland-left-tile-x));  width: calc(var(--card-w) * var(--garland-left-tile-w));  background-image: url('../assets/art/garland-left-tile.webp'); }
.ext-tile-right { left: calc(var(--card-left) + var(--card-w) * var(--garland-right-tile-x)); width: calc(var(--card-w) * var(--garland-right-tile-w)); background-image: url('../assets/art/garland-right-tile.webp'); }
.stage.fit-w .ext-tile { display: block; }
/* portrait phones: the marble floor continues below the art as a soft reflection */
.ext-floor {
  position: absolute;
  display: none;
  top: calc(var(--card-top) + var(--card-h));
  left: var(--card-left);
  width: var(--card-w);
  height: calc(var(--card-h) * .14);
  background: url('../assets/art/base.webp') left bottom / var(--card-w) var(--card-h) no-repeat;
  transform: scaleY(-1);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0));
  mask-image: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0));
}
.stage.fit-w .ext-floor { display: block; }

/* landscape screens: pillar continues, extra garland and leaves fill the sides */
.ext-pillar, .ext-garland, .ext-leaves { display: none; }
.stage.fit-h .ext-pillar, .stage.fit-h .ext-garland, .stage.fit-h .ext-leaves { display: block; }
.ext-pillar {
  position: absolute;
  top: var(--card-top);
  left: calc(var(--card-left) + var(--card-w));
  width: calc(var(--card-w) * .084);
  height: var(--card-h);
  background-image: url('../assets/art/base.webp');
  background-size: var(--card-w) var(--card-h);
  background-position: right top;
  transform: scaleX(-1);
}
.ext-garland {
  position: absolute;
  top: var(--card-top);
  left: calc(var(--card-left) + var(--card-w) * 1.30);
  width: calc(var(--card-w) * var(--garland-right-w));
  height: calc(var(--card-h) * var(--garland-right-h));
  background: url('../assets/art/garland-right.webp') center/100% 100% no-repeat;
  transform-origin: 50% 0;
}
.ext-leaves {
  position: absolute;
  left: 0;
  bottom: calc(100% - var(--card-top) - var(--card-h) * var(--leaves-h));
  width: calc(var(--card-w) * var(--leaves-w) * 1.28);
  height: calc(var(--card-h) * var(--leaves-h) * 1.28);
  background: url('../assets/art/leaves.webp') left bottom/100% 100% no-repeat;
  transform-origin: 0 100%;
}

/* Stills and reduced motion: the leaves hold the size they sway at */
html.debug .art-leaves { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .art-leaves { transform: scale(1.03); }
}
