/* ============ demo landing page (/demo) ============ */

/* --- hero additions --- */

.demo-hero .text .eyebrow {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.demo-hero .text .eyebrow #rotator {
  display: inline-block;
  color: var(--color-accent);
  transition: opacity 0.25s, transform 0.25s;
}

.demo-hero .text .eyebrow #rotator.swap {
  opacity: 0;
  transform: translateY(0.4rem);
}

.demo-hero .text p {
  margin: 1.5rem 0 2rem 0;
}

.demo-hero .text .proof {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.demo-hero .text .proof span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  opacity: 0.75;
}

.demo-hero .text .proof span::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  background: var(--color-success);
}

/* --- chat demo (signature element) --- */

.chatdemo {
  display: flex;
  flex-direction: column;
  height: 24rem;
  border: 1px solid var(--color-border-aa);
  background: #000;
  box-shadow:
    0 20px 40px var(--color-bg-73),
    0 0 0 1px #ffffff08;
}

.chatdemo .head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--color-border-aa);
  background: var(--color-bg-aa);
}

.chatdemo .head p {
  margin: 0;
  font-size: 0.9rem;
  font-family: var(--font-mono);
}

.chatdemo .head .hash {
  color: var(--color-accent);
  margin-right: 0.15rem;
}

.chatdemo .head .shield {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--color-accent-55);
  color: var(--color-accent);
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.chatdemo .head .shield .dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.chatdemo .messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem;
  overflow: hidden;
}

.chatdemo .msg {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem;
  animation: msg-in 0.3s ease-out;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: translateY(0); }
}

.chatdemo .msg .avatar {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--color-black);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-space);
}

.chatdemo .msg .body b {
  display: block;
  font-size: 0.85rem;
  font-family: var(--font-space);
}

.chatdemo .msg .body p {
  margin: 0.15rem 0 0 0;
  font-size: 0.9rem;
  opacity: 0.9;
  overflow-wrap: anywhere;
}

.chatdemo .msg.flagged {
  outline: 1px solid var(--color-danger-55);
  background: var(--color-danger-1a);
}

.chatdemo .msg.flagged .body p {
  text-decoration: line-through;
  opacity: 0.45;
}

.chatdemo .msg .verdict {
  display: none;
  width: max-content;
  margin-top: 0.4rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--color-danger-55);
  color: var(--color-danger);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  animation: msg-in 0.3s ease-out;
}

.chatdemo .msg.flagged .verdict {
  display: block;
}

.chatdemo .inputbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
  margin: 0 1rem 1rem 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--color-border-aa);
  background: var(--color-surface-75);
  font-size: 0.85rem;
  opacity: 0.7;
}

.chatdemo .inputbar .cursor {
  width: 1px;
  height: 1rem;
  background: var(--color-text);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- steps --- */

.steps {
  margin: 0 20rem;
  margin-top: 6rem;
  padding: 5rem 0;
  border-top: 1px solid var(--color-border-aa);
}

.steps h2, .why h2 {
  margin-bottom: 3rem;
  text-align: center;
  font-size: 2rem;
  font-family: var(--font-space);
}

.steps .container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem;
}

.steps .list {
  display: flex;
  flex-direction: column;
}

.steps .step {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border-aa);
  transition: 0.15s;
}

.steps .step.active {
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface-aa);
}

.steps .step .num {
  color: var(--color-accent);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}

.steps .step b {
  font-size: 1rem;
  font-family: var(--font-space);
}

.steps .step p {
  margin: 0.4rem 0 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.steps .step code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--color-accent);
}

.steps .codepanel {
  padding: 1rem;
  border: 1px solid var(--color-border-aa);
  background: #000;
}

.steps .codepanel .head {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.steps .codepanel .head button {
  padding: 0.2rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-mono);
  cursor: pointer;
  opacity: 0.8;
  transition: 0.15s;
}

.steps .codepanel .head button:hover {
  background: var(--color-border-90);
  opacity: 0.9;
}

.steps .codepanel .head button.active {
  background: var(--color-border-aa);
  opacity: 1;
}

.steps .codepanel #stepcode pre {
  margin: 0 0 0.25rem 0;
  color: var(--color-text);
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

/* --- why cards --- */

.why {
  margin: 0 20rem;
  padding: 3rem 0 5rem 0;
  border-bottom: 1px solid var(--color-border-aa);
}

.why .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.why .card {
  padding: 1.5rem;
  border: 1px solid var(--color-border-aa);
  background: var(--color-bg-aa);
  transition: 0.15s;
}

.why .card:hover {
  border-color: var(--color-accent-55);
  transform: translateY(-0.25rem);
}

.why .card > span {
  background-color: var(--color-accent);
}

.why .card b {
  display: block;
  margin-top: 1rem;
  font-size: 1.1rem;
  font-family: var(--font-space);
}

.why .card p {
  margin: 0.6rem 0 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* --- faq (interactive additions) --- */

.more .faq .container .card {
  cursor: pointer;
  transition: 0.15s;
}

.more .faq .container .card:hover {
  border-color: var(--color-accent-55);
}

.more .faq .container .card b span {
  transition: 0.15s;
}

.more .faq .container .card code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--color-accent);
}

/* --- cta banner --- */

.banner {
  margin: 5rem 20rem;
}

.banner .inner {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 3rem;
  border: 1px solid var(--color-accent-55);
  background:
    linear-gradient(120deg, var(--color-accent-strong-14), transparent 40%),
    var(--color-bg-aa);
  overflow: hidden;
}

.banner .inner::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, var(--color-accent-1a), transparent);
  animation: sweep 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sweep {
  0%, 60% { left: -60%; }
  100% { left: 130%; }
}

.banner h2 {
  margin: 0;
  font-size: 2rem;
  font-family: var(--font-space);
}

.banner p {
  margin: 0.75rem 0 0 0;
  opacity: 0.8;
}

.banner a.primary {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent-strong);
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 300;
  font-family: var(--font-space);
  text-decoration: none;
  transition: 0.15s;
}

.banner a.primary:hover {
  opacity: 0.9;
}

.banner a.primary:hover .icon-arrow-left {
  transform: translateX(0.25rem);
}

/* --- scroll reveal --- */

.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.shown {
  opacity: 1;
  transform: none;
}

/* --- icons --- */

.icon-key {
  display: inline-block;
  height: 1.5rem;
  width: 1.5rem;
  background-color: var(--color-text);
  -webkit-mask: url('/static/icon/key.svg') no-repeat center;
  mask: url('/static/icon/key.svg') no-repeat center;
  mask-size: contain;
  transition: 0.15s;
}

/* --- reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .chatdemo .msg,
  .chatdemo .msg .verdict {
    animation: none;
  }

  .chatdemo .head .shield .dot,
  .chatdemo .inputbar .cursor,
  .banner .inner::after {
    animation: none;
  }

  .demo-hero .text .eyebrow #rotator {
    transition: none;
  }
}

/* --- laptop --- */

@media (max-width: 1600px) {
  .steps, .why {
    margin: 0 12.5rem;
  }

  .banner {
    margin: 5rem 12.5rem;
  }
}

/* --- tablet --- */

@media (max-width: 1100px) {
  .demo-hero {
    grid-template-columns: 1fr;
    padding: 10rem 3rem 0 3rem;
  }

  .steps, .why {
    margin-left: 3rem;
    margin-right: 3rem;
  }

  .banner {
    margin: 4rem 3rem;
  }

  .why .container {
    grid-template-columns: 1fr 1fr;
  }

  .more {
    margin: 0 3rem;
  }
}

/* --- mobile --- */

@media (max-width: 480px) {
  .demo-hero {
    padding: 0 1rem;
  }

  .more {
    margin: 0 1rem;
  }

  .demo-hero .text h1 {
    font-size: 2.75rem;
  }

  .demo-hero .text {
    margin-top: 8rem;
  }

  .banner h2 {
    font-size: 1.5rem;
  }

  .demo-hero .text .proof {
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
  }

  .chatdemo {
    width: 100%;
    height: 22rem;
  }

  .steps, .why {
    margin: 0 1rem;
  }

  .steps {
    padding: 3rem 0;
  }

  .steps .container {
    display: flex;
    flex-direction: column;
  }

  .steps .codepanel #stepcode {
    overflow-x: auto;
  }

  .why .container {
    display: flex;
    flex-direction: column;
  }

  .banner {
    margin: 3rem 1rem;
  }

  .banner .inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.5rem;
  }
}
