/* ==================================================================
   Scroll-story workflows (Glean-style): left steps scroll and cross-
   fade while a pinned right laptop cross-fades the matching demo.
   No browser chrome around the stage — each panel IS a laptop.

   Demos render inside a hidden 1240x800 iframe canvas; JS measures the
   demo's real content box (its own laptop, or the app window) and crops
   + scales it to the stage width, so nothing ever wraps or gets cut.
   Panels whose demo has no built-in laptop get a generated laptop shell
   (data-wfs-shell="laptop").
   ================================================================== */

.wfs-section { position: relative; }
.wfs { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

.wfs-intro { max-width: 44em; margin: 0 0 clamp(28px, 4vw, 44px); }

.wfs-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(30px, 4vw, 60px);
  align-items: start;
}

/* ---- Left: scrolling steps ---- */
.wfs-steps { min-width: 0; }

.wfs-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 66vh;
  padding: clamp(26px, 4vw, 44px) 0;
  border-top: 1px solid rgba(43, 38, 32, 0.14);
  opacity: 0.38;
  transition: opacity 0.32s ease;
}
.wfs-step:first-child { border-top: 0; padding-top: 4px; }
.wfs-step:last-child { min-height: 52vh; }
.wfs-step.is-active { opacity: 1; }

.wfs-num {
  display: block;
  margin-bottom: 14px;
  color: #A9542C;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.wfs-kicker {
  margin: 0 0 12px;
  color: #A9542C;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.wfs-step h3 {
  max-width: 15em;
  margin: 0 0 14px;
  color: #2B2620;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.09;
  letter-spacing: -0.03em;
}
.wfs-body {
  max-width: 34em;
  margin: 0 0 20px;
  color: rgba(43, 38, 32, 0.68);
  font-size: 15.5px;
  line-height: 1.64;
}
.wfs-scenario {
  max-width: 36em;
  margin: 0 0 4px;
  padding: 15px 17px;
  border: 1px solid rgba(43, 38, 32, 0.1);
  border-radius: 12px;
  background: rgba(245, 240, 233, 0.72);
  font-size: 14px;
  line-height: 1.72;
  color: rgba(43, 38, 32, 0.8);
}
.wfs-scenario-label {
  display: block;
  margin: 0 0 8px;
  color: #6B5F52;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.wfs-checks { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 11px; }
.wfs-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.75px; line-height: 1.5; color: rgba(43, 38, 32, 0.72); }
.wfs-checks .tick { width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: oklch(.6 .09 150 / .16); color: oklch(.42 .09 150); display: grid; place-items: center; flex: none; font-size: 11px; }

/* context chips inside the scenario */
.ctx-chip { display: inline-flex; align-items: center; gap: 5px; background: #F5F0E9; border: 1px solid rgba(43, 38, 32, 0.16); border-radius: 7px; padding: 1px 8px 1px 6px; font-weight: 700; white-space: nowrap; line-height: 1.5; }
.ctx-chip img { width: 14px; height: 14px; object-fit: contain; border-radius: 3px; }
.ctx-chip--person { background: #F7E9DE; border-color: rgba(169, 84, 44, 0.24); padding-left: 4px; }
.ctx-person-avatar { width: 16px; height: 16px; border-radius: 50%; background: #A9542C; color: #fff; display: grid; place-items: center; font-size: 7px; font-weight: 800; letter-spacing: -0.02em; }

/* ---- Right: pinned laptop stage (no chrome around it) ---- */
.wfs-stage-wrap { min-width: 0; align-self: stretch; height: 100%; }
.wfs-stage { position: sticky; top: 84px; }

.wfs-panels { position: relative; display: grid; }
.wfs-panel {
  grid-area: 1 / 1;
  position: relative;
  padding-top: 46px; /* clear strip for the full-screen button */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(.22,.61,.36,1), visibility 0s linear 0.45s;
  will-change: opacity;
  align-self: start;
}
.wfs-panel.is-active { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }

/* the cropped demo shot */
.wfs-crop {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* aspect-ratio set by JS once the demo's content box is measured */
  aspect-ratio: 1240 / 800;
}
.wfs-scaler { position: absolute; top: 0; left: 0; transform-origin: top left; }
.wfs-scaler iframe { display: block; width: 1240px; height: 800px; border: 0; background: transparent; }

/* bare panels (demo has its own laptop) get a soft shadow only */
.wfs-panel[data-wfs-shell="none"] .wfs-crop { filter: drop-shadow(0 26px 34px rgba(20, 16, 12, 0.22)); overflow: visible; }

/* generated laptop shell (matches the demo-laptop style used site-wide) */
.wfs-lap { position: relative; width: 88%; margin: 0 auto; padding-bottom: 17px; filter: drop-shadow(0 22px 30px rgba(20, 16, 12, 0.26)); }
.wfs-lap-lid { position: relative; padding: 10px 10px 11px; border-radius: 18px; background: linear-gradient(#2A251F, #181410); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 1px 1px rgba(255,255,255,.12); }
.wfs-lap-cam { position: absolute; z-index: 3; top: 4px; left: 50%; width: 5px; height: 5px; transform: translateX(-50%); border-radius: 50%; background: #0C0A08; box-shadow: inset 0 0 2px rgba(120,150,160,.5); }
.wfs-lap-screen { position: relative; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.wfs-lap-deck { position: absolute; left: -8%; bottom: 0; width: 116%; height: 17px; border-radius: 0 0 14px 14px; background: linear-gradient(#D7D2CA, #B4AFA6 55%, #8F8A82); box-shadow: 0 2px 5px rgba(20,16,12,.28); }
.wfs-lap-deck::after { position: absolute; top: 0; left: 50%; width: 15%; height: 7px; content: ""; transform: translateX(-50%); border-radius: 0 0 8px 8px; background: linear-gradient(#A5A099, #C3BEB6); }
.wfs-lap .wfs-crop { aspect-ratio: 1240 / 800; }

/* floating code-window shell (API demos — no laptop) */
.wfs-window { width: 82%; margin: 8px auto 0; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 56px -24px rgba(10, 12, 16, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06) inset; filter: none; }
.wfs-window .wfs-crop { border-radius: 14px; }

/* ---- Full-width onboarding workspace ---- */
.wfs-onboarding {
  position: relative;
  margin: clamp(62px, 8vw, 112px) 0 clamp(36px, 5vw, 68px);
  padding-top: clamp(42px, 5vw, 66px);
  border-top: 1px solid rgba(43, 38, 32, 0.14);
}
.wfs-onboarding-copy {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.2fr) minmax(250px, .9fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.wfs-onboarding-heading h3 {
  max-width: 13em;
  margin: 0;
  color: #2B2620;
  font-size: clamp(27px, 3.3vw, 42px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
}
.wfs-onboarding-copy .wfs-body { max-width: 39em; margin-bottom: 16px; }
.wfs-onboarding-copy .wfs-scenario { max-width: 44em; margin: 0; }
.wfs-onboarding-copy > .wfs-checks { margin: 28px 0 0; }
.wfs-onboarding-stage { position: relative; display: grid; }
.wfs-onboarding-panel { grid-area: 1 / 1; padding-top: 0; scroll-margin-top: 88px; }
.wfs-onboarding-toolbar {
  display: flex;
  min-height: 42px;
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.wfs-onboarding-hint {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: rgba(43, 38, 32, 0.68);
  font-size: 12px;
  line-height: 1.35;
}
.wfs-onboarding-hint svg {
  width: 42px;
  height: 22px;
  flex: none;
  overflow: visible;
  stroke: #A9542C;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.wfs-onboarding-hint b { color: #8F421E; font-weight: 750; }
.wfs-onboarding-actions { display: inline-flex; flex: none; align-items: center; gap: 8px; }
.wfs-onboarding-control {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(43, 38, 32, 0.14);
  border-radius: 999px;
  background: rgba(245, 240, 233, 0.72);
  color: rgba(43, 38, 32, 0.58);
  font: 650 11.5px 'Instrument Sans', sans-serif;
  cursor: default;
}
.wfs-onboarding-control::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #A8A097;
  content: "";
}
.wfs-onboarding-control[data-state="playing"] { border-color: rgba(102, 132, 95, 0.25); background: rgba(233, 240, 231, 0.86); color: #516B4D; }
.wfs-onboarding-control[data-state="playing"]::before { background: #66845F; box-shadow: 0 0 0 4px rgba(102, 132, 95, 0.12); }
.wfs-onboarding-control[data-state="reduced"]::before { background: #7D8187; }
.wfs-onboarding-control.is-actionable {
  border-color: #A9542C;
  background: #F3DED0;
  color: #8F421E;
  cursor: pointer;
  box-shadow: 0 8px 24px -14px rgba(169, 84, 44, 0.7);
}
.wfs-onboarding-control.is-actionable::before { background: #A9542C; }
.wfs-onboarding-control.is-actionable:hover { border-color: #A9542C; background: #A9542C; color: #fff; }
.wfs-onboarding-control.is-actionable:hover::before { background: #fff; }
.wfs-onboarding-control:focus-visible { outline: 3px solid rgba(169, 84, 44, 0.2); outline-offset: 3px; }
.wfs-onboarding-control:disabled { opacity: 1; }
.wfs-onboarding-window {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(43, 38, 32, 0.16);
  border-radius: 18px;
  background: #E7E8EA;
  box-shadow: 0 42px 86px -42px rgba(20, 16, 12, 0.58), 0 1px 0 rgba(255,255,255,.8) inset;
}
.wfs-onboarding-window .wfs-crop { border-radius: 17px; filter: none; }
.wfs-grid--continuation { margin-top: clamp(58px, 8vw, 104px); }

/* full-screen button: sits in the clear strip ABOVE the mockup */
.wfs-expand {
  position: absolute;
  top: 0;
  right: 6px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(43, 38, 32, 0.16);
  border-radius: 999px;
  background: rgba(245, 240, 233, 0.95);
  color: rgba(43, 38, 32, 0.72);
  font: 600 11.5px 'Instrument Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.wfs-expand::after { content: "Full screen"; }
.wfs-expand:hover { background: #2B2620; border-color: #2B2620; color: #F5F0E9; }
.wfs-onboarding-toolbar .wfs-expand { position: static; }
.wfs-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  place-items: center;
  background: rgba(24, 20, 16, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 4vh 4vw;
}
.wfs-modal.is-open { display: grid; }
.wfs-modal-box { position: relative; border-radius: 16px; overflow: hidden; background: transparent; box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.7); }
.wfs-modal-crop { position: relative; overflow: hidden; width: 100%; height: 100%; }
.wfs-modal-scaler { position: absolute; top: 0; left: 0; transform-origin: top left; }
.wfs-modal-box iframe { display: block; border: 0; background: transparent; }
.wfs-modal-close {
  position: fixed;
  top: 22px;
  right: 26px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(245, 240, 233, 0.35);
  border-radius: 50%;
  background: rgba(43, 38, 32, 0.6);
  color: #F5F0E9;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.wfs-modal-close:hover { background: #A9542C; border-color: #A9542C; }

.wfs-mobile-slot { display: none; }

/* ---- Mobile: stack, no sticky, demo under each step ---- */
@media (max-width: 900px) {
  .wfs-grid { display: block; }
  .wfs-stage-wrap { display: none; }
  .wfs-step { min-height: 0 !important; opacity: 1; padding: clamp(30px, 7vw, 44px) 0; }
  .wfs-mobile-slot { display: block; margin-top: 22px; }
  .wfs-mobile-slot .wfs-panel { grid-area: auto; opacity: 1; visibility: visible; pointer-events: auto; position: relative; }
  .wfs-onboarding { margin: 42px 0 24px; padding-top: 38px; }
  .wfs-onboarding-copy { display: block; margin-bottom: 0; }
  .wfs-onboarding-heading h3 { margin-bottom: 16px; }
  .wfs-onboarding-copy > .wfs-checks { margin-top: 22px; }
  .wfs-onboarding-stage { display: none; }
  .wfs-mobile-slot .wfs-onboarding-panel { padding-top: 0; }
  .wfs-onboarding-toolbar { min-height: 0; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; }
  .wfs-onboarding-hint { flex: 1 1 230px; font-size: 11.5px; }
  .wfs-onboarding-actions { margin-left: auto; }
  .wfs-onboarding-window { border-radius: 13px; }
  .wfs-grid--continuation { margin-top: 44px; }
}
