/* === Runflow Brand — Dyver Showcase === */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #09090B;
  color: #FAFAFA;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* === Layout === */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

/* === Navbar === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #27272A;
  padding: 0 32px;
}

.navbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.navbar-logo svg { height: 28px; width: auto; }

.navbar-badge {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #A1A1AA;
  background: #18181B;
  border: 1px solid #27272A;
  padding: 2px 10px;
  border-radius: 999px;
}

.navbar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #A1A1AA;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.navbar-back:hover {
  color: #FAFAFA;
  background: #18181B;
}

.navbar-back svg {
  width: 14px;
  height: 14px;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 80px 0 64px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -100px -200px 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(251,191,36,0.10) 0%, transparent 55%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #FBBF24;
  margin-bottom: 16px;
  position: relative;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  position: relative;
}

.hero h1 .amber { color: #FBBF24; }

.hero-sub {
  font-size: 17px;
  color: #A1A1AA;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

/* === Workflow Cards Grid === */
.workflows-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 48px;
}

.workflow-card {
  background: #111113;
  border: 1px solid #27272A;
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.workflow-card:hover {
  border-color: rgba(251, 191, 36, 0.25);
  background: #141416;
  transform: translateY(-2px);
}

.workflow-card.has-gallery:hover {
  border-color: rgba(251, 191, 36, 0.4);
}

/* Static (non-interactive) card: shown as informational only, no hover lift */
.workflow-card.is-static {
  cursor: default;
}

.workflow-card.is-static:hover {
  border-color: #27272A;
  background: #111113;
  transform: none;
}

.workflow-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workflow-card-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.workflow-card h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.workflow-card p {
  font-size: 14px;
  color: #71717A;
  line-height: 1.5;
}

.workflow-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.workflow-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.workflow-card-count {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #52525B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.workflow-card-date {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #52525B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #27272A;
  background: #18181B;
}

.workflow-card-date::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #3F3F46;
  margin-right: 6px;
  vertical-align: middle;
}

.workflow-card-arrow {
  width: 20px;
  height: 20px;
  color: #3F3F46;
  transition: color 0.2s, transform 0.2s;
}

.workflow-card:hover .workflow-card-arrow {
  color: #FBBF24;
  transform: translateX(2px);
}

/* === Badges === */
.badge {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.badge-amber {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  color: #FCD34D;
}

.badge-gray {
  background: #18181B;
  border: 1px solid #27272A;
  color: #A1A1AA;
}

.badge-green {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  color: #86EFAC;
}

.badge-blue {
  background: rgba(96,165,250,0.08);
  border: 1px solid rgba(96,165,250,0.2);
  color: #93C5FD;
}

/* Version tag — shown alongside the status badge on workflow cards */
.badge-version {
  background: #18181B;
  border: 1px solid #27272A;
  color: #A1A1AA;
  letter-spacing: 0.08em;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  display: inline-block;
}

/* === Gallery View === */
.gallery-header {
  margin-bottom: 40px;
}

.gallery-header h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.gallery-header p {
  font-size: 15px;
  color: #A1A1AA;
}

.gallery-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  background: #111113;
  border: 1px solid #27272A;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.gallery-item:hover {
  border-color: rgba(251, 191, 36, 0.3);
  transform: translateY(-1px);
}

.gallery-item-images {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #0a0a0c;
}

.gallery-item-images img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.gallery-item-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
}

.gallery-item-before img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-item-divider {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(251, 191, 36, 0.5);
  transform: translateX(-1px);
  pointer-events: none;
  z-index: 2;
  transition: left 0.05s ease-out;
}

.gallery-item-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  background: #FBBF24;
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.3);
  opacity: 0;
  transition: opacity 0.15s, left 0.05s ease-out;
}

.gallery-item:hover .gallery-item-handle {
  opacity: 1;
}

.gallery-item-handle::after {
  content: '\25C2\2009\25B8';
  color: #09090B;
  font-size: 10px;
  font-weight: 800;
}

.gallery-item-labels {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid #27272A;
}

.gallery-item-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #52525B;
}

.gallery-item-label.after { color: #FBBF24; }

/* Empty workflow placeholder */
.empty-workflow {
  text-align: center;
  padding: 80px 32px;
}

.empty-workflow-icon {
  width: 48px;
  height: 48px;
  color: #27272A;
  margin-bottom: 16px;
}

.empty-workflow h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.empty-workflow p {
  font-size: 14px;
  color: #52525B;
}

/* === Slider Overlay === */
.slider-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #09090B;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.slider-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.slider-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #27272A;
  flex-shrink: 0;
}

.slider-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.slider-counter {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #71717A;
}

.slider-close {
  background: none;
  border: 1px solid #27272A;
  border-radius: 8px;
  color: #A1A1AA;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.slider-close:hover {
  background: #18181B;
  color: #FAFAFA;
}

.slider-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

/* Nav arrows */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(17, 17, 19, 0.9);
  border: 1px solid #27272A;
  border-radius: 8px;
  color: #A1A1AA;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.slider-nav:hover {
  background: #18181B;
  color: #FAFAFA;
  border-color: #3F3F46;
}

.slider-nav.prev { left: 16px; }
.slider-nav.next { right: 16px; }

.slider-nav svg { width: 18px; height: 18px; }

/* The comparison container */
.comparison {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  user-select: none;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #27272A;
}

.comparison img {
  display: block;
  max-width: 80vw;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
}

.comparison .img-after {
  display: block;
}

.comparison .img-before-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.comparison .img-before-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison .slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #FBBF24;
  cursor: ew-resize;
  z-index: 5;
  transform: translateX(-1.5px);
}

.comparison .slider-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: #FBBF24;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

.comparison .slider-handle::after {
  content: '\25C2\2009\25B8';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #09090B;
  font-size: 12px;
  font-weight: 800;
  z-index: 6;
  pointer-events: none;
}

.comparison .label {
  position: absolute;
  bottom: 16px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 999px;
  z-index: 4;
  pointer-events: none;
}

.comparison .label-before {
  left: 16px;
  background: rgba(9, 9, 11, 0.8);
  border: 1px solid #3F3F46;
  color: #A1A1AA;
}

.comparison .label-after {
  right: 16px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #FBBF24;
}

.comparison .label-mask {
  right: 16px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #FBBF24;
}

/* === Layer Pickers === */
.layer-pickers {
  display: flex;
  align-items: center;
  gap: 16px;
}

.slider-toolbar-left .layer-pickers {
  margin-top: 0;
  margin-left: 12px;
}

.layer-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #111113;
  border: 1px solid #27272A;
  border-radius: 8px;
  padding: 3px;
}

.layer-picker-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3F3F46;
  padding: 0 8px;
}

.layer-btn {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #52525B;
  background: transparent;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.layer-btn:hover {
  color: #A1A1AA;
}

.layer-btn.active {
  color: #FBBF24;
  background: #18181B;
}

/* === Mask Overlay === */
.mask-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.mask-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  mix-blend-mode: screen;
  opacity: 0.6;
  filter: sepia(1) saturate(5) hue-rotate(10deg) brightness(1.1);
}

.comparison-mask {
  cursor: default;
}

/* === Floating Image Toolbar === */
.img-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  display: flex;
  gap: 2px;
  background: rgba(9, 9, 11, 0.6);
  border: 1px solid rgba(39, 39, 42, 0.5);
  border-radius: 8px;
  padding: 3px;
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.gallery-item-images:hover .img-toolbar,
.comparison:hover .img-toolbar {
  opacity: 0.5;
  pointer-events: auto;
}

.img-toolbar:hover {
  opacity: 1 !important;
}

.img-tool-btn {
  width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: #A1A1AA;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.img-tool-btn:hover { color: #FAFAFA; background: rgba(255,255,255,0.08); }
.img-tool-btn.active { color: #FBBF24; background: rgba(251,191,36,0.12); }
.img-tool-btn svg { width: 14px; height: 14px; }

/* Zoom/Pan container */
.zoomable {
  transform-origin: 0 0;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.zoomable.no-transition {
  transition: none;
}

/* Zoomed-in cursor hint */
.zoomed-in { cursor: default; }

/* Keyboard hint */
.slider-hint {
  text-align: center;
  padding: 10px;
  border-top: 1px solid #1a1a1e;
  flex-shrink: 0;
}

.slider-hint span {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: #3F3F46;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.slider-hint kbd {
  display: inline-block;
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: #71717A;
  margin: 0 2px;
}

/* === Home Tabs === */
.home-tabs {
  display: flex;
  gap: 2px;
  background: #111113;
  border: 1px solid #27272A;
  border-radius: 8px;
  padding: 3px;
  display: inline-flex;
  margin-top: 32px;
}

.home-tab {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #52525B;
  background: transparent;
  border: none;
  padding: 8px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.home-tab:hover { color: #A1A1AA; }
.home-tab.active { color: #FBBF24; background: #18181B; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* === API Page === */
.api-page {
  max-width: 720px;
  padding-top: 16px;
}

.api-section {
  margin-bottom: 40px;
}

.api-section h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.api-section h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.api-section h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.api-section p {
  font-size: 15px;
  color: #A1A1AA;
  line-height: 1.6;
  margin-bottom: 12px;
}

.api-section p code {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 4px;
  padding: 1px 6px;
  color: #FBBF24;
}

.api-eyebrow {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #FBBF24;
  margin-bottom: 10px;
}

/* Code blocks */
.api-code-block {
  background: #111113;
  border: 1px solid #27272A;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.api-code-header {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #52525B;
  padding: 8px 16px;
  border-bottom: 1px solid #27272A;
  background: #0d0d0f;
}

.api-code-block pre {
  padding: 16px;
  overflow-x: auto;
}

.api-code-block code {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: #D4D4D8;
  line-height: 1.6;
}

/* Flow steps */
.api-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.api-flow-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: #111113;
  border: 1px solid #27272A;
  border-radius: 10px;
}

.api-flow-num {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 50%;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #FBBF24;
}

.api-flow-step strong {
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.api-flow-step p {
  font-size: 13px;
  color: #A1A1AA;
  margin-bottom: 0;
  line-height: 1.5;
}

.api-flow-step code {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 4px;
  padding: 1px 5px;
  color: #FBBF24;
}

/* Model cards */
.api-models-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.api-model-card {
  background: #111113;
  border: 1px solid #27272A;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-model-slug {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #71717A;
}

/* Links inside API / Get Started content */
.api-page a {
  color: #FBBF24;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.api-page a:hover {
  color: #FCD34D;
}

/* === Responsive === */
@media (max-width: 768px) {
  .page { padding: 32px 16px 64px; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 15px; }
  .workflows-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .slider-nav.prev { left: 8px; }
  .slider-nav.next { right: 8px; }
  .comparison img { max-width: 95vw; }
  .slider-hint { display: none; }
}

/* === Transitions === */
.view { display: none; }
.view.active { display: block; }

/* Fade in animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.gallery-item { animation: fadeUp 0.3s ease both; }
.gallery-item:nth-child(n+4)  { animation-delay: 0.05s; }
.gallery-item:nth-child(n+7)  { animation-delay: 0.1s; }
.gallery-item:nth-child(n+10) { animation-delay: 0.15s; }
