/* Motion and terminal styles. Honors prefers-reduced-motion. */

/* Subtle fixed grid under the page; rain canvas sits on top at low opacity. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(125, 211, 192, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 192, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.7;
}

.code-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.13;
}
body > header,
body > main,
body > footer { position: relative; z-index: 1; }

.price-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 1.1rem 0 0.4rem;
  padding: 0;
}
.price-chips li {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}
.price-chips strong { color: var(--gold); font-weight: 700; }

.terminal {
  background: #070b10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 22rem;
  display: flex;
  flex-direction: column;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  background: #10161e;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.term-dots { display: flex; gap: 0.3rem; }
.term-dots i {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #3a4656;
}
.term-dots i:nth-child(1) { background: #c45c5c; }
.term-dots i:nth-child(2) { background: #c9a36a; }
.term-dots i:nth-child(3) { background: #5aa886; }
.term-body {
  margin: 0;
  padding: 0.9rem 1rem 1.1rem;
  font: 0.82rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #c8d4e0;
  white-space: pre-wrap;
  flex: 1;
  min-height: 16rem;
}
.term-body .ok { color: #86d9b0; }
.term-body .miss { color: #e3b089; }
.term-body .cmt { color: #7d8b9c; }
.term-body .cmd { color: #7dd3c0; }
.term-body .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: #7dd3c0;
  margin-left: 1px;
  vertical-align: -0.15em;
}
.term-note {
  margin: 0;
  padding: 0.45rem 1rem 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #0b1016;
}
.term-note button {
  font: inherit;
  font-weight: 650;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.scan-frame { position: relative; }
.scan-line {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #7dd3c0, transparent);
  box-shadow: 0 0 14px rgba(125, 211, 192, 0.55);
  pointer-events: none;
  z-index: 2;
}
.snippet {
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem;
  background: #070b10;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 0.82rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #c8d4e0;
  overflow: auto;
  position: relative;
}

/* Reveals stay visible until JS opts in, and when motion is reduced. */
.reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  html.js-motion .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  html.js-motion .reveal.is-in {
    opacity: 1;
    transform: none;
  }
  .term-body .cursor { animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  .scan-line {
    display: block;
    animation: scan-move 3.8s ease-in-out infinite;
  }
  @keyframes scan-move {
    0% { top: 8%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 92%; opacity: 0; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .term-body .cursor { display: none; }
  .scan-line { display: none; }
  .code-bg { display: none; }
  body::before { display: none; }
}
