/* ===========================================================
   Flow page — layered on top of styles.css
   Reuses :root tokens, .site-header, .brand, .site-nav,
   .nav-toggle, .button(.--accent), .sr-only, fonts.
   Section scale/spacing mirrors author.css / insight.css.
   =========================================================== */

.flow-main {
  background: #ffffff;
}

/* ---------- Hero ---------- */
.flow-hero {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 8.5rem var(--gutter) 5.5rem;
  background: #0f0e0c;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

/* Curtain stacking (see curtain.js): each locked section rises up to cover the
   one before it (the first covers the pinned hero). z-index increases down the
   page so each section paints over the previous one; the closing + footer
   scroll in normally after #editor releases. */
.flow-intro,
.flow-feature,
.flow-closing,
.flow-footer {
  position: relative;
}
.flow-intro {
  z-index: 2;
}
#workflows {
  z-index: 3;
}
#editor {
  z-index: 4;
}
.flow-closing {
  z-index: 5;
}
.flow-footer {
  z-index: 6;
}

/* Locked panels fill the viewport so the lock-and-cover has no gap. */
@media (min-width: 960px) {
  .flow-intro,
  #workflows,
  #editor {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100svh;
  }
}

.flow-hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

/* the source photo is already dimmed; this just lifts text contrast */
.flow-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 12, 0.5) 0%,
    rgba(10, 10, 12, 0.26) 44%,
    rgba(10, 10, 12, 0.54) 100%
  );
}

.flow-hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  max-width: 46rem;
  text-align: center;
}

.flow-hero__icon {
  width: clamp(4.4rem, 6vw, 6.4rem);
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(226, 102, 37, 0.28));
}

.flow-hero h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.5rem, 5vw, 4.55rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.flow-hero__sub {
  margin: 0;
  max-width: 38rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(0.855rem, 1.4vw, 1.025rem);
  line-height: 1.55;
}

/* ---------- Intro band ---------- */
.flow-intro {
  background: #f2f1ef;
  padding: clamp(3rem, 6vw, 4.6rem) var(--gutter);
}

.flow-intro p {
  width: min(100%, 62rem);
  margin: 0 auto;
  text-align: center;
  color: #1f1f1f;
  font-size: clamp(0.855rem, 1.4vw, 1.025rem);
  line-height: 1.55;
}

/* ---------- Feature sections ---------- */
.flow-feature {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
  background: #ffffff;
}

.flow-feature__grid {
  width: min(calc(100% - 2 * var(--gutter)), var(--max-width));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.flow-feature__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(1rem, 1.6vw, 1.4rem);
  box-shadow: var(--section-shadow);
}

.flow-feature__copy h2 {
  margin: 0 0 1.4rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.flow-feature__copy p {
  margin: 0 0 1.1rem;
  max-width: 34rem;
  color: #1f1f1f;
  font-size: clamp(0.845rem, 0.12vw + 0.805rem, 0.875rem);
  line-height: 1.5;
}

.flow-feature__copy p:last-child {
  margin-bottom: 0;
}

@media (min-width: 860px) {
  .flow-feature__grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 5vw, 5.5rem);
  }

  /* image-right variant: copy stays first in DOM, media moves right */
  .flow-feature--media-right .flow-feature__media {
    order: 2;
  }
}

/* ---------- Closing copy ---------- */
.flow-closing {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3.5rem, 7vw, 6rem);
  background: #ffffff;
}

.flow-closing__inner {
  width: min(calc(100% - 2 * var(--gutter)), var(--max-width));
  margin-inline: auto;
}

.flow-closing p {
  margin: 0;
  max-width: 62rem;
  color: #1f1f1f;
  font-size: clamp(0.845rem, 0.12vw + 0.805rem, 0.875rem);
  line-height: 1.5;
}

/* ---------- Footer ---------- */
.flow-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(2.2rem, 4vw, 3rem) clamp(1.5rem, 5vw, 4rem);
  background: #474545;
  color: rgba(255, 255, 255, 0.92);
}

.flow-footer a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: opacity 160ms ease;
}

.flow-footer a:hover {
  opacity: 0.75;
}

.flow-footer__link {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.flow-footer__brand {
  display: inline-flex;
}

.flow-footer__brand img {
  width: 3rem;
  height: auto;
}

.flow-footer__powered {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

@media (max-width: 720px) {
  .flow-footer {
    flex-direction: column;
    text-align: center;
    gap: 1.1rem;
  }
}
