/* ── JEV SHOWCASE ──
   Page styles for jev.html. Panel, button, input and article rules follow
   retro-pet.css so the two demos read as one family, but are kept separate so
   editing one can never break the other. */

/* Outcome colours are the site's green / yellow / red from the Retro AI Pet.
   Each only marks a bar: the words and numbers beside it stay in text colour,
   so no verdict is carried by colour alone. */
:root {
  --inset: #0a0a0a;
  --ok: #45e0a6;
  --near: #ffe66d;
  --bad: #ff5d73;
}

/* Several blocks here set display, which would otherwise beat [hidden]. */
[hidden] { display: none !important; }

/* ── HERO ── */
.hero {
  padding: 9rem 2.5rem 3rem;
}

.hero-headline {
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

/* ── DEVICE ── */
.device-section {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1.5rem 5rem;
}

.device {
  width: 100%;
  max-width: 980px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow:
    0 0 0 6px #060606,
    0 0 0 7px var(--border),
    0 24px 70px rgba(0, 0, 0, 0.65);
}

.device-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.1rem;
  align-items: start;
}

.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  min-width: 0;
}

.panel-label {
  font-family: 'Sixtyfour Convergence', sans-serif;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── GAME ── */
.scene-title {
  font-family: 'VT323', monospace;
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 0.9rem;
}

/* 16:9. Until a scene has art, this is the placeholder. */
.scene-art {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--inset);
  border: 1px solid var(--border2);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.scene-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.scene-art-placeholder {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px dashed var(--border2);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
}

.scene-text {
  font-size: 15px;
  color: var(--muted2);
  line-height: 1.8;
  margin-bottom: 1.1rem;
}

.action-form {
  display: grid;
  gap: 0.5rem;
}

.action-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.action-input {
  width: 100%;
  resize: vertical;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  padding: 0.6rem 0.7rem;
  outline: none;
}

.action-input::placeholder { color: var(--muted); }

.action-input:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 2px;
}

.action-input:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn {
  justify-self: start;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn:hover { border-color: var(--text); }

.btn.primary {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

.btn.primary:hover {
  background: transparent;
  color: var(--text);
}

.btn:disabled,
.btn:disabled:hover {
  opacity: 0.4;
  cursor: default;
  background: var(--text);
  color: var(--bg);
}

.btn:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 2px;
}

.result-verdict:empty,
.result-text:empty { display: none; }

.result { margin-top: 1.1rem; }

.result-verdict {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.result-text {
  font-size: 15px;
  color: var(--muted2);
  line-height: 1.8;
  margin-bottom: 0.9rem;
}

/* The colour swatch beside a verdict. Always paired with the word. */
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--muted);
  flex: none;
}

.swatch[data-outcome="success"] { background: var(--ok); }
.swatch[data-outcome="narrow_success"] { background: var(--near); }
.swatch[data-outcome="failure"] { background: var(--bad); }

.ending-path {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 14px;
}

.ending-path li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted2);
}

.ending-path .ending-verdict {
  margin-left: auto;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ending-totals {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ── TELEMETRY ── */
.mode-badge {
  margin-left: auto;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.mode-badge.is-mock { border-style: dashed; }

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.tile {
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  min-width: 0;
}

.tile dt {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tile dd {
  font-family: 'VT323', monospace;
  font-size: 1.6rem;
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-note {
  font-size: 11px;
  color: var(--muted);
  min-height: 1.4em;
  margin-bottom: 0.9rem;
}

.meter-group { margin-bottom: 1rem; }

.meter-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.meter-type {
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.meter { margin-bottom: 0.55rem; }

.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted2);
  margin-bottom: 0.25rem;
}

.meter-value { color: var(--text); }

.meter.is-chosen .meter-label span:first-child { color: var(--text); }
.meter.is-chosen .meter-label span:first-child::after { content: '  \2190 chosen'; color: var(--muted); }

.meter-track {
  height: 8px;
  background: var(--inset);
  border: 1px solid var(--border2);
  border-radius: 4px;
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--muted2);
  transition: width 0.45s ease;
}

.meter[data-outcome="success"] .meter-fill { background: var(--ok); }
.meter[data-outcome="narrow_success"] .meter-fill { background: var(--near); }
.meter[data-outcome="failure"] .meter-fill { background: var(--bad); }

.race {
  border-top: 0.5px solid var(--border);
  padding-top: 0.9rem;
  margin-bottom: 0.9rem;
}

.race-row {
  display: grid;
  grid-template-columns: 7.5rem 5.5rem 1fr;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  padding: 0.2rem 0;
}

.race-name { color: var(--muted2); }

.race-time {
  font-family: 'VT323', monospace;
  font-size: 1.35rem;
  color: var(--text);
  text-align: right;
}

.race-time.is-running { color: var(--muted2); }

.race-verdict {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  min-width: 0;
}

.race-note {
  font-size: 12px;
  color: var(--muted2);
  min-height: 1.4em;
  margin-top: 0.3rem;
}

.raw summary {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.raw summary:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 2px;
}

.raw pre {
  margin-top: 0.5rem;
  max-height: 260px;
  overflow: auto;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted2);
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem;
}

/* ── UNDER THE HOOD ── */
.hood-panel { grid-column: 1 / -1; }

.hood-title {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.hood-text {
  font-size: 15px;
  color: var(--muted2);
  line-height: 1.8;
}

/* ── ARTICLE ── */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

.article-section {
  padding: 3rem 0;
  border-top: 0.5px solid var(--border);
}

.article-section:first-of-type {
  border-top: none;
  padding-top: 4rem;
}

.article-section h2 {
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

.article-section p {
  font-size: 16px;
  color: var(--muted2);
  line-height: 1.9;
  margin-bottom: 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

footer {
  border-top: 0.5px solid var(--border);
}

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
  .hero {
    padding: 7rem 1.5rem 3rem;
  }

  .device {
    padding: 1rem;
  }

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

@media (max-width: 400px) {
  .race-row {
    grid-template-columns: 6rem 4.5rem 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .meter-fill { transition: none; }
}
