/* =========================
   Lumeve • User Flow section
   Full-height animated line, subtle image card,
   overlay zoom, hint, fullscreen lightbox
========================= */

:root{
  --rail-max: var(--rail-max, 1160px);
  --rail-pad: var(--rail-pad, clamp(16px, 4vw, 48px));
  --ink-900: var(--ink-900, #1f1f1f);
  --ink-600: var(--ink-600, #5c626a);
  --accent: var(--accent, #FF6C63);
}

/* Section shell */
.user-flow{
  position: relative;
  padding: clamp(32px, 5vw, 72px) 0;


  /* Performance: skip layout and paint until near viewport */
  content-visibility: auto;
  contain-intrinsic-size: 760px; /* rough placeholder height to prevent jump */
}

/* Grid rail */
.user-flow__rail{
  position: relative; /* for full-height line */
  max-width: var(--rail-max);
  padding: 0 var(--rail-pad);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3vw, 28px);
}

/* === Full-height animated blue line === */
.user-flow__label{
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0; /* span entire section */
  width: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg,
    #FF6C63 0%,
    rgba(210, 115, 108, 0.75) 55%,
    rgba(236, 240, 242, 0.932) 100%);
  background-size: 100% 300%;
  animation: flowShimmer 6s linear infinite, breathe 6s ease-in-out infinite;
  box-shadow: inset 0 0 0 1px rgba(57,143,186,.15);
  overflow: hidden;

  /* Hint the browser this element animates */
  will-change: background-position, box-shadow;
}

.user-flow__label::after{
  content:"";
  position:absolute;
  left:2px; right:2px; top:-30%;
  height:28%;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,0));
  filter: blur(1px);
  opacity:0;
  animation: lineSweep 2.8s ease-in-out infinite;
}

@keyframes flowShimmer{
  0%   { background-position: 0% 0%; }
  100% { background-position: 0% 100%; }
}
@keyframes breathe{
  0%   { box-shadow: inset 0 0 0 1px rgba(57,143,186,.15); }
  50%  { box-shadow: inset 0 0 8px 2px rgba(57,143,186,.28); }
  100% { box-shadow: inset 0 0 0 1px rgba(57,143,186,.15); }
}
@keyframes lineSweep{
  0%   { top:-30%; opacity:0; }
  10%  { opacity:1; }
  50%  { top:68%; opacity:1; }
  100% { top:110%; opacity:0; }
}

/* Header text */
.user-flow__head{
  grid-template-columns: 1fr;
  padding-left: 28px; /* spacing from full-height line */
  width: 100%;
  contain: paint; /* isolate paints for the text block */
}
.user-flow__head > :not(.user-flow__label){
  grid-column: 1;
  max-width: 68ch;
}

.user-flow__title{
  color: var(--ink-900);
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.user-flow__lead{
  color: var(--ink-900);
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 500;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.7;
  margin-top: .35rem;
}
.user-flow__sub{
  color: var(--ink-600);
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(13px, 1.3vw, 16px);
  line-height: 1.6;
}

/* Figure card on clean white */
.user-flow__figure{
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff; /* white card */
  padding: clamp(8px, 2vw, 16px);
  border: 1px solid rgba(2, 6, 23, 0.12);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
  transition: box-shadow .3s ease, transform .3s ease, background .3s ease;

  /* Performance: keep paints inside the card */
  contain: paint;
  will-change: transform;
}
.user-flow__figure:hover{
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  transform: translateY(-1px);
  cursor: zoom-in;
}

/* Ensure image and picture fill the button or link */
.user-flow__figure picture,
.user-flow__figure img{
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1350/504;
  object-fit: cover;
  opacity: 0.98;
  transition: opacity .3s ease;
}
.user-flow__figure:hover img{ opacity: 1; }

/* If you use a <button> wrapper to open the lightbox */
.user-flow__openbtn{
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.user-flow__openbtn:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}

/* If you still use an <a>, keep it visually identical */
.user-flow__imglink{
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  text-decoration: none;
}

/* Hover overlay zoom */
.user-flow__figure.zoomable{ isolation: isolate; }
.user-flow__figure .zoom-overlay{
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  border-radius: inherit;
  background-color: rgba(0,0,0,.06);
  background-repeat: no-repeat;
  background-size: 185% auto;
  background-position: center center;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.22));
}
.user-flow__figure:hover .zoom-overlay{ opacity: 1; }

/* Hint caption under the image */
.user-flow__hint{
  margin-top: 10px;
  text-align: left;
}
.user-flow__hint,
.user-flow__hint a{
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-900);
  text-decoration: none;
}
.user-flow__hint a{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
}
.user-flow__hint a::before{ content: "🔍"; }
.user-flow__hint a:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.08);
}
/* If the hint is a button, style it like the pill link */
.user-flow__hint button{
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  font: 600 0.95rem/1.1 Montserrat, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink-900);
  cursor: pointer;
}
.user-flow__hint button::before{ content: "🔍"; }

/* Two column on larger screens */
@media (min-width: 980px){
  .user-flow__rail{
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: clamp(28px, 4vw, 64px);
  }
}

/* ===== Fullscreen lightbox, white background */
/* Neutralize any old :target rules */
.tf-lightbox:target{ display: none !important; }

/* Support [hidden] so overlay is zero cost until opened */
.tf-lightbox[hidden]{ display: none !important; }

body.lightbox-open{ overflow:hidden; }

.tf-lightbox{
  position: fixed;
  inset: 0;
  display: none;                 /* not in render tree until opened */
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 28px);
  background: #fff;             /* white full screen */
  z-index: 12000;
  opacity: 0;
  visibility: hidden;
  transform: scale(.985) translateZ(0); /* own compositor layer */
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;

  /* isolate and contain overlay work */
  isolation: isolate;
  contain: layout paint size;
}

.tf-lightbox.is-open{
  display: flex;
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateZ(0);
}

.tf-lightbox__img{
  max-width: min(96vw, 1600px);
  max-height: 92vh;
  border-radius: 10px;
  border: 1px solid rgba(2, 6, 23, 0.10); /* subtle frame on white */
  box-shadow: none;
  transform: none;
}

.tf-lightbox__close{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  display: grid;
  place-items: center;
  font: 800 18px/1 Montserrat, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  box-shadow: none;
  cursor: pointer;
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce){
  .user-flow__label,
  .user-flow__label::after,
  .zoom-overlay,
  .tf-lightbox,
  .tf-lightbox__img{
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile tweaks */
@media (max-width: 768px){
  .user-flow__label{
    position: relative;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    left: auto;
    top: auto;
    bottom: auto;
    margin-bottom: 12px;
    display: block;
  }
  .user-flow__head{
    padding-left: 0;
  }
}


/* Task Flow lightbox, safe defaults */
.tf-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0,0,0,0.7);
  z-index: 4000;
  padding: 24px;
}
.tf-lightbox.is-open { display: grid; }
.tf-lightbox__img {
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.35);
  background: #fff;
}
.tf-lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
@media (prefers-reduced-motion: reduce) {
  .tf-lightbox { transition: none; }
}
