/* ============================================================
   Weave Marketing Website — Custom Styles
   Supplements Tailwind CSS CDN
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  --weave-blue: #3B82F6;
  --weave-purple: #A855F7;
  --weave-pink: #EC4899;
  --weave-bg: #0F172A;
  --weave-surface: #1E293B;
  --weave-surface-hover: #334155;
  --weave-text: #F8FAFC;
  --weave-text-muted: #94A3B8;
}

/* ── Base ───────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--weave-bg);
  color: var(--weave-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Gradient Text ──────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #3B82F6 0%, #A855F7 50%, #EC4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* ── Gradient Border (via box-shadow trick) ─────────────────── */
.gradient-border {
  border: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
}

/* ── Glass-morphism Card ────────────────────────────────────── */
.glass-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 1rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(148, 163, 184, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ── Section Label (curly brace style) ──────────────────────── */
.section-label {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  color: var(--weave-text-muted);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.75rem;
}

/* ── Scroll Animations ──────────────────────────────────────── */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.35s; }
.delay-4 { transition-delay: 0.5s; }
.delay-5 { transition-delay: 0.65s; }
.delay-6 { transition-delay: 0.8s; }
.delay-7 { transition-delay: 0.95s; }
.delay-8 { transition-delay: 1.1s; }

/* ── Hero Headline Word Animation ───────────────────────────── */
@keyframes wordFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-word {
  display: inline-block;
  opacity: 0;
  animation: wordFadeIn 0.5s ease-out forwards;
}

/* ── Button Hover Fill (kiro.dev style) ─────────────────────── */
.btn-hover-fill {
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: color 0.3s ease;
}

.btn-hover-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #2563EB, #9333EA);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.btn-hover-fill:hover::before {
  transform: scaleX(1);
}

/* ── Terminal Block ─────────────────────────────────────────── */
.terminal {
  background: #080F1E;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 1rem;
  overflow: hidden;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
}

.terminal-chrome {
  background: #0F172A;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot-red    { background: #FF5F57; }
.terminal-dot-yellow { background: #FEBC2E; }
.terminal-dot-green  { background: #28C840; }

.terminal-body {
  padding: 1.25rem 1.5rem;
  line-height: 1.8;
}

/* Terminal typing animation */
@keyframes typing {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes blink {
  0%, 100% { border-color: #94A3B8; }
  50%       { border-color: transparent; }
}

.typing-line {
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  display: block;
}

.typing-line-1 {
  animation: typing 1.8s steps(40, end) 0.5s forwards;
}

.typing-line-2 {
  animation: typing 2.2s steps(50, end) 2.8s forwards;
}

.typing-line-3 {
  animation: typing 1.4s steps(32, end) 5.5s forwards;
}

/* ── Code Block ─────────────────────────────────────────────── */
.code-block {
  background: #080F1E;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-left: 3px solid var(--weave-purple);
  border-radius: 0.75rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  overflow-x: auto;
  line-height: 1.7;
  /* custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

.code-block::-webkit-scrollbar {
  height: 4px;
}

.code-block::-webkit-scrollbar-track {
  background: transparent;
}

.code-block::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 2px;
}

/* ── Agent Accent Colors ────────────────────────────────────── */
.agent-loom     { border-top-color: #4A90D9 !important; }
.agent-tapestry { border-top-color: #D94A4A !important; }
.agent-pattern  { border-top-color: #9B59B6 !important; }
.agent-thread   { border-top-color: #27AE60 !important; }
.agent-spindle  { border-top-color: #F39C12 !important; }
.agent-weft     { border-top-color: #1ABC9C !important; }
.agent-warp     { border-top-color: #E74C3C !important; }
.agent-shuttle  { border-top-color: #E67E22 !important; }

/* ── Capability Matrix ──────────────────────────────────────── */
.capability-matrix {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
}

.capability-matrix thead tr {
  background: rgba(15, 23, 42, 0.8);
  position: sticky;
  top: 0;
  z-index: 10;
}

.capability-matrix th {
  padding: 0.625rem 0.875rem;
  text-align: center;
  color: #94A3B8;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  white-space: nowrap;
}

.capability-matrix th:first-child {
  text-align: left;
}

.capability-matrix td {
  padding: 0.625rem 0.875rem;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.05);
  color: #94A3B8;
}

.capability-matrix td:first-child {
  text-align: left;
  color: var(--weave-text);
  font-weight: 500;
}

.capability-matrix tbody tr:hover {
  background: rgba(30, 41, 59, 0.4);
}

.cell-yes  { color: #22C55E; font-weight: 700; }
.cell-no   { color: #EF4444; opacity: 0.6; }
.cell-md   { color: #F59E0B; font-size: 0.75rem; font-weight: 600; }

/* ── Comparison Highlight ───────────────────────────────────── */
.comparison-highlight {
  border-top: 2px solid transparent;
  background-image: linear-gradient(var(--weave-surface), var(--weave-surface)),
                    linear-gradient(135deg, #3B82F6, #A855F7, #EC4899);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-color: transparent;
  position: relative;
}

.comparison-highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(135deg, #3B82F6, #A855F7, #EC4899);
  border-radius: 1rem 1rem 0 0;
}

/* ── Nav Active Link ─────────────────────────────────────────── */
.nav-link {
  position: relative;
  color: #94A3B8;
  transition: color 0.2s ease;
  font-size: 0.9375rem;
}

.nav-link:hover,
.nav-link.active {
  color: #F8FAFC;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(135deg, #3B82F6, #A855F7);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.nav-link.active::after,
.nav-link:hover::after {
  transform: scaleX(1);
}

/* ── Section gradient separators ────────────────────────────── */
.section-fade-top {
  background: linear-gradient(to bottom, var(--weave-bg), transparent);
  height: 80px;
  margin-bottom: -80px;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.section-fade-bottom {
  background: linear-gradient(to top, var(--weave-bg), transparent);
  height: 80px;
  margin-top: -80px;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

/* ── Install tab buttons ────────────────────────────────────── */
.tab-btn {
  padding: 0.375rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  border-radius: 0.375rem;
  color: #94A3B8;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, #3B82F6, #A855F7);
  color: #fff;
  border-color: transparent;
}

.tab-btn:hover:not(.active) {
  border-color: rgba(148, 163, 184, 0.35);
  color: #F8FAFC;
}

/* ── Step number circle ─────────────────────────────────────── */
.step-number {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #A855F7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  color: #fff;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Workflow arrow ─────────────────────────────────────────── */
.workflow-arrow {
  color: #A855F7;
  font-size: 2rem;
  opacity: 0.6;
  flex-shrink: 0;
  align-self: center;
}

/* ── OpenCode ecosystem badge ───────────────────────────────── */
.ecosystem-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: #94A3B8;
  background: rgba(30, 41, 59, 0.4);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.ecosystem-badge:hover {
  border-color: rgba(168, 85, 247, 0.4);
  color: #F8FAFC;
}

/* ── Version badge ──────────────────────────────────────────── */
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', monospace;
  color: #94A3B8;
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(8px);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .capability-matrix {
    font-size: 0.75rem;
  }

  .capability-matrix th,
  .capability-matrix td {
    padding: 0.5rem 0.5rem;
  }

  .terminal {
    font-size: 0.75rem;
  }

  .typing-line-1,
  .typing-line-2,
  .typing-line-3 {
    white-space: normal;
    width: auto;
    animation: none;
    opacity: 1;
  }
}

/* ── Utility: gradient background button ────────────────────── */
.btn-gradient {
  background: linear-gradient(135deg, #3B82F6, #A855F7);
  color: #fff;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-gradient:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── FAQ item ───────────────────────────────────────────────── */
.faq-item {
  border-left: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-left-color: var(--weave-purple);
}

/* ── Syntax highlighting spans ──────────────────────────────── */
.syn-key     { color: #60A5FA; }  /* blue — JSON keys */
.syn-str     { color: #86EFAC; }  /* green — strings */
.syn-num     { color: #FCA5A5; }  /* red/pink — numbers */
.syn-comment { color: #475569; }  /* slate — JSONC comments */
.syn-punc    { color: #94A3B8; }  /* muted — braces, brackets */
