/* Lifecycle Ring — see elements/lifecycle-ring.php and _/js/lifecycle-ring.js */
.lifecycle-ring {
  --lr-din: "din-2014", "DIN 2014", "DIN Next", "Archivo", system-ui, sans-serif;
  --lr-bg: #1A1E21;
  --lr-orange: #f47b20;
  --lr-ink: #e8ebed;
  --lr-muted: #9aa1a8;
  --lr-body: #c8cdd2;
  --lr-nav-bg: #26282c;
  --lr-nav-color: #fff;
  --lr-nav-active: var(--lr-orange);
  --lr-nav-sep: #4593dc;
  --lr-nav-h: 58px;
  --lr-step-box: 4% -42% 6% 50%; /* the stage's insets during a step */
  /* pinned top: room for a fixed header (set inline from the element settings) */
  --lr-top: var(--lr-offset, 120px);
  --lr-pin-h: calc(100vh - var(--lr-top));
  position: relative;
  width: 100%;
  /* the scroll track: the panel stays pinned while this scrolls past */
  height: calc(var(--lr-pin-h) * var(--lr-length, 6));
  background: var(--lr-bg);
  color: var(--lr-body);
  font-family: "Karla", system-ui, sans-serif;
}
/* phones: the small viewport height, so the panel fits with the toolbars showing */
@supports (height: 100svh) {
  .lifecycle-ring { --lr-pin-h: calc(100svh - var(--lr-top)); }
}
.lifecycle-ring *, .lifecycle-ring *::before, .lifecycle-ring *::after { box-sizing: border-box; }

.lifecycle-ring__pin {
  position: sticky;
  top: var(--lr-top);
  height: var(--lr-pin-h);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* sticky step nav, styled after the Industries nav (industries.css) */
.lifecycle-ring__nav {
  position: relative; z-index: 4; flex: none;
  min-height: var(--lr-nav-h);
  display: flex; align-items: center;
  padding-inline: clamp(24px, 5.5vw, 80px); /* lines up with the copy column */
  background: var(--lr-nav-bg);
  overflow-x: auto; scrollbar-width: none;
}
.lifecycle-ring__nav::-webkit-scrollbar { display: none; }
.lifecycle-ring__nav-list { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
.lifecycle-ring__nav-item { display: flex; align-items: center; margin: 0; }
.lifecycle-ring__nav-item + .lifecycle-ring__nav-item::before {
  content: ""; flex: none; width: 1px; height: 14px; margin-inline: 16px; background: var(--lr-nav-sep);
}
.lifecycle-ring__nav-link {
  padding: 8px 0; border: 0; background: none;
  color: var(--lr-nav-color);
  text-transform: uppercase; /* font comes from .font-button (main.scss) */
  cursor: pointer; transition: color .3s ease;
}
.lifecycle-ring__nav-link:hover,
.lifecycle-ring__nav-link:focus-visible,
.lifecycle-ring__nav-link[aria-current="true"] { color: var(--lr-nav-active); }
.lifecycle-ring__nav-link:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.lifecycle-ring__main { position: relative; flex: 1 1 auto; }

.lifecycle-ring__stagebox {
  /* above the step label, so its rule runs behind the ring and meets its edge */
  position: absolute; top: 2%; bottom: 4%; left: 50%; right: 1%; z-index: 2;
  transition: left 1.1s cubic-bezier(.4,0,.15,1), right 1.1s cubic-bezier(.4,0,.15,1),
              top 1.1s cubic-bezier(.4,0,.15,1), bottom 1.1s cubic-bezier(.4,0,.15,1);
}
.lifecycle-ring.is-step .lifecycle-ring__stagebox { inset: var(--lr-step-box); }
/* where the stage comes to rest for a step; the JS fits the step label to the ring in it */
.lifecycle-ring__stagebox-rest { position: absolute; inset: var(--lr-step-box); visibility: hidden; pointer-events: none; }
.lifecycle-ring__stage { position: absolute; inset: 0; }
.lifecycle-ring__stage canvas { display: block; width: 100% !important; height: 100% !important; }

/* left column */
.lifecycle-ring__copy {
  position: absolute; left: clamp(24px, 5.5vw, 80px); top: 6%; bottom: 6%;
  width: min(43%, 520px); z-index: 3;
  display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: none;
  transition: opacity .8s cubic-bezier(.2,0,.15,1), transform .9s cubic-bezier(.2,0,.15,1) .15s;
}
/* each Bricks child of the copy column is one pane: intro, then steps 1–4 */
.lifecycle-ring__copy > * { margin-block: auto; transition: opacity .55s ease, transform .7s cubic-bezier(.33,0,.15,1); }
/* out of flow but kept where it sat: full width, own height, centred by the auto margins as in the flex column */
.lifecycle-ring__copy > .is-hidden { opacity: 0; transform: translateX(-18px); pointer-events: none; position: absolute; inset: 0; height: fit-content; visibility: hidden; transition: opacity .55s ease, transform .7s cubic-bezier(.33,0,.15,1), visibility 0s .55s; }
/* pre-boot: the ring paints first, copy eases in after */
.lifecycle-ring.is-booting .lifecycle-ring__copy { opacity: 0; transform: translateY(10px); }

.lifecycle-ring h2 {
  font-family: var(--lr-din); font-weight: 800; font-size: clamp(34px, 3.4vw, 50px);
  line-height: 1.06; letter-spacing: -.01em; margin: 0; color: #fff; text-transform: uppercase;
}
.lifecycle-ring h2 span { color: var(--lr-orange); display: block; }
.lifecycle-ring__pane--intro p { font-size: 16px; line-height: 1.7; margin: 22px 0 0; max-width: 440px; }
.lifecycle-ring__pane--intro strong { font-weight: 700; color: var(--lr-ink); }
.lifecycle-ring__pane-title { display: none; }
.lifecycle-ring__svc { font-size: 14.5px; line-height: 1.72; margin: 0 0 20px; text-wrap: pretty; }
.lifecycle-ring__svc:last-child { margin-bottom: 0; }
.lifecycle-ring__svc b { color: var(--lr-orange); font-weight: 400; }

/* ring callouts (overview) */
.lifecycle-ring__callouts {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0; transition: opacity .6s ease;
}
.lifecycle-ring__callouts.is-ready { opacity: 1; }
.lifecycle-ring.is-booting .lifecycle-ring__callouts,
.lifecycle-ring.is-step .lifecycle-ring__callouts { opacity: 0; }
.lifecycle-ring__callout {
  position: absolute; font-family: var(--lr-din); font-weight: 500; font-size: 11.5px; letter-spacing: .07em;
  color: var(--lr-muted); white-space: nowrap; text-transform: uppercase;
}
.lifecycle-ring__callout b { color: var(--lr-orange); font-weight: 700; }
.lifecycle-ring__line { position: absolute; left: 50%; top: 22px; width: 1px; background: #5a6167; }

/* step label beside the ring: fixed in the panel, fades between steps */
.lifecycle-ring__label {
  position: absolute; z-index: 1;
  left: var(--lr-label-x, 48%); top: var(--lr-label-y, 46%);
  display: flex; align-items: flex-start;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.lifecycle-ring__label.is-on { opacity: 1; transition: opacity .6s ease .25s; }
.lifecycle-ring__label h3 {
  font-family: "Karla", system-ui, sans-serif; font-size: 14px; font-weight: 700; line-height: normal;
  letter-spacing: .7px; text-transform: uppercase; margin: 0; color: #b9bfc4; white-space: nowrap;
}
.lifecycle-ring__label h3 b { color: var(--lr-orange); font-weight: 700; }
.lifecycle-ring__label p { margin: 8px 0 0; max-width: min(240px, var(--lr-label-fit, 240px)); font-size: 14.5px; line-height: 1.62; color: var(--lr-body); }
/* centred on the heading's line */
.lifecycle-ring__rule { flex: 0 0 var(--lr-rule-w, 110px); height: 1px; margin: 8px 0 0 18px; background: var(--lr-orange); }
/* with a description: a grey rule above the text, running on behind the ring */
@media (min-width: 768px) {
  .lifecycle-ring__label--blurb { flex-direction: column; }
  .lifecycle-ring__label--blurb .lifecycle-ring__rule {
    order: -1; flex: none; width: calc(240px + var(--lr-rule-w, 110px));
    margin: 0 0 28px; background: #5a6167;
  }
}

.lifecycle-ring__pane-title {
  font-family: var(--lr-din); font-size: 15px; letter-spacing: .06em; margin: 0 0 8px;
  color: var(--lr-ink); text-transform: uppercase; font-weight: 700; line-height: 1.3;
}
.lifecycle-ring__pane-title b { color: var(--lr-orange); }

/* narrow screens: ring on top, copy below. The JS frames the ring to fit the
   stage and places the callouts and the step label with vertical lines. */
@media (max-width: 767px) {
  /* clear the 88px sticky mobile header */
  .lifecycle-ring {
    overflow-anchor: none;
    --lr-nav-h: 52px; --lr-top: var(--lr-offset-mobile, 88px);
    height: var(--lr-mobile-track-h, calc(var(--lr-pin-h) * var(--lr-length, 6)));
  }
  .lifecycle-ring__nav { padding-inline: 16px; }
  .lifecycle-ring__main { min-height: 0; overflow: hidden; }
  /* 32px of space above and below the ring */
  .lifecycle-ring__stagebox,
  .lifecycle-ring.is-step .lifecycle-ring__stagebox { left: 0; right: 0; top: 32px; bottom: calc(56% + 32px); }
  .lifecycle-ring__copy {
    left: 16px; right: 16px; width: auto; top: 45%; bottom: 16px;
    display: block; overflow: hidden; overflow: clip;
    overflow-anchor: none; touch-action: pan-y;
  }
  .lifecycle-ring__copy > * {
    /* Every pane uses the same containing block and natural content height.
       Hidden panes cannot change the copy window's size or scroll extent. */
    position: absolute; inset: 0 0 auto; width: 100%; height: auto;
    margin: 0; flex: none;
    translate: 0 var(--lr-copy-y, 0px);
    transition: opacity .35s ease;
  }
  .lifecycle-ring__copy > .is-hidden {
    inset: 0 0 auto; height: auto; margin: 0;
    visibility: hidden; transition: none;
  }
  .lifecycle-ring__callout { font-size: 10.5px; }
  /* step label: the title only, centred over the stage; the copy below has the rest */
  .lifecycle-ring__label { display: block; transform: translateX(-50%); z-index: 3; }
  /* the neighbouring segments fade out under the label */
  .lifecycle-ring.is-step .lifecycle-ring__stage {
    -webkit-mask-image: linear-gradient(to bottom, transparent 8px, #000 60px);
    mask-image: linear-gradient(to bottom, transparent 8px, #000 60px);
  }
  .lifecycle-ring__label h3 { font-size: 12.5px; }
  .lifecycle-ring__label p { display: none; }
  .lifecycle-ring__rule { position: absolute; left: 50%; top: 24px; width: 1px; height: 0; margin: 0; }
  .lifecycle-ring h2 { font-size: clamp(28px, 4.4svh, 34px); }
  .lifecycle-ring__pane--intro p { font-size: clamp(13px, 2svh, 16px); line-height: 1.6; margin-top: 14px; }
  .lifecycle-ring__svc { font-size: clamp(11.5px, 1.65svh, 13.5px); line-height: 1.55; margin-bottom: 10px; }
}

/* builder: show the copy without the scroll track */
body.bricks-is-builder .lifecycle-ring,
.brx-body.iframe .lifecycle-ring { height: auto; }
body.bricks-is-builder .lifecycle-ring__pin,
.brx-body.iframe .lifecycle-ring__pin { position: relative; height: 80vh; }
body.bricks-is-builder .lifecycle-ring.is-booting .lifecycle-ring__copy,
.brx-body.iframe .lifecycle-ring.is-booting .lifecycle-ring__copy { opacity: 1; transform: none; }
/* builder: every pane stacked so each can be edited */
body.bricks-is-builder .lifecycle-ring__pin,
.brx-body.iframe .lifecycle-ring__pin { height: auto; min-height: 80vh; overflow: visible; }
body.bricks-is-builder .lifecycle-ring__copy,
.brx-body.iframe .lifecycle-ring__copy { position: relative; top: auto; bottom: auto; padding-block: 48px; gap: 64px; overflow: visible; }
body.bricks-is-builder .lifecycle-ring__copy > *,
.brx-body.iframe .lifecycle-ring__copy > * { margin-block: 0; }
body.bricks-is-builder .lifecycle-ring__pane-title,
.brx-body.iframe .lifecycle-ring__pane-title { display: block; }

@media (max-width: 767px) {
  body.bricks-is-builder .lifecycle-ring__main,
  .brx-body.iframe .lifecycle-ring__main { overflow: visible; }
  body.bricks-is-builder .lifecycle-ring__copy,
  .brx-body.iframe .lifecycle-ring__copy { display: flex; }
  body.bricks-is-builder .lifecycle-ring__copy > *,
  .brx-body.iframe .lifecycle-ring__copy > * {
    position: static; inset: auto; translate: none;
  }
}
