/* ============================================================
   SOFTWARE FACTORY — Agentic Workflow OS components
   Shared across pre-login pages. Builds on sf.css tokens.
   Signature element: the workflow-execution diagram.
   ============================================================ */

/* ---- mono section eyebrow with bracket ---- */
.os-tag { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); display: inline-flex; align-items: center; gap: 8px; }
.os-tag b { color: var(--blue-hi); font-weight: 500; }

/* ============================================================
   1. SIGNATURE WORKFLOW-EXECUTION DIAGRAM
   Input → Context → Agents → Tools → Approval → Action → Evidence → Outcome
   ============================================================ */
.exec {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(59,130,246,.10), transparent 55%),
    radial-gradient(120% 140% at 100% 100%, rgba(139,92,246,.12), transparent 55%),
    linear-gradient(180deg, var(--surface-2), var(--navy));
  border: 1px solid var(--line-2); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); overflow: hidden; position: relative;
}
.exec__bar { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--text-3); background: rgba(0,0,0,.16); }
.exec__dots { display: inline-flex; gap: 6px; }
.exec__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.exec__name { color: var(--text-2); }
.exec__live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--success); }
.exec__live i { width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: blip 1.8s infinite; }

.exec__body { padding: clamp(20px, 3vw, 34px) clamp(16px, 3vw, 30px); }

/* IO chips above/below the rail */
.exec__io { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.exec__col { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }
.exec__col--out { align-items: flex-end; text-align: right; }
.exec__colhead { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.io-chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-2);
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 100px; padding: 6px 13px; white-space: nowrap; }
.io-chip .d { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); flex: none; }
.exec__col--out .io-chip .d { background: var(--purple); }

/* the rail of stages */
.exec__rail { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; position: relative; align-items: stretch; }
.exec__line { position: absolute; left: 6%; right: 6%; top: 27px; height: 2px; z-index: 0;
  background: var(--line-2); border-radius: 2px; overflow: hidden; }
.exec__line::after { content: ""; position: absolute; inset: 0; width: 36%;
  background: linear-gradient(90deg, transparent, var(--blue), var(--purple), transparent);
  animation: railpulse 3.4s linear infinite; }
@keyframes railpulse { from { transform: translateX(-100%); } to { transform: translateX(380%); } }

.exec-stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 9px; padding: 0 6px; }
.exec-stage__node { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; position: relative;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2);
  transition: .45s cubic-bezier(.2,.7,.2,1); }
.exec-stage__node svg { width: 22px; height: 22px; }
.exec-stage__num { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--mono); font-size: 9.5px; color: var(--text-3);
  background: var(--navy); border: 1px solid var(--line-2); }
.exec-stage__label { font-family: var(--display); font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.exec-stage__sub { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: var(--text-3); }
/* gate marker on the approval stage */
.exec-stage--gate .exec-stage__node { border-style: dashed; border-color: var(--warning); color: var(--warning); }

/* lit / active travelling state */
.exec-stage.lit .exec-stage__node {
  background: linear-gradient(180deg, var(--blue), var(--blue-deep)); color: #fff; border-color: transparent;
  box-shadow: 0 0 0 4px rgba(59,130,246,.14), 0 14px 30px -10px var(--glow-blue); transform: translateY(-3px); }
.exec-stage.lit .exec-stage__num { color: var(--blue-hi); border-color: var(--blue); }
.exec-stage--gate.lit .exec-stage__node { background: linear-gradient(180deg, var(--warning), #c2410c);
  border-color: transparent; box-shadow: 0 0 0 4px rgba(249,115,22,.14), 0 14px 30px -10px rgba(249,115,22,.5); }
.exec-stage.done .exec-stage__node { border-color: var(--success); color: var(--success); }

@media (max-width: 720px) {
  .exec__rail { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); gap: 18px 6px; }
  .exec__line { display: none; }
  .exec__io { display: none; }
}

/* ============================================================
   2. CIRCULAR EXECUTION LOOP
   ============================================================ */
.loop { position: relative; width: min(440px, 86vw); aspect-ratio: 1; margin: 0 auto; }
.loop__ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--line-2); }
.loop__spin { position: absolute; inset: 8%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(59,130,246,.18), rgba(139,92,246,.22), transparent 60%);
  animation: loopspin 16s linear infinite; }
@media (prefers-reduced-motion: reduce){ .loop__spin{ animation: none; } }
@keyframes loopspin { to { transform: rotate(360deg); } }
.loop__core { position: absolute; inset: 31%; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: linear-gradient(180deg, var(--surface-2), var(--navy)); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); padding: 12px; }
.loop__core b { font-family: var(--display); font-weight: 600; font-size: clamp(15px, 2vw, 19px); letter-spacing: -.02em; line-height: 1.1; }
.loop__core span { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; display: block; }
.loop__node { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column;
  align-items: center; gap: 5px; width: 96px; }
.loop__chip { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--blue-hi); transition: .35s; }
.loop__chip svg { width: 19px; height: 19px; }
.loop__node b { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: var(--text-2); }
.loop__node.on .loop__chip { background: linear-gradient(180deg, var(--blue), var(--blue-deep)); color: #fff; border-color: transparent;
  box-shadow: 0 0 22px -4px var(--glow-blue); transform: scale(1.08); }
.loop__node.on b { color: var(--text); }
@media (max-width: 560px) {
  .loop { width: min(300px, 70vw); margin-block: 30px; }
  .loop__node { width: 78px; }
  .loop__chip { width: 34px; height: 34px; }
  .loop__chip svg { width: 16px; height: 16px; }
  .loop__node b { font-size: 10px; }
}

/* ============================================================
   3. LAYER CARDS (Workflow / Agent / Tool / Trust)
   ============================================================ */
.layer { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px; position: relative; overflow: hidden; transition: .2s; }
.layer:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.layer::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--blue), var(--purple)); opacity: .85; }
.layer__n { font-family: var(--mono); font-size: 11px; color: var(--text-3); letter-spacing: .1em; }
.layer h3 { font-size: 19px; margin: 10px 0 6px; }
.layer__sub { font-size: 14px; color: var(--text-2); margin: 0 0 16px; }
.layer__tags { display: flex; flex-wrap: wrap; gap: 7px; }
.layer__tags span { font-family: var(--mono); font-size: 11px; color: var(--text-2); background: rgba(255,255,255,.03);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 9px; }
.layer--trust::before { background: linear-gradient(180deg, var(--success), var(--cyan)); }

/* ============================================================
   4. USE-CASE / SOLUTION CARDS
   ============================================================ */
.uc { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px; display: flex; flex-direction: column; transition: .2s; position: relative; overflow: hidden; }
.uc:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.uc__ic { width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; margin-bottom: 16px;
  background: rgba(59,130,246,.10); border: 1px solid rgba(59,130,246,.22); color: var(--blue-hi); }
.uc__ic svg { width: 21px; height: 21px; }
.uc--p .uc__ic { background: rgba(139,92,246,.10); border-color: rgba(139,92,246,.24); color: var(--purple-hi); }
.uc h3 { font-size: 19px; margin-bottom: 6px; }
.uc__line { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-bottom: 12px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 6px; }
.uc__line em { font-style: normal; color: var(--blue-hi); }
.uc__line .ar { color: var(--text-3); }
.uc > p { font-size: 14.5px; color: var(--text-2); margin: 0 0 16px; }
.uc__out { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 7px; }
.uc__out li { font-family: var(--mono); font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 9px; }
.uc__out li::before { content: ""; width: 5px; height: 5px; border-radius: 1px; background: var(--blue); flex: none; }
.uc--p .uc__out li::before { background: var(--purple); }
.uc__cta { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--blue-hi); }
.uc--p .uc__cta { color: var(--purple-hi); }
.uc:hover .uc__cta .arr { transform: translateX(3px); }

/* ============================================================
   5. TRUST FEATURE CARDS
   ============================================================ */
.trust-card { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px; transition: .2s; }
.trust-card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.trust-card__ic { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(34,197,94,.10); border: 1px solid rgba(34,197,94,.22); color: var(--success); }
.trust-card__ic svg { width: 19px; height: 19px; }
.trust-card h3 { font-size: 16px; margin-bottom: 6px; }
.trust-card p { font-size: 13.5px; color: var(--text-2); margin: 0; line-height: 1.5; }

/* ============================================================
   6. COMPARISON TABLE (Traditional AI vs Software Factory)
   ============================================================ */
.vs { border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--navy)); }
.vs__row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.vs__row:last-child { border-bottom: 0; }
.vs__row--head .vs__cell { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; padding: 16px 22px; }
.vs__cell { padding: 15px 22px; font-size: 14.5px; color: var(--text-2); display: flex; align-items: center; gap: 11px; }
.vs__cell:first-child { border-right: 1px solid var(--line); color: var(--text-3); }
.vs__cell--head-a { color: var(--text-3); }
.vs__cell--head-b { color: var(--blue-hi); background: rgba(59,130,246,.05); }
.vs__row .vs__cell:last-child { color: var(--text); background: rgba(59,130,246,.04); }
.vs__cell .ic { width: 17px; height: 17px; flex: none; }
.vs__cell--a .ic { color: var(--text-3); }
.vs__cell--b .ic { color: var(--success); }
@media (max-width: 600px) { .vs__cell { padding: 12px 15px; font-size: 13px; } }

/* ============================================================
   7. FOUNDRY GRID
   ============================================================ */
.fgroup { margin-top: 36px; }
.fgroup__head { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3);
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.fgroup__head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fcard { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; transition: .2s; position: relative; overflow: hidden; }
.fcard:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.fcard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fcard__ic { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center;
  background: rgba(59,130,246,.10); border: 1px solid rgba(59,130,246,.22); color: var(--blue-hi); }
.fcard__ic svg { width: 20px; height: 20px; }
.fcard--p .fcard__ic { background: rgba(139,92,246,.10); border-color: rgba(139,92,246,.24); color: var(--purple-hi); }
.fcard__badge { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px;
  border-radius: 100px; border: 1px solid var(--line-2); color: var(--text-3); }
.fcard__badge.live { color: var(--success); border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.07); }
.fcard h3 { font-size: 16.5px; margin-bottom: 4px; }
.fcard__tag { font-family: var(--mono); font-size: 11.5px; color: var(--blue-hi); margin-bottom: 10px; }
.fcard p { font-size: 13.5px; color: var(--text-2); margin: 0; line-height: 1.5; }

/* ============================================================
   8. ENGAGEMENT STAGES  Assess → Pilot → Prove → Scale
   ============================================================ */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stage-card { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px; position: relative; }
.stage-card__k { font-family: var(--mono); font-size: 11px; color: var(--text-3); letter-spacing: .1em; }
.stage-card h3 { font-size: 19px; margin: 8px 0 4px; }
.stage-card__dur { font-family: var(--mono); font-size: 11.5px; color: var(--blue-hi); margin-bottom: 12px; }
.stage-card p { font-size: 13.5px; color: var(--text-2); margin: 0 0 14px; }
.stage-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.stage-card li { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); display: flex; gap: 8px; align-items: flex-start; }
.stage-card li::before { content: "→"; color: var(--blue-hi); }
.stage-card--hot { border-color: var(--blue); box-shadow: 0 0 36px -16px var(--glow-blue); }
@media (max-width: 880px) { .stages { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .stages { grid-template-columns: 1fr; } }

/* ============================================================
   9. EVIDENCE PACKET (stacked cards)
   ============================================================ */
.evidence { display: flex; flex-wrap: wrap; gap: 10px; }
.ev-card { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--text-2);
  background: rgba(255,255,255,.03); border: 1px solid var(--line-2); border-radius: var(--r); padding: 11px 14px; }
.ev-card svg { width: 16px; height: 16px; color: var(--success); flex: none; }

/* ============================================================
   10. PAGE HERO (shared simple hero for sub-pages)
   ============================================================ */
.phero { padding-top: clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--line); position: relative; z-index: 1; }
.phero__inner { max-width: 880px; }
.phero h1 { font-size: clamp(34px, 5vw, 60px); margin: 18px 0 18px; letter-spacing: -.035em; }
.phero .lead { margin-bottom: 0; }

/* generic 2-col split used on sub-pages */
.os-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .os-split { grid-template-columns: 1fr; gap: 36px; } }

/* numbered step list (operating system page) */
.osteps { display: grid; gap: 14px; }
.ostep { display: grid; grid-template-columns: 46px 1fr; gap: 18px; align-items: start;
  background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 22px; transition: .2s; }
.ostep:hover { border-color: var(--line-2); }
.ostep__n { width: 46px; height: 46px; border-radius: var(--r); display: grid; place-items: center; font-family: var(--mono);
  font-size: 15px; color: var(--blue-hi); background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.2); }
.ostep h3 { font-size: 17px; margin-bottom: 6px; }
.ostep p { font-size: 14px; color: var(--text-2); margin: 0 0 10px; }
.ostep__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ostep__tags span { font-family: var(--mono); font-size: 11px; color: var(--text-2); background: rgba(255,255,255,.03);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; }

/* vertical architecture stack (operating system page) */
.arch-stack { display: flex; flex-direction: column; }
.arch-row { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line); }
.arch-row__n { font-family: var(--mono); font-size: 11px; color: var(--blue-hi); flex: none; width: 22px; }
.arch-row__meta b { font-family: var(--display); font-size: 14px; font-weight: 600; display: block; letter-spacing: -.01em; }
.arch-row__meta span { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); letter-spacing: .02em; }
.arch-row--ctl { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.05); }
.arch-row--ctl .arch-row__n { color: var(--success); }
.arch-arrow { text-align: center; color: var(--text-3); font-size: 14px; line-height: 1; padding: 3px 0; }

/* ---- workflow chain (mono steps with arrows) ---- */
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.chain__step { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: rgba(255,255,255,.03);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 12px; white-space: nowrap; }
.chain__ar { color: var(--text-3); font-size: 13px; }
.chain__step--in { color: var(--blue-hi); border-color: rgba(59,130,246,.32); }
.chain__step--out { color: var(--purple-hi); border-color: rgba(139,92,246,.32); }

/* ---- solution block (solutions page) ---- */
.sol { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(24px, 3vw, 38px); position: relative; overflow: hidden; scroll-margin-top: 90px; }
.sol::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--purple)); opacity: .8; }
.sol__head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.sol__ic { width: 50px; height: 50px; border-radius: var(--r); display: grid; place-items: center; flex: none;
  background: rgba(59,130,246,.10); border: 1px solid rgba(59,130,246,.22); color: var(--blue-hi); }
.sol__ic svg { width: 24px; height: 24px; }
.sol--p .sol__ic { background: rgba(139,92,246,.10); border-color: rgba(139,92,246,.24); color: var(--purple-hi); }
.sol__head h2 { font-size: clamp(22px, 2.6vw, 30px); }
.sol__aud { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.sol__body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; margin-top: 22px; }
.sol__body p { font-size: 15px; color: var(--text-2); margin: 0 0 18px; }
@media (max-width: 820px) { .sol__body { grid-template-columns: 1fr; gap: 20px; } }
