/* ==========================================================================
   TIPS scroll hero
   Mobile first. Two modes:
     default        static: assembled jar picture, full feature list, button
     .tips-live     added by JS once 3D is running: pinned, one step at a time
   Change the brand colours and font in the variables below.
   ========================================================================== */

.tips-scroll {
  --tips-cream: #f7f1e4;
  --tips-cream-2: #efe6d3;
  --tips-charcoal: #1f1f23;
  --tips-muted: #5f594e;
  --tips-gold: #e8b23c;
  --tips-gold-deep: #c9952a;
  --tips-font: inherit;            /* set to your site font if the section should differ */
  --tips-radius: 999px;

  position: relative;
  background: var(--tips-cream);
  color: var(--tips-charcoal);
  font-family: var(--tips-font);
  overflow: hidden;
}

.tips-pin {
  display: grid;
  grid-template-rows: auto auto;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 56px;
  gap: 8px;
}

/* ---------- the visual ---------- */
.tips-visual {
  position: relative;
  min-height: 0;
  aspect-ratio: 1 / 1;
  max-height: 62svh;
  width: 100%;
  margin: 0 auto;
}
.tips-glow {
  position: absolute;
  inset: 6% 4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(232, 178, 60, 0.34), rgba(232, 178, 60, 0) 72%);
  opacity: 0.6;
  pointer-events: none;
}
.tips-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.5s ease;
}
.tips-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: var(--tips-in, 0);
  transform: translateY(calc((1 - var(--tips-in, 0)) * 28px));
}
.tips-chips { display: none; }

/* ---------- the copy ---------- */
.tips-copy { position: relative; }
.tips-title {
  margin: 0;
  font-size: clamp(30px, 6.6vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}
.tips-text {
  margin: 14px 0 0;
  max-width: 34ch;
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.5;
  color: var(--tips-muted);
}
.tips-count {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--tips-gold-deep);
  font-variant-numeric: tabular-nums;
}
.tips-list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.tips-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 12px;
  align-items: start;
}
.tips-list li::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--tips-gold);
  box-shadow: inset 0 -3px 0 var(--tips-gold-deep);
  grid-row: span 2;
}
.tips-list b { font-size: 18px; font-weight: 700; }
.tips-list span { color: var(--tips-muted); font-size: 16px; line-height: 1.45; }

.tips-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  min-height: 56px;
  padding: 0 30px;
  border-radius: var(--tips-radius);
  background: var(--tips-charcoal);
  color: var(--tips-cream);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 28px -14px rgba(31, 31, 35, 0.7), inset 0 0 0 2px var(--tips-charcoal);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s, color 0.2s;
}
.tips-cta:hover { transform: translateY(-2px); background: var(--tips-gold); color: var(--tips-charcoal); }
.tips-cta:active { transform: translateY(1px) scale(0.98); }
.tips-cta:focus-visible,
.tips-dot:focus-visible { outline: 3px solid var(--tips-gold-deep); outline-offset: 4px; }

.tips-stages,
.tips-rail { display: none; }

/* ---------- live mode: pinned, one step at a time ---------- */
.tips-live .tips-pin {
  height: 100vh;
  height: 100svh;
  grid-template-rows: minmax(0, 56fr) minmax(0, 44fr);
  padding: 72px 20px 28px;
}
.tips-live .tips-visual { aspect-ratio: auto; max-height: none; height: 100%; }
.tips-live .tips-canvas { display: block; }
.tips-live.tips-ready .tips-poster { opacity: 0; visibility: hidden; }
.tips-live .tips-static-copy { display: none; }
.tips-live .tips-stages { display: block; position: relative; height: 100%; }

.tips-stage {
  position: absolute;
  inset: 0 44px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.tips-stage.is-active { opacity: 1; transform: none; pointer-events: auto; transition-delay: 0.08s; }
.tips-stage h3.tips-title { font-size: clamp(30px, 6vw, 54px); }

/* the short label that snaps in beside each part */
.tips-live .tips-chips { display: block; position: absolute; inset: 0; pointer-events: none; }
.tips-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 9px 14px;
  border-radius: var(--tips-radius);
  background: var(--tips-charcoal);
  color: var(--tips-cream);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translate(0, -50%) scale(0.6);
  transform-origin: 0 50%;
  transition: opacity 0.2s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 20px -10px rgba(31, 31, 35, 0.6);
}
.tips-chip[data-side="left"] { transform: translate(-100%, -50%) scale(0.6); transform-origin: 100% 50%; }
.tips-chip.is-active { opacity: 1; transform: translate(0, -50%) scale(1); }
.tips-chip.is-active[data-side="left"] { transform: translate(-100%, -50%) scale(1); }
.tips-chip::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--tips-gold);
  vertical-align: 1px;
}

/* step buttons */
.tips-live .tips-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: absolute;
  right: -8px;
  top: 0;
}
.tips-dot {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.tips-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tips-cream-2);
  box-shadow: inset 0 0 0 2px #cfc3aa;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s, box-shadow 0.2s;
}
.tips-dot.is-done::before { background: var(--tips-gold); box-shadow: inset 0 0 0 2px var(--tips-gold-deep); }
.tips-dot.is-active::before { background: var(--tips-charcoal); box-shadow: none; transform: scale(1.5); }

.tips-finished .tips-glow { transition: opacity 0.4s; }

/* ---------- wider screens: copy left, jar right ---------- */
@media (min-width: 900px) {
  .tips-pin {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: auto;
    align-items: center;
    gap: 40px;
    padding: 72px 48px;
  }
  .tips-visual { order: 2; max-height: 76vh; }
  .tips-copy { order: 1; }
  .tips-live .tips-pin { grid-template-rows: minmax(0, 1fr); padding: 88px 48px 48px; }
  .tips-live .tips-copy { height: min(420px, 60vh); }
  .tips-stage { inset: 0 0 0 56px; justify-content: center; }
  .tips-live .tips-rail { right: auto; left: -6px; top: 50%; transform: translateY(-50%); }
  .tips-chip { font-size: 15px; padding: 10px 16px; }
}

/* ---------- visitors who asked for less motion get the static version ---------- */
@media (prefers-reduced-motion: reduce) {
  .tips-cta, .tips-poster { transition: none; }
}
