/* Platform page: the Overview strip and the governed flow (loaded after
   platform-v4.css). Both are built from the homepage's figure language and
   only laid out here:
     .fig-panel (sandbox.css)            the figure frame
     .st-corners, .tl-name, .tl-mark,    corner marks, stage pills, line
     .st-name, .st-note (site-sections)  markers, mono labels and notes
     .surface-dots (site-sections)       the dot grid behind the section
   Colours come from the shared tokens (--kit-*, ui-kit.css); the four ways'
   colours (--way) from platform.css. */

.pf5 .fig-panel { position: relative; margin: 0; } /* <figure> defaults to 40px side margins */
.pf5 .st-corners { position: absolute; inset: 0; pointer-events: none; }
/* the four boxes and their wires span the content width (platform.css
   indents them for the old v1 rail) */
.pf6-orch .pf-ways, .pf6-orch .pf-wires { margin-left: 0; margin-right: 0; }
/* phones and tablets (2 x 2 boxes): the four boxes sit in one outer box
   (the figure panel's look); js/platform.js reads --pf-ways-boxed and runs
   the wires from its foot */
@media (max-width: 1023px) {
  .pf6-orch .pf-ways {
    --pf-ways-boxed: 1;
    padding: 12px;
    background: #FDFDFC;
    border: 1px solid #E4E1DF;
    border-radius: 16px;
  }
  .pf6-orch .pf-wires { z-index: 3; }
}
/* phones: logos sit at the foot of each card, the same distance from its
   bottom edge whatever the card's text */
@media (max-width: 599px) {
  .pf6-orch .pf-way { grid-template-rows: auto auto 1fr; }
}
/* with the four boxes in one row, the wires draw over them so each wire's
   top dot shows on the box edge (stacked boxes keep the wires behind) */
@media (min-width: 1024px) { .pf6-orch .pf-wires { z-index: 3; } }

/* the homepage's asset-step pill: Teal Shade, centred on its step */
.pf5 .tl-name {
  justify-self: center;
  margin: 0;
  background: var(--kit-teal-shade);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--kit-teal-shade) 18%, transparent);
}
.pf5 .tl-name .icon { width: 14px; height: 14px; color: var(--kit-white); }
.pf5 .st-name { display: inline-flex; align-items: center; gap: 6px; }
.pf5 .st-name .icon { width: 14px; height: 14px; color: var(--kit-teal-medium); }

/* ---------- Overview strip: brief -> four steps -> ESP ---------- */
.pf5-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
}
/* the brief and ESP boxes sit centred on the line (line at 44px, box ~74px) */
.pf5-strip > .pf5-io { margin-top: 7px; }
.pf5-io {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--kit-ivory-medium);
  border-radius: 10px;
  background: var(--kit-white);
}
.pf5-io .pf-logos { gap: 4px; justify-content: center; }
.pf5-io .pf-logo .logo-tile { --tile: 24px; }

.pf5-run { position: relative; }
/* the governed line, through the markers (pill 28 + gap 10 + marker 12 / 2),
   reaching out to the brief and ESP boxes */
.pf5-line {
  position: absolute;
  left: -24px;
  right: -24px;
  top: calc(28px + 10px + 6px - 1.5px);
  height: 3px;
  border-radius: 2px;
  background: var(--kit-ivory-medium);
}
.pf5-line > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--kit-citron-highlight);
  box-shadow: 0 0 0 1px var(--kit-stroke-subtle);
  transform-origin: left center;
  transition: transform 1.8s cubic-bezier(.45, 0, .35, 1);
}
.pf5-strip.is-armed .pf5-line > span { transform: scaleX(0); }
.pf5-strip.is-armed.is-on .pf5-line > span { transform: scaleX(1); }

.pf5-steps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* the steps share these rows (subgrid), so every note and every check box
     starts at the same height and the boxes are all as tall as the tallest */
  grid-template-rows: 28px 12px auto auto;
  gap: 10px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pf5-step {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 10px;
  justify-items: start;
  text-align: left;
}
/* pill, note and check box start at the step's marker */
.pf5-step > .tl-name { justify-self: start; }
/* one column per step (the shared timeline moves its pill to a second
   column below 760px) */
.pf5-step > * { grid-column: 1; }
.pf5-step .tl-mark { grid-row: 2; border: 2px solid var(--kit-teal-medium); }
.pf5-step > .st-note { grid-row: 3; }
/* what Stensul enforces at the step: the governed flow's citron box */
.pf5-checks {
  grid-row: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 2px 0 0;
  padding: 8px 10px;
  list-style: none;
  border-radius: 8px;
  background: var(--kit-citron-tint);
  box-shadow: 0 0 0 1px var(--kit-stroke-light);
}
.pf5-checks .st-note { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.pf5-checks .icon { width: 13px; height: 13px; color: var(--kit-teal-medium); }

/* Tablet and small desktop (600–1279px): the strip stays one row with the
   governed line running through. The brief and ESP boxes narrow to a column
   (label over stacked logos) and the check boxes may wrap. */
@media (max-width: 1279px) {
  .pf5-strip { gap: 12px; }
  .pf5-strip > .pf5-io { margin-top: 0; }
  .pf5-io { width: 72px; padding: 8px 4px; text-align: center; }
  .pf5-io .st-name { flex-direction: column; gap: 4px; }
  .pf5-io .pf-logos { flex-direction: column; }
  .pf5-line { left: -12px; right: -12px; }
  .pf5-steps { column-gap: 6px; }
  .pf5-checks { align-self: stretch; padding: 6px 8px; }
  /* checks may wrap here: the tick stays beside the first line */
  .pf5-checks .st-note { align-items: flex-start; white-space: normal; text-align: left; }
  .pf5-checks .icon { flex: none; margin-top: .15em; }
}
/* tablets: words only in the step pills, so Personalize fits its column */
@media (max-width: 1023px) {
  .pf5-step .tl-name .icon { display: none; }
  /* a column is never narrower than its pill, so the left-aligned pills
     never run into the next step */
  .pf5-steps { grid-template-columns: repeat(4, minmax(min-content, 1fr)); }
}
@media (max-width: 599px) {
  .pf5-strip { grid-template-columns: minmax(0, 1fr); }
  .pf5-io { width: auto; flex-direction: row; justify-content: space-between; padding: 10px 12px; }
  .pf5-io .st-name { flex-direction: row; }
  .pf5-io .pf-logos { flex-direction: row; }
  /* the governed line runs down the left, from the brief box to the ESP box;
     the steps sit to its right with their marker on it */
  .pf5-line { left: 13px; right: auto; top: -12px; bottom: -12px; width: 3px; height: auto; }
  .pf5-line > span { transform-origin: center top; }
  .pf5-strip.is-armed .pf5-line > span { transform: scaleY(0); }
  .pf5-strip.is-armed.is-on .pf5-line > span { transform: scaleY(1); }
  .pf5-steps { padding-left: 36px; }
  .pf5-step { position: relative; }
  .pf5-step .tl-mark { position: absolute; grid-area: auto; left: -27.5px; top: 8px; }
  .pf5-checks { align-self: auto; }
  .pf5-steps { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 24px; }
  .pf5-step { grid-row: auto; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 8px; justify-items: start; align-items: center; text-align: left; }
  .pf5-step > .tl-name { grid-row: 1; grid-column: 1; align-self: start; }
  .pf5-step > .st-note { grid-row: 1; grid-column: 2; align-self: center; }
  .pf5-checks { grid-row: 2; grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; column-gap: 12px; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { .pf5-line > span { transition: none; } }

/* ---------- The governed flow ---------- */

.pf6-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.pf6 { --pf6-corner: 190px; }
.pf6-corner { width: var(--pf6-corner); }

/* the gate: a citron line down every step column, at its left (as in the
   overview strip, pill, marker and check box start at the column's left;
   --pf6-ax is the line's centre) */
.pf6-grid { --pf6-ax: 6px; }
.pf6-step, .pf6-cell, .pf6-checks {
  background: linear-gradient(var(--kit-citron-highlight), var(--kit-citron-highlight)) calc(var(--pf6-ax) - 1.5px) 0 / 3px 100% no-repeat;
}
.pf6-step { padding: 0 8px 14px 0; text-align: left; background-size: 3px calc(100% - 28px); background-position: calc(var(--pf6-ax) - 1.5px) bottom; }
.pf6-step .tl-name { display: inline-flex; }

.pf6-who { padding: 0 12px 0 0; text-align: left; white-space: nowrap; }
.pf6 .pf6-who .icon { color: var(--way); }

.pf6-lane { transition: opacity .2s ease; }
.pf6-lane > * { height: 52px; border-top: 1px solid var(--kit-ivory-medium); }
.pf6-cell { position: relative; padding: 0; }
.pf6-cell[data-l]::before, .pf6-cell[data-r]::after {
  content: "";
  position: absolute;
  top: calc(50% - 1px);
  height: 2px;
  background: var(--way);
}
.pf6-cell[data-l]::before { left: 0; right: calc(100% - var(--pf6-ax)); }
.pf6-cell[data-r]::after { left: var(--pf6-ax); right: 0; }

.pf6-dot {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: var(--pf6-ax);
  margin: -6px 0 0 -6px;
  border: 2px solid var(--way);
}
.pf6-dot[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 10px);
  left: 50%;
  translate: -50% 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--kit-teal-dark);
  color: var(--kit-text-on-dark);
  font-size: var(--type-caption);
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.pf6-checks { height: 1px; padding: 14px 8px 0 0; vertical-align: top; border-top: 1px solid var(--kit-ivory-medium); }
tfoot .pf6-who { padding-top: 22px; vertical-align: top; border-top: 1px solid var(--kit-ivory-medium); }
.pf6-checks ul {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  box-sizing: border-box;
  height: 100%; /* every box in the row as tall as the tallest */
  margin: 0;
  padding: 8px 10px;
  list-style: none;
  border-radius: 8px;
  background: var(--kit-citron-tint);
  box-shadow: 0 0 0 1px var(--kit-stroke-light);
}
.pf6 .st-note { display: flex; align-items: center; gap: 5px; }
.pf6 .st-note .icon { width: 13px; height: 13px; color: var(--kit-teal-medium); }

/* "Governed by Stensul at every step": one citron box spanning the step
   check boxes above it (from the first step column to the last box) */
.pf5 .pf6-gov {
  display: flex;
  justify-content: center;
  margin: 8px 8px 0 var(--pf6-corner);
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--kit-citron-tint);
  box-shadow: 0 0 0 1px var(--kit-stroke-light);
  text-align: center;
}

/* hover a box above: only its lane stays lit */
.pf-orch[data-focus] .pf6-lane { opacity: .2; }
.pf-orch[data-focus="agents"] .pf6-lane[data-way="agents"],
.pf-orch[data-focus="systems"] .pf6-lane[data-way="systems"],
.pf-orch[data-focus="tools"] .pf6-lane[data-way="tools"],
.pf-orch[data-focus="people"] .pf6-lane[data-way="people"] { opacity: 1; }

/* ---------- tablet and phones ---------- */
.pf6-list { display: none; }
@media (max-width: 1023px) {
  .pf6 { --pf6-corner: 150px; }
  /* words only in the step pills, so each fits its column */
  .pf6-step .tl-name .icon { display: none; }
  /* row names wrap rather than run into the first step's line */
  .pf6-who { white-space: normal; }
}
@media (max-width: 899px) {
  .pf6 { --pf6-corner: 140px; }
  .pf6-step .tl-name { padding: 0 6px; }
}
@media (max-width: 767px) {
  .pf6-grid { display: none; }
  .pf6-list { display: block; margin: 0; padding: 0; list-style: none; }
  .pf6-list > li { padding: 14px 0; }
  .pf6-list > li + li { border-top: 1px solid var(--kit-ivory-medium); }
  .pf6-list .tl-name { display: inline-flex; }
  .pf6-list-who { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
  .pf6-swatch { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--way); }
  .pf5 .pf6-gov { margin: 4px 0 0; }
  .pf6-list-checks { margin: 10px 0 0; padding: 5px 8px; width: fit-content; border-radius: 6px; background: var(--kit-citron-tint); box-shadow: 0 0 0 1px var(--kit-stroke-light); }
}

/* ---------- Light hero with the strip as its figure ----------
   Headline left-aligned on the content width; from desktop the call to
   action sits on the right, level with the headline's last line. The strip
   follows below. */
.pf-hero.pf5 .hero-content { max-width: none; margin: 0; align-items: flex-start; text-align: left; }
.pf-hero.pf5 .hero-title { max-width: 14em; }
@media (min-width: 1024px) {
  .pf-hero.pf5 .hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "eyebrow eyebrow" "title actions";
    align-items: end;
    column-gap: 48px;
    row-gap: 0;
  }
  .pf-hero.pf5 .sw-eyebrow { grid-area: eyebrow; justify-self: start; }
  .pf-hero.pf5 .hero-title { grid-area: title; }
  .pf-hero.pf5 .hero-actions { grid-area: actions; margin: 0 0 8px; }
}
.pf-hero.pf5 .pf5-strip { margin-top: 56px; }
@media (max-width: 599px) { .pf-hero.pf5 .pf5-strip { margin-top: 40px; } }

/* ---------- Phone spacing between the page's parts ---------- */
@media (max-width: 599px) {
  /* 80px from the overview strip to the Agents + People head (the hero
     already leaves 48px under the strip) */
  .pf5#how-it-works { padding-top: 32px; }
  /* 40px from the System lede to its diagram (the head keeps its 40px) */
  main.pf .pf-system { padding-bottom: 0; }
  /* the diagram's phase headers (01 Creation, ...) sit 8px further in */
  main.pf .compare-section .pd-mhead { padding-left: 12px; }
  /* 80px above the Features head */
  main.pf #features { padding-top: 79px; } /* 80px to the head, with the 1px it already had */
}

/* ---------- Phones: hero spacing ----------
   Headline, button and strip sit the same distance apart. */
@media (max-width: 599px) {
  .pf-hero.pf5 .hero-title { margin-bottom: 0; }
  .pf-hero.pf5 .hero-actions { margin-top: 12px; }
  .pf-hero.pf5 .pf5-strip { margin-top: 40px; }
}

/* ---------- Hero, Agents + People and System ----------
   All three sit on the same ground, so their paddings add up; the System
   panel head takes no top padding of its own, at every width. */
#how-it-works + .pf-system { padding-top: 0; }
/* The hero's strip already leaves room below it, so Agents + People starts
   one section gap (128px on desktop) under the strip, not 200px. */
@media (min-width: 600px) {
  .pf-hero.pf5 + #how-it-works { padding-top: 56px; }
}

/* ---------- Security: heading left, four cards 2 x 2 on the right ---------- */
@media (min-width: 1024px) {
  .pf-security .l-container { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 64px; align-items: center; }
  .pf-security .section-intro { margin: 0; }
  .pf-security .pf-sec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Continuous innovation: swipe with dots (below desktop) ----------
   The cards already swipe with scroll snap; the dots show where you are and
   jump to a card. From desktop all five cards show, so the dots hide. */
.pf-rel-dots { display: flex; justify-content: center; gap: 4px; margin-top: 16px; }
.pf-rel-dot {
  width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.pf-rel-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--kit-ivory-dark); transition: background-color .2s, width .2s;
}
.pf-rel-dot[aria-current="true"]::before { width: 20px; border-radius: 4px; background: var(--kit-teal-medium); }
.pf-rel-dot:focus-visible { outline: 2px solid var(--kit-teal-medium); outline-offset: 0; border-radius: 6px; }
@media (min-width: 1024px) { .pf-rel-dots { display: none; } }
@media (prefers-reduced-motion: reduce) { .pf-rel-dot::before { transition: none; } }
@media (max-width: 1023px) {
  .pf-rel { scrollbar-width: none; }
  .pf-rel::-webkit-scrollbar { display: none; }
}
