/* =====================================================================
   AGENT SECTION — the centerpiece
   ===================================================================== */

.agents-section { padding-top: 120px; padding-bottom: 120px; }

.agents-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 48px;
}

.agents-stats {
  display: flex;
  gap: 32px;
  border-inline-start: 1px solid var(--hairline);
  padding-inline-start: 32px;
}
[lang="he"] .agents-stats { border-inline-start: none; border-inline-end: 1px solid var(--hairline); padding-inline-start: 0; padding-inline-end: 32px; }
.agents-stat-value {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.agents-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

/* Console: 2 columns — diagram + log feed */
.agents-console {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  border: 1px solid var(--hairline);
  background: linear-gradient(to bottom, rgba(255,255,255,0.015), transparent);
  position: relative;
}
.agents-console::before, .agents-console::after,
.agents-console > .corner {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--accent);
}
.agents-console::before { top: -1px; left: -1px; border-top: 1px solid; border-left: 1px solid; }
.agents-console::after { bottom: -1px; right: -1px; border-bottom: 1px solid; border-right: 1px solid; }

.console-frame-tag {
  position: absolute;
  top: -10px;
  inset-inline-start: 24px;
  background: var(--bg);
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.diagram-panel {
  position: relative;
  padding: 32px 28px;
  border-inline-end: 1px solid var(--hairline);
  min-height: 720px;
}
[lang="he"] .diagram-panel { border-inline-end: none; border-inline-start: 1px solid var(--hairline); }

.diagram-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.diagram-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.layer-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.layer-label::before, .layer-label::after {
  content: "";
  height: 1px;
  background: var(--hairline);
  flex: 1;
}

.layer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.agent-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 86px;
  padding: 14px 10px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-mono);
}
.agent-node::before {
  /* Corner ticks */
  content: "";
  position: absolute;
  inset: -1px;
  background:
    linear-gradient(to right, var(--node-color, var(--accent)) 0 8px, transparent 8px) 0 0/100% 1px no-repeat,
    linear-gradient(to right, var(--node-color, var(--accent)) 0 8px, transparent 8px) 100% 0/100% 1px no-repeat,
    linear-gradient(to bottom, var(--node-color, var(--accent)) 0 8px, transparent 8px) 0 0/1px 100% no-repeat;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.agent-node:hover, .agent-node.active {
  border-color: var(--node-color, var(--accent));
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
}
.agent-node:hover::before, .agent-node.active::before { opacity: 1; }
.agent-node.firing {
  animation: nodeFire 0.9s ease-out;
}
@keyframes nodeFire {
  0% { box-shadow: 0 0 0 0 var(--node-color, var(--accent)); border-color: var(--node-color, var(--accent)); }
  100% { box-shadow: 0 0 20px 0 transparent; }
}
.agent-code {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--node-color, var(--ink));
}
.agent-role {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-align: center;
  font-family: var(--font-body);
  font-weight: 500;
}

.dept-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.dept-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 2px 8px;
  border: 1px solid var(--hairline-2);
  background: var(--bg);
}
.dept-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.l2-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* Color tokens for agent nodes */
.node-indigo  { --node-color: #8b9eff; }
.node-green   { --node-color: #7dd87a; }
.node-amber   { --node-color: #f5b54e; }
.node-cyan    { --node-color: #6ee7ff; }
.node-purple  { --node-color: #c084fc; }
.node-red     { --node-color: #f87171; }
.node-slate   { --node-color: #94a3b8; }
.node-teal    { --node-color: #5eead4; }
.node-rose    { --node-color: #fb7185; }
.node-violet  { --node-color: #a78bfa; }

/* Detail card — shows when an agent is clicked */
.agent-detail {
  position: relative;
  margin-top: 8px;
  padding: 24px 28px;
  background: var(--bg);
  border-top: 1px solid var(--hairline);
}
.detail-empty {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 32px;
}
.detail-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 12px;
}
.detail-code {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  color: var(--node-color, var(--accent));
  letter-spacing: -0.02em;
}
.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.detail-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
}
.detail-tags {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-tags span { padding: 2px 8px; border: 1px solid var(--hairline); }
.detail-role {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 8px 0 0;
  text-wrap: pretty;
}

/* Log feed panel */
.log-panel {
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.log-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.log-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
}
.log-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.4s ease-in-out infinite;
}
.log-feed {
  flex: 1;
  overflow: hidden;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-2);
  position: relative;
  min-height: 540px;
}
.log-line {
  opacity: 0;
  animation: logIn 0.4s ease-out forwards;
  white-space: pre-wrap;
  word-break: break-word;
}
@keyframes logIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.log-time { color: var(--muted-2); margin-inline-end: 8px; }
.log-agent { color: var(--accent); margin-inline-end: 8px; font-weight: 600; }
.log-msg { color: var(--ink-2); }
.log-feed::after {
  /* Fade out the bottom of the feed */
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

@media (max-width: 980px) {
  .agents-head { grid-template-columns: 1fr; }
  .agents-stats { border: none; padding: 0; }
  .agents-console { grid-template-columns: 1fr; }
  .diagram-panel { border-inline-end: none; border-bottom: 1px solid var(--hairline); min-height: auto; }
  [lang="he"] .diagram-panel { border-inline-start: none; }
}

/* =====================================================================
   PROJECTS
   ===================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.proj-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s;
  min-height: 260px;
}
.proj-card:hover {
  border-color: var(--accent);
  background: linear-gradient(to bottom right, rgba(255,120,73,0.03), var(--bg-2));
  transform: translateY(-2px);
}
.proj-card.feature { grid-column: span 12; min-height: 320px; }
.proj-card.half { grid-column: span 6; }
.proj-card.third { grid-column: span 4; }

@media (max-width: 880px) {
  .proj-card, .proj-card.half, .proj-card.third, .proj-card.feature { grid-column: span 12; }
}

.proj-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: -4px;
}
.proj-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.proj-card.feature .proj-name { font-size: 34px; }
.proj-stack {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--cyan);
  line-height: 1.6;
}
.proj-desc {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
  text-wrap: pretty;
  margin: 0;
}
.proj-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
}
.proj-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 3px 8px;
  border: 1px solid var(--hairline);
}

.proj-card-corner {
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}
[lang="he"] .proj-card-corner { right: auto; left: 0; border-right: none; border-left: 1px solid var(--accent); }
.proj-card:hover .proj-card-corner { opacity: 1; }

/* =====================================================================
   EXPERIENCE TIMELINE
   ===================================================================== */

.timeline {
  position: relative;
  margin-top: 48px;
  padding-inline-start: 32px;
  border-inline-start: 1px solid var(--hairline);
}
[lang="he"] .timeline { padding-inline-start: 0; padding-inline-end: 32px; border-inline-start: none; border-inline-end: 1px solid var(--hairline); }

.tl-item {
  position: relative;
  padding-bottom: 40px;
}
.tl-item::before {
  content: "";
  position: absolute;
  inset-inline-start: -37px;
  top: 8px;
  width: 11px; height: 11px;
  background: var(--bg);
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}
[lang="he"] .tl-item::before { inset-inline-start: auto; inset-inline-end: -37px; }
.tl-item.current::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,120,73,0.15), 0 0 12px var(--accent);
}

.tl-period {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tl-role {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 4px;
}
.tl-company {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.tl-desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0;
  max-width: 720px;
  text-wrap: pretty;
}
.tl-bullets {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tl-bullets li {
  position: relative;
  padding-inline-start: 16px;
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.tl-bullets li::before {
  content: "›";
  position: absolute;
  inset-inline-start: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}
[lang="he"] .tl-bullets li::before { content: "‹"; }

/* =====================================================================
   STACK
   ===================================================================== */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 32px;
}
.stack-block {
  padding: 28px;
  border: 1px solid var(--hairline);
  background: linear-gradient(to bottom right, rgba(255,255,255,0.015), transparent);
}
.stack-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stack-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  color: var(--ink);
  background: rgba(255,255,255,0.02);
  transition: all 0.18s;
}
.stack-chip:hover { border-color: var(--accent); color: var(--accent); }
.stack-chip.primary { border-color: var(--accent); color: var(--accent); background: rgba(255,120,73,0.08); }

@media (max-width: 720px) {
  .stack-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   CONTACT
   ===================================================================== */

.contact-section {
  text-align: center;
  padding: 120px 0;
}
.contact-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 16px 0 24px;
  color: var(--ink);
}
.contact-sub {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 540px;
  margin: 0 auto 36px;
}
.contact-meta {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.contact-meta a:hover { color: var(--accent); }

/* Footer */
.footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--hairline-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* =====================================================================
   CHAT WIDGET
   ===================================================================== */

.chat-fab {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  box-shadow: 0 4px 24px rgba(255,120,73,0.3);
  transition: all 0.2s;
}
.chat-fab:hover { background: var(--accent-2); border-color: var(--accent-2); transform: translateY(-2px); }
.chat-fab svg { width: 14px; height: 14px; }

.chat-panel {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 95;
  width: min(380px, calc(100vw - 48px));
  height: min(560px, calc(100vh - 96px));
  background: var(--bg-2);
  border: 1px solid var(--accent);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.chat-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-head-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
}
.chat-head-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 2px;
}
.chat-close {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 1px solid var(--hairline);
}
.chat-close:hover { color: var(--accent); border-color: var(--accent); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-msg {
  font-size: 14px;
  line-height: 1.55;
  max-width: 88%;
  padding: 10px 14px;
  border: 1px solid var(--hairline);
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.chat-msg.bot {
  align-self: flex-start;
  color: var(--ink);
  background: rgba(255,255,255,0.03);
}
.chat-msg.thinking { color: var(--muted); font-style: italic; }

.chat-input {
  display: flex;
  border-top: 1px solid var(--hairline);
}
.chat-input input {
  flex: 1;
  padding: 14px 16px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.chat-input input::placeholder { color: var(--muted-2); }
.chat-input button {
  padding: 0 18px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chat-input button:disabled { opacity: 0.4; cursor: wait; }
