:root {
  color-scheme: light;
  --bg: #eef5f2;
  --panel: #ffffff;
  --ink: #15212c;
  --muted: #5d7181;
  --line: #dce9e6;
  --mint: #12b981;
  --mint-soft: #e5f8f1;
  --blue: #315f9d;
  --danger: #b75042;
  --danger-soft: #fff0ed;
  --amber: #b67a1d;
  --amber-soft: #fff4da;
  --night: #0c1720;
  --night-2: #122d35;
  --care: #f5c35b;
  --shadow: 0 22px 70px rgba(33, 61, 71, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(18, 185, 129, 0.12), transparent 34rem),
    linear-gradient(180deg, #f8fcfb, var(--bg));
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.app-shell {
  width: min(1600px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.demo-dock {
  position: sticky;
  top: 10px;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 2px solid rgba(18, 185, 129, 0.72);
  border-radius: 12px;
  background: rgba(242, 255, 250, 0.96);
  box-shadow: 0 22px 60px rgba(11, 38, 44, 0.2);
  backdrop-filter: blur(16px);
}

.demo-mode .demo-dock,
.video-mode .demo-dock {
  display: flex;
}

.demo-dock-copy strong,
.demo-dock-copy span {
  display: block;
}

.demo-dock-copy strong {
  color: #087a5f;
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.demo-dock-copy span {
  margin-top: 4px;
  color: #243b4e;
  font-size: 16px;
  font-weight: 850;
}

.demo-dock-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.demo-focus {
  --focus-color: rgba(18, 185, 129, 0.9);
  outline: 7px solid var(--focus-color);
  outline-offset: 6px;
  box-shadow: 0 0 0 13px rgba(18, 185, 129, 0.18), var(--shadow);
  scroll-margin-top: 92px;
}

.no_memory.demo-focus {
  --focus-color: rgba(49, 95, 157, 0.9);
}

.raw_memory.demo-focus {
  --focus-color: rgba(183, 80, 66, 0.9);
}

.why-panel.demo-focus {
  --focus-color: rgba(182, 122, 29, 0.9);
}

.erinys_qwen.demo-focus {
  --focus-color: rgba(18, 185, 129, 0.95);
}

.scenario,
.cloud-proof,
.comparison-banner,
.controls,
.lower-grid > article,
.answer-card,
.why-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(460px, 1.05fr) minmax(360px, 0.82fr) minmax(260px, 0.45fr);
  align-items: center;
  gap: 22px;
  min-height: 332px;
  overflow: visible;
  border: 1px solid rgba(195, 239, 226, 0.16);
  border-radius: 18px;
  padding: 28px 28px 28px 34px;
  background:
    radial-gradient(circle at 82% 8%, rgba(245, 195, 91, 0.26), transparent 18rem),
    radial-gradient(circle at 38% 20%, rgba(18, 185, 129, 0.22), transparent 24rem),
    linear-gradient(135deg, var(--night), var(--night-2) 62%, #102126);
  box-shadow: 0 32px 90px rgba(10, 27, 35, 0.26);
  color: #fff;
}

.eyebrow {
  margin: 0 0 7px;
  color: #97f1d8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(58px, 6vw, 96px);
  line-height: 0.9;
  letter-spacing: 0;
}

.tagline {
  margin-bottom: 12px;
  color: #fff;
  font-size: 23px;
  font-weight: 700;
}

.hero-summary {
  max-width: 650px;
  margin-bottom: 18px;
  color: #bdd1d4;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proof-row span {
  padding: 9px 11px;
  border: 1px solid rgba(168, 243, 220, 0.2);
  border-radius: 999px;
  background: rgba(168, 243, 220, 0.1);
  color: #d7fff1;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.architecture-card {
  min-width: 0;
  border: 1px solid rgba(168, 243, 220, 0.2);
  border-radius: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.architecture-title {
  margin-bottom: 12px;
  color: #f8d68a;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.architecture-flow {
  display: grid;
  gap: 8px;
}

.architecture-flow span {
  position: relative;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(10, 23, 32, 0.54);
  color: #f9fffd;
  font-size: 14px;
  font-weight: 950;
}

.architecture-card p {
  margin: 13px 0 0;
  color: #bdd1d4;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.hero-visual {
  position: relative;
  align-self: stretch;
  min-height: 280px;
}

.care-dog {
  position: absolute;
  top: 50%;
  right: -58px;
  width: min(520px, 31vw);
  max-width: none;
  height: auto;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 22px 38px rgba(0, 0, 0, 0.34));
  transform: translateY(-48%);
}

.care-dog img {
  display: block;
  width: 100%;
  height: auto;
}

.status-card {
  position: absolute;
  left: 0;
  bottom: 18px;
  display: none;
  align-items: center;
  gap: 12px;
  width: min(280px, 100%);
  min-width: 250px;
  padding: 14px 16px;
  border: 1px solid rgba(168, 243, 220, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(12px);
}

.status-card strong,
.status-card small {
  display: block;
}

.status-card small {
  margin-top: 2px;
  color: #bdd1d4;
  overflow-wrap: anywhere;
}

.live-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #b8c6cc;
  box-shadow: 0 0 0 6px rgba(184, 198, 204, 0.18);
}

.live-dot.online {
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(18, 185, 129, 0.16);
}

.cloud-proof {
  display: grid;
  grid-template-columns: 1fr 0.82fr 0.82fr 1.18fr;
  gap: 10px;
  margin-top: 14px;
  padding: 13px 14px;
}

.cloud-proof div {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fbfa;
}

.cloud-proof span,
.cloud-proof strong {
  display: block;
}

.cloud-proof span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.cloud-proof strong {
  overflow-wrap: anywhere;
  color: #183044;
  font-size: 14px;
  line-height: 1.25;
}

.scenario {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
  gap: 18px;
  margin-top: 14px;
  padding: 18px 22px;
}

.scenario h2,
.controls label,
.lower-grid h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.scenario p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.scenario-callout {
  align-self: stretch;
  padding: 14px 16px;
  border-radius: 11px;
  background: linear-gradient(135deg, #effbf7, #fff8e6);
}

.scenario-callout strong,
.scenario-callout span {
  display: block;
}

.scenario-callout strong {
  margin-bottom: 7px;
  color: #123044;
  font-size: 16px;
  font-weight: 950;
}

.scenario-callout span {
  color: #466172;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.42;
}

.tech-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.tech-strip span {
  min-height: 40px;
  padding: 10px 11px;
  border-radius: 9px;
  background: var(--mint-soft);
  color: #10785c;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.controls {
  margin-top: 18px;
  padding: 16px 18px;
}

.controls label {
  display: block;
  font-weight: 900;
}

textarea,
input {
  width: 100%;
  border: 1px solid #cfe0dc;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 82px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.5;
}

input {
  padding: 12px 13px;
}

textarea:focus,
input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(18, 185, 129, 0.12);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.primary,
.secondary {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 900;
}

.primary {
  background: var(--ink);
  color: #fff;
}

.secondary {
  background: #e8f0ef;
  color: var(--ink);
}

.comparison-banner {
  margin-top: 18px;
  padding: 14px 18px;
  background: linear-gradient(90deg, #10283b, #154438);
  color: #fff;
}

.comparison-banner > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.comparison-banner span {
  color: #a8f3dc;
  font-weight: 900;
}

.video-mode .app-shell {
  padding-top: 16px;
}

.video-mode .hero {
  min-height: 350px;
}

.video-mode .controls {
  display: block;
  margin-top: 12px;
}

.video-mode .cloud-proof,
.video-mode .scenario {
  margin-top: 10px;
}

.video-mode .comparison-banner {
  margin-top: 12px;
}

.answer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 150px minmax(0, 1.08fr);
  gap: 14px;
  margin-top: 14px;
  min-height: 620px;
}

.answer-card {
  min-width: 0;
  padding: 18px;
}

.answer-card header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.index {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #3a4f68;
  color: white;
  font-size: 20px;
  font-weight: 950;
}

.answer-card h2 {
  margin-bottom: 3px;
  font-size: 24px;
  line-height: 1.08;
}

.answer-card header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  margin: 13px 0;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 950;
}

.neutral {
  background: #edf1f5;
  color: #45586f;
}

.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.success {
  background: var(--mint-soft);
  color: #087a5f;
}

.answer-card.raw_memory {
  border-color: #efcac3;
  background: rgba(255, 249, 248, 0.9);
}

.answer-card.erinys_qwen {
  border-color: rgba(18, 185, 129, 0.42);
  background: rgba(249, 255, 253, 0.94);
}

.answer-card.erinys_qwen.demo-focus {
  border-color: rgba(18, 185, 129, 0.86);
  box-shadow: 0 0 0 13px rgba(18, 185, 129, 0.18), var(--shadow);
}

.bullets {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.bullets li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7fbfa;
  color: #284052;
  font-weight: 800;
}

.danger-list li {
  border-color: #efcac3;
  background: #fff4f1;
  color: var(--danger);
}

.success-list li {
  border-color: #bdebe0;
  background: #effbf7;
  color: #087a5f;
}

.answer-card h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

pre {
  overflow: auto;
  min-height: 258px;
  max-height: 360px;
  margin: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: #273747;
  white-space: pre-wrap;
  font: 700 15px/1.48 Inter, ui-sans-serif, system-ui, sans-serif;
}

.prompt-proof {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #cfe0dc;
  border-radius: 9px;
  background: #f6fbfa;
  color: #244154;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.36;
}

.raw_memory .prompt-proof {
  border-color: #efcac3;
  background: #fff0ed;
  color: var(--danger);
}

.erinys_qwen .prompt-proof {
  border-color: #bdebe0;
  background: #e5f8f1;
  color: #087a5f;
}

footer {
  margin-top: 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.why-panel {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 16px 12px;
  text-align: center;
}

.why-panel h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}

.why-step {
  padding: 13px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 950;
}

.why-step.select {
  background: var(--mint-soft);
  color: #087a5f;
}

.why-step.demote {
  background: var(--amber-soft);
  color: var(--amber);
}

.why-step.block {
  background: var(--danger-soft);
  color: var(--danger);
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.55fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.lower-grid > article {
  padding: 18px;
}

.lower-grid header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memory-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.memory-panel button {
  width: 100%;
  margin-top: 10px;
}

#persistedBadge {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: #087a5f;
  font-size: 13px;
  font-weight: 900;
}

.count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.count {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.count.selected,
.decision.selected span {
  background: var(--mint-soft);
  color: #087a5f;
}

.count.conflicted,
.decision.conflicted span {
  background: #eef3ff;
  color: #315f9d;
}

.count.demoted,
.decision.demoted span {
  background: var(--amber-soft);
  color: var(--amber);
}

.count.blocked,
.decision.blocked span {
  background: var(--danger-soft);
  color: var(--danger);
}

.decision-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.decision {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.decision > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.decision strong {
  font-size: 14px;
}

.decision span {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.decision p {
  margin: 9px 0 6px;
  color: #263b4c;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.decision small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 300px;
  }

  .care-dog {
    right: 0;
    width: min(520px, 58vw);
  }

  .status-card {
    left: 0;
    width: min(280px, 100%);
  }

  .cloud-proof,
  .tech-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .why-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    text-align: left;
  }

  .why-panel h2 {
    grid-column: 1 / -1;
  }

  .lower-grid,
  .scenario {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1350px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.5fr);
  }

  .architecture-card {
    grid-column: 1 / -1;
    order: 3;
  }

  .architecture-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .care-dog {
    width: 100%;
    right: -20px;
  }

  .hero-visual {
    justify-items: stretch;
  }

  .status-card {
    display: none;
  }
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .architecture-card {
    grid-column: auto;
    order: initial;
  }

  .architecture-flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 22px, 1540px);
    padding-top: 12px;
  }

  .comparison-banner > div,
  .lower-grid header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: 0;
    padding: 22px 18px;
  }

  h1 {
    font-size: 46px;
  }

  .status-card {
    min-width: 0;
    width: 100%;
  }

  .cloud-proof,
  .tech-strip,
  .decision-list,
  .why-panel {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 265px;
  }

  .care-dog {
    right: -26px;
    width: min(380px, 92vw);
  }

  .status-card {
    bottom: 0;
  }
}
