/* Ucotron demo landing — Phase 9 (UCO-30).
 *
 * Palette (matches ucotron-admin):
 *   --teal:        #0F4C5C   deep teal, primary
 *   --teal-ink:    #082A33   darker variant for text on light bg
 *   --gold:        #F9C846   accent
 *   --gold-deep:   #D9A521
 *   --paper:       #FBF8F2   off-white background
 *   --paper-card:  #FFFFFF
 *   --ink:         #1A2A2F   body text
 *   --ink-soft:    #4F646B   muted text
 *   --line:        #E2DCCB   borders / dividers
 *   --ok:          #2F9E6A
 *   --warn:        #C77B0A
 *   --err:         #B23B3B
 */

:root {
  --teal: #0f4c5c;
  --teal-ink: #082a33;
  --gold: #f9c846;
  --gold-deep: #d9a521;
  --paper: #fbf8f2;
  --paper-card: #ffffff;
  --ink: #1a2a2f;
  --ink-soft: #4f646b;
  --line: #e2dccb;
  --ok: #2f9e6a;
  --warn: #c77b0a;
  --err: #b23b3b;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(8, 42, 51, 0.08);
  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(15, 76, 92, 0.06);
  color: var(--teal-ink);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
a:hover {
  border-bottom-color: var(--gold-deep);
}

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar {
  background: var(--teal);
  color: #fff;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid var(--gold);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}
.brand-mark {
  background: var(--gold);
  color: var(--teal-ink);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 800;
  font-family: var(--font-mono);
}
.brand-name {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.brand-env {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.topbar-links a {
  color: #fff;
  margin-left: 1.25rem;
  font-size: 0.95rem;
  border-bottom-color: rgba(249, 200, 70, 0.4);
}
.topbar-links a:hover {
  border-bottom-color: var(--gold);
}

/* ─── Layout ──────────────────────────────────────────────── */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* ─── Hero ────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 3rem;
}
.hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--teal-ink);
  margin: 0 0 0.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.subhero {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 0.75rem;
}
.hero-meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ─── Demo cards ──────────────────────────────────────────── */
.demo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.demo-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.demo-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: var(--teal-ink);
}
.event-summary {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.event-details {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--ink);
}
.event-details li {
  padding: 0.2rem 0;
  border-bottom: 1px dotted var(--line);
}
.event-details li:last-child {
  border-bottom: none;
}
.event-details strong {
  display: inline-block;
  min-width: 100px;
  color: var(--ink-soft);
  font-weight: 600;
}

.run-btn {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  transition:
    background 0.15s ease,
    transform 0.05s ease;
}
.run-btn:hover {
  background: var(--teal-ink);
}
.run-btn:active {
  transform: translateY(1px);
}
.run-btn[disabled] {
  background: var(--ink-soft);
  cursor: progress;
  opacity: 0.8;
}

.demo-output {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--ink);
  min-height: 4rem;
}
.demo-output .output-placeholder {
  margin: 0;
  color: var(--ink-soft);
  font-style: italic;
}
.demo-output .step {
  margin: 0 0 0.3rem;
}
.demo-output .step.ok::before {
  content: "✓ ";
  color: var(--ok);
  font-weight: 700;
}
.demo-output .step.pending::before {
  content: "… ";
  color: var(--gold-deep);
  font-weight: 700;
}
.demo-output .step.err::before {
  content: "✗ ";
  color: var(--err);
  font-weight: 700;
}
.demo-output .payout {
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--teal-ink);
}
.demo-output .pdf-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--gold);
  color: var(--teal-ink);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: none;
}
.demo-output .pdf-link:hover {
  background: var(--gold-deep);
  border-bottom: none;
}

/* ─── Live metrics ────────────────────────────────────────── */
.live-metrics {
  margin-top: 3rem;
}
.live-metrics h2 {
  font-size: 1.4rem;
  color: var(--teal-ink);
  margin: 0 0 0.25rem;
}
.metrics-note {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.metric-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow);
}
.metric-card h3 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
}
.metric-value {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--teal-ink);
  font-variant-numeric: tabular-nums;
}
.metric-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.health-cells {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.85rem;
}
.health-cells li {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.5rem 0.4rem;
  text-align: center;
}
.health-label {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}
.health-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--line);
  color: transparent;
  font-size: 0;
  vertical-align: middle;
}
.health-dot[data-state="ok"] {
  background: var(--ok);
}
.health-dot[data-state="warn"] {
  background: var(--warn);
}
.health-dot[data-state="err"] {
  background: var(--err);
}

/* ─── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  background: var(--paper-card);
}
footer p {
  margin: 0 0 0.5rem;
}
footer .footer-fineprint {
  color: var(--ink-soft);
  opacity: 0.75;
  font-size: 0.78rem;
}

/* ─── Small screens ───────────────────────────────────────── */
@media (max-width: 640px) {
  .topbar {
    padding: 0.75rem 1rem;
  }
  main {
    padding: 1.5rem 1rem 2rem;
  }
  .topbar-links a {
    margin-left: 0.75rem;
  }
}
