/* The skin journey module: the demo page around it, and the pinned stage (the part a site copies). */
:root {
  --sj-bg: #f3eee8;
  --sj-ink: #2b221d;
  --sj-mute: #76675d;
  --sj-accent: #8a5a44;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--sj-bg);
  color: var(--sj-ink);
  font: 400 17px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the demo page */
.sj-intro, .sj-after {
  min-height: 72vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 14vh 24px;
  text-align: center;
}
.sj-intro h1, .sj-after h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.04;
}
.sj-intro h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
.sj-after h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
.sj-intro p, .sj-after p { margin: 0; max-width: 34ch; color: var(--sj-mute); font-size: 1.08rem; }
.sj-btn {
  margin-top: 6px;
  padding: 14px 26px;
  background: var(--sj-ink);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}

.sj-foot { padding: 28px 24px 36px; text-align: center; color: var(--sj-mute); font-size: 0.78rem; }

/* the journey: a tall track with the stage pinned inside it (journey.js TL: the way in, then the sequence's steps).
   A sequence with more to tell sets a longer track on its page: style="--sj-track: 1650vh; --sj-track-phone: 1500vh"
   (and its trackScale, so the way in keeps its pace) */
.sj-journey { position: relative; height: var(--sj-track, 1100vh); }
.sj-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(115% 85% at 50% 46%, #fbf8f5 0%, #f5f0eb 48%, var(--sj-bg) 100%);
}
.sj-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.sj-stage.is-ready .sj-canvas { opacity: 1; }
.sj-journey.sj-off { height: auto; }
.sj-journey.sj-off .sj-stage { display: none; }

/* the way in on video (film.js): the clip under the 3D, which fades in over it (its opacity set as you scroll). The
   stage behind the clip takes the studio's colour; on a wide screen the clip stands full height in the middle, its
   left edge (her hair) fading into it */
.sj-film { position: absolute; inset: 0; overflow: hidden; background: var(--sj-film-bg, #f4f3f1); }
.sj-film video { position: absolute; display: none; max-width: none; will-change: transform; }
.sj-film video.is-on { display: block; }
/* the page's colour runs a little way down, so the stage's top edge doesn't show as a line when it scrolls in (gone
   once the zoom starts: film.js sets --sj-top) */
.sj-film::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 9vh;
  background: linear-gradient(var(--sj-bg), transparent);
  opacity: var(--sj-top, 1);
}
.sj-filmed .sj-canvas { position: relative; transition: none; }

/* the explainer over the 3D (ui.js sets opacity and position; timing comes from data-in / data-out) */
.sj-ui { position: absolute; inset: 0; pointer-events: none; }
.sj-ui > *, .sj-label { opacity: 0; visibility: hidden; }

.sj-steps {
  position: absolute;
  top: clamp(20px, 5vh, 44px);
  left: clamp(20px, 5vw, 64px);
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--sj-mute);
}
.sj-steps li { position: relative; padding-bottom: 8px; transition: color 0.3s ease; }
.sj-steps li span { margin-right: 6px; font-variant-numeric: tabular-nums; opacity: 0.7; }
.sj-steps li::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.18;
  transition: opacity 0.3s ease;
}
.sj-steps li.is-on { color: var(--sj-ink); }
.sj-steps li.is-on::after { opacity: 1; }

.sj-cap {
  position: absolute;
  left: clamp(20px, 5vw, 64px);
  bottom: clamp(28px, 9vh, 96px);
  max-width: 360px;
  padding: 18px 20px 20px;
  background: rgba(251, 248, 245, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transform: translate3d(0, var(--sj-rise, 0px), 0);
}
.sj-cap-k { display: block; margin-bottom: 8px; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sj-accent); }
.sj-cap h3 { margin: 0 0 8px; font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
.sj-cap p { margin: 0; font-size: 0.98rem; line-height: 1.5; color: var(--sj-mute); }

/* a label: a dot on its point, a short line, the words; ui.js moves its box's left edge onto the point (on the
   right half of the stage the words flip to the left, the box's right edge on the point) */
.sj-labels { position: absolute; inset: 0; opacity: 1; visibility: visible; }
.sj-label {
  --gap: 30px;
  position: absolute;
  left: 0;
  top: 0;
  margin-top: -0.5em;
  padding-left: calc(var(--gap) + 6px);
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
  color: var(--sj-ink);
  text-shadow: 0 0 6px rgba(251, 248, 245, 0.95), 0 0 2px rgba(251, 248, 245, 0.95);
  background: linear-gradient(var(--sj-ink), var(--sj-ink)) no-repeat 4px 50% / var(--gap) 1px;
}
.sj-label::before {
  content: "";
  position: absolute;
  left: -4px;
  top: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--sj-ink);
}
.sj-label.is-left {
  translate: -100% 0;
  padding-left: 0;
  padding-right: calc(var(--gap) + 6px);
  background-position: calc(100% - 4px) 50%;
}
.sj-label.is-left::before { left: auto; right: -4px; }

/* a callout: a small circle round the point, a leader up to a bigger circle with that spot magnified (the canvas
   draws the magnified view inside the ring: loupe.js), its name above. ui.js makes the parts and places them */
.sj-loupe { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
.sj-loupe > span { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.sj-loupe-src {
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(43, 34, 29, 0.28), 0 2px 8px rgba(43, 34, 29, 0.18);
}
.sj-loupe-line {
  width: 1.5px;
  background: #fff;
  box-shadow: 0 0 0 0.5px rgba(43, 34, 29, 0.25);
  transform-origin: 50% 100%;
}
.sj-loupe-ring {
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px rgba(255, 255, 255, 0.7), 0 16px 36px -12px rgba(70, 40, 30, 0.4);
}
.sj-loupe-t {
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--sj-ink);
  text-shadow: 0 0 7px rgba(251, 248, 245, 0.95), 0 0 2px rgba(251, 248, 245, 0.95);
}

/* a deeper look (deep.js): a small circle on the point, a big magnifier beside it joined by a leader; the
   canvas draws the views inside the big circle. Under the captions and labels */
.sj-deep { position: absolute; inset: 0; opacity: 1; visibility: hidden; }
.sj-deep > span { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform, opacity; }
.sj-deep-src { box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(43, 34, 29, 0.28), 0 2px 8px rgba(43, 34, 29, 0.18); }
.sj-deep-ring {
  transform-origin: 50% 50%;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 44px -8px rgba(70, 40, 30, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 26px 60px -18px rgba(70, 40, 30, 0.5);
}
.sj-deep-lead { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sj-deep-line { stroke: #fff; stroke-width: 1.5; }
.sj-deep-line-u { stroke: rgba(43, 34, 29, 0.25); stroke-width: 2.5; }

.sj-week {
  position: absolute;
  right: clamp(20px, 5vw, 64px);
  top: clamp(20px, 5vh, 44px);
  font-size: 0.9rem;
  color: var(--sj-mute);
  letter-spacing: 0.02em;
}
.sj-week b { display: inline-block; min-width: 1.6em; color: var(--sj-ink); font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; vertical-align: -0.12em; }

@media (max-width: 699px) {
  .sj-journey { height: var(--sj-track-phone, 1000vh); }
  .sj-steps { left: 16px; right: 16px; gap: 0; justify-content: space-between; font-size: 0.74rem; }
  /* more than four steps: their numbers go, the names stay */
  .sj-steps li:nth-last-child(n + 5) span, .sj-steps li:nth-last-child(n + 5) ~ li span { display: none; }
  .sj-cap { left: 12px; right: 12px; bottom: 14px; max-width: none; padding: 14px 16px 16px; }
  .sj-cap h3 { font-size: 1.2rem; }
  .sj-cap p { font-size: 0.9rem; }
  .sj-label--minor { display: none; }
  .sj-label { font-size: 0.72rem; --gap: 20px; }
  .sj-week { top: 74px; right: 16px; }
}
