/* Pilates-specific background options for site-d (exploration, site-d-bg only).
   Switched by a class on <html> (set by assets/js/bg-switch.js from ?bg=NAME):
   bg-springs, bg-rings, bg-reformer, bg-balls, bg-studio. No class = plain.
   Every motif is a static CSS background or a pointer-events:none pseudo-element behind
   content, so nothing can be clicked, nothing moves, and nothing changes the layout.
   Line art stays light enough that secondary text (#6B6259) keeps >= 4.5:1 over it. */

/* Shared: a decorative layer centred on the reel, behind it, following it at every width. */
:is(.bg-rings, .bg-reformer, .bg-studio) .hero { overflow-x: clip; }
:is(.bg-rings, .bg-reformer, .bg-studio) .hero-media { isolation: isolate; }
:is(.bg-rings, .bg-reformer, .bg-studio) .hero-media::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  background-repeat: no-repeat;
}

/* ---------------------------------------------------------------- 1. springs
   Her reformer's spring bar: five springs with their handle loops, drawn on the diagonal
   and running off the page edge; one endless coil marks the top of the cream band. */
.bg-springs .hero {
  background: url("../bg/springs.svg") no-repeat left -96px top 206px / 270px auto;
}
.bg-springs .band-cream {
  background:
    url("../bg/spring-edge.svg") repeat-x left 0 top 26px / auto 18px,
    var(--cream);
}
.bg-springs .faq {
  background: url("../bg/springs.svg") no-repeat left -64px top 34px / 200px auto;
}
.bg-springs .site-footer {
  border-top: 0;
  background: url("../bg/spring-edge.svg") repeat-x left 0 top -9px / auto 18px;
}

/* ---------------------------------------------------------------- 2. rings
   Magic circles: one large ring haloing the reel with its two pads showing at the sides,
   and a few more, at other sizes and angles, drifting off the edges. */
.bg-rings .hero-media::before {
  inset: 50% auto auto 50%; width: 152%; aspect-ratio: 1;
  translate: -50% -53%;
  background-image: url("../bg/ring-a.svg"); background-size: contain;
}
.bg-rings .hero {
  background: url("../bg/ring-b.svg") no-repeat left -46px top 198px / 132px auto;
}
.bg-rings .band-cream {
  background:
    url("../bg/ring-b.svg") no-repeat left -122px top 4px / 210px auto,
    var(--cream);
}
.bg-rings .faq {
  background:
    url("../bg/ring-a.svg") no-repeat left -132px top -74px / 250px auto,
    url("../bg/ring-b.svg") no-repeat right 6% top 26px / 64px auto;
}

/* ---------------------------------------------------------------- 3. reformer
   One large, faint line drawing of a reformer: the reel stands on its carriage in the
   hero, and the same machine runs across the top of the cream band, like a watermark. */
.bg-reformer .hero-media::before {
  inset: auto auto 30% 50%; width: 142%; aspect-ratio: 1000 / 216;
  translate: -50% 0;
  background-image: url("../bg/reformer.svg"); background-size: contain;
}
.bg-reformer .band-cream {
  background:
    url("../bg/reformer.svg") no-repeat right -36px top 6px / min(560px, 118%) auto,
    var(--cream);
}

/* ---------------------------------------------------------------- 4. balls
   Soft Pilates balls in blush and cream, half off the edges, like the small ball on her
   reformer. Fills are pale enough to sit behind text. */
.bg-balls .hero {
  background:
    url("../bg/ball-blush.svg") no-repeat left -150px top 228px / 280px auto,
    url("../bg/ball-cream.svg") no-repeat right -96px top 620px / 210px auto;
}
.bg-balls .band-cream {
  background:
    url("../bg/ball-blush.svg") no-repeat left -132px top -96px / 250px auto,
    url("../bg/ball-white.svg") no-repeat right -90px bottom 80px / 220px auto,
    var(--cream);
}
.bg-balls .hila {
  background: url("../bg/ball-cream.svg") no-repeat right -120px top 28px / 250px auto;
}
.bg-balls .faq {
  background: url("../bg/ball-blush.svg") no-repeat left -80px bottom -60px / 200px auto;
}

/* ---------------------------------------------------------------- 5. studio
   A whisper of her oak wall: vertical slats behind the reel, the way her mirrors sit in
   the wood, and a narrow slatted edge at the top of the cream band and the footer. */
.bg-studio .hero-media::before {
  inset: 5% -19% 8%;
  background-image: url("../bg/slats.svg"); background-repeat: repeat-x; background-size: 54px 100%;
  background-position: center;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent),
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent),
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}
.bg-studio .band-cream {
  background:
    linear-gradient(to bottom, rgb(242 234 223 / 0) 0, var(--cream) 46px) no-repeat left top / 100% 46px,
    url("../bg/slats.svg") repeat-x center top / 54px 46px,
    var(--cream);
}
.bg-studio .site-footer {
  border-top: 0;
  background:
    linear-gradient(to bottom, rgb(251 248 244 / 0) 0, var(--paper) 34px) no-repeat left top / 100% 34px,
    url("../bg/slats.svg") repeat-x center top / 54px 34px;
}

/* ---------------------------------------------------------------- wider screens */
@media (min-width: 861px) {
  .bg-springs .hero { background-position: right 46% bottom 36px; background-size: 330px auto; }
  .bg-springs .faq { background-position: left 4% bottom 40px; background-size: 260px auto; }
  .bg-rings .hero { background-position: right 44% top 40px; background-size: 150px auto; }
  .bg-rings .band-cream { background-position: left 3% top 22px, 0 0; background-size: 280px auto, auto; }
  .bg-rings .faq { background-position: left 2% top -60px, right 30% top 60px; background-size: 320px auto, 90px auto; }
  .bg-reformer .band-cream { background-position: left 4% top 10px, 0 0; background-size: 620px auto, auto; }
  .bg-balls .hero { background-position: right -120px top -80px, left 44% bottom -40px; background-size: 360px auto, 240px auto; }
  .bg-balls .band-cream { background-position: left -120px top -90px, right -60px bottom 120px, 0 0; background-size: 380px auto, 220px auto, auto; }
}

/* ---------------------------------------------------------------- demo chip bar
   A review tool, not part of the design: system type, dark glass, fixed at the bottom. */
.bgdemo {
  position: fixed; z-index: 60; inset-inline-start: 50%; bottom: max(10px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: flex; align-items: center; gap: 0; max-width: calc(100% - 12px); padding: 3px;
  overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; background: rgb(32 28 25 / .9); color: #fff;
  box-shadow: 0 6px 24px -8px rgb(0 0 0 / .45);
  font: 600 12px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.bgdemo::-webkit-scrollbar { display: none; }
.bgdemo-label {
  flex: none; padding-inline: 7px 3px; color: rgb(255 255 255 / .6);
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em;
}
.bgdemo-chip {
  flex: none; min-height: 38px; padding-inline: 9px; border: 0; border-radius: 999px;
  background: transparent; color: #fff; font: inherit; cursor: pointer;
}
.bgdemo-chip:hover { background: rgb(255 255 255 / .14); }
.bgdemo-chip[aria-pressed="true"] { background: #fff; color: #201c19; }
.bgdemo-chip:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
html.has-bgdemo body { padding-bottom: 64px; }

/* ---------------------------------------------------------------- current site-d hero
   Desktop: the framed reel is now figure.hero-bg (it was .hero-media), 428px wide at 1440.
   Phones: the reel fills the first screen, so the hero motifs stay hidden behind it, and
   .hero-bg::before is the blur into the page there, so these rules are desktop-only. */
@media (min-width: 861px) {
  :is(.bg-rings, .bg-reformer, .bg-studio) .hero-bg { isolation: isolate; }
  :is(.bg-rings, .bg-reformer, .bg-studio) .hero-bg::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none; background-repeat: no-repeat;
  }
  /* two small rings beside the reel, never hidden behind it (user: the big ring behind the
     video looked like the video had been placed on top of it by mistake) */
  .bg-rings .hero-bg::before {
    inset: -34px -136px 30px -136px;
    background:
      url("../bg/ring-b.svg") no-repeat right 0 top 0 / 104px auto,
      url("../bg/ring-a.svg") no-repeat right 22px top 58% / 76px auto;
  }
  .bg-reformer .hero-bg::before {
    inset: auto auto 30% 50%; width: 142%; aspect-ratio: 1000 / 216; translate: -50% 0;
    background-image: url("../bg/reformer.svg"); background-size: contain;
  }
  .bg-studio .hero-bg::before {
    inset: 5% -19% 8%;
    background-image: url("../bg/slats.svg"); background-repeat: repeat-x; background-size: 54px 100%;
    background-position: center;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent),
      linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent),
      linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
    mask-composite: intersect;
  }
}

/* ---------------------------------------------------------------- more items
   (user: "add a bit more items to the background"). Every option now also marks the why,
   classes, Hila and Instagram sections and the final panel, alternating sides down the page
   and sitting beside the text, never behind the photos. Same faint line weights as above. */

/* springs */
.bg-springs .why { background: url("../bg/springs.svg") no-repeat left -104px top 62% / 250px auto; }
.bg-springs .classes { background: url("../bg/springs.svg") no-repeat right -128px top 26px / 230px auto; }
.bg-springs .hila { background: url("../bg/springs.svg") no-repeat right -112px bottom 40px / 220px auto; }
.bg-springs .ig { background: url("../bg/spring-edge.svg") repeat-x left 0 top 22px / auto 14px, var(--white); }
.bg-springs .final-panel {
  background:
    url("../bg/springs.svg") no-repeat left -72px bottom -42px / 190px auto,
    url("../bg/springs.svg") no-repeat right -98px top -56px / 170px auto,
    var(--cream);
}

/* rings */
.bg-rings .why { background: url("../bg/ring-a.svg") no-repeat left -130px top 60% / 250px auto; }
.bg-rings .classes { background: url("../bg/ring-b.svg") no-repeat right -44px top 34px / 120px auto; }
.bg-rings .hila {
  background:
    url("../bg/ring-a.svg") no-repeat right -112px bottom 28px / 230px auto,
    url("../bg/ring-b.svg") no-repeat left 7% top 18px / 58px auto;
}
.bg-rings .ig { background: url("../bg/ring-b.svg") no-repeat left -58px top 14px / 150px auto, var(--white); }
.bg-rings .final-panel {
  background:
    url("../bg/ring-a.svg") no-repeat right -86px top -76px / 230px auto,
    url("../bg/ring-b.svg") no-repeat left 8% bottom 22px / 54px auto,
    var(--cream);
}

/* reformer: one faint machine per section is plenty */
.bg-reformer .why { background: url("../bg/reformer.svg") no-repeat left -60px bottom 18px / min(500px, 118%) auto; }
.bg-reformer .hila { background: url("../bg/reformer.svg") no-repeat right -60px bottom 18px / min(480px, 112%) auto; }
.bg-reformer .final-panel { background: url("../bg/reformer.svg") no-repeat center bottom 16px / 88% auto, var(--cream); }

/* balls */
.bg-balls .why {
  background:
    url("../bg/ball-cream.svg") no-repeat left -120px top 62% / 230px auto,
    url("../bg/ball-blush.svg") no-repeat right -34px bottom 26px / 84px auto;
}
.bg-balls .classes { background: url("../bg/ball-blush.svg") no-repeat right -112px top 20px / 210px auto; }
.bg-balls .ig { background: url("../bg/ball-cream.svg") no-repeat left -96px top 16px / 190px auto, var(--white); }
.bg-balls .final-panel {
  background:
    url("../bg/ball-white.svg") no-repeat right -50px top -50px / 160px auto,
    url("../bg/ball-blush.svg") no-repeat left -64px bottom -56px / 180px auto,
    var(--cream);
}

/* studio: slatted edges between sections, like her oak wall */
.bg-studio .why, .bg-studio .hila {
  background:
    linear-gradient(to top, rgb(251 248 244 / 0) 0, var(--paper) 40px) no-repeat left bottom / 100% 40px,
    url("../bg/slats.svg") repeat-x center bottom / 54px 40px;
}
.bg-studio .final-panel {
  background:
    linear-gradient(to bottom, rgb(242 234 223 / 0) 0, var(--cream) 46px) no-repeat left top / 100% 46px,
    url("../bg/slats.svg") repeat-x center top / 54px 46px,
    var(--cream);
}

@media (min-width: 861px) {
  .bg-springs .why { background-position: left -60px top 58%; background-size: 320px auto; }
  .bg-springs .classes { background-position: right -90px top 44px; background-size: 300px auto; }
  .bg-springs .hila { background-position: right -70px bottom 56px; background-size: 290px auto; }
  .bg-springs .final-panel { background-size: 250px auto, 220px auto; }
  .bg-rings .why { background-position: left -110px top 56%; background-size: 320px auto; }
  .bg-rings .classes { background-position: right 3% top 50px; background-size: 150px auto; }
  .bg-rings .hila { background-position: right -90px bottom 40px, left 4% top 40px; background-size: 300px auto, 80px auto; }
  .bg-rings .ig { background-position: left -40px top 30px; background-size: 200px auto; }
  .bg-rings .final-panel { background-size: 300px auto, 70px auto; }
  .bg-reformer .why { background-position: left 2% bottom 30px; background-size: 560px auto; }
  .bg-reformer .hila { background-position: right 2% bottom 30px; background-size: 560px auto; }
  .bg-reformer .final-panel { background-size: min(680px, 70%) auto; }
  .bg-balls .why { background-position: left -100px top 58%, right 4% bottom 40px; background-size: 300px auto, 110px auto; }
  .bg-balls .classes { background-position: right -90px top 30px; background-size: 280px auto; }
  .bg-balls .ig { background-position: left -80px top 30px; background-size: 260px auto; }
  .bg-balls .final-panel { background-size: 220px auto, 240px auto; }
}

/* ---------------------------------------------------------------- springs + rings: one design
   (user: "make sure that the springs and rings go in one design, and that they are visible
   with the video behind them"). html.bg-springs.bg-rings: both sets apply; where both mark
   the same section the rings rule (later in this file) wins, and the rules below pick or
   merge so the two alternate down the page. */
.bg-springs.bg-rings .why { background: url("../bg/springs.svg") no-repeat left -104px top 62% / 250px auto; }
.bg-springs.bg-rings .hila { background: url("../bg/springs.svg") no-repeat right -112px bottom 40px / 220px auto; }
.bg-springs.bg-rings .band-cream {
  background:
    url("../bg/spring-edge.svg") repeat-x left 0 top 26px / auto 18px,
    url("../bg/ring-b.svg") no-repeat left -112px top 58px / 200px auto,
    var(--cream);
}
.bg-springs.bg-rings .final-panel {
  background:
    url("../bg/springs.svg") no-repeat left -72px bottom -42px / 190px auto,
    url("../bg/ring-a.svg") no-repeat right -86px top -76px / 230px auto,
    var(--cream);
}

@media (min-width: 861px) {
  .bg-springs.bg-rings .hero { background: url("../bg/springs.svg") no-repeat right 46% bottom 36px / 330px auto; }
  .bg-springs.bg-rings .why { background-position: left -60px top 58%; background-size: 320px auto; }
  .bg-springs.bg-rings .hila { background-position: right -70px bottom 56px; background-size: 290px auto; }
  .bg-springs.bg-rings .band-cream { background-position: left 0 top 26px, left 3% top 60px; background-size: auto 18px, 270px auto; }
  .bg-springs.bg-rings .final-panel { background-size: 250px auto, 300px auto; }
}

/* Contrast fixes (checked: every text line over a motif >= 4.5:1, large text >= 3:1).
   Phones: the final panel's ring sits higher, clear of the grey body text. */
@media (max-width: 860px) {
  .bg-springs.bg-rings .final-panel { background-position: left -72px bottom -42px, right -84px top -104px; background-size: 190px auto, 190px auto; }
}
/* English (left-aligned text): the springs beside the why copy and the ring in the week band
   move to the free right-hand side. */
[dir="ltr"].bg-springs.bg-rings .why { background-position: right -104px top 62%; }
[dir="ltr"].bg-springs.bg-rings .band-cream { background-position: left 0 top 26px, right -112px top 58px; }
@media (min-width: 861px) {
  [dir="ltr"].bg-springs.bg-rings .why { background-position: right -60px top 58%; }
  [dir="ltr"].bg-springs.bg-rings .band-cream { background-position: left 0 top 26px, right 3% top 60px; }
}
/* English phones: full-width left-aligned text, so these motifs go where there is no text:
   the springs peek out from behind the top corner of the why photo, the week ring sits above
   the heading, and the Instagram ring moves to the free right side. */
@media (max-width: 860px) {
  [dir="ltr"].bg-springs.bg-rings .why { background-position: right -40px top 0; background-size: 210px auto; }
  [dir="ltr"].bg-springs.bg-rings .band-cream { background-position: left 0 top 26px, right -120px top -70px; background-size: auto 18px, 180px auto; }
  [dir="ltr"].bg-springs.bg-rings .ig { background-position: right -58px top 14px; }
}

/* ---------------------------------------------------------------- more items
   (user: "add a bit more of those rings and strings"; the handles were tried and dropped:
   "just springs and" rings). Phones first; beside text, never behind it. */
.bg-springs.bg-rings .why {
  background:
    url("../bg/springs.svg") no-repeat left -104px top 62% / 250px auto,
    url("../bg/ring-b.svg") no-repeat left 10px bottom 22px / 62px auto;
}
.bg-springs.bg-rings .hila {
  background:
    url("../bg/springs.svg") no-repeat right -112px bottom 40px / 220px auto,
    url("../bg/ring-b.svg") no-repeat left 8px top 64% / 64px auto;
}
.bg-springs.bg-rings .final-panel {
  background:
    url("../bg/springs.svg") no-repeat left -72px bottom -42px / 190px auto,
    url("../bg/ring-a.svg") no-repeat right -84px top -104px / 190px auto,
    var(--cream);
}
@media (min-width: 861px) {
  .bg-springs.bg-rings .why {
    background-position: left -60px top 58%, right 2% top 18%;
    background-size: 320px auto, 92px auto;
  }
  .bg-springs.bg-rings .classes { background: url("../bg/ring-a.svg") no-repeat left 1% top 24% / 86px auto, url("../bg/ring-b.svg") no-repeat right 3% top 50px / 150px auto; }
  .bg-springs.bg-rings .hila {
    background-position: right -70px bottom 56px, left 3% top 20%;
    background-size: 290px auto, 100px auto;
  }
  .bg-springs.bg-rings .ig { background: url("../bg/ring-b.svg") no-repeat left -40px top 30px / 200px auto, url("../bg/ring-a.svg") no-repeat right 1.5% bottom 70px / 90px auto, var(--white); }
  .bg-springs.bg-rings .final-panel {
    background-position: left -72px bottom -42px, right -86px top -76px;
    background-size: 250px auto, 300px auto;
  }
}
