/* =====================================================
   BLUEPRINT-TO-BUILD ENGINE — SHARED DESIGN SYSTEM
   Palette from Antigravity slide-generator
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:  #A100FF;
  --dark:    #460073;
  --mid:     #7500C0;
  --tint:    #F2E6FF;
  --tint2:   #FAF5FF;
  --page-bg: #08000F;

  --n900: #0D0D0D;
  --n700: #333333;
  --n500: #666666;
  --n300: #999999;
  --n100: #F2F2F2;
  --rule: #D9D9D9;
  --white: #FFFFFF;

  --must:   #C62828;
  --should: #E65100;
  --could:  #2E7D32;
  --wont:   #757575;

  --success: #00C48C;
  --warn:    #FFB800;
  --error:   #FF3B3B;
}

html {
  background: var(--page-bg);
  width: 100%;
  overflow-x: hidden;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--page-bg);
  color: var(--n900);
  width: 1600px;
  min-height: 1200px;
  margin: 0 auto;
  overflow-x: hidden;
  animation: pageIn 0.35s ease both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PAGE SHELL ─────────────────────────────────────── */
.page {
  width: 1600px;
  min-height: 1200px;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

/* ── HEADER BAND ────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--page-bg) 0%, var(--dark) 60%, var(--mid) 100%);
  color: var(--white);
  padding: 28px 64px 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-left .kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}
.header-left h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.header-left .subhead {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  margin-top: 6px;
  font-weight: 400;
}

/* ── STEPPER ────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding-top: 4px;
}
.step-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}
.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  transition: all 0.4s ease;
}
.step-node.done .step-dot {
  border-color: rgba(255,255,255,0.6);
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
}
.step-node.active .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 0 18px rgba(161,0,255,0.7);
}
.step-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  text-align: center;
  white-space: nowrap;
}
.step-node.done .step-label  { color: rgba(255,255,255,0.6); }
.step-node.active .step-label { color: var(--white); }
.step-line {
  width: 40px;
  height: 2px;
  background: rgba(255,255,255,0.15);
  margin-bottom: 18px;
  transition: background 0.4s ease;
}
.step-node.done + .step-line { background: rgba(255,255,255,0.4); }

/* ── PAGE BODY ──────────────────────────────────────── */
.page-body {
  flex: 1;
  padding: 40px 64px 48px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── GRID HELPERS ───────────────────────────────────── */
.g2  { display: grid; grid-template-columns: 1fr 1fr;         gap: 24px; }
.g3  { display: grid; grid-template-columns: 1fr 1fr 1fr;     gap: 24px; }
.g4  { display: grid; grid-template-columns: repeat(4,1fr);   gap: 20px; }
.g32 { display: grid; grid-template-columns: 1.8fr 1fr;       gap: 32px; }
.g23 { display: grid; grid-template-columns: 1fr 1.5fr;       gap: 32px; }

/* ── CARDS ──────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 22px 26px;
}
.card-flat {
  background: var(--n100);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 22px 26px;
}
.card-dark {
  background: linear-gradient(135deg, var(--dark), var(--mid));
  border-radius: 6px;
  padding: 22px 26px;
  color: var(--white);
}
.card-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 14px;
}
.card-dark .card-title { color: rgba(255,255,255,0.6); }

/* ── SECTION HEADING ────────────────────────────────── */
.section-heading {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom: 2px solid var(--tint);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* ── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--mid);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(161,0,255,0.35);
}
.btn-large { padding: 18px 48px; font-size: 16px; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover { background: var(--tint); }

/* ── FORM ───────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--rule);
  border-radius: 4px;
  font-size: 16px;
  font-family: inherit;
  color: var(--n900);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(161,0,255,0.12);
}
.form-group { margin-bottom: 20px; }

/* ── CHIP ───────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--tint);
  color: var(--mid);
  border: 1px solid rgba(161,0,255,0.25);
}
.chip-dark {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.2);
}

/* ── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.badge-M { background: #FFEBEE; color: var(--must); }
.badge-S { background: #FFF3E0; color: var(--should); }
.badge-C { background: #E8F5E9; color: var(--could); }
.badge-W { background: #F5F5F5; color: var(--wont); }

/* ── PROCESSING OVERLAY ─────────────────────────────── */
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,0,15,0.96);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
#overlay.show { display: flex; }

.orb {
  width: 110px;
  height: 110px;
  position: relative;
}
.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation: spin 1.1s linear infinite;
}
.orb-ring:nth-child(2) {
  inset: 14px;
  border-top-color: var(--mid);
  animation-duration: 1.7s;
  animation-direction: reverse;
}
.orb-ring:nth-child(3) {
  inset: 28px;
  border-top-color: rgba(161,0,255,0.35);
  animation-duration: 2.3s;
}
.orb-core {
  position: absolute;
  inset: 42px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, var(--dark) 100%);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{ opacity:.8; transform:scale(1); } 50%{ opacity:1; transform:scale(1.12); } }

.overlay-title {
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.overlay-step {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  min-height: 20px;
  text-align: center;
}
.overlay-bar-wrap {
  width: 440px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.overlay-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--dark), var(--accent));
  border-radius: 2px;
  width: 0%;
  transition: width 0.25s ease;
}
.overlay-phase-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── SCOPE ITEMS (Phase 1) ──────────────────────────── */
.scope-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
  transform: translateX(-16px);
}
.scope-item.visible {
  opacity: 1;
  transform: translateX(0);
}
.scope-item.selected { border-color: var(--accent); background: var(--tint2); }
.scope-cb {
  width: 20px; height: 20px;
  border: 2px solid var(--rule);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.scope-item.selected .scope-cb {
  background: var(--accent);
  border-color: var(--accent);
}
.scope-item h4 { font-size: 14px; font-weight: 600; color: var(--n900); margin-bottom: 2px; }
.scope-item p  { font-size: 12px; color: var(--n500); }

/* NFR items */
.nfr-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}
.nfr-row:last-child { border-bottom: none; }
.nfr-label { font-size: 13px; font-weight: 600; color: var(--n700); }
.nfr-val   { font-size: 13px; font-weight: 700; color: var(--mid); text-align: right; }
.nfr-note  { font-size: 11px; color: var(--n300); text-align: right; margin-top: 2px; }

/* ── PERSONA (Phase 2) ──────────────────────────────── */
.persona-card {
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
}
.persona-head {
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--dark) 0%, var(--mid) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 14px;
}
.persona-av {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
  flex-shrink: 0;
}
.persona-name { font-size: 16px; font-weight: 700; }
.persona-role { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 2px; }
.persona-meta { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 1px; }
.persona-body { padding: 18px 22px; flex: 1; }

.journey-strip {
  display: flex;
  align-items: center;
  margin: 14px 0;
  position: relative;
}
.journey-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.j-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 auto 5px;
  position: relative;
  z-index: 1;
}
.journey-step + .journey-step::before {
  content: '';
  position: absolute;
  top: 4px; left: -50%; right: 50%;
  height: 2px;
  background: var(--rule);
  z-index: 0;
}
.j-label { font-size: 9px; color: var(--n500); line-height: 1.2; }

.pain-point {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--n700);
  line-height: 1.4;
}
.pain-icon { color: var(--error); font-size: 13px; flex-shrink: 0; margin-top: 1px; }

/* ── EPIC / STORY (Phase 3) ─────────────────────────── */
.epic-block {
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}
.epic-head {
  padding: 14px 22px;
  background: var(--dark);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.epic-title { font-size: 15px; font-weight: 700; }
.story-row {
  padding: 13px 22px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.story-row:last-child { border-bottom: none; }
.story-row p { font-size: 13px; color: var(--n700); line-height: 1.45; }
.story-row small { font-size: 11px; color: var(--n500); display: block; margin-top: 3px; }

/* ── TECH STACK (Phase 4) ───────────────────────────── */
.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.tech-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 10px;
  background: var(--tint);
  display: flex; align-items: center; justify-content: center;
}
.tech-name { font-size: 11px; font-weight: 700; color: var(--n700); }
.tech-role { font-size: 10px; color: var(--n400, #aaa); }

/* ADR accordion */
.adr-item {
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.adr-head {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--n100);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--n900);
  user-select: none;
}
.adr-head:hover { background: var(--tint); }
.adr-body {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--n700);
  border-top: 1px solid var(--rule);
  line-height: 1.5;
  display: none;
}
.adr-item.open .adr-body { display: block; }
.adr-chevron { transition: transform 0.2s; font-size: 10px; color: var(--n500); }
.adr-item.open .adr-chevron { transform: rotate(180deg); }

/* ── WIREFRAME SHELLS (Phase 5) ─────────────────────── */
.wf-shell {
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.wf-label {
  padding: 9px 16px;
  background: var(--dark);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wf-content { flex: 1; background: #F8F9FA; }

/* ── SHOWCASE PIPELINE BAR (Phase 6) ────────────────── */
.pipeline-bar {
  display: flex;
  align-items: center;
  background: var(--n100);
  border-radius: 8px;
  padding: 22px 32px;
}
.pl-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pl-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(161,0,255,0.35);
}
.pl-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--n700);
}
.pl-connector {
  flex: 0 0 32px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 28px;
}

/* ── SHOWCASE TABS ──────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 12px 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--n500);
  cursor: pointer;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: none;
  font-family: inherit;
  transition: all 0.2s;
  text-transform: uppercase;
}
.tab-btn.active  { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--n700); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── STAT TILES ─────────────────────────────────────── */
.stat-tile {
  text-align: center;
  padding: 24px 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--white);
}
.stat-num {
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--n500);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── STEPPER LINKS (change a) ───────────────────────── */
.step-link { text-decoration: none; }
.step-link:hover .step-dot {
  box-shadow: 0 0 12px rgba(161,0,255,0.55);
  transform: scale(1.08);
  transition: all 0.2s ease;
}

/* ── FUTURE PIPELINE STEPS (change c) ──────────────── */
.pl-step-future .pl-icon {
  background: #E0E0E0;
  box-shadow: none;
}
.pl-step-future .pl-label { color: var(--n300); }
.pl-conn-future { background: #D9D9D9; }
.pl-coming {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--n300);
  background: #F2F2F2;
  border-radius: 10px;
  padding: 2px 7px;
  margin-top: 5px;
}

/* ── UTILITY ────────────────────────────────────────── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap8  { gap: 8px; }
.gap16 { gap: 16px; }
.gap24 { gap: 24px; }
.mt8   { margin-top: 8px; }
.mt16  { margin-top: 16px; }
.mt24  { margin-top: 24px; }
.mb8   { margin-bottom: 8px; }
.mb16  { margin-bottom: 16px; }
.text-sm   { font-size: 12px; }
.text-xs   { font-size: 11px; }
.text-muted { color: var(--n500); }
.bold  { font-weight: 700; }
.row   { display: flex; gap: 16px; align-items: center; }
