/* ==========================================================================
   Cohesion Insight — How it works scrollytelling (FIG-HIW-SCROLLY)
   Drop-in section that sits right after the HIW hero.

   Structure:
     .hiwsc-wrap
       .hiwsc-steps  (LEFT column, scrolls)
         .hiwsc-step[data-step="1..4"]
           .hiwsc-ed  (editorial: eyebrow, headline, sub, body, cta)
       .hiwsc-sticky (RIGHT column, sticky)
         .hiwsc-stage[data-step="1"]  <- motion-UI placeholder container
           [data-motion-slot="1..4"]  <- Maya drops motion here

   Motion hooks:
     - .hiwsc-stage receives data-step="1..4" as the user scrolls
     - Each .hiwsc-step gets data-active="true|false"
     - Step 4 additionally gets data-approved="true" (auto-play "approved" moment)

   Palette + fonts read from css/site.css tokens where they exist.
   Local fallbacks are declared on .hiwsc-wrap so this file can drop onto any
   page without depending on site tokens.
   ========================================================================== */

.hiwsc-wrap {
  --hsc-magenta: #B83280;
  --hsc-deep-plum: #7A1F5C;
  --hsc-gold: #8A6800;
  --hsc-plum-ink: #351437;
  --hsc-warm-canvas: #FAF4E3;
  --hsc-magenta-wash: #FDE7F3;
  --hsc-ink-80: rgba(53, 20, 55, 0.80);
  --hsc-ink-70: rgba(53, 20, 55, 0.70);
  --hsc-ink-60: rgba(53, 20, 55, 0.60);
  --hsc-ink-55: rgba(53, 20, 55, 0.55);
  --hsc-ink-12: rgba(53, 20, 55, 0.12);
  --hsc-radius: 4px;

  display: grid;
  grid-template-columns: 46fr 54fr;
  gap: 64px;
  align-items: start;
}

/* Sticky is first in source (for mobile top-pin), but on desktop we place
   editorial in column 1 and sticky in column 2. */
.hiwsc-wrap .hiwsc-sticky { grid-column: 2; grid-row: 1; }
.hiwsc-wrap .hiwsc-steps  { grid-column: 1; grid-row: 1; }

/* ---------- RIGHT column: sticky motion stage --------------------------- */

.hiwsc-sticky {
  position: sticky;
  top: 12vh;
  height: 76vh;
}

.hiwsc-stage {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid var(--hsc-ink-12);
  border-radius: var(--hsc-radius);
  background: linear-gradient(180deg, #ffffff 0%, var(--hsc-magenta-wash) 100%);
  overflow: hidden;
}

/* Panel head: mimics the product frame chrome from the site */
.hiwsc-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--hsc-ink-12);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--hsc-ink-55);
  background: #fff;
}

.hiwsc-stage-head .live { color: var(--hsc-magenta); }

.hiwsc-stage-body {
  position: relative;
  height: calc(100% - 59px);
}

/* The four motion slots stack in the same absolute region.
   Maya replaces the placeholder markup inside each with her motion UI.
   Only the active slot is visible; the JS toggles [data-on] on transition. */
.hiwsc-slot {
  position: absolute;
  inset: 0;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
  pointer-events: none;
}

.hiwsc-slot[data-on="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- placeholder motion UI (visible only until Maya replaces it) - */
/* Everything below .hiwsc-slot is optional scaffolding to show what a
   motion slot might look like. Delete or replace with real motion. */

.hiwsc-placeholder {
  width: 100%;
  height: 100%;
  border: 1.5px dashed rgba(184, 50, 128, 0.35);
  border-radius: var(--hsc-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--hsc-ink-60);
  background:
    radial-gradient(circle at 30% 30%, rgba(184, 50, 128, 0.06), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(201, 151, 0, 0.06), transparent 60%);
  text-align: center;
  padding: 32px;
}

.hiwsc-placeholder-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hsc-magenta);
  padding: 4px 10px;
  border: 1px solid rgba(184, 50, 128, 0.35);
  border-radius: 3px;
  background: #fff;
}

.hiwsc-placeholder-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--hsc-plum-ink);
  max-width: 34ch;
  line-height: 1.4;
}

.hiwsc-placeholder-hint {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--hsc-ink-60);
  max-width: 44ch;
  line-height: 1.5;
}

/* Step 4 gets an approved stamp that fades in when the step is active for a moment */
.hiwsc-slot[data-step="4"] .hiwsc-approved-stamp {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 8px 14px;
  background: var(--hsc-gold);
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 3px;
  opacity: 0;
  transform: translateY(-6px) scale(0.94);
  transition: opacity 480ms ease 260ms, transform 480ms ease 260ms;
  z-index: 3;
}

.hiwsc-stage[data-approved="true"] .hiwsc-slot[data-step="4"] .hiwsc-approved-stamp {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---------- LEFT column: editorial steps -------------------------------- */

.hiwsc-steps {
  display: flex;
  flex-direction: column;
}

.hiwsc-step {
  box-sizing: border-box;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
}

.hiwsc-ed {
  display: flex;
  flex-direction: column;
  padding: 2.5rem 3rem 2.5rem 0;
  max-width: 60ch;
  opacity: 0.32;
  transform: translateY(10px);
  transition: opacity 450ms ease, transform 450ms ease;
}

.hiwsc-step[data-active="true"] .hiwsc-ed {
  opacity: 1;
  transform: translateY(0);
}

.hiwsc-ed-num {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hsc-ink-60);
  margin: 0 0 1.5rem;
}

.hiwsc-ed-head {
  font-size: 44px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hsc-plum-ink);
  margin: 0 0 1.4rem;
}

.hiwsc-ed-sub {
  font-size: 21px;
  line-height: 1.42;
  font-weight: 500;
  color: var(--hsc-deep-plum);
  margin: 0 0 1.75rem;
  max-width: 46ch;
}

.hiwsc-ed-body {
  font-size: 18px;
  line-height: 1.62;
  font-weight: 400;
  color: var(--hsc-ink-80);
  max-width: 54ch;
  margin: 0 0 2rem;
}

.hiwsc-ed-cta {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hsc-magenta);
  text-decoration: none;
  padding: 0 0 6px;
  border-bottom: 1.5px solid var(--hsc-magenta);
  cursor: pointer;
  align-self: flex-start;
  transition: color 160ms ease, border-color 160ms ease, transform 200ms ease;
}

.hiwsc-ed-cta:hover {
  color: var(--hsc-deep-plum);
  border-bottom-color: var(--hsc-deep-plum);
  transform: translateY(-1px);
}

.hiwsc-ed-cta:focus-visible {
  outline: 2px solid var(--hsc-deep-plum);
  outline-offset: 4px;
}

.hiwsc-ed-cta .arrow {
  font-weight: 500;
  transform: translateY(1px);
}

.hiwsc-ed-cta-final {
  color: var(--hsc-plum-ink);
  border-bottom-color: var(--hsc-plum-ink);
}

.hiwsc-ed-cta-final:hover {
  color: var(--hsc-magenta);
  border-bottom-color: var(--hsc-magenta);
}

/* ---------- responsive -------------------------------------------------- */

@media (max-width: 1023px) {
  .hiwsc-wrap { gap: 40px; }
  .hiwsc-ed { padding: 2rem 2rem 2rem 0; }
  .hiwsc-ed-head { font-size: 36px; }
}

@media (max-width: 899px) {
  /* Mobile: sticky motion strip at the top, editorial streams beneath. */
  .hiwsc-wrap { display: block; gap: 0; }

  .hiwsc-sticky {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 20;
    margin: 0 calc(-1 * var(--container-padding, 20px));
    background: var(--hsc-magenta-wash);
    border-bottom: 1px solid var(--hsc-ink-12);
    box-shadow: 0 6px 18px -14px rgba(53, 20, 55, 0.25);
  }
  .hiwsc-stage {
    position: relative;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 12px 20px 16px;
  }
  .hiwsc-stage-head {
    padding: 0 0 10px;
    border-bottom: 1px solid var(--hsc-ink-12);
    background: transparent;
    font-size: 11px;
    margin-bottom: 12px;
  }
  .hiwsc-stage-body {
    position: relative;
    height: calc(72vw + 20px);
    max-height: calc(100vh - 200px);
  }
  .hiwsc-slot { padding: 0; }
  .hiwsc-placeholder { padding: 20px; gap: 8px; }
  .hiwsc-placeholder-label { font-size: 13px; }
  .hiwsc-placeholder-hint { display: none; }

  .hiwsc-steps { display: block; }
  .hiwsc-step {
    min-height: 0;
    padding: 28px 0 40px;
    scroll-margin-top: calc(72vw + 100px);
  }
  .hiwsc-ed { padding: 0; opacity: 1; transform: none; max-width: none; }
  .hiwsc-ed-head { font-size: 28px; }
  .hiwsc-ed-sub { font-size: 17px; }
  .hiwsc-ed-body { font-size: 16px; }
  .hiwsc-ed-num { font-size: 14px; margin-bottom: 12px; }
}

/* ---------- reduced motion ---------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .hiwsc-wrap { display: block; }
  .hiwsc-sticky { position: static; box-shadow: none; margin: 0; }
  .hiwsc-stage { padding: 16px 20px; height: auto; }
  .hiwsc-stage-body { height: auto; }
  .hiwsc-slot {
    position: static;
    opacity: 1;
    transform: none;
    padding: 12px 0;
    transition: none;
    margin-bottom: 16px;
  }
  .hiwsc-step { min-height: 0; padding: 0 0 32px; }
  .hiwsc-ed { padding: 0; opacity: 1; transform: none; max-width: none; transition: none; }
  .hiwsc-approved-stamp { opacity: 1 !important; transform: none !important; }
}
