/* === Modal détaillée pour chaque agent === */

.agent-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.agent-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.agent-modal {
  position: relative;
  background: var(--paper, #FBF7EE);
  border-radius: 24px;
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 100px -20px rgba(26, 26, 26, 0.5);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--line-2, rgba(26,26,26,0.20));
}
.agent-modal-overlay.open .agent-modal {
  transform: scale(1) translateY(0);
}

.agent-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.2s ease, background 0.2s ease;
  font-size: 18px;
  color: var(--ink);
}
.agent-modal-close:hover {
  transform: rotate(90deg);
  background: var(--cream-2);
}

.agent-modal-header {
  display: flex;
  gap: 28px;
  padding: 36px 40px 28px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.agent-modal-photo {
  position: relative;
  width: 160px;
  height: 192px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--cream-2);
  box-shadow: 0 12px 32px -8px rgba(196, 90, 47, 0.4);
}
.agent-modal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.agent-modal-photo::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--angle, 0deg), transparent 0deg, var(--halo, rgba(196, 90, 47, 0.9)) 60deg, transparent 120deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: rotate-border 4s linear infinite;
  pointer-events: none;
}

.agent-modal-headtxt {
  flex: 1;
}
.agent-modal-name {
  font-family: 'Fraunces', serif;
  font-size: clamp(36px, 4.5vw, 52px);
  line-height: 1;
  margin: 0 0 6px;
  font-weight: 500;
}
.agent-modal-name em {
  font-style: italic;
  color: var(--orange, #C45A2F);
}
.agent-modal-role {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #6B665C);
  margin-bottom: 14px;
  font-weight: 500;
}
.agent-modal-tagline {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink-soft, #2E2C29);
  margin: 0;
}

.agent-modal-body {
  padding: 28px 40px 36px;
}
.agent-modal-summary {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.agent-modal-section {
  margin-bottom: 26px;
}
.agent-modal-section-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.agent-modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agent-modal-list li {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  padding-left: 22px;
  position: relative;
}
.agent-modal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}
.agent-modal-list.limits li::before {
  background: var(--muted);
  width: 6px;
  height: 2px;
  border-radius: 0;
  top: 0.85em;
}

.agent-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.agent-modal-tag {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-soft);
  background: var(--cream);
  transition: background 0.2s ease, transform 0.2s ease;
}
.agent-modal-tag:hover {
  background: var(--cream-2);
  transform: translateY(-1px);
}
.agent-modal-tag.plan {
  background: var(--orange);
  color: #FBF7EE;
  border-color: var(--orange);
  font-weight: 500;
}

.agent-modal-cta {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.agent-modal-cta-btn {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 28px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.agent-modal-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(26, 26, 26, 0.3);
}
.agent-modal-cta-btn .arr svg { display: block; }

.agent-modal-cta-note {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* clickable cursor on agent cards */
.agent-card { cursor: pointer; }

/* mobile */
@media (max-width: 720px) {
  .agent-modal-header {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px 22px;
    gap: 18px;
  }
  .agent-modal-photo { width: 140px; height: 168px; margin: 0 auto; }
  .agent-modal-body { padding: 24px 24px 30px; }
  .agent-modal-tagline { font-size: 18px; }
  .agent-modal-cta { flex-direction: column; align-items: stretch; }
  .agent-modal-cta-btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-modal-overlay, .agent-modal {
    transition: none !important;
  }
  .agent-modal-photo::after { animation: none !important; }
}
