/* ═══ CTEM Flow Diagram — Page embed ═══ */

.flow {
  width: 100%;
  max-width: 1300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.flow__pipeline {
  width: 100%;
  border: 1px solid rgba(254, 196, 0, 0.3);
  position: relative;
  height: 520px;
}

/* ── Orion Hub ── */
.flow__orion {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  background: #141416;
  border: 2px solid #FEC400;
  padding: 14px 28px;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; z-index: 2;
}
.flow__orion::after {
  content: ''; position: absolute; bottom: -5px; left: 50%;
  transform: translateX(-50%); width: 7px; height: 7px;
  border-radius: 50%; background: #FEC400; opacity: 0.6;
}
.flow__orion-title { font-family: 'Tektur', sans-serif; font-weight: 700; font-size: 24px; color: #FEC400; }
.flow__orion-rule { width: 50%; height: 1px; background: #3C3E43; }
.flow__orion-sub { font-family: 'Geist Mono', monospace; font-size: 10px; color: #F4F3ED; text-align: center; }

/* ── SVG lines ── */
.flow__lines { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: visible; }
.flow__lines path, .flow__lines line { fill: none; stroke: #FEC400; stroke-width: 1.5; opacity: 0.15; }
.flow__lines path.line-active { opacity: 0.7; stroke-width: 2; transition: none; }
.flow__lines path.line-dim { opacity: 0.15; transition: opacity 0.6s ease 0.3s; }
.flow__lines circle { fill: #FEC400; opacity: 0.2; transition: opacity 0.4s ease; }
.flow__lines circle.dot-active { opacity: 0.9; }
.flow__lines circle.dot-dim { opacity: 0.2; transition: opacity 0.6s ease 0.3s; }
.flow__lines .line--foundation { opacity: 0.2; stroke-dasharray: 4 8; }

/* ── Step nodes ── */
.flow__step {
  position: absolute;
  background: #141416;
  border: 1px solid #3C3E43;
  display: flex; flex-direction: column; align-items: center;
  z-index: 1;
  cursor: pointer;
  transition: border-color 0.5s ease;
}
.flow__step:hover { border-color: rgba(254, 196, 0, 0.35); }

/* Box sizes — bookends wider */
#s-scope,
#s-discover,
#s-prioritize,
#s-validate,
#s-mobilize {
  padding: 12px 14px 16px;
  gap: 4px;
}
#s-scope      { width: 210px; }
#s-discover   { width: 200px; }
#s-prioritize { width: 195px; }
#s-validate   { width: 200px; }
#s-mobilize   { width: 210px; }

.flow__step-label { font-family: 'Tektur', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; }
.flow__step-title { font-family: 'Tektur', sans-serif; font-size: 15px; font-weight: 700; color: #F4F3ED; text-align: center; line-height: 1.25; }
.flow__step-desc { font-family: 'Geist Mono', monospace; font-size: 9px; color: #767C91; text-align: center; line-height: 1.4; border-top: 1px solid #2A2B30; padding-top: 4px; margin-top: 2px; width: 100%; }

/* ── Positions — spaced out for 1300px canvas ── */
#s-scope      { left: 20px;  top: 260px; }
#s-discover   { left: 275px; top: 95px; }
#s-prioritize { left: 520px; top: 275px; }
#s-validate   { left: 765px; top: 140px; }
#s-mobilize   { left: 1010px; top: 68px; }

/* ── Accent colors ── */
#s-scope .flow__step-label      { color: #FBBF24; }
#s-discover .flow__step-label   { color: #60A5FA; }
#s-prioritize .flow__step-label { color: #F472B6; }
#s-validate .flow__step-label   { color: #9333EA; }
#s-mobilize .flow__step-label   { color: #4ADE80; }

/* ── Hover detail panels ── */
.flow__detail {
  position: absolute; left: 0; width: 100%;
  background: #111113; border: 1px dashed rgba(254, 196, 0, 0.25);
  padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 4px;
  z-index: 3; opacity: 0; pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.flow__detail--above { bottom: calc(100% + var(--gap, 14px)); transform: translateY(5px); }
.flow__detail--below { top: calc(100% + var(--gap, 14px)); transform: translateY(-5px); }
.flow__step:hover .flow__detail { opacity: 1; transform: translateY(0); pointer-events: auto; }
.flow__detail::before {
  content: ''; position: absolute; left: 50%; width: 1px;
  height: var(--gap, 14px);
  background: repeating-linear-gradient(to bottom, rgba(254, 196, 0, 0.3) 0px, rgba(254, 196, 0, 0.3) 3px, transparent 3px, transparent 7px);
}
.flow__detail--above::before { bottom: calc(var(--gap, 14px) * -1); }
.flow__detail--below::before { top: calc(var(--gap, 14px) * -1); }
.flow__detail-title { font-family: 'Tektur', sans-serif; font-size: 10px; font-weight: 600; letter-spacing: 1.2px; color: #767C91; }
.flow__detail-item { font-family: 'Geist Mono', monospace; font-size: 9px; color: #A0A3AB; line-height: 1.5; display: flex; align-items: flex-start; gap: 4px; }
.flow__detail-item::before { content: '\203A'; color: rgba(254, 196, 0, 0.5); flex-shrink: 0; }

/* ── Step animations ── */
.flow__step-anim { width: 100%; margin-top: 3px; padding-top: 4px; border-top: 1px solid #1E1F23; }
.anim-item { opacity: 0; transform: translateY(2px); transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.anim-item.visible { opacity: 1; transform: translateY(0); }
.anim-cycle { transition: opacity 0.4s ease, color 0.4s ease, border-color 0.4s ease; }

@keyframes select-pop { 0% { transform: scale(1); } 35% { transform: scale(1.08); } 100% { transform: scale(1); } }
.flow__step.step-active { border: 2px solid #FEC400; transition: border-color 0.4s ease, border-width 0.1s ease; }

.scope-anim { position: relative; height: 18px; }
.scope-row { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 5px; font-family: 'Geist Mono', monospace; font-size: 9px; color: #F4F3ED; }
.scope-cat { font-size: 8px; font-weight: 600; letter-spacing: 0.4px; color: #FBBF24; min-width: 38px; opacity: 0.7; }
.scope-val { color: #A0A3AB; }
.scope-row.selected { animation: select-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.scope-row.selected .scope-val { color: #FBBF24; font-weight: 600; }
.scope-row.selected .scope-cat { opacity: 1; }

.discover-anim { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.disc-tag { font-family: 'Geist Mono', monospace; font-size: 8px; color: #60A5FA; padding: 0px 3px; border: 1px solid rgba(96, 165, 250, 0.2); background: rgba(96, 165, 250, 0.04); letter-spacing: 0.3px; }

.pri-anim { display: flex; flex-direction: column; gap: 0; align-items: center; }
.pri-path { font-family: 'Geist Mono', monospace; font-size: 8px; color: #767C91; opacity: 0.3; padding: 0; line-height: 1.6; display: flex; align-items: center; gap: 3px; }
.pri-path.active { opacity: 1; color: #F472B6; }
.pri-marker { opacity: 0; transition: opacity 0.3s ease; color: #F472B6; }
.pri-path.active .pri-marker { opacity: 1; }
.pri-path.selected { opacity: 1; color: #F472B6; animation: select-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.pri-path.selected .pri-marker { opacity: 1; }

.pb-anim { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.pb-pill { font-family: 'Geist Mono', monospace; font-size: 8px; color: #767C91; padding: 1px 6px; border: 1px solid #2A2B30; opacity: 0.35; cursor: pointer; user-select: none; }
.pb-pill.active { opacity: 1; }
.pb-pill.selected { opacity: 1; animation: select-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.pb-pill:hover { opacity: 1; }

.exec-anim { background: rgba(0, 0, 0, 0.3); padding: 3px 5px; display: flex; flex-direction: column; gap: 0; }
.exec-line { font-family: 'Geist Mono', monospace; font-size: 8px; color: #4ADE80; line-height: 1.6; }
.exec-line .exec-check { opacity: 0.7; }

/* ── Outcomes ── */
.flow__outcomes {
  position: absolute; bottom: 14px; left: 1010px; z-index: 1;
  display: flex; flex-direction: column; gap: 2px;
  border: 1px dashed rgba(254, 196, 0, 0.25); padding: 8px 10px;
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.flow__outcomes.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.flow__outcome {
  display: flex; align-items: center; gap: 5px;
  font-family: 'Geist Mono', monospace; font-size: 7px;
  opacity: 0; transform: translateX(-4px); transition: opacity 0.4s ease, transform 0.4s ease;
}
.flow__outcomes.visible .flow__outcome:nth-child(2) { transition-delay: 0.1s; }
.flow__outcomes.visible .flow__outcome:nth-child(3) { transition-delay: 0.2s; }
.flow__outcomes.visible .flow__outcome:nth-child(4) { transition-delay: 0.3s; }
.flow__outcomes.visible .flow__outcome:nth-child(5) { transition-delay: 0.4s; }
.flow__outcomes.visible .flow__outcome { opacity: 1; transform: translateX(0); }
.flow__outcomes-label { font-family: 'Tektur', sans-serif; font-size: 10px; font-weight: 600; color: #767C91; letter-spacing: 1.2px; margin-bottom: 2px; }
.flow__outcome-role { font-family: 'Geist Mono', monospace; font-size: 9px; color: #767C91; min-width: 56px; text-align: right; }
.flow__outcome-product { font-family: 'Geist Mono', monospace; font-size: 9px; color: #F4F3ED; padding: 2px 6px; background: rgba(254, 196, 0, 0.04); border: 1px solid #2A2B30; }

/* ── Foundation ── */
.flow__foundation-gap { height: 28px; display: flex; justify-content: center; }
.flow__foundation-line { width: 1.5px; height: 100%; background: repeating-linear-gradient(to bottom, #FEC400 0px, #FEC400 4px, transparent 4px, transparent 10px); opacity: 0.5; }
.flow__foundation { width: 100%; border: 2px solid #FEC400; background: #111113; padding: 14px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.flow__foundation-title { font-family: 'Tektur', sans-serif; font-size: 17px; font-weight: 700; color: #F4F3ED; font-style: italic; }
.flow__foundation-sub { font-family: 'Geist Mono', monospace; font-size: 9px; color: #FEC400; letter-spacing: 3px; font-weight: 600; }
.flow__foundation-note { font-family: 'Geist Mono', monospace; font-size: 9px; color: #767C91; margin-top: 0; }

/* ── Mobile ── */
.ctem-mobile { display: none; }

@media (max-width: 1024px) {
  .ctem-desktop { display: none !important; }
  .ctem-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 32px;
  }
}

/* ── Mobile Accordion ── */
.dm-card.ctem-acc-card {
  cursor: pointer;
  flex-direction: column;
  align-items: flex-start !important;
  width: 100%;
  padding: 14px 16px 14px 28px !important;
  gap: 4px;
}
.dm-card.ctem-acc-card .dm-card__text { width: 100%; }
.ctem-accordion { width: 100%; }
.ctem-acc-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0;
}
.ctem-acc-card.is-open .ctem-acc-expand {
  max-height: 400px;
  opacity: 1;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease 0.1s;
}
.ctem-acc-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  margin-top: 10px;
  border-top: 1px solid #2A2B30;
}
.ctem-acc-item {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: #A0A3AB;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.ctem-acc-item::before { content: '\203A'; color: rgba(254, 196, 0, 0.5); flex-shrink: 0; }

/* Animation area */
.ctem-acc-anim {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  opacity: 0;
  transition: opacity 0.5s ease 0.2s;
}
.ctem-acc-card.is-open .ctem-acc-anim { opacity: 1; }

/* Technique tags */
.ctem-acc-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: #60A5FA;
  padding: 2px 6px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  background: rgba(96, 165, 250, 0.04);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.ctem-acc-card.is-open .ctem-acc-tag { opacity: 1; transform: translateY(0); }
.ctem-acc-card.is-open .ctem-acc-tag:nth-child(1) { transition-delay: 0.3s; }
.ctem-acc-card.is-open .ctem-acc-tag:nth-child(2) { transition-delay: 0.45s; }
.ctem-acc-card.is-open .ctem-acc-tag:nth-child(3) { transition-delay: 0.6s; }
.ctem-acc-card.is-open .ctem-acc-tag:nth-child(4) { transition-delay: 0.75s; }
.ctem-acc-card.is-open .ctem-acc-tag:nth-child(5) { transition-delay: 0.9s; }
.ctem-acc-card.is-open .ctem-acc-tag:nth-child(6) { transition-delay: 1.05s; }

/* Attack paths */
.ctem-acc-anim[data-anim="prioritize"] { flex-direction: column; gap: 2px; }
.ctem-acc-path {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: #767C91;
  opacity: 0.35;
  width: 100%;
  padding: 2px 0;
  transition: opacity 0.4s ease, color 0.4s ease;
}
.ctem-acc-path.is-scanning { opacity: 1; color: #F472B6; }
.ctem-acc-path.is-selected { opacity: 1; color: #F472B6; font-weight: 600; }

/* Playbook pills */
.ctem-acc-pill {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  padding: 4px 12px;
  border: 1px solid;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease, background-color 0.3s ease, color 0.3s ease;
}
.ctem-acc-card.is-open .ctem-acc-pill { opacity: 0.5; transform: translateY(0); }
.ctem-acc-card.is-open .ctem-acc-pill:nth-child(1) { transition-delay: 0.3s; }
.ctem-acc-card.is-open .ctem-acc-pill:nth-child(2) { transition-delay: 0.5s; }
.ctem-acc-card.is-open .ctem-acc-pill:nth-child(3) { transition-delay: 0.7s; }
.ctem-acc-card.is-open .ctem-acc-pill:nth-child(4) { transition-delay: 0.9s; }
.ctem-acc-pill.is-cycling { opacity: 1 !important; }
.ctem-acc-pill.is-selected { opacity: 1 !important; color: #0C0C0D !important; }

/* Terminal */
.ctem-acc-terminal {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.ctem-acc-line {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: #4ADE80;
  line-height: 1.6;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.ctem-acc-line.is-visible { opacity: 1; transform: translateX(0); }

/* Scope cycling animation */
.ctem-acc-cycle {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: #F4F3ED;
  min-height: 20px;
}
.ctem-acc-cycle .cycle-label {
  font-size: 9px;
  color: #FBBF24;
  opacity: 0.7;
  margin-right: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.ctem-acc-cycle .cycle-value {
  color: #A0A3AB;
}
.ctem-acc-cycle .cycle-value.selected {
  color: #FBBF24;
  font-weight: 600;
}
