/* ============================================
   AEF Shared Stylesheet
   ============================================ */

/* ---- Base ---- */

.dot-grid {
  background-image: radial-gradient(circle, rgba(200, 112, 64, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

/* ---- Scroll reveal ---- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Animations ---- */

@keyframes flowPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes nodeBreath {
  0%, 100% { box-shadow: 0 0 0 0 var(--node-color); }
  50% { box-shadow: 0 0 20px 2px var(--node-color); }
}

@keyframes dashFlow {
  to { stroke-dashoffset: -20; }
}

@keyframes issuesFlow {
  to { stroke-dashoffset: -30; }
}

@keyframes dataPulse {
  0% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(60px); opacity: 0; }
}

@keyframes layerPulse {
  0%, 100% { border-color: rgba(200, 112, 64, 0.2); }
  50% { border-color: rgba(200, 112, 64, 0.5); }
}

.flow-line { animation: flowPulse 3s ease-in-out infinite; }
.pipeline-node { animation: nodeBreath 4s ease-in-out infinite; }
.loop-arc { animation: dashFlow 1s linear infinite; }
.issues-arc { animation: issuesFlow 2s linear infinite; }
.data-dot { animation: dataPulse 2s ease-in-out infinite; }
.layer-card-glow { animation: layerPulse 4s ease-in-out infinite; }

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  .flow-line, .pipeline-node, .loop-arc, .issues-arc, .data-dot, .layer-card-glow { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Phase card ---- */

.phase-card {
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.phase-card[data-level] {
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.phase-card:hover {
  border-color: var(--phase-color);
  background-color: #2a201a;
}

/* ---- Permission badges ---- */

.perm-allowed {
  background: rgba(138, 176, 106, 0.12);
  color: #8ab06a;
  border: 1px solid rgba(138, 176, 106, 0.2);
}
.perm-denied {
  background: rgba(194, 84, 80, 0.08);
  color: #c25450;
  border: 1px solid rgba(194, 84, 80, 0.15);
}

/* ---- Code block ---- */

.code-block {
  background: #140d0a;
  border: 1px solid #3a2e26;
  border-radius: 8px;
}
.code-block .var { color: #e08a5a; }
.code-block .keyword { color: #9b6b8a; }
.code-block .string { color: #7a9b5e; }
.code-block .comment { color: #6b5849; }
.code-block .type { color: #5a9ba0; }

/* ---- Maturity stepper ---- */

.step-connector {
  width: 2px;
  background: linear-gradient(to bottom, #c87040, #3a2e26);
}

/* ---- Scrollbar ---- */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #140d0a; }
::-webkit-scrollbar-thumb { background: #3a2e26; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #6b5849; }

/* ---- Nav link ---- */

.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #c87040;
  transition: width 0.25s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ---- Focus indicators ---- */

*:focus-visible {
  outline: 2px solid #c87040;
  outline-offset: 2px;
  border-radius: 4px;
}
*:focus:not(:focus-visible) {
  outline: none;
}

/* ---- Pipeline phase sidebar ---- */

.phase-sidebar-item {
  transition: all 0.2s ease;
}
.phase-sidebar-item:hover .phase-dot {
  filter: brightness(1.3);
}
.phase-sidebar-item.active {
  border-left: 3px solid var(--phase-color);
}
.phase-sidebar-item.active .phase-name {
  color: var(--phase-color);
}
.phase-sidebar-item.active .phase-dot {
  box-shadow: 0 0 10px var(--phase-color);
}

/* ---- Mobile phase bar ---- */

.mobile-phase-bar {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mobile-phase-bar::-webkit-scrollbar { display: none; }

/* ---- Pipeline index SVG interactions ---- */

.svg-phase-group { cursor: pointer; transition: opacity 0.3s ease; }
.svg-phase-group:hover rect { filter: brightness(1.3); }
.pipeline-diagram:hover .svg-phase-group { opacity: 0.4; }
.pipeline-diagram:hover .svg-phase-group:hover { opacity: 1; }
.pipeline-diagram:hover .svg-phase-group:hover ~ .flow-line,
.pipeline-diagram:not(:hover) .svg-phase-group { opacity: 1; }

/* ---- Pipeline summary table row ---- */

.summary-row { transition: background-color 0.2s ease; }

/* ---- Sidebar link (concepts/reference variant) ---- */

.page-concepts .sidebar-link,
.page-reference .sidebar-link {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #b89f88;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}
.page-concepts .sidebar-link:hover,
.page-reference .sidebar-link:hover {
  color: #f0e4d8;
  border-left-color: #3a2e26;
}
.page-concepts .sidebar-link.active,
.page-reference .sidebar-link.active {
  color: #e08a5a;
  border-left-color: #c87040;
}

/* ---- Sidebar link (framework variant) ---- */

.page-framework .sidebar-link { position: relative; }
.page-framework .sidebar-link.active {
  color: #c87040;
  border-left: 2px solid #c87040;
  padding-left: 0.75rem;
}

/* ---- Sidebar link (agentic-layer variant) ---- */

.page-agentic-layer .sidebar-link {
  transition: color 0.2s ease, border-color 0.2s ease;
}
.page-agentic-layer .sidebar-link.active {
  color: #f0e4d8;
  border-left-color: #c87040;
}

/* ---- Concept link ---- */

.concept-link {
  color: #e08a5a;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(200, 112, 64, 0.3);
  transition: color 0.2s;
}
.concept-link:hover { color: #c87040; }

/* ---- Pattern card (prompt-engineering) ---- */

.pattern-card { cursor: pointer; }
.pattern-card .pattern-detail { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.pattern-card.expanded .pattern-detail { max-height: 800px; }
.pattern-card .expand-icon { transition: transform 0.3s; }
.pattern-card.expanded .expand-icon { transform: rotate(180deg); }

/* ---- Decision diagram (agent-patterns) ---- */

.decision-node { cursor: pointer; transition: all 0.3s ease; }
.decision-node:hover rect, .decision-node:hover polygon { filter: brightness(1.3); }
.decision-node.selected rect, .decision-node.selected polygon { stroke-width: 2.5; }
.decision-path { transition: opacity 0.3s, stroke-width 0.3s; }
.decision-path.highlight { opacity: 1 !important; stroke-width: 2.5 !important; }

/* ---- Expandable content (tool-integrations) ---- */

.expandable-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.expandable-content.open { max-height: 2000px; }

/* ---- Accordion content ---- */

.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.accordion-content.open { max-height: 2000px; }

/* ---- Tab components ---- */

.tab-btn.active {
  border-bottom-color: var(--tab-color, #c87040);
  color: var(--tab-text, #f0e4d8);
  background: rgba(42, 32, 26, 0.5);
}
.tab-btn.active-tab {
  border-bottom-color: var(--tab-color, #c87040);
  color: var(--tab-text, #f0e4d8);
  background: rgba(42, 32, 26, 0.5);
}
.gate-tab.active-tab {
  border-bottom-color: var(--tab-color, #c87040);
  color: var(--tab-text, #f0e4d8);
  background: rgba(42, 32, 26, 0.5);
}
.team-tab.active-team {
  border-bottom-color: #c87040;
  color: #f0e4d8;
  background: rgba(42, 32, 26, 0.5);
}

/* ---- Tab panel ---- */

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Copy button ---- */

.copy-btn {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.code-block:hover .copy-btn,
.copy-btn:focus {
  opacity: 1;
}

/* ---- Sub-nav link ---- */

.sub-nav-link.active {
  color: #f0e4d8;
  border-left-color: #c87040;
  background: rgba(200, 112, 64, 0.08);
}

/* ---- Custom checkbox (maturity-path) ---- */

.grad-check {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #6b5849;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}
.grad-check:checked {
  background: #c87040;
  border-color: #c87040;
}
.grad-check:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.grad-check:focus-visible {
  outline: 2px solid #c87040;
  outline-offset: 2px;
}

/* ============================================
   Inline style replacement classes
   ============================================ */

/* ---- Phase color custom properties ---- */

.phase-color-overview { --phase-color: #c87040; }
.phase-color-plan { --phase-color: #9b6b8a; }
.phase-color-build { --phase-color: #d4a04a; }
.phase-color-test { --phase-color: #7a9b5e; }
.phase-color-review { --phase-color: #6b8a9b; }
.phase-color-document { --phase-color: #b89bb0; }
.phase-color-deploy { --phase-color: #b35a30; }
.phase-color-monitor { --phase-color: #5a9ba0; }

/* ---- Phase card color variants (rgba 0.3) ---- */

.phase-card-plan { --phase-color: rgba(155, 107, 138, 0.3); }
.phase-card-build { --phase-color: rgba(212, 160, 74, 0.3); }
.phase-card-test { --phase-color: rgba(122, 155, 94, 0.3); }
.phase-card-review { --phase-color: rgba(107, 138, 155, 0.3); }
.phase-card-document { --phase-color: rgba(184, 155, 176, 0.3); }
.phase-card-deploy { --phase-color: rgba(179, 90, 48, 0.3); }
.phase-card-monitor { --phase-color: rgba(90, 155, 160, 0.3); }

/* ---- Node color custom properties (0.25 alpha) ---- */

.node-color-plan { --node-color: rgba(155, 107, 138, 0.25); }
.node-color-build { --node-color: rgba(212, 160, 74, 0.25); }
.node-color-test { --node-color: rgba(122, 155, 94, 0.25); }
.node-color-review { --node-color: rgba(107, 138, 155, 0.25); }
.node-color-document { --node-color: rgba(184, 155, 176, 0.25); }
.node-color-deploy { --node-color: rgba(179, 90, 48, 0.25); }
.node-color-monitor { --node-color: rgba(90, 155, 160, 0.25); }

/* ---- Node color custom properties (0.2 alpha) ---- */

.node-color-plan-20 { --node-color: rgba(155, 107, 138, 0.2); }
.node-color-build-20 { --node-color: rgba(212, 160, 74, 0.2); }
.node-color-test-20 { --node-color: rgba(122, 155, 94, 0.2); }
.node-color-review-20 { --node-color: rgba(107, 138, 155, 0.2); }
.node-color-document-20 { --node-color: rgba(184, 155, 176, 0.2); }
.node-color-deploy-20 { --node-color: rgba(179, 90, 48, 0.2); }
.node-color-monitor-20 { --node-color: rgba(90, 155, 160, 0.2); }

/* ---- Node color (glow 0.15 alpha) ---- */

.node-color-glow-15 { --node-color: rgba(200, 112, 64, 0.15); }

/* ---- Tab color custom properties ---- */

.tab-color-plan { --tab-color: #9b6b8a; --tab-text: #9b6b8a; }
.tab-color-build { --tab-color: #d4a04a; --tab-text: #d4a04a; }
.tab-color-test { --tab-color: #7a9b5e; --tab-text: #7a9b5e; }
.tab-color-review { --tab-color: #6b8a9b; --tab-text: #6b8a9b; }
.tab-color-document { --tab-color: #b89bb0; --tab-text: #b89bb0; }
.tab-color-deploy { --tab-color: #b35a30; --tab-text: #b35a30; }
.tab-color-glow { --tab-color: #c87040; --tab-text: #e08a5a; }

/* ---- Active tab initial state ---- */

.tab-active-plan { color: #9b6b8a; border-bottom-color: #9b6b8a; background: rgba(42, 32, 26, 0.5); }
.tab-active-build { color: #d4a04a; border-bottom-color: #d4a04a; background: rgba(42, 32, 26, 0.5); }
.tab-active-test { color: #7a9b5e; border-bottom-color: #7a9b5e; background: rgba(42, 32, 26, 0.5); }
.tab-active-review { color: #6b8a9b; border-bottom-color: #6b8a9b; background: rgba(42, 32, 26, 0.5); }
.tab-active-document { color: #b89bb0; border-bottom-color: #b89bb0; background: rgba(42, 32, 26, 0.5); }
.tab-active-deploy { color: #b35a30; border-bottom-color: #b35a30; background: rgba(42, 32, 26, 0.5); }
.tab-active-glow { color: #e08a5a; border-bottom-color: #c87040; background: rgba(42, 32, 26, 0.5); }
.tab-active-base { background: rgba(42, 32, 26, 0.5); }

/* ---- Border left utilities ---- */

.bl-3-glow { border-left: 3px solid #c87040; }
.bl-3-plan { border-left: 3px solid #9b6b8a; }
.bl-3-build { border-left: 3px solid #d4a04a; }
.bl-3-test { border-left: 3px solid #7a9b5e; }
.bl-3-review { border-left: 3px solid #6b8a9b; }
.bl-3-document { border-left: 3px solid #b89bb0; }
.bl-3-deploy { border-left: 3px solid #b35a30; }
.bl-3-monitor { border-left: 3px solid #5a9ba0; }
.bl-3-pass { border-left: 3px solid #8ab06a; }
.bl-3-fail { border-left: 3px solid #c25450; }

.bl-4-plan { border-left: 4px solid #9b6b8a; }
.bl-4-build { border-left: 4px solid #d4a04a; }
.bl-4-test { border-left: 4px solid #7a9b5e; }
.bl-4-review { border-left: 4px solid #6b8a9b; }
.bl-4-document { border-left: 4px solid #b89bb0; }
.bl-4-deploy { border-left: 4px solid #b35a30; }
.bl-4-monitor { border-left: 4px solid #5a9ba0; }

/* ---- Border top utilities ---- */

.bt-3-test { border-top: 3px solid #7a9b5e; }
.bt-3-review { border-top: 3px solid #6b8a9b; }
.bt-3-fail { border-top: 3px solid #c25450; }

/* ---- Section heading accent ---- */

.section-heading-accent { padding-left: 12px; }

/* ---- Animation delay utilities ---- */

.anim-delay-0 { animation-delay: 0s; }
.anim-delay-300 { animation-delay: 0.3s; }
.anim-delay-500 { animation-delay: 0.5s; }
.anim-delay-600 { animation-delay: 0.6s; }
.anim-delay-900 { animation-delay: 0.9s; }
.anim-delay-1000 { animation-delay: 1s; }
.anim-delay-1200 { animation-delay: 1.2s; }
.anim-delay-1500 { animation-delay: 1.5s; }
.anim-delay-2000 { animation-delay: 2s; }
.anim-delay-2500 { animation-delay: 2.5s; }
.anim-delay-3000 { animation-delay: 3s; }

/* ---- Transition delay utilities ---- */

.transition-delay-100 { transition-delay: 100ms; }
.transition-delay-200 { transition-delay: 200ms; }

/* ---- Misc utilities ---- */

.code-block-scroll { max-height: 600px; overflow-y: auto; }
.hidden-panel { display: none; }
