/* Cassandra tool page: the bespoke self-playing demo device and a few helpers.
   Built entirely on the Company31 design tokens, so it follows light, dark and
   high-contrast like the rest of the site. Loaded only on cassandra.html. */

/* Hero: copy beside the demo device */
.hero--cassandra .hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--c31-space-8);
  align-items: center;
}
.hero--cassandra .hero__title { max-inline-size: 18ch; }
.hero--cassandra .hero__lead { max-inline-size: 54ch; }

@media (max-width: 980px) {
  .hero--cassandra .hero__layout { grid-template-columns: 1fr; gap: var(--c31-space-6); }
  .hero--cassandra .hero__title,
  .hero--cassandra .hero__lead { max-inline-size: none; }
  .hero-demo { max-inline-size: 560px; margin-block-start: var(--c31-space-2); }
}

/* Hero supporting points */
.hero-points {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--c31-space-2) var(--c31-space-5);
  padding: 0;
  margin-block-start: var(--c31-space-6);
  color: var(--c31-text-muted);
  font-size: var(--c31-fs-sm);
}

/* ===== Demo device ===== */
.hero-demo { inline-size: 100%; }
.device {
  inline-size: 100%;
  border: 1px solid var(--c31-border);
  border-radius: var(--c31-radius-lg);
  overflow: hidden;
  background: var(--c31-surface);
  box-shadow: var(--c31-shadow-lift);
}
.device-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: var(--c31-palette-ink-800);
}
.device-bar .dot { inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--c31-palette-slate-700); }
.device-url { margin-inline-start: 12px; color: var(--c31-palette-slate-400); font-size: 12px; }
.device-screen {
  block-size: 416px; background: var(--c31-bg-subtle);
  padding: 16px; overflow: hidden; position: relative;
}

.demo-controls {
  display: flex; gap: var(--c31-space-2); justify-content: center; flex-wrap: wrap;
  margin-block-start: var(--c31-space-4);
}
.chip-btn {
  border: 1px solid var(--c31-border); background: var(--c31-surface); color: var(--c31-text-muted);
  border-radius: var(--c31-radius-pill); padding: 6px 14px; font-size: 13px; font-weight: 600;
}
.chip-btn.active { background: var(--c31-text); color: var(--c31-bg); border-color: var(--c31-text); }
.chip-btn.replay { color: var(--c31-accent); }

/* Demo internals */
.d-card { background: var(--c31-surface); border: 1px solid var(--c31-border);
  border-radius: var(--c31-radius-md); padding: 16px; }
.d-h { font-weight: 700; color: var(--c31-text); font-size: 15px; margin: 0 0 4px; }
.d-sub { color: var(--c31-text-muted); font-size: 12.5px; margin: 0 0 14px; }
.fade-in { animation: c-fade .4s ease; }
@keyframes c-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.rec-dot { inline-size: 11px; block-size: 11px; border-radius: 50%; background: #e2483b;
  display: inline-block; margin-inline-end: 8px; animation: c-pulse 1s infinite; vertical-align: middle; }
@keyframes c-pulse { 50% { opacity: .25; } }
.wave { display: flex; align-items: flex-end; gap: 3px; block-size: 68px; margin: 18px 0; }
.wave span { flex: 1; background: var(--c31-accent); border-radius: 2px; animation: c-bar 1s ease-in-out infinite; }
@keyframes c-bar { 0%,100% { block-size: 16%; } 50% { block-size: 100%; } }
.rec-timer { font-variant-numeric: tabular-nums; color: var(--c31-text); font-weight: 700; }
.rec-src { display: flex; gap: 8px; margin-block-start: 8px; flex-wrap: wrap; }
.rec-src .tagx { background: var(--c31-accent-soft); color: var(--c31-accent);
  border-radius: var(--c31-radius-pill); padding: 4px 11px; font-size: 12px; font-weight: 600; }

.gen-steps { list-style: none; padding: 0; margin: 8px 0 0; }
.gen-steps li { padding: 7px 0 7px 26px; position: relative; color: var(--c31-text-muted); font-size: 14px; }
.gen-steps li.done { color: var(--c31-text); }
.gen-steps li.done::before { content: "\2713"; position: absolute; inset-inline-start: 0; color: var(--c31-accent); font-weight: 800; }
.gen-steps li.active::before { content: ""; position: absolute; inset-inline-start: 2px; inset-block-start: 11px;
  inline-size: 12px; block-size: 12px; border: 2px solid var(--c31-border);
  border-block-start-color: var(--c31-accent); border-radius: 50%; animation: c-spin .7s linear infinite; }
@keyframes c-spin { to { transform: rotate(360deg); } }

.p-head { display: flex; justify-content: space-between; align-items: center; margin-block-end: 10px; }
.p-title { font-weight: 800; color: var(--c31-text); font-size: 16px; }
.p-counts { color: var(--c31-text-muted); font-size: 12px; }
.p-tabs { display: flex; gap: 4px; border-block-end: 2px solid var(--c31-border); margin-block-end: 12px; }
.p-tab { background: none; border: none; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--c31-text-muted); cursor: pointer; border-block-end: 2px solid transparent; margin-block-end: -2px; }
.p-tab.active { color: var(--c31-text); border-block-end-color: var(--c31-accent); }
.p-body { font-size: 12.5px; }
.p-row { display: grid; grid-template-columns: 56px 1fr 70px; gap: 8px; padding: 6px 0;
  border-block-end: 1px solid var(--c31-border); align-items: center; }
.p-row strong { color: var(--c31-text); }

.pill { padding: 1px 8px; border-radius: var(--c31-radius-pill); font-size: 11px; font-weight: 700;
  text-align: center; color: #3a2a1a; }
.pill.Critical { background: #f3b8b1; } .pill.High { background: #f8d49e; }
.pill.Medium { background: #fdeeb6; } .pill.Low { background: #d7ead0; }
.dtag { padding: 1px 8px; border-radius: var(--c31-radius-sm); font-size: 11px; font-weight: 700; color: #3a2a1a; }
.dtag.Risk { background: #fce0d6; } .dtag.Issue { background: #f7c9ad; }
.dtag.Assumption { background: #dcebf7; } .dtag.Dependency { background: #e0efda; }

.g-row { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.g-lab { font-size: 11.5px; color: var(--c31-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; block-size: 16px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--c31-surface), var(--c31-surface) 13px, var(--c31-bg-muted) 13px, var(--c31-bg-muted) 14px); }
.g-bar { position: absolute; inset-block-start: 2px; block-size: 12px; border-radius: 3px; }
.g-bar.Critical { background: #f3b8b1; } .g-bar.High { background: #f8d49e; }
.g-bar.Medium { background: #fdeeb6; } .g-bar.Low { background: #d7ead0; }

.p-foot { display: flex; gap: 8px; margin-block-start: 12px; }
.p-foot .mini { background: var(--c31-accent); color: var(--c31-palette-white); border-radius: 7px;
  padding: 6px 12px; font-size: 12px; font-weight: 600; }
:root[data-theme="dark"] .p-foot .mini { color: var(--c31-palette-black); }
.p-foot .mini.alt { background: var(--c31-text); color: var(--c31-bg); }

/* Centre a section's content (used by the closing CTA) */
.center { text-align: center; }
.center .section-lead, .center .hero__actions { margin-inline: auto; }
.center .hero__actions { justify-content: center; }

/* High contrast: keep the device frame and chips legible */
:root[data-contrast="high"] .device,
:root[data-contrast="high"] .d-card,
:root[data-contrast="high"] .chip-btn { border-width: 2px; box-shadow: none; }

@media (max-width: 820px) {
  .device-screen { block-size: 392px; }
}
@media (max-width: 480px) {
  .device-screen { block-size: 372px; }
}
