/* ================================================================
   Sunholo Design System — Shared CSS
   Light theme: #f6f8fa bg | #e73c17 coral | Montserrat + JetBrains Mono
   Used by: site/index.html, streaming/index.html, docparse/site/index.html
   ================================================================ */

/* -- Variables -- */
:root {
  --primary: #e73c17;
  --primary-light: #f25d3b;
  --primary-dark: #c43010;
  --primary-faded: rgba(231, 60, 23, 0.08);

  --charcoal: #314352;
  --charcoal-light: #3d5468;

  --indigo: #4f46e5;
  --indigo-light: #6366f1;
  --contract-purple: #8b5cf6;
  --contract-purple-bg: rgba(139, 92, 246, 0.1);
  --ai-orange: #f59e0b;
  --ai-orange-bg: rgba(245, 158, 11, 0.1);

  --bg: #f6f8fa;
  --bg-card: #ffffff;
  --bg-code: #0f172a;
  --bg-input: #f1f5f9;
  --border: #e2e8f0;
  --border-active: #cbd5e1;

  --text-primary: #1a202c;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;

  --teal: #0d9488;
  --teal-bg: rgba(13, 148, 136, 0.08);
  --blue: #2563eb;
  --blue-bg: rgba(37, 99, 235, 0.08);
  --emerald: #059669;
  --purple: #7c3aed;
  --purple-bg: rgba(124, 58, 237, 0.08);
  --amber: #d97706;
  --amber-bg: rgba(217, 119, 6, 0.08);
  --green: #16a34a;
  --pink: #db2777;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.04);

  --font-display: 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Menlo', monospace;
}

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

body {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(231, 60, 23, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 60, 23, 0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* -- Header bar -- */
.header {
  background: var(--charcoal);
  color: #fff;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-home { display: flex; align-items: center; }
.nav-home:hover .header-logo { opacity: 0.8; }
.header img.header-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.header-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.header-title .ai { color: var(--primary-light); }

.header-sep {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
}

.header-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.3px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.header-nav a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.header-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.header-right a:hover { color: #fff; }

.dp-header-auth { position: relative; }
.dp-header-auth-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  transition: background 0.15s;
  color: rgba(255,255,255,0.75);
}
.dp-header-auth-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.dp-header-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  object-fit: cover;
}
.dp-header-user-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp-header-auth-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 200; overflow: hidden;
}
.dp-header-auth.open .dp-header-auth-menu { display: block; }
.dp-header-auth-email {
  padding: 12px 16px 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.dp-header-auth-item {
  display: block; width: 100%; padding: 10px 16px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-secondary); text-decoration: none;
  background: none; border: none; cursor: pointer;
  text-align: left; transition: background 0.15s, color 0.15s;
}
.dp-header-auth-item:hover {
  background: var(--bg-input); color: var(--text-primary);
}

.header-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-badge code {
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}

/* -- Page layout -- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px 48px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
}

/* -- Hero -- */
.hero { text-align: center; margin-bottom: 40px; }

.hero h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.hero h1 .accent { color: var(--primary); }
.hero .subtitle { font-size: 16px; color: var(--text-secondary); margin-bottom: 20px; }

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hero .note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.hero .note code {
  color: var(--primary);
  background: var(--primary-faded);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* -- Tags -- */
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 100px;
  border: 1px solid;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tag--wasm { color: var(--blue); border-color: rgba(37,99,235,0.25); background: var(--blue-bg); }
.tag--streaming { color: var(--teal); border-color: rgba(13,148,136,0.25); background: var(--teal-bg); }
.tag--contracts { color: var(--contract-purple); border-color: rgba(139,92,246,0.25); background: var(--contract-purple-bg); }
.tag--budgets { color: var(--amber); border-color: rgba(217,119,6,0.25); background: var(--ai-orange-bg); }
.tag--effects { color: var(--teal); border-color: rgba(13,148,136,0.25); background: var(--teal-bg); }
.tag--formats { color: var(--blue); border-color: rgba(37,99,235,0.25); background: var(--blue-bg); }
.tag--ai { color: var(--amber); border-color: rgba(217,119,6,0.25); background: var(--ai-orange-bg); }

/* -- Section -- */
.section { margin-bottom: 40px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 100px;
}

.section-link {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.3px;
}

.section-link:hover { color: var(--primary); }

.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* -- Card Grid -- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  flex: 1;
}

/* -- Cards -- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.25s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(18px);
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }
.card:nth-child(7) { animation-delay: 0.35s; }

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-active);
}

/* Top accent stripe */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* -- Card accent colors -- */
.card--extractor::before { background: var(--primary); }
.card--docparse::before { background: var(--blue); }
.card--verify::before { background: var(--purple); }
.card--contracts::before { background: var(--contract-purple); }
.card--claude::before { background: var(--amber); }
.card--live::before { background: linear-gradient(90deg, var(--amber), #e88a30); }
.card--safe::before { background: var(--success); }
.card--vdocparse::before { background: var(--blue); }
.card--ecommerce::before { background: var(--teal); }
.card--website::before { background: linear-gradient(90deg, var(--purple), var(--pink)); }

/* -- Card icons -- */
.card-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 20px;
  line-height: 1;
}

.card--extractor .card-icon { background: var(--primary-faded); color: var(--primary); }
.card--docparse .card-icon { background: var(--blue-bg); color: var(--blue); }
.card--verify .card-icon { background: var(--purple-bg); color: var(--purple); }
.card--contracts .card-icon { background: var(--contract-purple-bg); color: var(--contract-purple); }
.card--claude .card-icon { background: var(--ai-orange-bg); color: var(--amber); }
.card--live .card-icon { background: var(--ai-orange-bg); color: var(--amber); }
.card--safe .card-icon { background: var(--success-bg); color: var(--success); }
.card--vdocparse .card-icon { background: var(--blue-bg); color: var(--blue); }
.card--ecommerce .card-icon { background: var(--teal-bg); color: var(--teal); }
.card--website .card-icon { background: var(--purple-bg); color: var(--purple); }

.card-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.card-desc {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  flex: 1;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

/* -- Badges -- */
.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-wasm { background: var(--blue-bg); color: var(--blue); }
.badge-ws { background: var(--success-bg); color: var(--success); }
.badge-sse { background: var(--warning-bg); color: var(--warning); }
.badge-rest { background: var(--bg-input); color: var(--text-muted); }
.badge-provider { background: var(--bg-input); color: var(--text-muted); }
.badge-key { background: var(--primary-faded); color: var(--primary); font-size: 9px; }
.badge-cli { background: var(--blue-bg); color: var(--blue); }

/* -- Card arrow on hover -- */
.card-arrow {
  position: absolute;
  top: 24px;
  right: 22px;
  color: var(--text-muted);
  font-size: 16px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
  font-family: var(--font-mono);
}

.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* -- Footer -- */
.footer {
  text-align: center;
  padding: 40px 0 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.footer-brand svg { width: 22px; height: 22px; }
.footer-brand span { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text-secondary); }
.footer-brand .ai { color: var(--primary); }

.footer-line {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 2;
}

.footer-line a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-line a:hover { color: var(--primary); }

.footer-sep {
  display: inline-block;
  width: 1px;
  height: 10px;
  background: var(--border);
  margin: 0 10px;
  vertical-align: middle;
}

/* -- Section Intro Panel -- */
.section-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.section-intro::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.section-intro--docs::before { background: var(--blue); }
.section-intro--streaming::before { background: var(--teal); }
.section-intro--website::before { background: var(--purple); }
.section-intro--data::before { background: var(--teal); }

.section-intro-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.section-intro-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section-intro-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 680px;
}

.section-intro-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 8px 20px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.section-intro-cta:hover {
  background: var(--primary);
  color: #fff;
}

/* -- Responsive -- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 28px; }
  .page { padding: 32px 20px 40px; }
  .header { padding: 0 20px; }
  .header-subtitle { display: none; }
  .header-nav { display: none; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .hero h1 { font-size: 24px; }
  .hero .subtitle { font-size: 14px; }
  .page { padding: 24px 16px 32px; }
  .card { padding: 20px 18px 18px; }
  .header-badge { display: none; }
  .section-intro { padding: 20px 20px; }
  .section-intro-title { font-size: 18px; }
}
