/* ==========================================================================
   AI Council - page styles
   Uses the global design tokens from style.css. The scene keeps its own
   light pixel-art styling regardless of the site theme.
   ========================================================================== */

.council-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 1080px) {
  .council-layout { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
}

.council-form-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.council-form-card h2 { margin-bottom: 0.4rem; }
.council-form-intro { margin-bottom: 1.25rem; color: var(--ink-2); }
.council-form-card .form-field { margin-bottom: 1.1rem; }

.council-chips-label {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.council-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.council-chip {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.council-chip:hover { border-color: var(--ink); color: var(--ink); }
.council-chip.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.council-error {
  color: var(--accent);
  font-size: 0.88rem;
  margin: 0 0 0.9rem;
}

.council-limit-note {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

/* ---- scene ---- */
.council-tool {
  position: relative;
}
.council-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
}
.council-toolbar .btn-ghost {
  border: 2px solid var(--rule, #D9D6CD);
  color: var(--ink, #0A0A0A);
}
.council-toolbar .btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.council-scene {
  position: relative;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 1000 / 660;
  overflow: hidden;
  border: 3px solid var(--ink, #0A0A0A);
  border-radius: 4px;
  background: #0A0A0A;
}
.council-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 660px;
  transform-origin: 0 0;
}
.council-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  z-index: 0;
  pointer-events: none;
}

/* fountain arc sits at scene coords (733, 351) */
.council-fountain {
  position: absolute;
  left: 733px;
  top: 351px;
  width: 0;
  height: 0;
  z-index: 2;
  pointer-events: none;
}
.council-fountain span {
  position: absolute;
  width: 4px;
  height: 18px;
  bottom: 0;
  border-radius: 2px;
  background: rgba(214, 244, 255, 0.85);
  image-rendering: pixelated;
  transform-origin: bottom center;
  animation: fountain-drop 1.1s infinite;
}
.council-fountain span:nth-child(1) { left: -34px; animation-delay: 0s; }
.council-fountain span:nth-child(2) { left: -17px; height: 24px; animation-delay: 0.18s; }
.council-fountain span:nth-child(3) { left: 0; height: 28px; animation-delay: 0.36s; }
.council-fountain span:nth-child(4) { left: 17px; height: 22px; animation-delay: 0.54s; }
.council-fountain span:nth-child(5) { left: 34px; animation-delay: 0.72s; }
@keyframes fountain-drop {
  0% { transform: translateY(-4px) scaleY(0.55); opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(10px) scaleY(0.9); opacity: 0; }
}

/* ---- characters ---- */
.council-cast { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.council-cast.speaking-pointer { pointer-events: auto; }
.persona {
  position: absolute;
  width: 60px;
  margin-left: -30px;
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  transition: left 0.8s ease, top 0.8s ease;
}
.persona:hover .persona-img,
.persona:focus-visible .persona-img { filter: drop-shadow(0 0 6px rgba(255, 90, 31, 0.8)); }
.persona-img {
  display: block;
  width: auto;
  height: 130px;
  image-rendering: pixelated;
}
.persona::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 44px;
  height: 10px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 70%);
  pointer-events: none;
}
.persona-name {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  color: #0A0A0A;
  background: rgba(244, 244, 241, 0.92);
  border: 1px solid #0A0A0A;
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
  pointer-events: none;
}
.persona.speaking .persona-name {
  background: #FF5A1F;
  color: #fff;
  border-color: #FF5A1F;
}
.persona.speaking .persona-img { animation: speaker-pulse 1.4s ease-in-out infinite; }
@keyframes speaker-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 90, 31, 0.7)); }
  50% { filter: drop-shadow(0 0 12px rgba(255, 90, 31, 1)); }
}

.persona.bobbing .persona-img { animation: bob 0.5s ease-in-out infinite alternate; }
@keyframes bob {
  from { transform: translateY(0); }
  to { transform: translateY(-5px); }
}

.persona.dust .persona-img { animation: dust-squash 0.4s ease-out 1; }
@keyframes dust-squash {
  0% { transform: translateY(-2px) scale(0.96); }
  45% { transform: translateY(1px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

/* ---- envelope drop ---- */
.council-envelope {
  position: absolute;
  left: 500px;
  top: -40px;
  z-index: 6;
  pointer-events: none;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.3));
}
.council-envelope.drop { animation: envelope-drop 1.15s cubic-bezier(0.22, 0.9, 0.36, 1) 1; }
@keyframes envelope-drop {
  0% { transform: translateY(0) scale(1); }
  78% { transform: translateY(430px) scale(1); }
  86% { transform: translateY(398px) scale(1.06, 0.82); }
  92% { transform: translateY(418px) scale(1); }
  100% { transform: translateY(410px) scale(1); }
}
.council-envelope.puff { animation: envelope-puff 0.55s ease-out 1; }
@keyframes envelope-puff {
  0% { transform: translateY(410px) scale(0.8); opacity: 1; }
  60% { transform: translateY(410px) scale(1.15); opacity: 1; }
  100% { transform: translateY(410px) scale(0.4); opacity: 0; }
}

/* ---- deliberation bubble + verdict ---- */
.council-speech {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 82%);
  z-index: 5;
  background: rgba(244, 244, 241, 0.97);
  border: 3px solid #0A0A0A;
  border-radius: 6px;
  padding: 0.7rem 1rem 0.85rem;
  box-shadow: 4px 4px 0 rgba(10, 10, 10, 0.35);
}
.council-speech-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: #FF5A1F;
  display: inline-block;
  border-radius: 3px;
  padding: 2px 8px;
  margin-bottom: 0.45rem;
}
.council-speech-body {
  font-size: 0.95rem;
  line-height: 1.45;
  color: #0A0A0A;
}

.council-deliberating {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 82%);
  z-index: 5;
  background: rgba(244, 244, 241, 0.97);
  border: 3px solid #0A0A0A;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(10, 10, 10, 0.35);
}
.council-deliberating-title {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #0A0A0A;
}
.council-deliberating-note { margin-top: 0.35rem; font-size: 0.82rem; color: #5A5A57; }
.council-deliberating.shimmer .council-deliberating-title {
  background: linear-gradient(100deg, #0A0A0A 30%, #FF5A1F 50%, #0A0A0A 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.council-verdict {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(360px, 40%);
  z-index: 7;
  overflow-y: auto;
  background: rgba(244, 244, 241, 0.98);
  border: 3px solid #0A0A0A;
  border-radius: 6px;
  padding: 1rem;
  box-shadow: -4px 4px 0 rgba(10, 10, 10, 0.35);
  transform: translateX(120%);
  opacity: 0;
}
.council-verdict.slide-in { animation: verdict-in 0.55s cubic-bezier(0.22, 0.9, 0.36, 1) forwards; }
@keyframes verdict-in {
  to { transform: translateX(0); opacity: 1; }
}
.council-verdict h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: #0A0A0A;
  display: inline-block;
  border-radius: 3px;
  padding: 2px 8px;
  margin: 0.9rem 0 0.5rem;
}
.council-verdict h3:first-child { margin-top: 0; }
.council-verdict p, .council-verdict ul { color: #0A0A0A; }
.council-verdict ul { padding-left: 1.1rem; margin: 0.4rem 0; }
.council-verdict li { margin-bottom: 0.45rem; }
.council-verdict .council-objection { display: block; margin-bottom: 0.5rem; }
.council-objection-text { font-size: 0.86rem; line-height: 1.4; }
.council-objection-pips { margin-top: 0.15rem; display: inline-flex; gap: 3px; }
.council-objection-pips i {
  width: 9px;
  height: 9px;
  background: #E0E0DC;
  border: 1px solid #0A0A0A;
  border-radius: 2px;
}
.council-objection-pips i.on { background: #FF5A1F; border-color: #FF5A1F; }
.council-verdict .council-verdict-disclaimer {
  margin-top: 1rem;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #5A5A57;
  font-style: italic;
}
.council-verdict .council-verdict-cta {
  display: inline-block;
  margin-top: 0.9rem;
}

/* ---- stance card ---- */
.council-stance {
  position: fixed;
  width: 290px;
  z-index: 900;
  background: var(--paper);
  border: 1px solid var(--ink-3);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: 0.9rem 1rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.council-stance.show { opacity: 1; transform: translateY(0); }
.council-stance-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}
.council-stance-head img {
  width: 48px;
  height: auto;
  image-rendering: pixelated;
  flex: 0 0 auto;
}
.council-stance-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.council-stance-role {
  font-size: 0.78rem;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.council-stance-row {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-2);
  margin-top: 0.5rem;
}
.council-stance-row strong { color: var(--ink); font-family: var(--font-mono); font-size: 0.78rem; }

/* ---- toast ---- */
.council-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.75rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(90vw, 420px);
}
.council-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- toolbar ---- */
.council-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
}
.council-tool-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}

/* ---- examples ---- */
.council-example {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-top: 1rem;
}
.council-example h3 { margin-bottom: 0.35rem; }
.council-example p { color: var(--ink-2); margin: 0; }

/* ---- printable ---- */
@media print {
  .council-toolbar, .council-toast, .nav, .footer, .cta-strip, .breadcrumb { display: none !important; }
  .council-scene { border: 1px solid #000; }
}
