/* Ask the Book: interactive book page (Cognitive Architecture) */

.bx-hero {
  position: relative;
  padding: 9rem 2rem 4rem;
  background:
    radial-gradient(1100px 520px at 82% -6%, rgba(212, 175, 120, 0.10), transparent 60%),
    linear-gradient(180deg, var(--abyss), var(--abyss));
  overflow: hidden;
}
.bx-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3rem;
  align-items: center;
}
.bx-hero-intro { max-width: 560px; }
.bx-title {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.02;
  color: var(--star);
  margin: 0.5rem 0 0.5rem;
}
.bx-subtitle {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  color: var(--dune);
  margin: 0 0 1.25rem;
}
.bx-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--star-muted);
  margin-bottom: 1.75rem;
}
.bx-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Ask panel */
.ask-panel {
  background: var(--abyss-light);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  min-height: 480px;
}
.ask-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ask-cover {
  width: 44px;
  height: 62px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
}
.ask-head-text { display: flex; flex-direction: column; }
.ask-head-text strong { color: var(--star); font-size: 1rem; font-weight: 600; }
.ask-head-text span { color: var(--star-dim); font-size: 0.82rem; }

.ask-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-height: 360px;
}
.msg {
  max-width: 88%;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  font-size: 0.93rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.msg-book {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--star-muted);
  border-bottom-left-radius: 4px;
}
.msg-user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--dune) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--dune) 35%, transparent);
  color: var(--star);
  border-bottom-right-radius: 4px;
}
.msg-typing { display: inline-flex; gap: 5px; align-items: center; }
.msg-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--star-dim);
  animation: askdot 1s infinite ease-in-out;
}
.msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes askdot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0 0.5rem;
}
.ask-chip {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--star-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.ask-chip:hover { border-color: var(--dune); color: var(--star); background: color-mix(in srgb, var(--dune) 10%, transparent); }

.ask-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.ask-input {
  flex: 1;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--star);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}
.ask-input::placeholder { color: var(--star-dim); }
.ask-input:focus { outline: none; border-color: var(--dune); }
.ask-send {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--abyss);
  background: var(--dune);
  border: none;
  border-radius: 10px;
  padding: 0 1.15rem;
  cursor: pointer;
  transition: background 0.18s ease;
}
.ask-send:hover { background: var(--dune-hover); }
.ask-note { color: var(--star-dim); font-size: 0.76rem; margin: 0.75rem 0 0; line-height: 1.5; }

/* Brief */
.bx-brief-text {
  max-width: 760px;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--star-muted);
}

/* Frameworks */
.bx-fw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.75rem;
}
.bx-fw-card {
  text-align: left;
  font-family: var(--sans);
  background: var(--abyss-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
  display: flex;
  flex-direction: column;
}
.bx-fw-card:hover { border-color: var(--dune); transform: translateY(-3px); }
.bx-fw-num { font-family: var(--serif); font-size: 1.1rem; color: var(--dune); }
.bx-fw-card h3 { color: var(--star); font-size: 1.1rem; margin: 0.5rem 0 0.5rem; }
.bx-fw-card p { color: var(--star-muted); font-size: 0.9rem; line-height: 1.6; margin: 0 0 0.9rem; flex: 1; }
.bx-fw-cta { color: var(--dune); font-size: 0.82rem; font-weight: 600; }
.bx-fw-more { margin-top: 1.75rem; }

/* Reserve */
.bx-reserve-sub {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--star-muted);
  margin-bottom: 1.5rem;
}
.bx-reserve-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.bx-reserve-note { color: var(--star-dim); font-size: 0.88rem; margin-top: 1.25rem; }
.bx-reserve-note a { color: var(--dune); }

@media (max-width: 900px) {
  .bx-hero-inner { grid-template-columns: 1fr; gap: 2.25rem; }
  .bx-fw-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .bx-hero { padding: 7.5rem 1.5rem 3rem; }
  .ask-panel { min-height: 440px; }
}
