/* =============================================
   Contact Console — OFFART (cinematic redesign)
   Spec: docs/superpowers/specs/2026-05-17-contact-console-redesign-design.md
   Restyles the shared chat engine DOM. Engine JS untouched.
   ============================================= */

body.page-template-template-contact-console {
  --cc-bg: #050505;
  --cc-gold: #c9a84c;
  --cc-gold-bright: #e7cf86;
  --cc-gold-deep: #9c8030;
  --cc-ink: #ffffff;
  --cc-dim: rgba(255, 255, 255, 0.55);
  --cc-faint: rgba(255, 255, 255, 0.30);
  --cc-line: rgba(255, 255, 255, 0.10);
  --cc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cc-bot: rgba(255, 255, 255, 0.06);
  --cc-bot-bd: rgba(255, 255, 255, 0.10);
  --cc-user: rgba(201, 168, 76, 0.16);
  --cc-user-bd: rgba(201, 168, 76, 0.34);
  --cc-user-tx: #f3e7c4;
  --cc-green: #27c93f;
  --cc-top: 9vh;
  --cc-con: min(680px, 95vw);
  overflow: hidden !important;
  background: var(--cc-bg) !important;
}
body.page-template-template-contact-console #page,
body.page-template-template-contact-console .site-content,
body.page-template-template-contact-console #content,
body.page-template-template-contact-console .entry-content,
body.page-template-template-contact-console .ast-container {
  background: var(--cc-bg) !important;
}
body.page-template-template-contact-console .site-footer,
body.page-template-template-contact-console .ast-breadcrumbs-wrapper {
  display: none !important;
}

/* ===== cinematic background ===== */
.cc-atmo { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cc-aurora {
  position: absolute; left: 50%; top: 42%; width: 140vw; height: 140vw;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, rgba(201,168,76,0.20), transparent 70%) 38% 42%/55% 55% no-repeat,
    radial-gradient(closest-side, rgba(120,90,200,0.09), transparent 70%) 66% 56%/60% 60% no-repeat,
    radial-gradient(closest-side, rgba(201,168,76,0.11), transparent 70%) 52% 30%/50% 50% no-repeat;
  filter: blur(40px);
  animation: ccDrift 16s var(--cc-ease) infinite alternate;
}
@keyframes ccDrift {
  0%   { transform: translate(-50%, -50%) rotate(0) scale(1); }
  100% { transform: translate(-50%, -50%) rotate(8deg) scale(1.08); }
}
.cc-rays {
  position: absolute; left: 50%; top: 44%; width: 120vw; height: 120vw;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg,
    transparent 0 8deg, rgba(201,168,76,0.05) 9deg 10deg, transparent 11deg 26deg,
    rgba(201,168,76,0.04) 27deg 28deg, transparent 29deg 50deg,
    rgba(201,168,76,0.05) 51deg 52deg, transparent 53deg);
  -webkit-mask-image: radial-gradient(circle, #000 6%, transparent 52%);
  mask-image: radial-gradient(circle, #000 6%, transparent 52%);
  animation: ccSpin 90s linear infinite;
  opacity: 0.7;
}
@keyframes ccSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.cc-ghost {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 100%; text-align: center;
  font-family: "Audiowide", sans-serif;
  font-size: min(10.5vw, 150px); line-height: 1; letter-spacing: 4px;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.055);
  text-shadow: 0 0 70px rgba(201, 168, 76, 0.07);
  white-space: nowrap; user-select: none;
}
.cc-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(201,168,76,0.15) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 46%, #000 14%, transparent 74%);
  mask-image: radial-gradient(ellipse at 50% 46%, #000 14%, transparent 74%);
  opacity: 0.5;
}
.cc-grain {
  position: absolute; inset: 0; opacity: 0.45; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.5'/></svg>");
}
.cc-glowbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(0deg, rgba(201, 168, 76, 0.06), transparent);
}
.cc-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 44%, transparent 40%, rgba(0,0,0,0.6) 100%);
}

/* ===== Open Canvas shell ===== */
.cc-wrap { position: fixed; inset: var(--cc-top) 0 0 0; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 22px; overflow: hidden; z-index: 90; }

.cc-brand { position: relative; z-index: 2; text-align: center; }
.cc-word { font-family: "Audiowide", sans-serif; font-size: clamp(20px,2.8vw,32px);
  letter-spacing: 3px; line-height: 1; color: #f4f4f5;
  text-shadow: 0 1px 0 #cfcfcf,0 2px 0 #aeaeae,0 3px 0 #8f8f8f,0 4px 1px rgba(0,0,0,.5),
    0 5px 6px rgba(0,0,0,.55),0 0 22px rgba(255,255,255,.18); }
.cc-word .cc-amp { color: var(--cc-gold); text-shadow: 0 1px 0 #8a6f2c,0 2px 2px rgba(0,0,0,.5); }
.cc-tag { margin-top: 12px; font-size: 11px; letter-spacing: 5px; text-transform: uppercase;
  color: var(--cc-dim); font-family: "Inter", sans-serif; }

/* The mode column — narrow, generous side breathing room */
.cc-stack { position: relative; z-index: 2; width: min(560px, 60vw);
  display: flex; flex-direction: column; gap: 16px; }

/* Mode visibility driven by #cc-wrap[data-mode] */
#cc-wrap[data-mode="form"] .cc-chat { display: none; }
#cc-wrap[data-mode="chat"] .cc-form { display: none; }

/* ===== Lead form (default) ===== */
.cc-form { display: flex; flex-direction: column; gap: 16px; }
.cc-form input, .cc-form textarea {
  width: 100%; box-sizing: border-box; background: rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  padding: 14px 16px; color: #fff; font-size: 15px; font-family: "Inter", sans-serif; }
.cc-form textarea { resize: none; min-height: 70px; }
.cc-form input::placeholder, .cc-form textarea::placeholder { color: rgba(255,255,255,.4); }
.cc-form input:focus, .cc-form textarea:focus { outline: none;
  border-color: rgba(201,168,76,.55); background: rgba(0,0,0,.42); }
.cc-hpot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cc-submit { align-self: stretch; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--cc-gold-bright), var(--cc-gold));
  color: #120d02; font-weight: 700; font-size: 15px; font-family: "Inter", sans-serif;
  border-radius: 12px; padding: 14px 20px; transition: filter .2s; }
.cc-submit:hover { filter: brightness(1.06); }
.cc-form-status { font-size: 13px; color: var(--cc-dim); min-height: 18px; text-align: center; }
.cc-form-status.is-error { color: #ff7a7a; }
.cc-form-status.is-ok { color: var(--cc-green); }

/* ===== Chat (box-less, on canvas) ===== */
#chat-panel.cc-console { position: relative; z-index: 2; background: none;
  border: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  display: flex; flex-direction: column; max-height: 52vh; opacity: 1; visibility: visible; }
.cc-console .chat-panel-header { display: none; }
.cc-console #chat-panel-close { display: none !important; }
.cc-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cc-console .chat-panel-messages { flex: 1; overflow-y: auto; padding: 6px 4px 14px;
  display: flex; flex-direction: column; gap: 14px; min-height: 160px;
  scrollbar-width: thin; scrollbar-color: rgba(201,168,76,.55) transparent; }
.cc-console .chat-panel-messages::-webkit-scrollbar { width: 7px; }
.cc-console .chat-panel-messages::-webkit-scrollbar-thumb {
  background: rgba(201,168,76,.55); border-radius: 999px; }
.cc-console .chat-msg { border-radius: 16px; padding: 11px 16px; font-size: 15px;
  line-height: 1.55; max-width: 78%; width: fit-content; font-family: "Inter", sans-serif; color: #fff; }
.cc-console .chat-msg.bot { background: var(--cc-bot); border: 1px solid var(--cc-bot-bd);
  border-bottom-left-radius: 5px; align-self: flex-start; }
.cc-console .chat-msg.user { background: var(--cc-user); border: 1px solid var(--cc-user-bd);
  color: var(--cc-user-tx); border-bottom-right-radius: 5px; align-self: flex-end; }
.cc-console .chat-msg.bot a { color: var(--cc-gold); }
.cc-console .chat-msg.typing { opacity: .7; font-style: italic; }
.cc-console .chat-panel-suggestions { display: none !important; }
.cc-console .dock-chat { padding: 12px 0 0; }
.cc-console .chat-capsule { display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px; padding: 8px 8px 8px 18px; }
.cc-console .chat-input { flex: 1; background: transparent; border: none; outline: none;
  color: #fff; font-size: 15px; font-family: "Inter", sans-serif; resize: none;
  max-height: 90px; line-height: 1.4; }
.cc-console .chat-input::placeholder { color: rgba(255,255,255,.4); }
.cc-console .chat-action-btn { width: 40px; height: 40px; border-radius: 50%;
  border: none; background: transparent; color: var(--cc-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cc-console .chat-action-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
/* Send button — gold, rounded-square (matches the form submit aesthetic, not a circle pill) */
.cc-console .chat-action-btn.send-btn { background: #c9a84c; color: #1a1304;
  border-radius: 10px; aspect-ratio: 1; }
.cc-console .chat-action-btn.send-btn:hover { background: #e0bd56; }
/* Mic active — red, same as the dock's .chat-action-btn.mic-active */
.cc-console .chat-action-btn.mic-active { background: #ff3b3b; color: #fff;
  box-shadow: 0 0 15px rgba(255,59,59,.5); }
.cc-console .chat-action-btn:focus-visible { outline: 2px solid rgba(201,168,76,.6); outline-offset: 2px; }

/* scroll-to-bottom affordance */
.cc-scrolldn { position: absolute; right: 8px; bottom: 12px; width: 36px; height: 36px;
  border-radius: 50%; border: 1px solid rgba(201,168,76,.4); cursor: pointer;
  background: rgba(20,16,6,.78); color: var(--cc-gold); display: flex;
  align-items: center; justify-content: center; opacity: 0; pointer-events: none;
  transition: opacity .25s; }
.cc-scrolldn.is-visible { opacity: 1; pointer-events: auto; }
.cc-scrolldn svg { width: 16px; height: 16px; }
.cc-scrolldn .cc-badge { position: absolute; top: -4px; right: -4px; min-width: 16px;
  height: 16px; padding: 0 4px; border-radius: 999px; background: var(--cc-gold);
  color: #120d02; font-size: 10px; font-weight: 600; display: none;
  align-items: center; justify-content: center; }
.cc-scrolldn .cc-badge.is-shown { display: flex; }

/* ===== Action strip (below the input/submit) ===== */
.cc-strip { position: relative; z-index: 2; display: flex; align-items: center;
  justify-content: center; flex-wrap: wrap; gap: 10px 14px; width: min(560px, 60vw);
  font-family: "Inter", sans-serif; font-size: 13px; }
.cc-tabs-row, .cc-icons-row { display: contents; }
.cc-strip-item { display: inline-flex; align-items: center; gap: 6px;
  color: var(--cc-dim); background: none; border: none; cursor: pointer;
  text-decoration: none; padding: 6px 4px; transition: color .2s; }
.cc-strip-item i { font-size: 14px; }
.cc-strip-item:hover { color: #fff; }
.cc-strip-item.is-active { color: var(--cc-gold); font-weight: 600; }
.cc-strip-sep { color: rgba(255,255,255,.2); }
.cc-strip .cc-wa { color: #36e07a; }
.cc-strip .cc-wa:hover { color: #5ff0a0; }

/* ===== Legal popover (self-contained; mirrors dock styling) ===== */
.cc-legal-wrap { position: relative; display: inline-flex; }
#cc-legal-panel { position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%); min-width: 180px; background: rgba(13,13,14,.92);
  border: 1px solid rgba(201,168,76,.25); border-radius: 12px; padding: 10px;
  display: flex; flex-direction: column; gap: 2px; opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 9; }
#cc-legal-panel.open { opacity: 1; pointer-events: auto; }
#cc-legal-panel .cc-legal-link { display: flex; align-items: center; gap: 8px;
  color: var(--cc-dim); text-decoration: none; font-size: 13px; padding: 8px 10px;
  border-radius: 8px; }
#cc-legal-panel .cc-legal-link i { width: 16px; text-align: center; }
#cc-legal-panel .cc-legal-link:hover, #cc-legal-panel .cc-legal-link:focus {
  color: var(--cc-gold); background: rgba(201,168,76,.08); }

/* entrance cascade — progressive enhancement only */
.cc-anim .cc-brand { animation: ccFadeUp .8s var(--cc-ease) .15s both; }
.cc-anim .cc-stack { animation: ccFadeUp .8s var(--cc-ease) .35s both; }
.cc-anim .cc-strip { animation: ccFadeUp .8s var(--cc-ease) .55s both; }
@keyframes ccFadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ====================  MOBILE (≤768px) — segmented tabs  ==================== */
@media (max-width: 768px) {
  body.page-template-template-contact-console { --cc-top: 60px; }
  .cc-wrap { gap: 16px; padding: 28px 18px 20px; justify-content: flex-start; }
  /* .cc-strip dissolves so its two rows become direct children of .cc-wrap:
     tabs sit ABOVE the form, channels pin to the BOTTOM (spec mockup A) */
  .cc-strip { display: contents; }
  .cc-brand { order: 0; }
  .cc-tabs-row { display: flex; gap: 8px; width: 100%; max-width: 420px; order: 1; }
  .cc-stack { width: 100%; max-width: 420px; order: 2; }
  .cc-icons-row { display: flex; justify-content: center; gap: 24px;
    width: 100%; max-width: 420px; order: 3; margin-top: auto; padding-top: 8px; }
  /* mode buttons = 2-up segmented control */
  .cc-strip-item[data-cc-mode] { flex: 1; justify-content: center;
    border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.3);
    border-radius: 999px; padding: 11px 0; }
  .cc-strip-item[data-cc-mode].is-active { background: rgba(201,168,76,.18);
    border-color: rgba(201,168,76,.4); color: var(--cc-gold); }
  /* channels = icon-only circles (text label hidden, icon kept) */
  .cc-icons-row .cc-strip-item { width: 52px; height: 52px; border-radius: 50%;
    justify-content: center; font-size: 0; gap: 0;
    border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.3); }
  .cc-icons-row .cc-strip-item i { font-size: 19px; }
  #chat-panel.cc-console { max-height: 46vh; }
  .cc-ghost { font-size: 15vw; }

  /* Chat mode: column fills available height so the input rests just above the channel icons. */
  #cc-wrap[data-mode="chat"] .cc-stack { flex: 1 1 auto; min-height: 0; }
  #cc-wrap[data-mode="chat"] #chat-panel.cc-console { flex: 1; max-height: none; min-height: 0; }
  /* Slim chat capsule + send button so they read as a thin input bar, not a swollen pill. */
  .cc-console .dock-chat { padding: 8px 0 0; }
  .cc-console .chat-capsule { padding: 4px 4px 4px 14px; gap: 8px; }
  .cc-console .chat-input { font-size: 14px; max-height: 72px; }
  .cc-console .chat-action-btn { width: 34px; height: 34px; }
  .cc-console .chat-action-btn i { font-size: 13px; }
}

/* ====================  REDUCED MOTION  ==================== */
@media (prefers-reduced-motion: reduce) {
  .cc-aurora, .cc-rays { animation: none; }
  .cc-anim .cc-brand, .cc-anim .cc-stack, .cc-anim .cc-strip { animation: none; }
}
