:root {
  color-scheme: light dark;
  --base-bg: #f6f7fb;
  --base-text: #0f172a;
  --surface-1: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #edf1f7;
  --border: rgba(15, 23, 42, 0.1);
  --muted: rgba(15, 23, 42, 0.65);
  --accent: #b6881b;
  --accent-dark: #8f6a12;
  --shadow-strong: 0 22px 46px rgba(15, 23, 42, 0.16);
  --shadow-soft: 0 12px 24px rgba(15, 23, 42, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --base-bg: #0b1220;
    --base-text: #f6f7fb;
    --surface-1: #151c2a;
    --surface-2: #1b2334;
    --surface-3: #222c40;
    --border: rgba(241, 244, 248, 0.08);
    --muted: rgba(241, 244, 248, 0.65);
    --shadow-strong: 0 22px 46px rgba(11, 14, 19, 0.35);
    --shadow-soft: 0 12px 24px rgba(11, 14, 19, 0.2);
  }
}

html[data-theme="dark"] {
  --base-bg: #0b1220;
  --base-text: #f6f7fb;
  --surface-1: #151c2a;
  --surface-2: #1b2334;
  --surface-3: #222c40;
  --border: rgba(241, 244, 248, 0.08);
  --muted: rgba(241, 244, 248, 0.65);
  --shadow-strong: 0 22px 46px rgba(11, 14, 19, 0.35);
  --shadow-soft: 0 12px 24px rgba(11, 14, 19, 0.2);
}

html[data-theme="light"] {
  --base-bg: #f6f7fb;
  --base-text: #0f172a;
  --surface-1: #ffffff;
  --surface-2: #eef2f7;
  --surface-3: #e3e8ef;
  --border: rgba(15, 23, 42, 0.1);
  --muted: rgba(15, 23, 42, 0.65);
  --shadow-strong: 0 22px 46px rgba(15, 23, 42, 0.16);
  --shadow-soft: 0 12px 24px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--base-text);
  background: radial-gradient(
      circle at 20% 0%,
      color-mix(in srgb, var(--accent) 18%, transparent),
      transparent 60%
    ),
    radial-gradient(
      circle at 100% 20%,
      color-mix(in srgb, var(--base-text) 6%, transparent),
      transparent 55%
    ),
    var(--base-bg);
  overflow: auto;
}

html[data-theme="dark"] body {
  background: var(--base-bg);
}

@media (prefers-color-scheme: dark) {
  body {
    background: var(--base-bg);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  background: color-mix(in srgb, var(--base-bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}

.brand-name {
  font-size: 16px;
  letter-spacing: 0.04em;
}

.brand-accent {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.site-nav a {
  text-decoration: none;
  color: inherit;
}

.site-nav a:hover {
  color: var(--base-text);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.6;
  z-index: 0;
}

html[data-theme="dark"] .bg-shape {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .bg-shape {
    display: none;
  }
}

.bg-shape--one {
  width: 320px;
  height: 320px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 22%, transparent),
    color-mix(in srgb, var(--base-text) 6%, transparent)
  );
  top: -100px;
  left: -80px;
}

.bg-shape--two {
  width: 420px;
  height: 420px;
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--accent) 18%, transparent),
    color-mix(in srgb, var(--base-text) 8%, transparent)
  );
  bottom: -160px;
  right: -120px;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  animation: rise 0.7s ease-out;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 10px;
}

.subhead {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
}

.hero-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  min-width: 240px;
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 6px;
}

.mono {
  font-family: "IBM Plex Sans", "SFMono-Regular", "Menlo", monospace;
  font-size: 14px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 26px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.test-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

input[type="text"] {
  flex: 1 1 320px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: var(--surface-1);
  color: var(--base-text);
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--base-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 14px 28px rgba(182, 136, 27, 0.35);
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

button.ghost {
  background: transparent;
  color: var(--base-text);
  border: 1px solid color-mix(in srgb, var(--base-text) 28%, transparent);
  box-shadow: none;
}

.primary-btn,
.ghost-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
  background: var(--accent);
  color: var(--base-bg);
  box-shadow: 0 14px 28px rgba(182, 136, 27, 0.35);
}

.primary-btn:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

.ghost-btn {
  background: transparent;
  color: var(--base-text);
  border: 1px solid color-mix(in srgb, var(--base-text) 28%, transparent);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.run-extras {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.progress-wrap,
.activity-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.progress-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.progress-bar {
  height: 10px;
  background: color-mix(in srgb, var(--base-text) 6%, transparent);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, transparent));
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 6px 16px rgba(182, 136, 27, 0.25);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.activity {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  max-height: 140px;
  overflow: auto;
  padding-right: 4px;
}

.activity-item {
  font-size: 12px;
  color: var(--base-text);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}

.pill.running {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--base-text);
  animation: pulse 1.4s ease-in-out infinite;
}

.pill.completed {
  background: color-mix(in srgb, var(--base-text) 10%, transparent);
  color: var(--base-text);
}

.pill.failed {
  background: #ffe2d8;
  color: #9c3a21;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(182, 136, 27, 0.28);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(182, 136, 27, 0);
  }
}

.stage,
.meta {
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  min-height: 220px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-sub {
  font-size: 12px;
  color: var(--muted);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
  grid-auto-rows: max-content;
}

.timeline li {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.phase-label {
  font-weight: 600;
  color: var(--base-text);
}

.phase-state {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.phase--running {
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.phase--done {
  border-color: color-mix(in srgb, var(--base-text) 12%, transparent);
  background: color-mix(in srgb, var(--base-text) 6%, transparent);
}

.phase--failed {
  border-color: #f1c9b9;
  background: #fff0ea;
}

.dots {
  display: inline-flex;
  gap: 2px;
  margin-left: 6px;
}

.dots span {
  opacity: 0.2;
  animation: dotPulse 1.2s infinite;
}

.dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}

.signals {
  display: grid;
  gap: 10px;
}

.signal {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.artifacts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
  grid-auto-rows: max-content;
}

.artifacts li {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
  padding-bottom: 6px;
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
}

.site-footer {
  margin-top: 24px;
  padding-top: 24px;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.site-footer p {
  margin: 6px 0 0;
  color: var(--muted);
}

.footer-note {
  font-size: 12px;
  color: var(--muted);
}

.theme-toggle-group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  opacity: 0.65;
}

.theme-option {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.theme-option:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.theme-option svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-option[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
  opacity: 1;
}

.theme-option[aria-pressed="true"] svg {
  stroke: var(--accent);
}

.outcome-item {
  display: grid;
  gap: 4px;
}

.outcome-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.outcome-value {
  font-size: 13px;
  color: var(--base-text);
  line-height: 1.4;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--base-text) 6%, transparent);
  border-radius: 10px;
  height: 14px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-header {
    padding: 14px 20px;
  }
  .site-nav {
    display: none;
  }
  .run-extras {
    grid-template-columns: 1fr;
  }
  body {
    overflow: auto;
  }
  main {
    min-height: auto;
  }
}
