/* ───────────────────────── Tokens ───────────────────────── */

:root {
  color-scheme: dark;

  --bg: #0e0c09;
  --surface: #171411;
  --raised: #1f1b16;
  --glass: rgba(31, 27, 22, 0.72);
  --text: #ede8df;
  --text-muted: #928a7e;
  --text-dim: #5e574d;
  --border: rgba(237, 232, 223, 0.07);
  --border-strong: rgba(237, 232, 223, 0.14);

  --accent: #5bb98c;
  --accent-soft: rgba(91, 185, 140, 0.10);
  --amber: #d4a462;
  --amber-soft: rgba(212, 164, 98, 0.10);
  --red: #c75a4a;
  --red-soft: rgba(199, 90, 74, 0.10);

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 6px;
  --max-w: 1100px;
}

/* ───────────────────────── Reset ───────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Lexend', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-width: 320px;
}

/* Grain texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ───────────────────────── Layout ───────────────────────── */

.wrap {
  width: min(var(--max-w), calc(100% - 2.5rem));
  margin: 0 auto;
}

/* ───────────────────────── Header ───────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(1.4);
  background: rgba(14, 12, 9, 0.82);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: 1.4rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 180ms;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

/* ───────────────────────── Chip / Tag ───────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ───────────────────────── Lucide Icons ───────────────────── */

.brand-icon,
.nav-icon,
.chip-icon,
.btn-icon,
.label-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.brand-icon {
  width: 1.1em;
  height: 1.1em;
  color: var(--accent);
}

.nav-icon {
  opacity: 0.5;
}

.fcard-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1rem;
}

.fcard-icon svg {
  width: 1.3rem;
  height: 1.3rem;
}

/* ───────────────────────── Hero ───────────────────────── */

.hero {
  position: relative;
  padding: 8rem 0 6rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -8rem;
  left: 50%;
  transform: translateX(-60%);
  width: 900px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(91, 185, 140, 0.06) 0%, rgba(212, 164, 98, 0.03) 45%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: 'Young Serif', serif;
  font-size: clamp(3rem, 7.5vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0;
  max-width: 14ch;
}

.lead {
  max-width: 52ch;
  margin: 1.6rem 0 0;
  font-size: 1.08rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.2rem;
}

.copy-msg {
  margin: 0.6rem 0 0;
  min-height: 1.4rem;
  font-size: 0.85rem;
  color: var(--accent);
}

/* ───────────────────────── Buttons ───────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 140ms, background 140ms, border-color 140ms;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

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

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
}

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

/* Filter buttons */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.fbtn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 140ms, color 140ms, border-color 140ms;
}

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

.fbtn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ───────────────────────── Sections ───────────────────────── */

.workflow,
.features,
.scenarios,
.install-section {
  padding: 5rem 0;
}

.workflow {
  border-top: 1px solid var(--border);
}

.features {
  border-top: 1px solid var(--border);
}

.scenarios {
  border-top: 1px solid var(--border);
}

.install-section {
  border-top: 1px solid var(--border);
}

/* ───────────────────────── Workflow ───────────────────────── */

.workflow-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-top: 2.5rem;
}

.wstep {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  flex: 1;
  max-width: 220px;
  padding: 0 0.8rem;
}

.wstep-num {
  position: absolute;
  top: -0.5rem;
  right: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  opacity: 0.5;
}

.wstep-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  margin-bottom: 1rem;
  transition: border-color 220ms, background 220ms;
}

.wstep:hover .wstep-icon {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.wstep-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.wstep h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.wstep p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.wstep-arrow {
  display: flex;
  align-items: center;
  color: var(--text-dim);
  padding-top: 1rem;
  flex-shrink: 0;
}

.wstep-arrow svg {
  width: 1.2rem;
  height: 1.2rem;
}

h2 {
  font-family: 'Young Serif', serif;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

h3 {
  font-family: 'Young Serif', serif;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-sub {
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 2rem;
  line-height: 1.65;
}

/* ───────────────────────── Feature Grid ───────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}

.fcard {
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 220ms, transform 220ms;
}

.fcard:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.fcard h3 {
  margin-bottom: 0.6rem;
}

.fcard p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ──────────────────────── Summary Bar ─────────────────────── */

.summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.metric {
  display: flex;
  flex-direction: column;
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  min-width: 7rem;
}

.metric span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.metric strong {
  font-size: 1.5rem;
  margin-top: 0.3rem;
}

/* ───────────────────────── Run Cards ───────────────────────── */

.run-list {
  display: grid;
  gap: 1rem;
}

.run-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.5rem;
  overflow: hidden;
}

.run-card--empty {
  text-align: center;
  padding: 3rem 1.5rem;
}

.run-card--empty h3 {
  margin-bottom: 0.5rem;
}

.run-card--empty p {
  color: var(--text-muted);
  margin: 0;
}

.run-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.run-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0.3rem 0 0;
}

.run-summary {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Status badge */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: capitalize;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-passed {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-failed {
  background: var(--red-soft);
  color: var(--red);
}

.badge-unknown {
  background: rgba(237, 232, 223, 0.06);
  color: var(--text-muted);
}

/* Findings */

.finding-list {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.finding-list li {
  margin-top: 0.35rem;
}

/* Media preview */

.run-media {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.run-media img,
.run-media video {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--raised);
  object-fit: cover;
}

/* Details / expand */

.run-details {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--raised);
  overflow: hidden;
}

.run-details summary {
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  user-select: none;
}

.run-details summary:hover {
  color: var(--text);
}

/* Markdown body inside run card */

.run-card .markdown-body {
  padding: 1.2rem;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
  overflow-x: auto;
}

.run-card .markdown-body img,
.run-card .markdown-body video {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 0.8rem 0;
}

.run-card .markdown-body pre {
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
}

.run-card .markdown-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
}

.run-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.run-foot a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 140ms;
}

.run-foot a:hover {
  color: var(--text);
}

/* ───────────────────────── Install ───────────────────────── */

.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
  align-items: start;
}

.install-block {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.install-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.install-pre {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.install-pre code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  color: var(--accent);
  white-space: pre;
}

.prompt-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.prompt-list li {
  margin-top: 0.55rem;
}

/* ───────────────────────── Footer ───────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* ───────────────────────── Reveal ───────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ───────────────────────── Responsive ───────────────────── */

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .workflow-steps {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .wstep-arrow {
    display: none;
  }

  .wstep {
    flex-basis: calc(50% - 0.5rem);
    max-width: none;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 5rem 0 4rem;
  }

  .workflow,
  .features,
  .scenarios,
  .install-section {
    padding: 3.5rem 0;
  }

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

  .workflow-steps {
    flex-direction: column;
    align-items: center;
  }

  .wstep {
    flex-basis: auto;
  }

  .site-header .wrap {
    flex-direction: column;
    height: auto;
    padding: 0.8rem 0;
    gap: 0.5rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .summary-bar {
    flex-direction: column;
  }

  .metric {
    min-width: 0;
  }
}